-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[feature]: different handlers for customizability (ticktextHandler) #1658
Comments
Sounds like a duplicate of #1464 unless we can come up with JSON serializable equivalent. |
It is, sorry. I'm unsure of the needs for the serializability, but if at some point handlers like these would become feasible, perhaps it could be possible to just ignore the handlers? Serialize the values which are serializable and if they weren't defined, use the the defaults like currently (ie, use default |
Right, what you suggest is definitely doable but not something any plotly.js dev will spend time on. The plotly.js data / layout API is designed to be JSON serializable so that it can be used on -- even grounds -- in non-JS clients. |
@druvisc This issue looks stale. Closing. If you can think of other JSON-serializable tick options we could add, feel free to open up a new issue. Cheers. |
I hope it's okay to suggest features here.
I'd like Plotly.js to expose different handlers for customization. I think currently it's only possible for events. Don't think it would be hard too implement in most cases (if a handler is defined, call it, otherwise do the usual). At least if error handling is kept to the minimum and it would be up to the user to properly define the handlers.
One of my biggest problems currently is to set up the y-axis to display si prefix scaled and padded values, so 2 decimal values are always shown, for example 60.00, 1.02k. For this purpose I have to manually calculate the
tickvals
andticktext
.In an ideal scenario, there would be a
ticktextHandler
to whom I can attach a formatting function, receiving the corresponding tick value and returning the formatted tick text.On a side note, could any of the contributors please point me where plotly calculates the appropriate
tickvals
? Turns out not to be that straightforward. I tried looking myself, but currently to no avail.The text was updated successfully, but these errors were encountered: