Forging SVG support. Anyone interested?

80 views
Skip to first unread message

Tor

unread,
May 14, 2013, 8:21:46 AM5/14/13
to mootool...@googlegroups.com
Hi guys
 
I'm working on a web application with support for drawing diagrams. I've looked into Raphael but I don't like the syntax and want to create a solution that is more in synch with MooTools.
 
So I'm thinking about writing an SVG plugin for MooTools and post it on Forge to perhaps get some added feedback but before I get too deep into development I'd like to run a couple of things by you guys.
 
First off I'm having to add Element support for SVG elements that as far as I can see is not supported at the moment because of the lack of namespace handling on Elements.
I'm currently solving this by adding a SvgElement class which is basically a copy of document.newElement and the Element constructor minus the support for IE8 and older that does not have SVG support anyways.
 
Secondly I need Drag support for these SvgElements which means the modifiers for the dragged element has to be x.baseVal.value and y.baseVal.value because of the nature of SVG elements.
Now I've again just made a copy of the Drag class and refurbished the code to support SVG. As a lazy developer I find this solution sufficient for the job but in every other aspect I feel like a butcher.
 
Is there a better approach I could take instead of the crude copy and paste and is there anyone else that have any interest in SVG support in the style of MooTools or is it a wasted endeavor?
 
Sincerely
 Tor Viktorsson
 Åskvigg
 
ps. Any MooTools users in Stockholm out there?

Barry van Oudtshoorn

unread,
May 14, 2013, 8:35:28 AM5/14/13
to mootool...@googlegroups.com
Have you had a look at Art [1]? It's a MooTools project that's actually very stable -- I've been using a graphing library I built using Art in production for over two years now, without any issues. I'd probably start from there and build on that.

--
 
---
You received this message because you are subscribed to the Google Groups "MooTools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mootools-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tor

unread,
May 14, 2013, 9:58:05 AM5/14/13
to mootool...@googlegroups.com
Thanks Barry!
 
I think you meant to link here https://github.com/kamicane/art . Not sure what's happening here but an uneducated guess is that the development of Art has moved along to CommonJs. I'm guessing using Prime with the elements and Art library could be a solution for the future though.
 
This is enough for me to assume that there is no additional need for an SVG plugin since Art has been around (under my radar) for years. What I'll do is streamline the working copy I've got now and perhaps in the future add the diagram manipulation code to Forge as a specific use case instead of as a library for generic SVG handling.
 
Tor Viktorsson 

Erik Cervin Edin

unread,
May 14, 2013, 1:34:28 PM5/14/13
to mootool...@googlegroups.com
Not sure what you mean by diagrams or what you're trying to do, but have you checked out http://d3js.org/ or Highcharts

Benjamin Kuker

unread,
May 14, 2013, 9:19:16 PM5/14/13
to mootool...@googlegroups.com
Hi Tor,

I created some MooTools SVG classes for a charts plugin for VM UI Framework that you might find helpful. Here's a gist of the SVG class, the charts code, and the docs and demos for the charts. It's not in the Forge, but feel free to expand on the SVG class if you'd like. I only added the stuff I needed, so I'm sure there are a few things missing.

-Benjamin

Tor

unread,
May 15, 2013, 3:07:53 AM5/15/13
to mootool...@googlegroups.com, er...@cervined.in
Thanks Erik!
 
I'm going to use a MooTools approach and won't be using a library with a different coding style at this point.
With that said I think I've got everything I need at the moment and my prototype is making progress.
 
The diagrams I'm making could be anything from simple mind maps to more advanced behavior trees for gaming AI but it's basically all rectangles and connectors.
That library looks great for visualizing large data though so I'll definitely keep it in mind for future projects.

Tor

unread,
May 15, 2013, 3:19:37 AM5/15/13
to mootool...@googlegroups.com
That's great
I can see that we've both chosen a similar approach. I've settled on not making a generic SVG library though but will instead just implement the UI elements needed for the project I'm working on which is basically all rectangles with text and connectors and sub trees.
 
If there is a official SVG library for MooTools or even something added to Forge by you, Valerio, Sebastian or anyone else who's worked on managing SVG I'll be able to help out but at this moment I'm going to keep it simple and just target the problem I've got in front of me.
 
Again, thanx everyone who came with suggestions for libraries, I think I'm on the right path with the solution at hand.
 
/ Tor Viktorsson

Benjamin Kuker

unread,
May 15, 2013, 6:19:59 AM5/15/13
to mootool...@googlegroups.com, er...@cervined.in
It's canvas, not SVG, but is the NodeGraphJS forge plugin close to what you're trying to achieve?
Reply all
Reply to author
Forward
0 new messages