andreaferretti / paths-js

Generate SVG paths for geometric shapes :bar_chart:
http://andreaferretti.github.io/paths-js-react-demo/
Apache License 2.0
1.71k stars 84 forks source link

Is there a way to make a tree chart populate vertically rather than horizontally? #40

Open abilashs90 opened 8 years ago

abilashs90 commented 8 years ago

Hi, Is there a way to make a tree chart populate vertically rather than horizontally?

andreaferretti commented 8 years ago

Well, what I usually do is insert the whole tree inside a g element with the transform=rotate(90) attribute.

This has the unfortunate effect of rotating labels as well, but you can insert the opposite rotation.

I have been thinking whether to add a flag to make the tree vertical, but I am not sure if the additional parameter would be worth, given that SVG graphics allows rotations

abilashs90 commented 8 years ago

Yes, I tried rotate, but that needs a lot of changes wrt margins etc. It would be a nice addon to a great library.