-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Custom scales or more advanced hoverinfo support #1008
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
Comments
Thanks for writing in! Adding fully custom scales will be a little tricky for us. The plotly.js Looking forward, the best solution for such deeper customization would be using plotly.js transforms. We're still working on the details on what transforms should and what they can do. We might want to take a look at #499 and #978 for more details. For example of transform in action, take a look at @rreusser 's http://codepen.io/rsreusser/pen/GjoAJA |
Thanks for the prompt and helpful reply. Based on the issues you linked to, it looks like I should hang on for a bit until a transform type that suits this problem is available? Or do you think it's already doable? (I don't see any docs for it yet, at least.) (https://github.com/rreusser/plotly-basis-transform looks relevant, also!) |
We're not planning on adding a particular transform for your use case. I meant: you should start thinking about writing your own custom transforms to achieve tasks of the likes.
Yep, it's already doable. Though probably a little bit tricky. As you point out, https://github.com/rreusser/plotly-basis-transform is probably the best example of a custom transform at the moment. |
@etpinard I finally tried to use a transform to create a log2 scale, but I'm not seeing a way to solve the original problem (show From digging, it looks like I can almost do what I want by defining a This invokes plotly.js/src/components/fx/hover.js Lines 563 to 568 in 46483f2
but then plotly.js/src/components/fx/hover.js Line 591 in 46483f2
Is that intentional? |
Actually, I forgot that I can make use of So, my workaround: And implemented as a transform: |
I need to scale data with a custom function (let's say
log2
). Right now I'm doing that by:tickvals
andticktext
to the scaled and unscaled values, respectively. (easy enough)This works okay, except that the hover info shows the transformed values (e.g.
log2(x)
instead ofx
). As far as I can tell, there's no way to change that. I would have to sethoverinfo: "none"
, listen toplotly_hover
and implement my own tooltip.Some solutions I can think of:
hoverinfo
that is called with some data (x
,y
,z
,text
,name
probably); return value is displayed in the hover. This goes with the workaround I listed above, but also seems like a very nice feature.This could help with #221 and any other future requests for new scales.
The text was updated successfully, but these errors were encountered: