On Mon, Apr 17, 2017 at 4:49 AM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> Not much progress with this recently, sorry. But starting to look at it
> again today and I am back to work this week. I'm just trying to render some
> simple diagrams with boxes and text and arrows and such-like.
>

Great!


>
> The way you put text in a diagram is a bit strange, as you use
> "TypedSvg.text_" to render the <text> node but then "TypedSvg.Core.text" to
> insert the actual text. So that is how SVG works but I think perhaps a
> helper function could make it nicer.
>

Yeah, I think that's reasonable. Would it make sense to have:

`text : List (Attribute msg) -> String -> Svg msg`
a helper method that takes attributes and a string, and returns a text node
with text

`textNode : List (Attribute msg) -> List (Svg msg) -> Svg msg`
what is now "text_"

`textContent : String -> Svg msg`
what is now "text"

The reason I think it makes sense to use the more-desirable "text" method
as the helper itself is because I can't think of a use case where you'd
want to add anything other than one piece of text content inside a text
node. And if there is such a use case, it seems obscure. So that makes me
want to make the short and concise function the one that is most useful,
and the more verbose ones used in rare cases.

Duane

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to