Skip to content
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

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

Merged
merged 5 commits into from
Sep 30, 2019

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Sep 26, 2019

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
@archmoj archmoj added bug something broken status: reviewable labels Sep 26, 2019
@archmoj archmoj added this to the v1.50.0 milestone Sep 26, 2019
@archmoj archmoj 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
@@ -1345,7 +1345,7 @@ describe('Test sunburst texttemplate without `values` should work at root level:
['path: %{currentPath}', ['path: /', 'path: Eve/', 'path: Eve/', 'path: Eve/', 'path: Eve/', 'path: Eve', 'path: Eve/Seth', 'path: Eve/Seth/', 'path: Eve/Awan/']],
['%{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
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
Contributor Author

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.

Copy link
Contributor

@etpinard etpinard Sep 30, 2019

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
Contributor Author

Choose a reason for hiding this comment

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

Done in 7155917.

@etpinard
Copy link
Contributor

Nicely done 💃 thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants