Skip to content
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
11 changes: 9 additions & 2 deletions frontend/src/plugins/impl/plotly/PlotlyPlugin.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright 2024 Marimo. All rights reserved. */

import type { Figure } from "react-plotly.js";
import type { Figure, PlotParams } from "react-plotly.js";
import { z } from "zod";
import type { IPlugin, IPluginProps, Setter } from "@/plugins/types";
import { Logger } from "@/utils/Logger";
Expand Down Expand Up @@ -71,7 +71,14 @@ interface PlotlyPluginProps extends Data {
host: HTMLElement;
}

export const LazyPlot = lazy(() => import("react-plotly.js"));
// For whatever reason, the version of vite-rolldown that we are one is not exporting this default export correctly.
export const LazyPlot = lazy(() =>
import("react-plotly.js").then((module) => {
return module.default as unknown as {
default: React.ComponentType<PlotParams>;
};
}),
);

function initialLayout(figure: Figure): Partial<Plotly.Layout> {
// Enable autosize if width is not specified
Expand Down
Loading