-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
hightlight when hovered over #409
Comments
sounds like another vote for #403? |
kind of. the hightlight can be done by width/rad change, or color change, or style change or combos of aboves, or some other ways. also the target may not be lines, it could also be group of dots or others. |
i assume you've seen https://leeoniya.github.io/uPlot/demos/focus-cursor.html which can be enabled for the band demo as well. there's probably not a way currently to isolate this behavior to just a single series.
when scatter/bubble is implemented (#107), then probably there will have to be support for hovering points/circles as well. however, there is no plan to add more complex hover detection. unlike html & svg, canvas does not provide these things out of the box, so everything has to be done in javascript, which adds a ton of code and complexity for not a lot of benefit. if you need something more complex, then an svg-based charting library is probably more suitable for your use-case. |
points taken. agree with you that we want to keep this lib lean and clean. back to this issue. what I am currently doing is that, for an obj that is pushed into a drawing array, I assign a groupId, so that when an element is hovered, I will search for all objs with same groupId, then changes their line width, then redraw. not many lines of codes though. just feel like it could be useful to put these in a lib, say, adding groupId field, adding group callback function handle upon hovering events so users can put their own implementations like change color, rad, etc. BTW, just took a look at the focus_cursor demo, it does get very close to the goal. the seriesIdx is close to the groupId, also it reports the group event which is the hovering in/out, then what we need is the group event function that will have default behavior (could be dummy for nothing) and can be overloaded by users' own implementations. |
i think this is a bit too case-specific to add to the core, since it takes very little effort to do externally, i'm going to leave it as-is. as for dynamic line width, it actually turns out that handling this consistently across the full API is not a simple change, but if you're okay with just increasing the line width and not affecting point sizes, then it's very easy to do externally. i've added this behavior to the focus-cursor demo. please see #403 (comment) for more details. |
thanks |
in the high-low-band demo, is it possible to make the middle dotted line highlighted when cursor hovers over, e.g. thicker but kept the same color? thanks
I am not sure if it is part of the non-features.
The text was updated successfully, but these errors were encountered: