Open pmantica3 opened 1 year ago
The need for what you're asking for is very clear and your proposal makes a lot of sense from the Python developer's perspective but unfortunately this would be extremely challenging with the current architecture, as no Python code can be executed while a figure is being rendered... update_layout()
and all other Python functions exclusively populate static JSON objects which are passed to Plotly.js for browser-side processing, so there would be no way for such a function to execute, and for security reasons the Plotly.js system cannot accept workaround such as stringified Javascript function in such a place either. We're basically left with the kind of formatting mini-language that we have right now, which we can/should expand to meet various missing formatting needs.
Regarding bolding, this is also something which is missing from Plotly.js' formatting concept at the moment. We have font family and font size but not font weight in the data model, although this could be added globally to all text objects I think. Conditional bolding, much like conditional coloring of something like tick text would need to work a bit differently however.
+1 for this kind of a feature. I came a cross a task recently where I needed to create custom format for tick values. I ended up just creating a fixed set of tick values manually but that killed the dynamic nature of the plot's ticks when zooming in on the plot which is a major drawback of my solution.
Just for a note, the task was to create a secondary y axis ticks which would be proportional to the primary y axis ticks with a custom proportion function (something like lambda x = 1 - x / some_constatnt
).
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson
@gvwilson yes, it is still a concern, see my previous comment right above yours
Thanks for the awesome work on this project! It is incredibly useful!
I have a feature request. I work for a hedge fund and we want our plotly graphs to follow a standardized format. I am having a hard time through writing a generic formatting function that formats the x-axis and y-axis tick values.
For instance, if you wanted to set the tick axis to be bold and include a "x" at the end, you would need to do something like:
Which is pretty inconvenient because you have to specify the tickvals every time you want to do this.
So I was thinking that it could be a good idea to add something like:
fig.update_xaxis(tick_text_formatter=<function that formats a tick value>)
Thoughts?
Again, thanks for the awesome work!