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

Auto apply theme to mo.ui.data_explorer based on the notebook display theme #2233

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ColumnSummary } from "./components/column-summary";
import type { VegaLiteProps } from "react-vega/lib/VegaLite";
import { useOnMount } from "@/hooks/useLifecycle";
import type { ChartSpec } from "./state/types";
import { useTheme } from "@/theme/useTheme";

/**
* @param label - a label of the table
Expand Down Expand Up @@ -104,6 +105,7 @@ export const DataExplorerComponent = ({

const { mark } = useAtomValue(chartSpecAtom);
const charts = useAtomValue(relatedChartSpecsAtom);
const { theme } = useTheme();

if (error) {
return <ErrorBanner error={error} />;
Expand Down Expand Up @@ -133,6 +135,7 @@ export const DataExplorerComponent = ({
padding={PADDING}
actions={ACTIONS}
spec={makeResponsive(mainPlot.spec)}
theme={theme === "dark" ? "dark" : undefined}
/>
</div>
);
Expand Down Expand Up @@ -207,6 +210,7 @@ export const DataExplorerComponent = ({
key={idx}
actions={false}
spec={plot.spec}
theme={theme === "dark" ? "dark" : undefined}
/>
</HorizontalCarouselItem>
))}
Expand Down
Loading