-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pie & sunburst: pass empty text string to texttemplate
- Loading branch information
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -991,8 +991,8 @@ function formatSliceLabel(gd, pt, cd0) { | |
pt.text = ''; | ||
} else { | ||
var obj = makeTemplateVariables(pt); | ||
var ptTx = helpers.getFirstFilled(trace.text, pt.pts); | ||
if(isValidTextValue(ptTx)) obj.text = ptTx; | ||
var ptTx = Lib.castOption(trace, pt.i, 'text'); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
etpinard
Contributor
|
||
if(isValidTextValue(ptTx) || ptTx === '') obj.text = ptTx; | ||
pt.text = Lib.texttemplateString(txt, obj, gd._fullLayout._d3locale, obj, trace._meta || {}); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -718,7 +718,7 @@ function formatSliceLabel(pt, trace, fullLayout) { | |
obj.color = cdi.color; | ||
} | ||
var ptTx = Lib.castOption(trace, cdi.i, 'text'); | ||
if(Lib.isValidTextValue(ptTx)) obj.text = ptTx; | ||
if(Lib.isValidTextValue(ptTx) || ptTx === '') obj.text = ptTx; | ||
This comment has been minimized.
Sorry, something went wrong.
archmoj
Contributor
|
||
obj.customdata = Lib.castOption(trace, cdi.i, 'customdata'); | ||
return Lib.texttemplateString(txt, obj, fullLayout._d3locale, obj, trace._meta || {}); | ||
} | ||
|
Hmm. I think we need to keep
helpers.getFirstFilled
here to handle cases with aggregated labels e.g.https://rreusser.github.io/plotly-mock-viewer/#pie_aggregated
By the looks like of it, we don't have any tests for hover on aggregated pies.