-
-
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
texttemplate with date formatting #4071
Conversation
Add `textemplate` support to the following traces: - [x] pie - [x] sunburst - [x] funnelarea - [x] bar - [x] waterfall - [x] funnel - [x] scatter
@@ -534,6 +537,64 @@ function getTextPosition(trace, index) { | |||
return helpers.coerceEnumerated(attributeTextPosition, value); | |||
} | |||
|
|||
function calcTexttemplate(fullLayout, calcTrace, index, xa, ya) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to merge this routine with calcTextinfo
where we could first set the obj.??Label
values and then use those to translate the textinfo
flags.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -29,7 +29,7 @@ module.exports = { | |||
moduleType: 'trace', | |||
name: 'scatter3d', | |||
basePlotModule: require('../../plots/gl3d'), | |||
categories: ['gl3d', 'symbols', 'showLegend'], | |||
categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add 'scatter-like'
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, you're using traceIs(trace, 'scatter-like')
in your tests. A quick grep reveals that 'scatter-like'
is only used in two places, in modebar/manage.js
and for some restyle
call. Adding it to scatter3d
won't break anything and is arguably the thing to do, so I'm 👌 with this.
Awesome PR @antoinerg !! 💃 💃 💃 - let's get the 1.50.0 🚋 up and running! |
This partially closes #3816 by adding
textemplate
support to traces withtextinfo
:plus:
as well as GL traces:
Also introduced in this PR is the ability to format dates in both
(hover|text)template
via pipe|
(c6370d9 and 836d5a2).TODO:
funnel
andwaterfall
(db87e62)(text|hover)templateAttrs
into a single file (4ef8392)gl2d
texttemplateString
(done in cbbcfcb)customdata
variable available in texttemplate (e0bde45)templateFormatString
(ee0a309)textinfo
whentexttemplate
(9330290)meta
is available withintexttemplate
(e7c034a)