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

New chart from different dataset #1527

Merged
merged 31 commits into from
May 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f6ce7e4
fix: Bad SVG props triggered warning in console
ptbrowne May 24, 2024
aeed5c2
refactor: Clarify name
ptbrowne May 22, 2024
a54bac0
feat: Show a button in tabs to open select dataset step in drawer (WIP)
ptbrowne May 8, 2024
cbc2543
feat: Use a zustand store to share if add new dataset panel is opened
ptbrowne May 22, 2024
947fcbf
feat: Ability to adapt the select dataset step for usage in the drawer
ptbrowne May 23, 2024
8cc1f62
fix: Force re-rendering of the chart when switching tabs in the confi…
ptbrowne May 24, 2024
69d60f2
feat: Correctly size drawer
ptbrowne May 24, 2024
266dd58
feat: Adapt select dataset step to work in drawer
ptbrowne May 23, 2024
cd1e494
feat: Create a new specific action to add a new chart config from scr…
ptbrowne May 24, 2024
fb023eb
fix: Dataset section show only the cubes for the current chart config
ptbrowne May 24, 2024
a47b840
refactor: Allow creation of useBrowseParams passing the underlying hook
ptbrowne May 24, 2024
f9dd22b
refactor: Rename
ptbrowne May 24, 2024
08020f4
feat: Make a variant of SelectStep which uses a state that does not s…
ptbrowne May 24, 2024
0b11fb5
feat: Adapt design for "Add chart" menu
ptbrowne May 24, 2024
40e93f4
feat: Alignment of button and dialog title
ptbrowne May 26, 2024
8d2dd1e
feat: Hide comparison chart when adding a new dataset
ptbrowne May 26, 2024
9e2dc2d
refactor: Clarification on usage
ptbrowne May 26, 2024
04fe0b2
refactor: UseQueryParams can receive a setState function
ptbrowne May 26, 2024
e5df03c
docs: Add comments
ptbrowne May 26, 2024
2a057ea
refactor: Extract to useStyles
ptbrowne May 26, 2024
17344ed
fix: Add keys
ptbrowne May 26, 2024
f1bfffa
feat: Search filters inside drawer work
ptbrowne May 26, 2024
455b938
feat: Close drawer after adding dataset
ptbrowne May 26, 2024
174002b
refactor: Remove unneeded
ptbrowne May 28, 2024
b51a09b
refactor: Renamed props for clarity
ptbrowne May 28, 2024
31a8a1c
refactor: Use variant to hide different context
ptbrowne May 28, 2024
d583bd4
refactor: Do not separate the BrowseProviders, but change the useBrow…
ptbrowne May 28, 2024
d1a4a8f
fix: Remove unused
ptbrowne May 28, 2024
18c9dec
refactor: Move responsibility of persisting to createUseBrowseState
ptbrowne May 28, 2024
3253d85
refactor: Name is explicit that the hook is not generic but is only a…
ptbrowne May 28, 2024
25950b9
docs: Add doc
ptbrowne May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/components/chart-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { Trans } from "@lingui/macro";
import { Box } from "@mui/material";
import Head from "next/head";
import React, {
ReactNode,
forwardRef,
ReactNode,
useCallback,
useMemo,
useState,
Expand Down Expand Up @@ -44,10 +44,10 @@ import { BANNER_MARGIN_TOP } from "@/components/presence";
import {
ChartConfig,
DataSource,
Layout,
getChartConfig,
hasChartConfigs,
isConfiguring,
Layout,
useConfiguratorState,
} from "@/configurator";
import { Description, Title } from "@/configurator/components/annotators";
Expand Down Expand Up @@ -78,7 +78,10 @@ export const ChartPreview = (props: ChartPreviewProps) => {
) : layout.type === "singleURLs" ? (
<SingleURLsPreview dataSource={dataSource} layout={layout} />
) : (
<ChartTablePreviewProvider>
// Important to keep the key here to force re-rendering of the chart when
// we switch tabs in the configurator, otherwise we end up with the wrong
// data in the downstream hooks (useDataCubesMetadataQuery, etc.)
<ChartTablePreviewProvider key={state.activeChartKey}>
ptbrowne marked this conversation as resolved.
Show resolved Hide resolved
<ChartWrapper editing={editing} layoutType={layout.type}>
<ChartPreviewInner dataSource={dataSource} />
</ChartWrapper>
Expand Down