Tree drawing orientation

前端 未结 1 1854
长情又很酷
长情又很酷 2020-12-03 01:36

I\'ve made a slightly modified tree using the tree layout. I needed to orient the tree right-to-left instead of the regular left-to-right orientation that\'s the default. Wh

相关标签:
1条回答
  • 2020-12-03 02:27

    The tree layout computes node positions in an arbitrary coordinate space of breadth (x) and depth (y). To change the orientation of the layout, change the mapping from the layout’s coordinate space to SVG pixel coordinates. If you prefer not to do the mapping manually, you could use quantitative scales to specify a more intuitive (but more verbose) mapping.

    Here’s an example showing four different orientations:

    • http://bl.ocks.org/3184089
    0 讨论(0)
提交回复
热议问题