jFranciscov
jFranciscov

Reputation: 73

d3 parcoords lineWidth based on attribute

I'm trying to set lineWidth to each line based on attribute. If certaing attribute has some value, the width of that polyline should be defined.

I have similar functionality for colors:

parcoords.color(function(d){
  return colorCluster(d.Cluster);
}).render()

Now I'm looking something similar for line width

Upvotes: 1

Views: 217

Answers (1)

BroHammie
BroHammie

Reputation: 36

This is not possible with the current library as is, although it would not be difficult to add it in.

Add a property 'lineWidth' to the __ object in start.js then in styles.js under the path_brushed, path_foreground, path_highlight add ctx.brushed.lineWidth = d3.functor(__.lineWidth)(d, i);

Then just like you are calling parcoords.color() you would use parcoords.lineWidth() passing a function that returns a line width value based on an attribute.

Post an issue under the github project to see if the community would like this feature.

Upvotes: 1

Related Questions