fperucic / treant-js

Treant.js - javascript library for drawing tree diagrams
MIT License
862 stars 314 forks source link

How to add node to top of clicked node #170

Open rameshwarcode opened 2 years ago

rameshwarcode commented 2 years ago

When i clicked on node i am able to add node as child of clicked node. My Requirement is: When i click on a node would like to prepend a new node to clicked node. In other words i want to add as parent (top) of the clicked node. Is there any method to do this or possible solution to this.

Thanks in advance

knutesears commented 7 months ago

The node already has a parent: both in the DOM and in the logical model that is the Treant object. Both are kinda tree-like. You have two parents, but I'm not sure the node can, or maybe I'm misunderstanding something about your Q.