Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide axis label per dimension #340

Open
rvberloo opened this issue Nov 1, 2017 · 4 comments
Open

Provide axis label per dimension #340

rvberloo opened this issue Nov 1, 2017 · 4 comments

Comments

@rvberloo
Copy link

rvberloo commented Nov 1, 2017

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
Copy link
Owner

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
Copy link
Author

rvberloo commented Nov 6, 2017

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
Copy link
Owner

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
Copy link
Author

rvberloo commented Dec 7, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants