Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: dark mode charts and json viewer crashing (#5332)

Shahmir Varqha1308cdddf70f
diff --git a/frontend/src/components/datasources/column-preview.tsx b/frontend/src/components/datasources/column-preview.tsx
index b3507bf9d3..e975280013 100644
--- a/frontend/src/components/datasources/column-preview.tsx
+++ b/frontend/src/components/datasources/column-preview.tsx
@@ -192,6 +192,7 @@ export function renderChart(chartSpec: string, theme: Theme) {
const updateSpec = (spec: TopLevelFacetedUnitSpec) => {
return {
...spec,
+ background: "transparent",
config: { ...spec.config, background: "transparent" },
};
};
diff --git a/frontend/src/components/editor/output/JsonOutput.tsx b/frontend/src/components/editor/output/JsonOutput.tsx
index c4545303de..dc6a050f6d 100644
--- a/frontend/src/components/editor/output/JsonOutput.tsx
+++ b/frontend/src/components/editor/output/JsonOutput.tsx
@@ -128,8 +128,9 @@ export const JsonOutput: React.FC<Props> = memo(
collapseStringsAfterLength={COLLAPSED_TEXT_LENGTH}
// leave the default valueTypes as it was - 'python', only 'json' is changed
valueTypes={valueTypesMap[valueTypes]}
- // disable array grouping (it's misleading) by using a large value
- groupArraysAfterLength={1_000_000}
+ // When the number of elements exceed 50, we group them in sizes of 50
+ // This improves perf but may look like there are nested arrays
+ groupArraysAfterLength={50}
// Built-in clipboard shifts content on hover
// so we provide our own copy button
enableClipboard={false}
diff --git a/marimo/_smoke_tests/tables/complex_types.py b/marimo/_smoke_tests/tables/complex_types.py
index 813108efc3..ca85d8c713 100644
--- a/marimo/_smoke_tests/tables/complex_types.py
+++ b/marimo/_smoke_tests/tables/complex_types.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.13.14"
+__generated_with = "0.13.15"
app = marimo.App(width="medium")
@@ -145,5 +145,29 @@ def _(mo):
return (pd,)
+def _(mo):
+ mo.md(
+ r"""
+ ## Stress testing
+
+ We can use a large dataset to stress test our rendering, charting. Notebook credit to Vincent: [WoW Dataset](https://github.com/koaning/wow-avatar-datasets)
+
+ ~36 million rows, 7 columns
+ """
+ )
+ return
+
+
+def _(pl):
+ wow_data = pl.scan_parquet(
+ "https://github.com/koaning/wow-avatar-datasets/raw/refs/heads/main/wow-full.parquet"
+ )
+ wow_data
+ # wow_data.collect()
+ return
+
+
if __name__ == "__main__":
app.run()
diff --git a/marimo/_smoke_tests/tables/rich_elements.py b/marimo/_smoke_tests/tables/rich_elements.py
index c8490fcd54..c57b8449db 100644
--- a/marimo/_smoke_tests/tables/rich_elements.py
+++ b/marimo/_smoke_tests/tables/rich_elements.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.11.30"
+__generated_with = "0.13.15"
app = marimo.App(width="medium")
@@ -108,6 +108,14 @@ def _(alt, mo, pd):
"lorem_ipsum_dollar_sit" * 20,
"lorem_ipsum_dollar_sit" * 20,
],
+ "large_array": [
+ [1] * 60,
+ [2] * 60,
+ ],
+ "large_json": [
+ [{"key": i, "value": i} for i in range(60)],
+ [{"key": i, "value": i} for i in range(60)],
+ ],
"images": [img, html_img],
"batch": user_info,
"dropdowns": [
@@ -124,24 +132,7 @@ def _(alt, mo, pd):
}
mo.vstack([mo.md("## Dictionary"), data])
- return (
- chart,
- chat,
- data,
- dictionary,
- html_img,
- img,
- mermaid,
- office_characters,
- password,
- simple_echo_model,
- source,
- table,
- tabs,
- text,
- user_info,
- warn_btn,
- )
+ return data, password
@app.cell
@@ -176,7 +167,7 @@ def _(data, mo, pl):
@app.cell
def _(mo, password):
- mo.md(f"### Password value: {password.value}")
+ mo.md(f"""### Password value: {password.value}""")
return