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

enhance(scatter): remove entities from the data table that are not displayed in the chart #2720

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Oct 10, 2023

fixes #2692

Problem

  • In scatter plot charts, entities without data along the x- and y-axis ended up being displayed in the data table because they did have data for the size dimension (often, the size dimension is population)

Solution

This PR makes sure that only entities show up in the data table that are actually displayed in the chart:

  • Entities in scatter plots that don't have data for the x- and y-dimension are removed from the table view
  • Entities in scatter plots and Marimekko charts that were manually excluded by the author are also removed from the table view

Technical details

  • Grapher has a new computed property, tableForDisplay
  • Each chart type optionally can have a transformTableForDisplay method that produces tableForDisplay
  • tableForDisplay is passed to <DataTable />

Base automatically changed from grapher-redesign to master October 16, 2023 09:22
@sophiamersmann sophiamersmann force-pushed the hide-entities-in-data-table branch from bf6a0e2 to 96b5c0b Compare October 16, 2023 09:56
@sophiamersmann sophiamersmann marked this pull request as ready for review October 16, 2023 11:23
Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

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

Nicely done, this makes lots of sense and I like the tableForDisplay approach!

Copy link

github-actions bot commented Nov 1, 2023

This PR has had no activity within the last two weeks. It is considered stale and will be closed in 3 days if no further activity is detected.

@github-actions github-actions bot added the stale label Nov 1, 2023
@sophiamersmann sophiamersmann force-pushed the hide-entities-in-data-table branch from b26732a to 666ce4f Compare November 2, 2023 07:29
@github-actions github-actions bot removed the stale label Nov 3, 2023
@sophiamersmann sophiamersmann merged commit 2471fd7 into master Nov 3, 2023
13 checks passed
@sophiamersmann sophiamersmann deleted the hide-entities-in-data-table branch November 3, 2023 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scatter plot: Remove entities from the data table that are not displayed in the chart
2 participants