Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-21 Thread 'Rupert Smith' via Elm Discuss
On Thursday, April 20, 2017 at 12:33:54 PM UTC+1, Jakub Hampl wrote:
>
> https://codepen.io/anon/pen/gWrbxr
>

Very nice. And I see your point - you have multiple strings within a single 
 node. Perhaps my suggestion of a help function that takes a single 
String is not so useful.

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-20 Thread Jakub Hampl
https://codepen.io/anon/pen/gWrbxr

On Wednesday, 19 April 2017 14:16:08 UTC+1, Duane Johnson wrote:
>
>
> On Tue, Apr 18, 2017 at 7:20 AM, Jakub Hampl  > wrote:
>
>> Think of the  element akin to the  element in HTML. Yes, fairly 
>> often you will simply pass a string to it, but it needing lower level 
>> styling is pretty common.
>>
>> For the API you proposed, what would happen if you passed in both a 
>> non-empty list of svgs and a string?
>>
>
> Do you happen to have an example of the  element in use as a parent 
> node of several child nodes? Up to this point, I've simply used it as a 
> "label"-like feature of my SVG graphics, where the attributes of the  
> element have sufficed to place a single line or label in the correct 
> location, with the right color etc.
>

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-19 Thread Duane Johnson
On Tue, Apr 18, 2017 at 7:20 AM, Jakub Hampl  wrote:

> Think of the  element akin to the  element in HTML. Yes, fairly
> often you will simply pass a string to it, but it needing lower level
> styling is pretty common.
>
> For the API you proposed, what would happen if you passed in both a
> non-empty list of svgs and a string?
>

Do you happen to have an example of the  element in use as a parent
node of several child nodes? Up to this point, I've simply used it as a
"label"-like feature of my SVG graphics, where the attributes of the 
element have sufficed to place a single line or label in the correct
location, with the right color etc.

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-18 Thread Duane Johnson
On Tue, Apr 18, 2017 at 6:52 AM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

>
> So I tried setting a strokeWidth attribute on a box and on a line, but it
> has no effect. Instead I had to set the style like this:
>
> style [ ( "stroke-width", "4" ) ]
>

Thanks (and thanks to Jakub). Fixed in 2.1.1:

https://ellie-app.com/X7DYKGwFh4a1/4

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-18 Thread Jakub Hampl
Think of the  element akin to the  element in HTML. Yes, fairly 
often you will simply pass a string to it, but it needing lower level 
styling is pretty common.

For the API you proposed, what would happen if you passed in both a 
non-empty list of svgs and a string?


RE: strokeWidth - that's a bug, the attribute is actually called 
stroke-width 
.

On Tuesday, 18 April 2017 12:08:23 UTC+1, Rupert Smith wrote:
>
> On Tuesday, April 18, 2017 at 10:59:20 AM UTC+1, Jakub Hampl wrote:
>>
>>
>> https://developer.mozilla.org/en-US/docs/Web/SVG/Element#Text_content_elements
>>
>>  elements can contain quite a number of children that allow you to 
>> do very precise formatting of the actual text content. There are plenty of 
>> usecases like custom fonts, rendering text on a path, text effects, etc.
>>
>
> Yes. I suspected this might be the case. 
>
> Perhaps it is more often the case than the simple situation of inserting a 
> hello is?
>
> How about this for the signature for a text node:
>
> text : List (Attribute msg) -> List (Svg msg) -> String -> Svg msg
>
> Lets you specify the actual text as a String, and you can supply empty 
> lists if you don't need any attributes or other Svg elements?
>

-- 
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.


[elm-discuss] Re: ANN: TypedSvg

2017-04-18 Thread 'Rupert Smith' via Elm Discuss
On Thursday, March 30, 2017 at 4:35:32 PM UTC+1, Duane Johnson wrote:
>
> Hi all,
>
> I've been working on a TypedSvg package here:
>
> http://package.elm-lang.org/packages/canadaduane/typed-svg/2.0.1
>

