Elm good for graphical apps?

213 views
Skip to first unread message

Rupert Smith

unread,
Jul 30, 2016, 5:37:52 AM7/30/16
to Elm Discuss
New to Elm, hello all. I only heard about Elm because Manning send me emails about their MEAP books and the latest one was for 'Elm in Action'.

I noticed that quite a few Elm examples are graphical, the asteroid game, or elm-flatris, sketch-n-sketch. Is there something about Elm that makes it suited to working with HTML canvas?

I am writing an application that could conveniently be described as like a UML modeller. I would like to mix fairly simple graphical elements and text and particularly text input fields. Up until now I have been trying out Paper.js - which does not support text input fields. Do you think Elm might be useful for this type of application?

Thanks for your input.

Rupert

Duane Johnson

unread,
Jul 30, 2016, 11:12:37 AM7/30/16
to elm-d...@googlegroups.com
Welcome, Rupert! Elm started small and has been growing significantly in the last year. In its initial phase, it focused a lot on the graphical/canvas oriented possibilities. Many web developers gravitated toward its innovative ideas and its javascript-community-friendly culture, however, and Elm's creator has now spent a lot of time (along with many others) making it better suited to a more general web application framework. In other words, it isn't just canvas graphics any more, although you can still do that.

I think you may find a UML modeller would work well with SVG, and Elm also supports that quite nicely. I think it's still missing a higher-level library in this area (for instance, I find my SVG code peppered with a lot of toString calls while converting numbers to SVG attributes) but because it's implemented in the virtual-dom manner (similar to React) it's very pleasant to make state changes. See http://package.elm-lang.org/packages/elm-lang/svg/1.1.1/

--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rupert Smith

unread,
Jul 30, 2016, 3:03:05 PM7/30/16
to Elm Discuss
Is SVG good for interactive GUIs though?

Duane Johnson

unread,
Jul 30, 2016, 5:15:50 PM7/30/16
to elm-d...@googlegroups.com

On Sat, Jul 30, 2016 at 1:03 PM, 'Rupert Smith' via Elm Discuss <elm-d...@googlegroups.com> wrote:
Is SVG good for interactive GUIs though?

In my experience, SVG is even better for interactive GUIs, unless you have very dense graphic elements, or your UI is more on the unusual/experimental side of things and you need full control over every pixel. The reason SVG is nice to work with is that a built-in concept to SVG is an "object" that has width and height and properties like stroke width and fill color. This tends to be really nice to work with because along with these properties you also have standard events like mouse clicks and that sort of thing that you can hook in to.

Rupert Smith

unread,
Jul 31, 2016, 2:04:23 PM7/31/16
to Elm Discuss
Ok, thanks. Sounds like its worth exploring - I don't need pixel level control. What about text input boxes, and maybe things like controlling focus so you can tab between inputs, and keyboard shortcuts? 
Reply all
Reply to author
Forward
0 new messages