-
Notifications
You must be signed in to change notification settings - Fork 211
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
Polyline meta-information #305
Comments
If the polyline is rendered in a Canvas, as like as this chart does, you loose the control of the polyline itself. The canvas is just a rasterization of all your lines and you cannot assign pointer events to specific lines. Of course, if you draw the polylines as SVG objects, you can assign pointer events to them and do what you'd like to do. But it really depends on the number of lines you have to plot. Canvas performs much better with a lot of lines. |
A few ideas of how to implement:
|
Thanks for the clarifications @t3o-it . So probably rendering each line as SVG would become a problem for hundreds of lines. @syntagmatic, idea number 2 seems like it would work nicely and doesn't look too complex to implement. Otherwise, the brush function still remains a good alternative to select a single polyline and access info with the associated table as in slickgrid. |
Hi again, In summary, my approach was as follows:
So the issue is that I cannot get the colors from the “layered” canvases (whether the new “clickable_colors”, or others (e.g. “foreground”). I tried setting a very high z-index to the layers, but this doesn’t seem to work either. The minimal working example is available here, and also uploaded as a bl.ocks here Any hints on how to make this work, and handle the layered canvases appropriately? |
I managed to get a working version of clickable polylines, you can try it out at the following bl.ocks. If it gets the job done, it could certainly benefit from some improvements. Currently the hovering is a bit "jumpy" because it isn't possible to draw crisp lines, so using @syntagmatic 's color-coded approach always leads to some wrongly colored pixels. I could filter out some of the wrong colors (e.g. if they contain letters), but others always remain. Any further suggestions are welcome! |
How could one display meta-information about a polyline by hovering the pointer over the line? (e.g. its ID number or name would appear in an info bubble when passing the mouse over a polyline).
I suspect this would be fairly easy to do: the slickgrid example already allows to highlight a polyline by hovering over the corresponding row in the table. This feature would more or less be the opposite.
Thanks for any tips regarding this, I'm still fairly new to D3 and JS, and any help would be appreciated to get started!
The text was updated successfully, but these errors were encountered: