Skip to content

Commit e9813e3

Browse files
authored
set all vega renderer to canvas except col header charts (#6985)
## 📝 Summary <!-- Provide a concise summary of what this pull request is addressing. If this PR fixes any issues, list them here by number (e.g., Fixes #123). --> Due to vega/vega-embed#1460, the default renderer is svg. We set it to canvas for performance. ## 🔍 Description of Changes <!-- Detail the specific changes made in this pull request. Explain the problem addressed and how it was resolved. If applicable, provide before and after comparisons, screenshots, or any relevant details to help reviewers understand the changes easily. --> ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [ ] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected.
1 parent 93d8d9a commit e9813e3

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

frontend/src/components/data-table/charts/lazy-chart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const LazyChart: React.FC<{
4040
editor: true,
4141
},
4242
mode: "vega",
43+
renderer: "canvas",
4344
tooltip: tooltipHandler.call,
4445
}}
4546
/>

frontend/src/components/datasources/column-preview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export function renderChart(chartSpec: string, theme: Theme) {
230230
height: 100,
231231
width: "container" as unknown as number,
232232
actions: false,
233+
renderer: "canvas",
233234
}}
234235
/>
235236
</Suspense>

frontend/src/components/editor/Output.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export const OutputRenderer: React.FC<{
181181
theme: theme === "dark" ? "dark" : "vox",
182182
mode: "vega-lite",
183183
tooltip: tooltipHandler.call,
184+
renderer: "canvas",
184185
}}
185186
/>
186187
</Suspense>

frontend/src/components/tracing/tracing.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ const TraceBlockBody: React.FC<{
213213
actions: false,
214214
// Using vega instead of vegaLite as some parts of the spec get interpreted as vega & will throw warnings
215215
mode: "vega",
216+
renderer: "canvas",
216217
},
217218
});
218219

frontend/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ function chartOptions(theme: ResolvedTheme): VegaEmbedProps["options"] {
8181
},
8282
theme: theme === "dark" ? "dark" : undefined,
8383
tooltip: tooltipHandler.call,
84+
renderer: "canvas",
8485
};
8586
}
8687

frontend/src/plugins/impl/vega/vega-component.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ const LoadedVegaComponent = ({
235235
actions: actions,
236236
mode: "vega-lite",
237237
tooltip: tooltipHandler.call,
238+
renderer: "canvas",
238239
},
239240
onError: handleError,
240241
onEmbed: handleNewView,

0 commit comments

Comments
 (0)