So I tried setting a strokeWidth attribute on a box and on a line, but it 
has no effect. Instead I had to set the style like this: 

style [ ( "stroke-width", "4" ) ]

All the examples given here use css styling:

https://www.w3schools.com/graphics/svg_line.asp

Not sure what is going on as I don't actually know SVG, this is really my 
first time to work with it programmatically (I've made plenty SVG drawing 
in Inkscape and imported them into HTML previously). Seting the 
"strokeWidth" attribute sets a "strokeWidth" attribute on the SVG node, but 
Chrome seems to ignore it. Are these attributes deprecated in favour of CSS 
styling or something?

In which case styling attributes that need to be represented as CSS need to 
be handled differently when rendering the nodes.

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-18 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, April 18, 2017 at 10:59:20 AM UTC+1, Jakub Hampl wrote:
>
>
> https://developer.mozilla.org/en-US/docs/Web/SVG/Element#Text_content_elements
>
>  elements can contain quite a number of children that allow you to 
> do very precise formatting of the actual text content. There are plenty of 
> usecases like custom fonts, rendering text on a path, text effects, etc.
>

Yes. I suspected this might be the case. 

Perhaps it is more often the case than the simple situation of inserting a 
hello is?

How about this for the signature for a text node:

text : List (Attribute msg) -> List (Svg msg) -> String -> Svg msg

Lets you specify the actual text as a String, and you can supply empty 
lists if you don't need any attributes or other Svg elements?

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-18 Thread Jakub Hampl
https://developer.mozilla.org/en-US/docs/Web/SVG/Element#Text_content_elements

 elements can contain quite a number of children that allow you to do 
very precise formatting of the actual text content. There are plenty of 
usecases like custom fonts, rendering text on a path, text effects, etc.

However having the thing that inserts a text node called text when there 
exists also a text element is confusing. Also text nodes are much rarer in 
practice in SVG than in HTML, so using a longer function name would make 
sense. 

I think textNode : String -> Svg msg would make sense and make text : List 
(Attribute msg) -> List (Svg msg) -> Svg msg would make sense.

On Monday, 17 April 2017 16:07:44 UTC+1, Duane Johnson wrote:
>
>
> On Mon, Apr 17, 2017 at 4:49 AM, 'Rupert Smith' via Elm Discuss <
> elm-d...@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  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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-17 Thread Duane Johnson
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  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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-17 Thread 'Rupert Smith' via Elm Discuss
On Thursday, April 6, 2017 at 4:38:36 PM UTC+1, Duane Johnson wrote:
>
> Sounds quite reasonable :)
>  
>
>> - fill in missing documentation on all elements and attributes
>>> - add helpful functions as we go to the TypedSvg.Extra module (currently 
>>> only `centeredImage` resides there)
>>>
>>
>> These sound more like the things that I could contribute to at the 
>> moment. I see lots of empty doc comments. :-) 
>>
>
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. 

The way you put text in a diagram is a bit strange, as you use 
"TypedSvg.text_" to render the  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.

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-06 Thread Duane Johnson
>
>
>> - separate out the Animation elements and attributes into their own module
>> - continue to add length-unit-specific modules like InPx and InEm (InPt,
>> InMm, etc.)
>> - move `text` element from Core to regular elements (TypedSvg)
>>
>
> These things sound fairly structural, so perhaps best left to you to do,
> as you have the vision for it.
>
>

Sounds quite reasonable :)


> - fill in missing documentation on all elements and attributes
>> - add helpful functions as we go to the TypedSvg.Extra module (currently
>> only `centeredImage` resides there)
>>
>
> These sound more like the things that I could contribute to at the moment.
> I see lots of empty doc comments. :-)
>
>
Perfect!

