syntagmatic / parallel-coordinates

A d3-based parallel coordinates plot in canvas. This library is no longer actively developed.
http://syntagmatic.github.com/parallel-coordinates/
Other
511 stars 212 forks source link

Prevent brushing from changing line width #319

Closed jmgelman closed 8 years ago

jmgelman commented 8 years ago

I implemented variable line widths for polylines by adding a lineWidth property, and adding the following line in path_foreground:

ctx.foreground.lineWidth = d3.functor(__.lineWidth)(d, i);

By doing this, I was then able to pass a function to parcoords.lineWidth() to have variable sized polylines, defined by a function.

The problem is, when I go to brush, these thicknesses get wiped out. If I brush the data, the default thickness is used.

I tried adding ctx.brushed.lineWidth = d3.functor(__.lineWidth)(d, i), but all of the lines ended up being the same thickness.

Does anyone know where in the code the overriding of my lineWidth values is occurring during brushing? Basically, I just don't want the lineWidth values to change back. Perhaps I'm missing something easy?

Thank you!

jmgelman commented 8 years ago

I think I might have figured this out. I added the line ctx.brushed.lineWidth = d3.functor(__.lineWidth)(d, i) to path_brushed and path_highlight, as well as path_foreground, and now it seems to work.