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

feat: Add logic to merge multiple by multiple join bys #1480

Merged
merged 30 commits into from
Apr 30, 2024

Conversation

ptbrowne
Copy link
Collaborator

@ptbrowne ptbrowne commented Apr 25, 2024

Some cubes should be merged on multiple dimensions. This PR makes it possible.

How to test

  1. Start with Photovoltaikanlagen <PREVIEW_URL>/en/create/new?cube=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9&dataSource=Prod
  2. Click add dataset
  3. Median electricity per Kanton is mergeable through "year" and "kanton"
  4. Preview shows the two columns as joined
  5. Ability to switch between map / line charts and other charts

@ptbrowne ptbrowne requested a review from bprusinowski as a code owner April 25, 2024 14:37
Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 5:28pm

Copy link
Collaborator

@bprusinowski bprusinowski left a comment

Choose a reason for hiding this comment

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

LGTM! 👏

Some things I noticed when checking out the deployment preview:

  • when merging Photovoltaikanlagen with Gebaude, the chart looks broken,
  • published chart looks different than chart in the edit mode.

To reproduce both issues go to https://visualization-tool-git-feat-multiple-join-by-ixt1.vercel.app/en/v/ZOYp4gfZ_gXN?dataSource=Prod, see how the chart looks like, copy and edit the chart to see that it looks different in the edit mode.

app/configurator/components/add-dataset-dialog.tsx Outdated Show resolved Hide resolved
@ptbrowne
Copy link
Collaborator Author

Thanks @bprusinowski, the charts should not look broken anymore (not enough filters applied when switching from chart to chart), and the published chart should not look different anymore (bug of extracting component iris from chart config).

@ptbrowne ptbrowne force-pushed the feat/multiple-join-by branch from 59ffde4 to 2b603fa Compare April 30, 2024 14:35
Copy link
Collaborator

@bprusinowski bprusinowski left a comment

Choose a reason for hiding this comment

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

LGTM! 👏

One small thing, I think it's not related to this PR but found while testing it – it looks like the join by dimension description is carried over to every dataset, while it could be dataset-based (I think right now the Jahr, in welchem die EIV ausbezahlt wurde is not really true for Gebaude dataset?) 👀

Screenshot 2024-04-30 at 16 33 57

Let me know if I should create an issue or if it's intended behavior 👍

app/charts/chart-data-wrapper.tsx Show resolved Hide resolved
app/configurator/config-form.tsx Show resolved Hide resolved
app/configurator/configurator-state.tsx Show resolved Hide resolved
app/utils/assert.ts Show resolved Hide resolved
app/configurator/configurator-state.tsx Show resolved Hide resolved
app/charts/shared/chart-helpers.spec.tsx Outdated Show resolved Hide resolved
app/graphql/join.spec.ts Show resolved Hide resolved
@ptbrowne ptbrowne force-pushed the feat/multiple-join-by branch from ec6b9cf to b954117 Compare April 30, 2024 17:17
@ptbrowne ptbrowne merged commit 36a4c93 into main Apr 30, 2024
3 of 4 checks passed
@ptbrowne ptbrowne deleted the feat/multiple-join-by branch April 30, 2024 17:23
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.

2 participants