Skip to content

Revise hierarchy referencing and fixup parent percentage at the root node of treemap and sunburst - #4219

Merged
archmoj merged 5 commits into
masterfrom
hierarchy-percentages
Sep 30, 2019
Merged

Revise hierarchy referencing and fixup parent percentage at the root node of treemap and sunburst #4219
archmoj merged 5 commits into
masterfrom
hierarchy-percentages

Conversation

@archmoj

Copy link
Copy Markdown
Contributor

This PR

  • simplifies the plot and hover code for displaying percentages on sunburst and treemap plots
  • fixes a bug at the root node | now the hover/text template/info are available there
  • adds jasmine tests for treemap hovertemplate at different levels
  • uploads the CI version of a baseline which started failing after we merged Treemap new trace type #4185
    @etpinard

- simplify sunburst and treemap percentage references
- add hovertemplate tests to treemap
- fixup sunburst jasmine texttemplate tests
@archmojarchmoj added this to the v1.50.0 milestone Sep 26, 2019
@archmojarchmoj changed the title Revise hierarchy parent percentage at the root node of treemap and sunburst Revise hierarchy referencing and fixup parent percentage at the root node of treemap and sunburst Sep 26, 2019
Comment threadsrc/traces/sunburst/helpers.js Outdated
Comment threadtest/jasmine/tests/sunburst_test.js Outdated
['%{percentRoot} of %{root}', ['100% of Eve', '33% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve']],
['%{percentEntry} of %{entry}', ['100% of Eve', '33% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve']],
['%{percentParent} of %{parent}', ['%{percentParent} of %{parent}', '100% of Seth', '33% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '50% of Seth', '100% of Awan']],
['%{percentParent} of %{parent}', ['100% of Eve', '100% of Seth', '33% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '17% of Eve', '50% of Seth', '100% of Awan']],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait. Is this the root node sector? You're saying the parent of the root node is itself?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Fixed in 54360be.

@etpinardetpinardSep 30, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it. After 54360be, looks like %{parent} is now '', but %{percentParent} is still 100% for the root node.

Can we have '%{percentParent} of %{parent}' resolve as '%{percentParent} of %{parent}' for the root node (i.e. the percentParent and parent keys are not defined) like before?

I know this is not ideal, but I don't like filling in '%{percentParent} and %{parent} with wrong values for the root node just to make the template string look better.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 7155917.

Comment threadtest/jasmine/tests/treemap_test.js Outdated
Comment threadsrc/traces/sunburst/calc.js
@etpinard

Copy link
Copy Markdown
Contributor

Nicely done 💃 thanks!!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugsomething broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@archmoj@etpinard