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

Overhaul availableEntities indexing #3401

Closed
5 tasks done
Tracked by #3330
marcelgerber opened this issue Mar 26, 2024 · 1 comment
Closed
5 tasks done
Tracked by #3330

Overhaul availableEntities indexing #3401

marcelgerber opened this issue Mar 26, 2024 · 1 comment
Assignees

Comments

@marcelgerber
Copy link
Member

marcelgerber commented Mar 26, 2024

For #3388, we need a more accurate representation of the availableEntities field that is currently part of a chart's config.

We want it to

  • more accurately match the actual entities that can be found in the chart (not just "overestimating" them)
    • ... by using grapher.tableForSelection
  • "default" to the chart tab, which is the more interesting tab usually
  • respect the chart's EntitySelectionMode

Implementation & progress

In discussion with @danyx23:

  • Create a new table charts_x_entities with columns chartId and entityId (both primary keys, both foreign keys, both indexed)
  • Write a script that runs ~weekly and updates this table, using a simple DELETE FROM charts_x_entities; INSERT INTO ... destroy-and-recreate behavior.
  • The script instantiates every grapher, downloads its data, looks at grapher.tableForSelection, etc.
  • Get rid (-> migration) of the config field data.availableEntities and the code writing it; it is only used for Algolia indexing.
  • Think about handling selectedEntityNames/availableEntityNames for chart types like Marimekko, scatter, slope; where currently selection just highlights entities, but leaves unselected entities visible
  • The new table charts_x_entities may also be useful for upcoming country pages.
@marcelgerber
Copy link
Member Author

Done in #3418.

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

No branches or pull requests

2 participants