如何渲染d3.layout.tree以使其向下传播(root在顶部) [英] How to render d3.layout.tree so that it spreads downwards (root at the top)
问题描述
我在下面找到了一棵很棒的树,几乎满足了我的需求。
但是,我想纵向扩展树。任何人都可以给我b
任何想法如何制作它或任何参考网站。任何帮助将是
赞赏。
I found a fantastic tree as below which meets almost my needs. However, I would like to expand lengthwise the tree. Could anyone give me any ideas how to make it or any reference sites. Any help will be appreciated.
http:// mbostock.github.com/d3/talk/20111018/tree.html
推荐答案
一般来说,旋转很简单数学过程。
In general, rotating is simple mathematical process.
如果该点的原始坐标是 {x,y}
:
If the original coordinates of the point are {x,y}
:
{-y,x} = rotated 90° (anti-clockwise)
{y,-x} = rotated -90° (clockwise)
{-x,y} = mirrored along y-axis
{x,-y} = mirroded along x-axis
{-x,-y} = mirroded along both
这些开关应该在所有路径和坐标计算中完成。我认为相当一份工作。
These switches should be done in all path- and coordinate-calculations. Quite a job, I think.
是否可以将整个模式包含在单个 DIV
中?然后你可以尝试用CSS3-transform旋转这个 DIV
。
Is it possible to include the whole pattern into single DIV
? Then you could try to rotate this DIV
with CSS3-transform.
这篇关于如何渲染d3.layout.tree以使其向下传播(root在顶部)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!