jcblw / vsvg

〰️ A minimal virtual svg dom that allows some basic dom Node api methods.
https://www.npmjs.org/package/vsvg
14 stars 1 forks source link

Make a Document constructor #2

Open jcblw opened 9 years ago

jcblw commented 9 years ago

So this is a nice to have to keep track of all the Nodes. So if a node that is already in a document is added to some other place on the document the document should know and remove the node from its current place and add it to the new position. Maybe this could be the svg element eg.

var doc = vsvg.svg(),
      line = doc.line( );

// now the line is registed with this document