-
-
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
Support text templates for shape labels #6511
Comments
Hey @emilykl, it is important that the slope value is scalable. We are handling timeseries data and sometimes the the slope should be measured per second or per minute. This should only be configurable via plotly.py. |
Good point @JulianWgs . @alexcjohnson Any thoughts on how unit conversions could be achieved? For timeseries, is it possibly covered by d3 time formatting? https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md ? More generally, could it make sense to support applying a multiplication factor to the slope value? |
Looping in @ndrezn here as well |
I think the multiplication / division solution is the best here. Right now IIRC we support format strings in text templates, like Does it make sense what numbers you'd want to use here? @emilykl if we're just doing |
It's already confusing to me. Do you want to build a unit parser?
Imho it is sufficient to stick to the |
@JulianWgs that's great, thanks for the feedback. Sounds like we're in agreement. For |
I agree, |
Hello thanks for this implementation, i wonder if its possible to add percent calculation ? I wanted to try to add this function. But the codebase is way to profesional for me, No way i can make a good PR for this. I started to try to add this , but i dont even get , to the testing of this. Because like i said the codebase is way over my programming skills. I think the best would be be allowing this in direct in the texttemplate for example : "xPCT: %{ ( (x0 / x1) -1 ) * 100}" this would give us so much freedom. |
@mosaikme that's certainly a nice use case, but it seems to me a little too specific to add a dedicated field for Certainly not a simple addition, and unfortunately this isn't really on our roadmap any time soon but if you or anyone else is interested in sponsoring it we'd be happy to discuss. |
Add support for text templates in shape labels.
Add a text template property to
shape.label
, with support for displaying variables which are updated automatically based on the shape's properties -- for example, the x/y coordinates of a rectangle or the slope of a line.This feature depends on #6454 (Support adding text labels to lines and shapes).
Proposed API
shape.label.texttemplate
propertyhovertemplate
/texttemplate
, where variables can be included in the string using the syntax%{variable}
.x0
,x1
,y0
,y1
slope
Partnership
Development of this feature is sponsored by Volkswagen's Center of Excellence for Battery Systems.
The text was updated successfully, but these errors were encountered: