simonellistonball / techradar

A d3.js based implementation of the ThoughtWorks TechRadar visualisation with additions.
Apache License 2.0
7 stars 9 forks source link

Make use of "links" property on data array #4

Open jzabroski opened 8 years ago

jzabroski commented 8 years ago

Simply make the following changes to radar.js:

After line 58, add:

    link: entry.links[0],

After line 223, add:

    .append('a')
    .attr('href', function(d) { return d.link })
    .text(function(d) { return d.name; });

And voila, we now have support for the links in the data array. Note, I was not sure why we support multiple links, so I simply treat the first href in the links array as 'primary'. I suppose this code snippet could be altered to have a "See also" in the legend for the radar, but I think the legend would be better served by including details such as start/end time on entries.

Previously, links was defined in the test.html example but not used anywhere in the code.