philogb / jit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web
http://thejit.org
Other
1.51k stars 297 forks source link

"offsetY" setting doesn't work after "removeSubtree" call #191

Open shkleinik opened 9 years ago

shkleinik commented 9 years ago

Hi, I'm trying to implement editable chart with "top" orientation. I want my chart be centred horizontally and stick to top vertically:

    var spaceTree = new $jit.ST({
                                  injectInto: container.id,
                                  orientation: "top",
                                  offsetY: 300
                               });

After I remove some subtree, entire tree is moved from the canvas to the center:

    spaceTree.removeSubtree(nodeId, true, "animate", {
                    hideLabels: false,
                    onComplete: function () {
                        console.log("subtree removed");
                    }
                }

Maybe somebody can suggest some workaround (set start point not on the canvas center but at the x/2, 0 + myOffset)?

P.S. By the way with 'replot' option NO reposition to center happens.