Live data from Hacker News

Labella.js – placing labels on a timeline without overlap

twitter.github.io

81–83 of 83 posts

Re: Labella.js – placing labels on a timeline without overlap

#82
post #46

How come the labels are sideways in left/right position? It feels like it defeats the purpose.

That was to showcase that you can render it in any orientation.

This example might be a more likely use case for left/right (all labels usually have same height)

http://twitter.github.io/labella.js/with_text.html

Re: Labella.js – placing labels on a timeline without overlap

#83
post #50

How complex would it be to do it without taking in the min/max width parameters? It soon becomes insanely complex when you want draw a graph with nodes of variable width and height. Say for example if you wanted to add text inside the boxes and you want the box width to be determined based on the text. I have previously tried to adapt the default tree layout algorithm (Reingold–Tilford?!) in D3 and failed miserably.…

This example has text inside the boxes. I use svg's .getBBox() to obtain width/height for each label.

http://twitter.github.io/labella.js/with_text.html

The max width parameter is optional. I am not sure what are you trying to do with the graphs though. This library is not for graphs or trees. It's for points on single axis.

Post reply on HN