TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Labella.js – placing labels on a timeline without overlap

375 pointsby callumlockeover 9 years ago

22 comments

jbranchaudover 9 years ago
It'd be cool if the creator used some filler text on the labels generated on the home page so that we could see what it looks like that way.
评论 #10673874 未加载
评论 #10672223 未加载
iheartmemcacheover 9 years ago
Man, I've been searching for a way to do this (generate declaratively images for flow-charts, graphs, etc) which are aesthetically pleasing enough to embed into case studies and white-papers for ages. DIA is functionally sufficient but aesthetically awful when you end up embedding it into a nicely styled InDesign, LaTeX, or Quark publication. I'm going to be pairing this with PhantomJS and making a command-line front-end -> svg over the weekend.
评论 #10669175 未加载
评论 #10670338 未加载
scrollawayover 9 years ago
Boy does that freak out with 200+ labels. :)<p>Looks fun, though.
评论 #10669601 未加载
评论 #10669100 未加载
评论 #10669151 未加载
评论 #10669029 未加载
评论 #10669065 未加载
shsehamover 9 years ago
How complex would it be to do it without taking in the min&#x2F;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. <a href="http:&#x2F;&#x2F;bl.ocks.org&#x2F;mbostock&#x2F;4339184" rel="nofollow">http:&#x2F;&#x2F;bl.ocks.org&#x2F;mbostock&#x2F;4339184</a>
评论 #10669962 未加载
评论 #10675049 未加载
评论 #10671778 未加载
samuellover 9 years ago
Thought I read &quot;lalibela&quot; first :) (Those famous buildings carved out of rocks, a loooong time ago, in Ethiopia <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lalibela" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lalibela</a>)
bakkerthehackerover 9 years ago
neat <a href="http:&#x2F;&#x2F;i.imgur.com&#x2F;0LIwCOO.png" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;0LIwCOO.png</a>
plaid_devover 9 years ago
Can someone briefly explain, at a high level, the positioning algorithm that one would use to solve a problem like this?<p>Reingold–Tilford was referenced below but doesn&#x27;t seem applied in this case.<p>I&#x27;ve attempted to look through the code here but comments are limited and it is pretty imperative.
评论 #10673941 未加载
vladover 9 years ago
Someone sent me a direct link and I had no idea what &quot;Labels should be beautiful&quot; meant.<p>The slogan should be changed to &quot;Labels on a timeline without overlap&quot;, just like the hacker news thread title. :)
macca321over 9 years ago
I would like something like this for things placed anywhere on a screen. The use case is hitting the alt key and displaying labels with the keyboard shortcuts for buttons.
mstadeover 9 years ago
This looks really good. I wonder, how well would it work with a network rather than just a single line? I&#x27;m thinking about something like a git network graph.
haldeanover 9 years ago
I wrote a simple thing to do a similar operation for photos that are in-line with text on my website; I wrote a little bit about it at <a href="http:&#x2F;&#x2F;haldean.org&#x2F;hooke" rel="nofollow">http:&#x2F;&#x2F;haldean.org&#x2F;hooke</a> if people are interested!
Cianticover 9 years ago
How come the labels are sideways in left&#x2F;right position? It feels like it defeats the purpose.
评论 #10675028 未加载
评论 #10669846 未加载
maneeshover 9 years ago
How do you add text to these labels?
评论 #10675024 未加载
chdirover 9 years ago
Wouldn&#x27;t it look more readable if the connectors are straight lines with 90 degree bends instead of curves (like a neatly laid out circuit or wire diagram or tube network).<p>The current version is artsy. Thanks for sharing this though. Looks very cool.
评论 #10669726 未加载
gotchangeover 9 years ago
Any specific use case for this plugin?<p>What about the restrictions on the height imposed on the labels?
dvdplmover 9 years ago
Is this restricted to a straight line or can it be used to label any svg (?) path?
评论 #10673919 未加载
xomateixover 9 years ago
The simple example link from the github page (<a href="http:&#x2F;&#x2F;twitter.github.io&#x2F;labella.js&#x2F;easy.html" rel="nofollow">http:&#x2F;&#x2F;twitter.github.io&#x2F;labella.js&#x2F;easy.html</a>) is a 404.
评论 #10673924 未加载
estefanover 9 years ago
Sounds like a disease.
评论 #10669347 未加载
thejerzover 9 years ago
Is there a way to lay out the nodes vertically instead of horizontally?
评论 #10669051 未加载
dvhover 9 years ago
Labela.js - placing labels on a timeline without overlap
评论 #10669085 未加载
评论 #10672640 未加载
idibidiartover 9 years ago
WHOOPS! Set Labels to 200 instead of 20 and click Generate Labels. The diagram is not only incomprehensible, it actually wobbles, flickers and shakes as you scroll.<p>You need something better than a linear progression of ticks if you want to track and label lot of events that have happened.
评论 #10669229 未加载
idibidiartover 9 years ago
&quot;Shakes, wobbles and flickers&quot; when user is scrolling while algo is running with 200 points, which isn&#x27;t a huge number of points if you consider other means of showing time series data. Positioning algo is dumb if it doesn&#x27;t take UX into account when number of points is relatively large. It should pause while the user is scrolling.<p>Also, it is a futile to suggest that automatically placing labels is scalable for any number of labels beyond 40 or so. The resulting diagram beyond 40 or so points is incomprehensible. I tried 200, but 50 or 70 would also most likely result in messy diagram.
评论 #10670351 未加载
评论 #10669641 未加载