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.

Legends in D3

206 pointsby jsweojtjalmost 10 years ago

6 comments

banealmost 10 years ago
A team I work with built a great internal tool with D3 and there were a few things that they did that really bumped it up to the next level:<p>- The data was the interface. Things that they used d3 to show, were also the interaction elements which could be clicked to focus-in on subsets of the same data. It was almost fractal, but also immediately clear and simple to use. There were no control bars or sliders or really buttons. Anybody who could use google maps could use this and it took about 10 seconds to show somebody how it worked before they could operate it at a high-level.<p>- The legend was not just a visual aid, but had interactive components in the tool:<p>1) Hovering over an element in the legend caused all the corresponding elements in the display to highlight so you could see where they were in a complex display. (and visa-versa, hovering over an element in the main display caused that element in the legend to highlight)<p>2) Clicking an element in the legend caused it to filter on-off, allowing various unimportant parts of the display to be eliminated.<p>These three things changed it from just a static picture into a useful analytic tool and getting more value out of the legend by turning it from just a picture into a fully interactive element felt so obvious in retrospect that legends I see now that are just a legend feel incomplete.
评论 #9902542 未加载
评论 #9904025 未加载
评论 #9903892 未加载
staredalmost 10 years ago
Very nice! I was tired of making my own legends for each single things. And this one looks really nice and easy.<p>Though, one of my pet peeves: people, please don&#x27;t use discrete color scales for continuous parameters. It distorts presentation for no good reason. For example two countries are colored the same way even though they are on the opposing edges of a bin (so the difference is being masked), or two countries are colored in a different way, even though the difference is minimal, but just passes an artificial threshold (then an artificial difference is being shown).
评论 #9901987 未加载
评论 #9902005 未加载
评论 #9905087 未加载
评论 #9902036 未加载
aubergenealmost 10 years ago
Looks very good.<p>For the size legend, the defaults are a bit odd. You should almost always be using d3.scale.sqrt() as you&#x27;re comparing area, also zero in the domain should usually map to zero on the range.<p>I made a similar legend for circle areas, but they are stacked within each other. <a href="http:&#x2F;&#x2F;bl.ocks.org&#x2F;aubergene&#x2F;4723857" rel="nofollow">http:&#x2F;&#x2F;bl.ocks.org&#x2F;aubergene&#x2F;4723857</a>
mslevalmost 10 years ago
I can&#x27;t be the only one who thought this article would be about people who will be known throughout history for their amazing work in D3- champions, heroes, front-end developers!
评论 #9904671 未加载
geoffharcourtalmost 10 years ago
This is awesome. After spending a lot of time tweaking chart legend code, I would be very happy to pull a polished toolset like this in to future projects.
couchandalmost 10 years ago
&quot;Tired of making legends for your data visualizations?&quot;<p>No. It never takes more than about two minutes to whip up something basic like this.<p>Integrating your legend tightly with your visualization has lots of benefits, mostly in terms of enabling interaction.
评论 #9902494 未加载
评论 #9903492 未加载