Thanks,
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-06 Thread 'Rupert Smith' via Elm Discuss
On Thursday, April 6, 2017 at 3:44:56 PM UTC+1, Duane Johnson wrote:
>
> On Thu, Apr 6, 2017 at 8:03 AM, 'Rupert Smith' via Elm Discuss <
> elm-d...@googlegroups.com > wrote:
>
>> What are the immediate todos that need worked on? Is there a list of 
>> issues on the github project, for example?
>>
>
> That's a good idea. I should write that up. For now, here's what I'm 
> thinking:
>
> - separate out the Animation elements and attributes into their own module
> - continue to add length-unit-specific modules like InPx and InEm (InPt, 
> InMm, etc.)
> - move `text` element from Core to regular elements (TypedSvg)
>

These things sound fairly structural, so perhaps best left to you to do, as 
you have the vision for it.
 

> - fill in missing documentation on all elements and attributes
> - add helpful functions as we go to the TypedSvg.Extra module (currently 
> only `centeredImage` resides there)
>

These sound more like the things that I could contribute to at the moment. 
I see lots of empty doc comments. :-) 

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-06 Thread Duane Johnson
On Thu, Apr 6, 2017 at 8:03 AM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> On Saturday, April 1, 2017 at 5:15:47 AM UTC+1, Duane Johnson wrote:
>>
>> The short term goal is to make a typed SVG library (as mentioned earlier,
>> fully typed and documented). Medium-term, I'd like to adopt some sensible
>> module partitions that help segregate functionality into logical units
>> (e.g. core graphics, animations, filters). The long term goal is to create
>> a pleasant and intuitive SVG library, something that will come from seeing
>> how we all use this in practice.
>>
>
> What are the immediate todos that need worked on? Is there a list of
> issues on the github project, for example?
>

That's a good idea. I should write that up. For now, here's what I'm
thinking:

- separate out the Animation elements and attributes into their own module
- continue to add length-unit-specific modules like InPx and InEm (InPt,
InMm, etc.)
- move `text` element from Core to regular elements (TypedSvg)
- fill in missing documentation on all elements and attributes
- add helpful functions as we go to the TypedSvg.Extra module (currently
only `centeredImage` resides there)


> I've set myself up an elm-reactor project to start having a play around
> with it. Will be aiming to render some of the various diagrams I need, and
> happy to start filling in the blanks once I run off the end of the road...
>

Awesome! I look forward to your feedback and help.

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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-04-06 Thread 'Rupert Smith' via Elm Discuss
On Saturday, April 1, 2017 at 5:15:47 AM UTC+1, Duane Johnson wrote:
>
> The short term goal is to make a typed SVG library (as mentioned earlier, 
> fully typed and documented). Medium-term, I'd like to adopt some sensible 
> module partitions that help segregate functionality into logical units 
> (e.g. core graphics, animations, filters). The long term goal is to create 
> a pleasant and intuitive SVG library, something that will come from seeing 
> how we all use this in practice.
>

What are the immediate todos that need worked on? Is there a list of issues 
on the github project, for example?

I've set myself up an elm-reactor project to start having a play around 
with it. Will be aiming to render some of the various diagrams I need, and 
happy to start filling in the blanks once I run off the end of the road...

-- 
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.


[elm-discuss] Re: ANN: TypedSvg

2017-04-03 Thread 'Rupert Smith' via Elm Discuss
On Friday, March 31, 2017 at 3:40:23 PM UTC+1, Noah Gordon wrote:
>
> elm-lang/svg does not provide any strong typing for its functions; it's a 
> direct exposure of SVG's API, and all of its functions take strings as 
> arguments. An incorrectly-formatted string will not break your application 
> but will fail to render as you might expect. It looks like this library is 
> trying to be more prescriptive about the data types you can use to 
> construct SVGs. For example, "viewBox" takes four numbers as opposed to a 
> string with four space-separated values. With elm-lang/svg, providing "0 0 
> 0 foo" will compile but fail to render properly; with this library, it 
> won't compile.
>
> This also means you don't need to manually coerce numbers to strings any 
> more when working with coordinates in your model that are stored as numbers!
>
> Duane, I've been waiting for something like this for a while. Thanks for 
> undertaking the tedium of translating the entire SVG spec and giving it a 
> nice, typed interface. Will take a closer look when I get a chance.
>

