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

Provide axis label per dimension #340

Open rvberloo opened 6 years ago

rvberloo commented 6 years ago

I am trying to plot data that is numerically coded (eg 1,2, .. 9) but has a translation for each value that is informative (eg 1=yellow, 2=orange, 3=red etc). I would like to use the domain as 'number' to keep the order but plot the translation on the label axis. Any hack to get this to work?

syntagmatic commented 6 years ago

The axis/tick config was refactored by some contributors and I haven't been too active, so apologies for not knowing the answer. You're looking for the tickFormat method on the axis. Then you can use a lookup object to map numbers to the colors you want.

If you work from this example (which is my latest but doesn't use the library-- just D3 from scratch) this is easy to add:

https://bl.ocks.org/syntagmatic/482706e0638c67836d94b20f0cb37122

If you figure it out with the library, please post the answer!

rvberloo commented 6 years ago

Hi Kai thanks for pointing to this example. I basically started working from that as it seems to do exactly what I need. And I got it running with my own data :) But I have a slightly different setup where I connect the brush event to an update of data in a connected ag-grid. That also works fine. What I cannot get to work is the reverse: selecting a row (or rows) in my grid should highlight that data in the ParCoordPlot. Using the library I could use highlight function, how can I accomplish the same in this example ?

thx, Ralph

syntagmatic commented 6 years ago

You'll need to add a second canvas overlaid on the chart, and redraw the highlighted line on that. This example's pretty old, but has that functionality. Look at code related to highlight and highlighted.

http://bl.ocks.org/syntagmatic/3150059

rvberloo commented 6 years ago

Starting from you Nutrient IV example, how can you reset all brushes in one function call ? (like the BrushReset() function in ParCoordPlot)