-
dcJune 29, 2016 at 3:51 am #6269
Is it possible to configure the weighted tree to display vertically, from top to bottom rather than horizontally, from side to side?
Thanks.
vizulyJune 29, 2016 at 5:50 am #6273Hello DC,
Great question. You would think this could be a relatively simple change, but it isn’t.
The measurements taken for the layout are really based on a horizontal spread. That being said it is not impossible to do what you want, but it will require a bit of tweaking to the src/viz/weightedtree.js file.
Here is a great link to help get you started: http://bl.ocks.org/d3noob/8326869
You will want to start by looking at three areas in src/viz/weightedtree.js
1. Initializing the
d3.svg.diagonal().projection(function (d) { return [d.x,d.y] });
2. Changing related code in themeasure()
function for setting the appropriate width/height of thetree.nodeSize()
and other related measures.
3. Changing the code in theupdate()
function so it translates the nodes to the correct position usingd.x,d.y
instead ofd.y,d.x
. And also changing how the labels are laid out.So while not impossible to do, there is no simply parameter you can change that will do it automatically.
– Tom
-
|
You must be logged in to reply to this topic.