Sounds good. I will start using it very soon, that will be the best way to 
understand what it is and where it is at. 

-- 
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.


Re: [elm-discuss] Re: ANN: TypedSvg

2017-03-31 Thread Duane Johnson
Thanks for the kind words everyone. Yes, please send pull requests to the
main repo and I will integrate them.

The short term goal is to make a typed SVG library (as mentioned earlier,
fully typed and documented). Medium-term, I'd like to adopt some sensible
module partitions that help segregate functionality into logical units
(e.g. core graphics, animations, filters). The long term goal is to create
a pleasant and intuitive SVG library, something that will come from seeing
how we all use this in practice.

For instance, one idea I've had is to create core graphics modules that
"assume" a length such as `px` or `em`. I've noticed when I create scalable
vector graphics, I typically measure everything in the same units, so it
doesn't make sense to specify units all over the place.

As an example, right now you need the following `px` helper methods to
express unit of length:

{
import TypedSvg.Attributes exposing (x, y, width, height, strokeWidth)

rect
[ x (px 150)
, y (px 150)
, width (px 200)
, height (px 200)
, fill Color.black
, strokeWidth (px 2)
, stroke <| Color.rgba 90 60 60 0.5
]
[]
}

I'd rather be able to forego the `px`:

{
import TypedSvg.Attributes.InPx exposing (x, y, width, height,
strokeWidth)

rect
[ x 150
, y 150
, width 200
, height 200
, fill Color.black
, strokeWidth 2
, stroke <| Color.rgba 90 60 60 0.5
]
[]
}

Anyway, just some of my current thinking. Other thoughts and ideas welcome.

Duane


On Mar 31, 2017 12:09 PM, "Nicholas Hollon" 
wrote:

> This is awesome! Something I've wished for since about 5 minutes after I
> started learning elm-svg.
>
>  Will definitely be adopting it for future projects... possibly sending
> some pull requests along the way.  :-)
>
> On Thursday, March 30, 2017 at 8:35:32 AM UTC-7, Duane Johnson wrote:
>>
>> Hi all,
>>
>> I've been working on a TypedSvg package here:
>>
>> http://package.elm-lang.org/packages/canadaduane/typed-svg/2.0.1
>>
>> Its intent is to replace `elm-lang/svg` with a fully typed and documented
>> SVG package. There's still a lot of work to do (the SVG spec is huge) but
>> I'm pretty happy with the progress that's been made. I'm announcing this
>> now so that if others are interested in a similar package, we can
>> consolidate effort and help one another rather than duplicate effort.
>>
>> Thanks,
>> Duane Johnson
>>
>> --
> 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.
>

-- 
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.


[elm-discuss] Re: ANN: TypedSvg

2017-03-31 Thread Nicholas Hollon
This is awesome! Something I've wished for since about 5 minutes after I 
started learning elm-svg.

 Will definitely be adopting it for future projects... possibly sending 
some pull requests along the way.  :-)

On Thursday, March 30, 2017 at 8:35:32 AM UTC-7, Duane Johnson wrote:
>
> Hi all,
>
> I've been working on a TypedSvg package here:
>
> http://package.elm-lang.org/packages/canadaduane/typed-svg/2.0.1
>
> Its intent is to replace `elm-lang/svg` with a fully typed and documented 
> SVG package. There's still a lot of work to do (the SVG spec is huge) but 
> I'm pretty happy with the progress that's been made. I'm announcing this 
> now so that if others are interested in a similar package, we can 
> consolidate effort and help one another rather than duplicate effort.
>
> Thanks,
> Duane Johnson
>
>

-- 
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.


[elm-discuss] Re: ANN: TypedSvg

