Thanks! Could you please add a comment to example2 and update
example1 to match?
--
Paul Belt
> On Thu, Nov 12, 2009 at 9:06 AM, Nico Garcia Belmonte wrote:
> I explicitly change the id of the JSON nodes in the JSON string first:
>
> var subtree = eval('(' + json.replace(/id:\"([a-zA-Z0-9]+)\"/g,
> function(all, match) {
> return "id:\"" + match + "_" + i + "\""
> }) + ')');
>
> and then eval the string to create a new json object. This way I can clone a
> new tree as many times as I want without node or id conflicts.
>
> > On Wed, Nov 11, 2009 at 11:48 PM, Paul Belt wrote:
> > The one change that is related to the data-structure I did make was to copy
> > the spacetree data-structure from example1 and paste it into example2, then
> > removed the eval in the JSON loader and a substitution in getTree.
> >
> > It doesn't matter which level-2 node nor level-4 node I click.
> >
> > > On 11 Nov 09 1737, Nico Garcia Belmonte wrote:
> > > Seems you're having two nodes with the same id in your json data.
> > >
> > > Or perhaps two different nodes are somehow connected as parents to a node
> > > with the same id, which is not possible for a tree structure.
> > >
> > > > On Wed, Nov 11, 2009 at 4:12 PM, Paul Belt wrote:
> > > > Based on:
http://thejit.org/Jit/Examples/Spacetree/example2.html
> > > >
> > > > Changes:
> > > > * added orientation: 'top' to new ST()
> > > > * added '{ Move: { enable: true, offsetX: 0, offsetY: 200 } }' to st.onClick(st.root)
> > > >
> > > > Everything else is nearly exactly the same (changed colors, ripped out the Log div, :%s/ / /g, etc)
> > > >
> > > > Click on a level 2 node. Click on a level 4 node. Graphing blows up
> > > > (see attached) i.e. a bug or I'm doing something wrong. Please advise.
> > > > --
> > > > Paul Belt
> > >
> > > --
> > > I would never die for my beliefs because I might be wrong.
> > > Bertrand Russell