2017-03-31 Thread Magnus Rundberget
Nice !

-magnus

On Thursday, 30 March 2017 17:35:32 UTC+2, Duane Johnson wrote:
>
> Hi all,
>
> I've been working on a TypedSvg package here:
>
> http://package.elm-lang.org/packages/canadaduane/typed-svg/2.0.1
>
> Its intent is to replace `elm-lang/svg` with a fully typed and documented 
> SVG package. There's still a lot of work to do (the SVG spec is huge) but 
> I'm pretty happy with the progress that's been made. I'm announcing this 
> now so that if others are interested in a similar package, we can 
> consolidate effort and help one another rather than duplicate effort.
>
> Thanks,
> Duane Johnson
>
>

-- 
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.


[elm-discuss] Re: ANN: TypedSvg

2017-03-31 Thread Rex van der Spuy


> Duane, I've been waiting for something like this for a while. Thanks for 
> undertaking the tedium of translating the entire SVG spec and giving it a 
> nice, typed interface. Will take a closer look when I get a chance.
>

Yeah, it's really great, thanks! 

-- 
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.


[elm-discuss] Re: ANN: TypedSvg

2017-03-31 Thread Noah Gordon
elm-lang/svg does not provide any strong typing for its functions; it's a 
direct exposure of SVG's API, and all of its functions take strings as 
arguments. An incorrectly-formatted string will not break your application 
but will fail to render as you might expect. It looks like this library is 
trying to be more prescriptive about the data types you can use to 
construct SVGs. For example, "viewBox" takes four numbers as opposed to a 
string with four space-separated values. With elm-lang/svg, providing "0 0 
0 foo" will compile but fail to render properly; with this library, it 
won't compile.

This also means you don't need to manually coerce numbers to strings any 
more when working with coordinates in your model that are stored as numbers!

Duane, I've been waiting for something like this for a while. Thanks for 
undertaking the tedium of translating the entire SVG spec and giving it a 
nice, typed interface. Will take a closer look when I get a chance.

On Friday, March 31, 2017 at 7:09:17 AM UTC-4, Rupert Smith wrote:
>
> On Thursday, March 30, 2017 at 4:35:32 PM UTC+1, Duane Johnson wrote:
>>
>> Hi all,
>>
>> I've been working on a TypedSvg package here:
>>
>> http://package.elm-lang.org/packages/canadaduane/typed-svg/2.0.1
>>
>> Its intent is to replace `elm-lang/svg` with a fully typed and documented 
>> SVG package. There's still a lot of work to do (the SVG spec is huge) but 
>> I'm pretty happy with the progress that's been made. I'm announcing this 
>> now so that if others are interested in a similar package, we can 
>> consolidate effort and help one another rather than duplicate effort.
>>
>
> Sound interesting and good timing for me as my next project will involve 
> lots of diagrams and SVG seems the most likely way to render them. Can you 
> explain what the deficiencies of elm-lang/svg are that you are aiming to 
> improve on?
>

-- 
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.


[elm-discuss] Re: ANN: TypedSvg

2017-03-31 Thread 'Rupert Smith' via Elm Discuss
On Thursday, March 30, 2017 at 4:35:32 PM UTC+1, Duane Johnson wrote:
>
> Hi all,
>
> I've been working on a TypedSvg package here:
>
> http://package.elm-lang.org/packages/canadaduane/typed-svg/2.0.1
>
> Its intent is to replace `elm-lang/svg` with a fully typed and documented 
> SVG package. There's still a lot of work to do (the SVG spec is huge) but 
> I'm pretty happy with the progress that's been made. I'm announcing this 
> now so that if others are interested in a similar package, we can 
> consolidate effort and help one another rather than duplicate effort.
>

Sound interesting and good timing for me as my next project will involve 
lots of diagrams and SVG seems the most likely way to render them. Can you 
explain what the deficiencies of elm-lang/svg are that you are aiming to 
improve on?

-- 
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.