@marimo-team/frontend 0.25.1-dev90 → 0.25.2-dev0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-Bdak5-o8.js → ConnectedDataExplorerComponent-DJ5jwKfp.js} +1 -1
- package/dist/assets/{ErrorBoundary-DrliQ_7g.js → ErrorBoundary-BeE1cdgM.js} +2 -2
- package/dist/assets/{ImageComparisonComponent-DLxkuRy3.js → ImageComparisonComponent-pCLPT6RA.js} +1 -1
- package/dist/assets/LazyAnyLanguageCodeMirror-B_IYTCX5.js +2 -0
- package/dist/assets/{RunButton-qknEPbRR.js → RunButton-C2kFUhyO.js} +10 -10
- package/dist/assets/{abnfDiagram-VCTEODGH-dm832Yw9.js → abnfDiagram-VCTEODGH-CSPJSGaM.js} +1 -1
- package/dist/assets/add-cell-with-ai-BFgdVPaN.js +76 -0
- package/dist/assets/{agent-panel-CJva58SL.js → agent-panel-Dh7yWh9P.js} +5 -5
- package/dist/assets/ai-model-dropdown-DJ2elMLM.js +5 -0
- package/dist/assets/{any-language-editor-B7QvjaYO.js → any-language-editor-Cj_HzlZY.js} +1 -1
- package/dist/assets/app-config-button-DBCTefOX.js +1 -0
- package/dist/assets/{architectureDiagram-5GKGNRK7-CiRaYU5G.js → architectureDiagram-5GKGNRK7-7iukRoC9.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-BK3JcsXA.js → blockDiagram-I7D4REHJ-cuhpQB60.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-BbMz-zwF.js → c4Diagram-7LVT6UL2-CMQEYn6T.js} +1 -1
- package/dist/assets/{cache-panel-DxdmvFwH.js → cache-panel-C0oB1kE2.js} +1 -1
- package/dist/assets/{cells-BcQ8Tm3j.js → cells-CzugpTQu.js} +33 -33
- package/dist/assets/channel-CGdeorQk.js +1 -0
- package/dist/assets/{chat-display-TI342pMF.js → chat-display-DevO4F8W.js} +1 -1
- package/dist/assets/chat-panel-BGw0bqDk.js +4 -0
- package/dist/assets/{chat-ui-B1aeiWdr.js → chat-ui-CZZFGlZi.js} +4 -4
- package/dist/assets/{chunk-4HAMMTFA-F3WVmmmo.js → chunk-4HAMMTFA-C6Tl7kEY.js} +1 -1
- package/dist/assets/{chunk-75Z2AOVW-DA_lihEi.js → chunk-75Z2AOVW-BzzYECN7.js} +1 -1
- package/dist/assets/{chunk-DU6HZSFF-J-califE.js → chunk-DU6HZSFF-BlpgvKzl.js} +2 -2
- package/dist/assets/{chunk-F27PBJKO-BzJrz4xx.js → chunk-F27PBJKO-BVIgLGPF.js} +1 -1
- package/dist/assets/{chunk-GMAD6QVW-mXoq4V-T.js → chunk-GMAD6QVW-hv6IsAru.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-B-87l3Xt.js → chunk-GVQU2GXP-Duv4ZYb-.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-yy9Ec7ZM.js → chunk-IMKFNOWR-BIILwBhp.js} +1 -1
- package/dist/assets/{chunk-L3NEJ4N5-DLeZO9l0.js → chunk-L3NEJ4N5-B2hafvRU.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-PWoOtECb.js → chunk-OSK3NFVY-SNGRdtNA.js} +1 -1
- package/dist/assets/{chunk-P2QGCYS3-DsJshZeL.js → chunk-P2QGCYS3-_SeE0QXb.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-CCg5TpSp.js → chunk-POPQ4Y6H-BB5NNJFE.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-CrFPAGFi.js → chunk-PWAF6VOD-BZoBqp8x.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-lri4OQTX.js → chunk-SHT3W25Y-BtLGdeDB.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-B3ISFgJc.js → chunk-SVP7TREG-B0UfxhUP.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-CJ7ETjY3.js → chunk-TICWLB2K-BP7vel_P.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-CoNXKNMZ.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-CoNXKNMZ.js +1 -0
- package/dist/assets/code-visibility-BFNYI7hr.js +1 -0
- package/dist/assets/command-palette-DN4JoOLD.js +1 -0
- package/dist/assets/{common-cDzShymV.js → common-DUCPhoyP.js} +1 -1
- package/dist/assets/{components-B3KlHXnD.js → components-CK7CeYlo.js} +1 -1
- package/dist/assets/components-DAmFBASm.js +1 -0
- package/dist/assets/config-B4VJJibu.js +1 -0
- package/dist/assets/{utils-B3E7otfg.js → config-BxZgoFvi.js} +1 -1
- package/dist/assets/config-DpGPGznL.js +1 -0
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-1zl1wSTB.js → cynefinDiagram-5FMLGOSQ-BARZRQBb.js} +1 -1
- package/dist/assets/{dagre-DM-Ch8wC.js → dagre-DVyyr7Cb.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-BqoUeivc.js → dagre-GXQ25YYZ-79s0lOP0.js} +1 -1
- package/dist/assets/data-grid-overlay-editor-DPfnIudL.js +1 -0
- package/dist/assets/{dependency-graph-panel-C-SFFOPF.js → dependency-graph-panel-BN4CLayU.js} +3 -3
- package/dist/assets/{diagram-S7CK7UJ4-CF90sb1m.js → diagram-S7CK7UJ4-BCviGhvd.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-DgbZAUCH.js → diagram-UQ7AKVKN-Ds-BT46T.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DOQllF_r.js → diagram-VSXAHHWV-CK4GkM-q.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-6dC0a_-i.js → diagram-VX7I27RA-BtL2eh0t.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-C1OXYmlB.js → diagram-Z3DM3KII-C6SmbLBS.js} +1 -1
- package/dist/assets/{dist-0HQ0BMF5.js → dist-CQvJDryh.js} +1 -1
- package/dist/assets/{documentation-panel-idK3s0j3.js → documentation-panel-CzRbXV5u.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-7gC3cuC7.js → ebnfDiagram-PWID7BFC-D_JU4cMQ.js} +1 -1
- package/dist/assets/edit-page-jGNYBqQo.js +174 -0
- package/dist/assets/{erDiagram-RLTQ6QDP-BsE87b_i.js → erDiagram-RLTQ6QDP-Z9MJ6X-r.js} +1 -1
- package/dist/assets/{error-entries-C-LFkdXb.js → error-entries-CDSsy76p.js} +1 -1
- package/dist/assets/{error-panel-YAFgCest.js → error-panel-ABvjFG3p.js} +1 -1
- package/dist/assets/{feedback-button-sRQQL2TH.js → feedback-button-CZhLiwkO.js} +2 -2
- package/dist/assets/file-explorer-panel-DTiEpmVE.js +1 -0
- package/dist/assets/file-name-input-C1C8xrjA.js +3 -0
- package/dist/assets/filename-fxG7K_MU.js +1 -0
- package/dist/assets/flowDiagram-HODETNUW-ncLciK2K.js +1 -0
- package/dist/assets/{gallery-page-CH8TM7bV.js → gallery-page-Moi4ZdJ0.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-d9Qqbnau.js → ganttDiagram-EL5Y4UJY-Cgy11k0G.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DBunV_fz.js → gitGraphDiagram-WWUBYQGX-CVH8fay_.js} +1 -1
- package/dist/assets/glide-data-editor-CbsCWu-K.js +131 -0
- package/dist/assets/{graphlib-DDJ8O6ZH.js → graphlib-3maKwbRO.js} +1 -1
- package/dist/assets/has-cJsIKK9t.js +1 -0
- package/dist/assets/home-page-UAgVOkCZ.js +4 -0
- package/dist/assets/index--sT8xf-8.css +2 -0
- package/dist/assets/index-DafnX1Xx.js +62 -0
- package/dist/assets/{infoDiagram-27XIBGKW-FE7De1I6.js → infoDiagram-27XIBGKW-Dk8U81nJ.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-CSEGYrJ-.js → ishikawaDiagram-5VMMS53U-CzHQlMUQ.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-Cp4mxQrE.js → journeyDiagram-3NMN7TZE-DRc8ACzh.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-d7iAZsOb.js → kanban-definition-UXKFOSKX-CVyVYiI6.js} +1 -1
- package/dist/assets/katex-DkE0ukCy.js +257 -0
- package/dist/assets/{logs-panel-xMj01DRN.js → logs-panel-Bz5ysVX4.js} +1 -1
- package/dist/assets/{mermaid-CNjXdDrA.js → mermaid-D_jPUVqz.js} +4 -4
- package/dist/assets/mhchem-CmzEtQj8.js +1 -0
- package/dist/assets/{mindmap-definition-YA3MSWOX-CddM9_uP.js → mindmap-definition-YA3MSWOX-D5t6Aq5Z.js} +1 -1
- package/dist/assets/{number-overlay-editor-N57if5NT.js → number-overlay-editor-FAD8sjFU.js} +1 -1
- package/dist/assets/{outline-panel-Garp-f5k.js → outline-panel-85oiQ0XX.js} +1 -1
- package/dist/assets/packages-panel-ClKIaP5S.js +1 -0
- package/dist/assets/{panels-CnbmgzkS.js → panels-B48zp96D.js} +9 -9
- package/dist/assets/{pegDiagram-XKGWAZYB-CEns8d-M.js → pegDiagram-XKGWAZYB-BTkTm4ej.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-wyb0xQ0R.js → pieDiagram-E7YTZNPT-Bq6X88M1.js} +1 -1
- package/dist/assets/{process-output-ObDfw1uu.js → process-output-Cg2ta3vY.js} +1 -1
- package/dist/assets/{quadrantDiagram-AXDQQJYC-BE-xlTLH.js → quadrantDiagram-AXDQQJYC-D_wrOwLk.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-DZZVHmr2.js → railroadDiagram-O6MQD6OU-fv8HXW_g.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-C3Bf4dd5.js → requirementDiagram-BXWQKSXE-DDOOMUfC.js} +1 -1
- package/dist/assets/{reveal-component-DgrXq3Kv.js → reveal-component-CR43gpTZ.js} +3 -3
- package/dist/assets/run-page-NR_KFWk8.js +1 -0
- package/dist/assets/{sankeyDiagram-P5KCCOFB-BWLQCyjK.js → sankeyDiagram-P5KCCOFB-CvvUY6tS.js} +1 -1
- package/dist/assets/scratchpad-panel-DHc-oVb1.js +1 -0
- package/dist/assets/{secrets-panel-4dRIaZfY.js → secrets-panel-C-65ZjnM.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-BIY0mgX7.js → sequenceDiagram-WJ2MYXX4-DdpBhQaS.js} +1 -1
- package/dist/assets/session-DXKMv4Bs.js +1 -0
- package/dist/assets/session-panel-DiwQqIbt.js +1 -0
- package/dist/assets/{SelectionIndicator-DLJBcP4e.js → shell-BSnvn9t7.js} +1 -1
- package/dist/assets/snippets-panel-BLmXrneD.js +1 -0
- package/dist/assets/{stateDiagram-D77RDMKH-D_xRHRLf.js → stateDiagram-D77RDMKH-D3p19fac.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-CplsDaDl.js +1 -0
- package/dist/assets/{swimlanes-42K2YHIH-CDQzpfz0.js → swimlanes-42K2YHIH-CLxCSvU4.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-DPoIFx8T.js +8 -0
- package/dist/assets/{swiper-component-j-Lk25wW.js → swiper-component-rqJChT_P.js} +1 -1
- package/dist/assets/{terminal-BToH-U1t.js → terminal-CY4h1UmO.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-D5Jgj1fz.js → timeline-definition-24CTP7MA-Cw2PY--x.js} +1 -1
- package/dist/assets/tooltip-PLkI_UfK.js +61 -0
- package/dist/assets/{tracing-DtKLmNHj.js → tracing-Q8NAdlrA.js} +1 -1
- package/dist/assets/tracing-panel-Ci4kY4dr.js +2 -0
- package/dist/assets/useCellActionButton-DpYtVfFe.js +1 -0
- package/dist/assets/useTheme-DcnXlv0_.js +1 -0
- package/dist/assets/{constants-BDbGiS7O.js → utils-B4K466FK.js} +1 -1
- package/dist/assets/{vega-component-DVSvu4vP.js → vega-component-BpoSew4K.js} +1 -1
- package/dist/assets/{vega-embed-container-QM1zZmYi.js → vega-embed-container-BOJG8mCA.js} +1 -1
- package/dist/assets/{vennDiagram-4TSXK5OY-Cv6jxbpX.js → vennDiagram-4TSXK5OY-D8bN6lVl.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-lwv-YoWo.js → wardleyDiagram-VM6X3IG4-CbZdo0SA.js} +1 -1
- package/dist/assets/{write-secret-modal-CBUZw27N.js → write-secret-modal-BiG2tahJ.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-CGM4LlFN.js → xychartDiagram-S5SC5T6Z-DUUQ9tau.js} +1 -1
- package/dist/assets/youtube-A9VT7NHb.js +1 -0
- package/dist/index.html +14 -13
- package/package.json +1 -2
- package/src/__mocks__/common.ts +3 -3
- package/src/__tests__/CellStatus.test.tsx +1 -1
- package/src/__tests__/setup.ts +7 -7
- package/src/components/app-config/ai-config.tsx +2 -0
- package/src/components/app-config/optional-features.tsx +1 -1
- package/src/components/chat/chat-panel.tsx +19 -8
- package/src/components/data-table/TableTopBar.tsx +2 -2
- package/src/components/data-table/__tests__/export-actions.test.tsx +662 -0
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +286 -0
- package/src/components/data-table/charts/charts.tsx +26 -13
- package/src/components/data-table/column-summary/chart-spec-model.tsx +4 -4
- package/src/components/data-table/data-table.tsx +1 -1
- package/src/components/data-table/export-actions.tsx +642 -176
- package/src/components/data-table/schemas.ts +25 -3
- package/src/components/dependency-graph/elements.ts +2 -2
- package/src/components/editor/__tests__/package-alert.test.tsx +140 -0
- package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +107 -0
- package/src/components/editor/actions/pair-with-agent.tsx +119 -0
- package/src/components/editor/actions/useNotebookActions.tsx +2 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +2 -0
- package/src/components/editor/ai/staged-cell-submission.ts +2 -2
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
- package/src/components/editor/chrome/components/contribute-snippet-button.tsx +6 -1
- package/src/components/editor/connections/database/as-code.ts +44 -44
- package/src/components/editor/connections/storage/as-code.ts +3 -3
- package/src/components/editor/file-tree/requesting-tree.tsx +16 -13
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/notebook-cell.tsx +2 -2
- package/src/components/editor/output/MarimoTracebackOutput.tsx +1 -1
- package/src/components/editor/output/VideoOutput.tsx +1 -1
- package/src/components/editor/output/ansi-reduce.ts +21 -17
- package/src/components/editor/output/console/ConsoleOutput.tsx +3 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +59 -0
- package/src/components/editor/output/console/text-rendering.tsx +3 -1
- package/src/components/editor/package-alert.tsx +20 -7
- package/src/components/home/components.tsx +1 -0
- package/src/components/markdown/markdown-renderer.css +1 -1
- package/src/components/pages/run-page.tsx +1 -0
- package/src/components/slides/__tests__/minimap-actions.test.tsx +7 -7
- package/src/components/slides/__tests__/minimap.test.ts +12 -12
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +8 -8
- package/src/components/static-html/__tests__/share-modal.test.tsx +154 -0
- package/src/components/static-html/__tests__/stage-for-publish.test.ts +111 -0
- package/src/components/static-html/share-modal.tsx +114 -144
- package/src/components/static-html/stage-for-publish.ts +56 -0
- package/src/components/static-html/static-banner.tsx +2 -2
- package/src/components/ui/links.tsx +6 -1
- package/src/components/ui/typography.tsx +16 -8
- package/src/core/ai/context/__tests__/registry.test.ts +31 -28
- package/src/core/ai/context/providers/cell-output.ts +8 -8
- package/src/core/ai/context/providers/datasource.ts +10 -7
- package/src/core/ai/context/providers/error.ts +7 -7
- package/src/core/ai/context/providers/file.ts +8 -8
- package/src/core/ai/context/providers/tables.ts +7 -7
- package/src/core/ai/context/providers/variable.ts +7 -7
- package/src/core/ai/context/registry.ts +18 -18
- package/src/core/ai/ids/ids.ts +5 -5
- package/src/core/ai/model-registry.ts +12 -9
- package/src/core/ai/staged-cells.ts +6 -6
- package/src/core/ai/tools/base.ts +6 -6
- package/src/core/ai/tools/edit-notebook-tool.ts +6 -6
- package/src/core/ai/tools/registry.ts +4 -4
- package/src/core/ai/tools/run-cells-tool.ts +7 -7
- package/src/core/ai/tools/sample-tool.ts +6 -6
- package/src/core/cells/__tests__/cells.test.ts +27 -0
- package/src/core/cells/cells.ts +2 -1
- package/src/core/codemirror/cells/debugger-decorations.ts +13 -7
- package/src/core/codemirror/cells/line-timing-decorations.ts +9 -9
- package/src/core/codemirror/cells/traceback-decorations.ts +7 -4
- package/src/core/codemirror/code-lens/extension.ts +13 -13
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +6 -6
- package/src/core/codemirror/copilot/__tests__/transport.test.ts +12 -12
- package/src/core/codemirror/copilot/language-server.ts +13 -13
- package/src/core/codemirror/copilot/transport.ts +1 -1
- package/src/core/codemirror/find-replace/search-highlight.ts +5 -5
- package/src/core/codemirror/go-to-definition/underline.ts +3 -3
- package/src/core/codemirror/keymaps/vim.ts +3 -3
- package/src/core/codemirror/language/languages/markdown.ts +8 -8
- package/src/core/codemirror/language/languages/python.ts +7 -7
- package/src/core/codemirror/language/languages/sql/completion-builder.ts +5 -5
- package/src/core/codemirror/language/languages/sql/completion-store.ts +4 -4
- package/src/core/codemirror/language/languages/sql/sql.ts +21 -21
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +10 -10
- package/src/core/codemirror/lsp/federated-lsp.ts +29 -27
- package/src/core/codemirror/lsp/notebook-lsp.ts +21 -21
- package/src/core/codemirror/misc/__tests__/dnd.test.ts +10 -10
- package/src/core/codemirror/misc/__tests__/paste.test.ts +7 -4
- package/src/core/codemirror/reactive-references/extension.ts +3 -3
- package/src/core/codemirror/rtc/loro/awareness.ts +12 -12
- package/src/core/codemirror/rtc/loro/sync.ts +5 -5
- package/src/core/codemirror/vim/cursor-visibility.ts +3 -3
- package/src/core/dom/ui-element.ts +5 -5
- package/src/core/dom/uiregistry.ts +10 -10
- package/src/core/hotkeys/hotkeys.ts +9 -9
- package/src/core/islands/__tests__/bridge.test.ts +4 -4
- package/src/core/islands/__tests__/test-utils.tsx +4 -4
- package/src/core/islands/bridge.ts +85 -82
- package/src/core/islands/components/web-components.tsx +7 -7
- package/src/core/islands/worker/__tests__/controller.test.ts +1 -1
- package/src/core/islands/worker/controller.ts +6 -3
- package/src/core/islands/worker-factory.ts +2 -2
- package/src/core/kernel/RuntimeState.ts +4 -4
- package/src/core/kernel/__tests__/session.test.ts +110 -1
- package/src/core/kernel/session.ts +46 -15
- package/src/core/lsp/__tests__/transport.test.ts +19 -19
- package/src/core/lsp/transport.ts +5 -5
- package/src/core/network/CachingRequestRegistry.ts +2 -2
- package/src/core/network/DeferredRequestRegistry.ts +4 -4
- package/src/core/network/__tests__/export-asset-url.test.ts +45 -0
- package/src/core/network/export-asset-url.ts +19 -0
- package/src/core/network/requests-network.ts +2 -7
- package/src/core/runtime/runtime.ts +25 -20
- package/src/core/static/virtual-file-tracker.ts +5 -5
- package/src/core/wasm/__tests__/bridge.test.ts +2 -2
- package/src/core/wasm/bridge.ts +132 -133
- package/src/core/wasm/router.ts +5 -5
- package/src/core/wasm/store.ts +4 -4
- package/src/core/wasm/worker/bootstrap.ts +8 -5
- package/src/core/wasm/worker/message-buffer.ts +3 -3
- package/src/core/websocket/transports/__tests__/ws.test.ts +8 -8
- package/src/core/websocket/transports/basic.ts +15 -8
- package/src/core/websocket/transports/sse.ts +7 -7
- package/src/core/websocket/transports/transport.ts +3 -3
- package/src/core/websocket/transports/ws.ts +9 -7
- package/src/css/globals.css +18 -21
- package/src/css/katex.min.css +260 -241
- package/src/hooks/__tests__/useOverflowDetection.test.tsx +5 -5
- package/src/hooks/__tests__/useResizeObserver.test.tsx +12 -12
- package/src/plugins/core/registerReactComponent.tsx +5 -5
- package/src/plugins/core/sidebar-element.tsx +2 -2
- package/src/plugins/impl/ButtonPlugin.tsx +3 -3
- package/src/plugins/impl/CheckboxPlugin.tsx +3 -3
- package/src/plugins/impl/CodeEditorPlugin.tsx +3 -3
- package/src/plugins/impl/DatePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DateRangePlugin.tsx +3 -3
- package/src/plugins/impl/DateTimePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DictPlugin.tsx +3 -3
- package/src/plugins/impl/DropdownPlugin.tsx +3 -3
- package/src/plugins/impl/FileUploadPlugin.tsx +3 -3
- package/src/plugins/impl/MatrixPlugin.tsx +4 -4
- package/src/plugins/impl/MicrophonePlugin.tsx +3 -3
- package/src/plugins/impl/MultiselectPlugin.tsx +3 -3
- package/src/plugins/impl/NumberPlugin.tsx +3 -3
- package/src/plugins/impl/RadioPlugin.tsx +9 -5
- package/src/plugins/impl/RangeSliderPlugin.tsx +3 -3
- package/src/plugins/impl/RefreshPlugin.tsx +3 -3
- package/src/plugins/impl/SliderPlugin.tsx +3 -3
- package/src/plugins/impl/SwitchPlugin.tsx +3 -3
- package/src/plugins/impl/TabsPlugin.tsx +3 -3
- package/src/plugins/impl/TextAreaPlugin.tsx +3 -3
- package/src/plugins/impl/TextInputPlugin.tsx +3 -3
- package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +2 -2
- package/src/plugins/impl/anywidget/model.ts +10 -10
- package/src/plugins/impl/anywidget/registry.ts +12 -9
- package/src/plugins/impl/anywidget/runtime.ts +11 -9
- package/src/plugins/impl/anywidget/widget-binding.ts +6 -6
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +7 -6
- package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +3 -3
- package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +2 -2
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +2 -2
- package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -10
- package/src/plugins/impl/panel/utils.ts +5 -5
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
- package/src/plugins/impl/vega/VegaPlugin.tsx +3 -3
- package/src/plugins/impl/vega/__tests__/use-vega-container-remeasure.test.ts +7 -7
- package/src/plugins/impl/vega/__tests__/utils.test.ts +16 -1
- package/src/plugins/impl/vega/__tests__/vega.test.ts +37 -0
- package/src/plugins/impl/vega/loader.ts +23 -1
- package/src/plugins/impl/vega/utils.ts +5 -4
- package/src/plugins/layout/AccordionPlugin.tsx +3 -3
- package/src/plugins/layout/CalloutPlugin.tsx +3 -3
- package/src/plugins/layout/ImageComparisonPlugin.tsx +5 -3
- package/src/plugins/layout/JsonOutputPlugin.tsx +3 -3
- package/src/plugins/layout/MimeRenderPlugin.tsx +3 -3
- package/src/plugins/layout/NavigationMenuPlugin.tsx +3 -3
- package/src/plugins/layout/OutlinePlugin.tsx +3 -3
- package/src/plugins/layout/ProgressPlugin.tsx +3 -3
- package/src/plugins/layout/RoutesPlugin.tsx +6 -8
- package/src/plugins/layout/StatPlugin.tsx +3 -3
- package/src/plugins/layout/TexPlugin.tsx +3 -3
- package/src/plugins/layout/carousel/CarouselPlugin.tsx +4 -4
- package/src/plugins/layout/mermaid/MermaidPlugin.tsx +3 -3
- package/src/utils/Deferred.ts +6 -6
- package/src/utils/async-capture-tracker.ts +10 -7
- package/src/utils/errors.ts +5 -5
- package/src/utils/id-tree.tsx +83 -80
- package/src/utils/lru.ts +1 -1
- package/src/utils/multi-map.ts +14 -12
- package/src/utils/paths.ts +6 -6
- package/src/utils/pluralize.ts +3 -3
- package/src/utils/progress.ts +6 -6
- package/src/utils/python-poet/poet.ts +14 -14
- package/src/utils/routes.ts +4 -2
- package/src/utils/semaphore.ts +6 -6
- package/src/utils/storage/storage.ts +6 -6
- package/src/utils/storage/typed.ts +16 -12
- package/src/utils/time.ts +9 -9
- package/src/utils/timed-cache.ts +4 -4
- package/src/utils/tracer.ts +9 -6
- package/dist/assets/LazyAnyLanguageCodeMirror-EBegnOE0.js +0 -2
- package/dist/assets/add-cell-with-ai-Ovbsj95O.js +0 -76
- package/dist/assets/ai-model-dropdown-1t7m1iFc.js +0 -3
- package/dist/assets/app-config-button-vCxNGhe2.js +0 -1
- package/dist/assets/channel-ni7ei-yz.js +0 -1
- package/dist/assets/chat-panel-CzdR8RG_.js +0 -4
- package/dist/assets/classDiagram-ZZMXUADV-CIEFh40S.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY-CIEFh40S.js +0 -1
- package/dist/assets/code-visibility-G0W4ym3Y.js +0 -1
- package/dist/assets/command-palette-DhdK67bL.js +0 -1
- package/dist/assets/components-CQVZgYvR.js +0 -1
- package/dist/assets/config-CMqNngzA.js +0 -1
- package/dist/assets/config-CmBpjGXk.js +0 -1
- package/dist/assets/data-grid-overlay-editor-DbqMOWZn.js +0 -1
- package/dist/assets/edit-page-_D_Nv3dJ.js +0 -176
- package/dist/assets/file-explorer-panel-LAa-LxTN.js +0 -1
- package/dist/assets/file-name-input-BXq6eIDs.js +0 -3
- package/dist/assets/flowDiagram-HODETNUW-B4xRBXB1.js +0 -1
- package/dist/assets/glide-data-editor-DPMjaN4R.js +0 -131
- package/dist/assets/has-CanCEarv.js +0 -1
- package/dist/assets/home-page-vDWLpS4F.js +0 -4
- package/dist/assets/index-2TQenOiQ.css +0 -2
- package/dist/assets/index-CgQsZfww.js +0 -62
- package/dist/assets/katex-mNPPSsir.js +0 -257
- package/dist/assets/katex-ukvJUC1e.js +0 -257
- package/dist/assets/mhchem-DcHTrqjv.js +0 -1
- package/dist/assets/packages-panel-B8HU9FAM.js +0 -1
- package/dist/assets/run-page-E0qMru0p.js +0 -1
- package/dist/assets/scratchpad-panel-CCFyaegO.js +0 -1
- package/dist/assets/session-C8nQMsOE.js +0 -1
- package/dist/assets/session-panel-CR3BHLhQ.js +0 -1
- package/dist/assets/snippets-panel-Dn22yTr_.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-BQvYFx_a.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-BAn2JKhB.js +0 -8
- package/dist/assets/tooltip-B1vGi-z4.js +0 -61
- package/dist/assets/tracing-panel-C5ybTQyJ.js +0 -2
- package/dist/assets/useCellActionButton-Bm9OZdcq.js +0 -1
- package/dist/assets/useTheme-Ho3YdAx3.js +0 -1
- package/dist/assets/youtube-ELpGJEdR.js +0 -1
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, waitFor } from "@testing-library/react";
|
|
4
|
+
import { createStore, Provider } from "jotai";
|
|
5
|
+
import { Tooltip } from "radix-ui";
|
|
6
|
+
import type { ComponentProps } from "react";
|
|
7
|
+
import { beforeAll, describe, expect, it, vi } from "vitest";
|
|
8
|
+
import { SetupMocks } from "@/__mocks__/common";
|
|
9
|
+
import { cellId } from "@/__tests__/branded";
|
|
10
|
+
import { LazyVegaEmbed } from "@/components/charts/lazy";
|
|
11
|
+
import { vegaLoader } from "@/plugins/impl/vega/loader";
|
|
12
|
+
import { ChartPanel, TablePanel, type TablePanelProps } from "../charts";
|
|
13
|
+
import { getChartTabName, tabsStorageAtom } from "../storage";
|
|
14
|
+
import { ChartType, NONE_VALUE } from "../types";
|
|
15
|
+
|
|
16
|
+
vi.mock("@/components/charts/lazy", () => ({
|
|
17
|
+
LazyVegaEmbed: vi.fn(() => null),
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
beforeAll(() => {
|
|
21
|
+
SetupMocks.resizeObserver();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe("ChartPanel", () => {
|
|
25
|
+
it.each([undefined, null, []] as const)(
|
|
26
|
+
"infers the full CSV through TablePanel without backend metadata (%s)",
|
|
27
|
+
async (fieldTypes) => {
|
|
28
|
+
vi.spyOn(vegaLoader, "load").mockResolvedValue(
|
|
29
|
+
"value,index\n,0\n2.5,1\n",
|
|
30
|
+
);
|
|
31
|
+
const store = createStore();
|
|
32
|
+
const id = cellId("csv-inference");
|
|
33
|
+
const tabName = getChartTabName(0, ChartType.BAR);
|
|
34
|
+
store.set(
|
|
35
|
+
tabsStorageAtom,
|
|
36
|
+
new Map([
|
|
37
|
+
[
|
|
38
|
+
id,
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
tabName,
|
|
42
|
+
chartType: ChartType.BAR,
|
|
43
|
+
config: {
|
|
44
|
+
general: {
|
|
45
|
+
xColumn: { field: "value", type: "number" },
|
|
46
|
+
yColumn: {
|
|
47
|
+
field: "index",
|
|
48
|
+
type: "integer",
|
|
49
|
+
aggregate: NONE_VALUE,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
],
|
|
56
|
+
]),
|
|
57
|
+
);
|
|
58
|
+
const sample = [{ value: null }];
|
|
59
|
+
const SampleTable = (_props: { data: typeof sample }) => null;
|
|
60
|
+
const props: TablePanelProps = {
|
|
61
|
+
cellId: id,
|
|
62
|
+
data: sample,
|
|
63
|
+
dataTable: <SampleTable data={sample} />,
|
|
64
|
+
totalRows: 2,
|
|
65
|
+
columns: 1,
|
|
66
|
+
displayHeader: true,
|
|
67
|
+
fieldTypes: fieldTypes == null ? fieldTypes : [...fieldTypes],
|
|
68
|
+
rowHeaders: [["index", ["integer", "int64"]]],
|
|
69
|
+
getDataUrl: vi
|
|
70
|
+
.fn()
|
|
71
|
+
.mockResolvedValue({ data_url: "chart.csv", format: "csv" }),
|
|
72
|
+
};
|
|
73
|
+
const { getByRole } = render(
|
|
74
|
+
<Provider store={store}>
|
|
75
|
+
<Tooltip.Provider>
|
|
76
|
+
<TablePanel {...props} />
|
|
77
|
+
</Tooltip.Provider>
|
|
78
|
+
</Provider>,
|
|
79
|
+
);
|
|
80
|
+
fireEvent.click(getByRole("tab", { name: tabName }));
|
|
81
|
+
await waitFor(() => {
|
|
82
|
+
expect(vi.mocked(LazyVegaEmbed).mock.lastCall?.[0].spec).toEqual(
|
|
83
|
+
expect.objectContaining({
|
|
84
|
+
data: {
|
|
85
|
+
values: [
|
|
86
|
+
{ value: null, index: 0 },
|
|
87
|
+
{ value: 2.5, index: 1 },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
it("reloads CSV only when column types change, not their array identity", async () => {
|
|
97
|
+
vi.spyOn(vegaLoader, "load").mockResolvedValue("value\n001\n");
|
|
98
|
+
const getDataUrl = vi.fn().mockResolvedValue({
|
|
99
|
+
data_url: "chart.csv",
|
|
100
|
+
format: "csv",
|
|
101
|
+
});
|
|
102
|
+
const props: ComponentProps<typeof ChartPanel> = {
|
|
103
|
+
tableData: [{ value: "001" }],
|
|
104
|
+
chartConfig: {
|
|
105
|
+
general: {
|
|
106
|
+
xColumn: { field: "value", type: "string" },
|
|
107
|
+
yColumn: { field: "value", type: "integer", aggregate: NONE_VALUE },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
chartType: ChartType.BAR,
|
|
111
|
+
saveChart: vi.fn(),
|
|
112
|
+
saveChartType: vi.fn(),
|
|
113
|
+
getDataUrl,
|
|
114
|
+
isLargeDataset: false,
|
|
115
|
+
};
|
|
116
|
+
const panel = (
|
|
117
|
+
fieldTypes: ComponentProps<typeof ChartPanel>["fieldTypes"],
|
|
118
|
+
) => (
|
|
119
|
+
<Tooltip.Provider>
|
|
120
|
+
<ChartPanel {...props} fieldTypes={fieldTypes} />
|
|
121
|
+
</Tooltip.Provider>
|
|
122
|
+
);
|
|
123
|
+
const expectValues = async (value: string | number) => {
|
|
124
|
+
await waitFor(() => {
|
|
125
|
+
expect(vi.mocked(LazyVegaEmbed).mock.lastCall?.[0].spec).toEqual(
|
|
126
|
+
expect.objectContaining({ data: { values: [{ value }] } }),
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const { rerender } = render(panel([["value", ["string", "object"]]]));
|
|
132
|
+
await expectValues("001");
|
|
133
|
+
expect(getDataUrl).toHaveBeenCalledTimes(1);
|
|
134
|
+
|
|
135
|
+
rerender(panel([["value", ["string", "object"]]]));
|
|
136
|
+
await expectValues("001");
|
|
137
|
+
expect(getDataUrl).toHaveBeenCalledTimes(1);
|
|
138
|
+
|
|
139
|
+
rerender(panel([["value", ["integer", "int64"]]]));
|
|
140
|
+
await expectValues(1);
|
|
141
|
+
expect(getDataUrl).toHaveBeenCalledTimes(2);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("uses column types to parse numeric CSV values without coercing text", async () => {
|
|
145
|
+
vi.spyOn(vegaLoader, "load").mockResolvedValue(
|
|
146
|
+
"a.b,n,label,day,timestamp,active,duration\ninf,1,inf,2024-01-01,2024-01-01T12:00:00Z,True,1 days\n-inf,2,001,2024-01-02,2024-01-02T12:00:00Z,False,2 days\n2.5,3,2024-01-03,2024-01-03,2024-01-03T12:00:00Z,True,3 days\n,4,,,,,\n",
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
render(
|
|
150
|
+
<Tooltip.Provider>
|
|
151
|
+
<ChartPanel
|
|
152
|
+
tableData={[{ "a.b": 1, n: 1 }]}
|
|
153
|
+
chartConfig={{
|
|
154
|
+
general: {
|
|
155
|
+
xColumn: { field: "a.b", type: "number" },
|
|
156
|
+
yColumn: { field: "n", type: "integer", aggregate: NONE_VALUE },
|
|
157
|
+
},
|
|
158
|
+
}}
|
|
159
|
+
chartType={ChartType.BAR}
|
|
160
|
+
saveChart={vi.fn()}
|
|
161
|
+
saveChartType={vi.fn()}
|
|
162
|
+
getDataUrl={vi.fn().mockResolvedValue({
|
|
163
|
+
data_url: "chart.csv",
|
|
164
|
+
format: "csv",
|
|
165
|
+
})}
|
|
166
|
+
fieldTypes={[
|
|
167
|
+
["a.b", ["number", "float64"]],
|
|
168
|
+
["n", ["integer", "int64"]],
|
|
169
|
+
["label", ["string", "object"]],
|
|
170
|
+
["day", ["date", "date"]],
|
|
171
|
+
["timestamp", ["datetime", "datetime64[ns]"]],
|
|
172
|
+
["active", ["boolean", "bool"]],
|
|
173
|
+
["duration", ["unknown", "timedelta64[ns]"]],
|
|
174
|
+
]}
|
|
175
|
+
isLargeDataset={false}
|
|
176
|
+
/>
|
|
177
|
+
</Tooltip.Provider>,
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
await waitFor(() => {
|
|
181
|
+
expect(vi.mocked(LazyVegaEmbed).mock.lastCall?.[0].spec).toEqual(
|
|
182
|
+
expect.objectContaining({
|
|
183
|
+
data: {
|
|
184
|
+
values: [
|
|
185
|
+
{
|
|
186
|
+
"a.b": Infinity,
|
|
187
|
+
n: 1,
|
|
188
|
+
label: "inf",
|
|
189
|
+
day: new Date("2024-01-01"),
|
|
190
|
+
timestamp: new Date("2024-01-01T12:00:00Z"),
|
|
191
|
+
active: true,
|
|
192
|
+
duration: "1 days",
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"a.b": -Infinity,
|
|
196
|
+
n: 2,
|
|
197
|
+
label: "001",
|
|
198
|
+
day: new Date("2024-01-02"),
|
|
199
|
+
timestamp: new Date("2024-01-02T12:00:00Z"),
|
|
200
|
+
active: false,
|
|
201
|
+
duration: "2 days",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"a.b": 2.5,
|
|
205
|
+
n: 3,
|
|
206
|
+
label: "2024-01-03",
|
|
207
|
+
day: new Date("2024-01-03"),
|
|
208
|
+
timestamp: new Date("2024-01-03T12:00:00Z"),
|
|
209
|
+
active: true,
|
|
210
|
+
duration: "3 days",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"a.b": null,
|
|
214
|
+
n: 4,
|
|
215
|
+
label: null,
|
|
216
|
+
day: "",
|
|
217
|
+
timestamp: "",
|
|
218
|
+
active: null,
|
|
219
|
+
duration: "",
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it.each([true, false])(
|
|
229
|
+
"keeps dotted CSV columns aligned with the chart encodings (schema: %s)",
|
|
230
|
+
async (hasSchema) => {
|
|
231
|
+
vi.spyOn(vegaLoader, "load").mockResolvedValue("a.b,n\n1,1\n2,2\n3,3\n");
|
|
232
|
+
|
|
233
|
+
render(
|
|
234
|
+
<Tooltip.Provider>
|
|
235
|
+
<ChartPanel
|
|
236
|
+
tableData={[{ "a.b": 1, n: 1 }]}
|
|
237
|
+
chartConfig={{
|
|
238
|
+
general: {
|
|
239
|
+
xColumn: { field: "a.b", type: "number" },
|
|
240
|
+
yColumn: {
|
|
241
|
+
field: "n",
|
|
242
|
+
type: "number",
|
|
243
|
+
aggregate: NONE_VALUE,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
}}
|
|
247
|
+
chartType={ChartType.BAR}
|
|
248
|
+
saveChart={vi.fn()}
|
|
249
|
+
saveChartType={vi.fn()}
|
|
250
|
+
getDataUrl={vi.fn().mockResolvedValue({
|
|
251
|
+
data_url: "chart.csv",
|
|
252
|
+
format: "csv",
|
|
253
|
+
})}
|
|
254
|
+
fieldTypes={
|
|
255
|
+
hasSchema
|
|
256
|
+
? [
|
|
257
|
+
["a.b", ["number", "float64"]],
|
|
258
|
+
["n", ["integer", "int64"]],
|
|
259
|
+
]
|
|
260
|
+
: undefined
|
|
261
|
+
}
|
|
262
|
+
isLargeDataset={false}
|
|
263
|
+
/>
|
|
264
|
+
</Tooltip.Provider>,
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
await waitFor(() => {
|
|
268
|
+
expect(vi.mocked(LazyVegaEmbed).mock.lastCall?.[0].spec).toEqual(
|
|
269
|
+
expect.objectContaining({
|
|
270
|
+
data: {
|
|
271
|
+
values: [
|
|
272
|
+
{ "a.b": 1, n: 1 },
|
|
273
|
+
{ "a.b": 2, n: 2 },
|
|
274
|
+
{ "a.b": 3, n: 3 },
|
|
275
|
+
],
|
|
276
|
+
},
|
|
277
|
+
encoding: expect.objectContaining({
|
|
278
|
+
x: expect.objectContaining({ field: "a\\.b" }),
|
|
279
|
+
y: expect.objectContaining({ field: "n" }),
|
|
280
|
+
}),
|
|
281
|
+
}),
|
|
282
|
+
);
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
);
|
|
286
|
+
});
|
|
@@ -23,9 +23,11 @@ import { Form } from "@/components/ui/form";
|
|
|
23
23
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
24
24
|
import type { CellId } from "@/core/cells/ids";
|
|
25
25
|
import { useAsyncData } from "@/hooks/useAsyncData";
|
|
26
|
+
import { useDeepCompareMemoize } from "@/hooks/useDeepCompareMemoize";
|
|
26
27
|
import { useDebouncedCallback } from "@/hooks/useDebounce";
|
|
27
28
|
import type { GetDataUrl } from "@/plugins/impl/DataTablePlugin";
|
|
28
29
|
import { vegaLoadData } from "@/plugins/impl/vega/loader";
|
|
30
|
+
import { getVegaFieldTypes } from "@/plugins/impl/vega/utils";
|
|
29
31
|
import { useTheme } from "@/theme/useTheme";
|
|
30
32
|
import { uniqueBy } from "@/utils/arrays";
|
|
31
33
|
import { inferFieldTypes } from "../columns";
|
|
@@ -284,6 +286,7 @@ export const TablePanel: React.FC<TablePanelProps> = ({
|
|
|
284
286
|
saveChart={saveChart}
|
|
285
287
|
saveChartType={saveChartType}
|
|
286
288
|
getDataUrl={getDataUrl}
|
|
289
|
+
hasSchema={Boolean(fieldTypes?.length)}
|
|
287
290
|
fieldTypes={mergeIndexFields(
|
|
288
291
|
fieldTypes ?? inferFieldTypes(dataTable.props.data),
|
|
289
292
|
rowHeaders,
|
|
@@ -307,6 +310,7 @@ export const ChartPanel: React.FC<{
|
|
|
307
310
|
saveChartType: (chartType: ChartType) => void;
|
|
308
311
|
getDataUrl?: GetDataUrl;
|
|
309
312
|
fieldTypes?: FieldTypesWithExternalType | null;
|
|
313
|
+
hasSchema?: boolean;
|
|
310
314
|
isLargeDataset: boolean;
|
|
311
315
|
}> = ({
|
|
312
316
|
tableData,
|
|
@@ -316,6 +320,7 @@ export const ChartPanel: React.FC<{
|
|
|
316
320
|
saveChartType,
|
|
317
321
|
getDataUrl,
|
|
318
322
|
fieldTypes,
|
|
323
|
+
hasSchema = Boolean(fieldTypes?.length),
|
|
319
324
|
isLargeDataset,
|
|
320
325
|
}) => {
|
|
321
326
|
const { theme } = useTheme();
|
|
@@ -331,6 +336,8 @@ export const ChartPanel: React.FC<{
|
|
|
331
336
|
const [renderLargeCharts, setRenderLargeCharts] = useState(!isLargeDataset);
|
|
332
337
|
|
|
333
338
|
const { ref: chartContainerRef } = useResizeObserver();
|
|
339
|
+
// Sample-inferred types are useful for controls, but not full CSV parsing.
|
|
340
|
+
const csvFieldTypes = useDeepCompareMemoize(hasSchema ? fieldTypes : null);
|
|
334
341
|
|
|
335
342
|
const { data, isPending, error } = useAsyncData(async () => {
|
|
336
343
|
if (!getDataUrl || tableData.length === 0 || !renderLargeCharts) {
|
|
@@ -342,20 +349,26 @@ export const ChartPanel: React.FC<{
|
|
|
342
349
|
return response.data_url;
|
|
343
350
|
}
|
|
344
351
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
let format: Parameters<typeof vegaLoadData>[1];
|
|
353
|
+
if (response.format === "arrow") {
|
|
354
|
+
format = { type: "arrow" };
|
|
355
|
+
} else if (response.format === "json") {
|
|
356
|
+
format = { type: "json" };
|
|
357
|
+
} else {
|
|
358
|
+
format = {
|
|
359
|
+
type: "csv",
|
|
360
|
+
parse: getVegaFieldTypes(
|
|
361
|
+
csvFieldTypes &&
|
|
362
|
+
Object.fromEntries(
|
|
363
|
+
csvFieldTypes.map(([name, [type]]) => [name, type]),
|
|
364
|
+
),
|
|
365
|
+
{ parseDates: true },
|
|
366
|
+
),
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
return vegaLoadData(response.data_url, format);
|
|
357
370
|
// Re-run when the data table changes
|
|
358
|
-
}, [tableData, renderLargeCharts]);
|
|
371
|
+
}, [tableData, renderLargeCharts, csvFieldTypes]);
|
|
359
372
|
|
|
360
373
|
const formValues = form.watch();
|
|
361
374
|
|
|
@@ -137,14 +137,14 @@ export class ColumnChartSpecModel<T> {
|
|
|
137
137
|
private legacySourceName: "data_0" | "source_0";
|
|
138
138
|
|
|
139
139
|
private readonly fieldTypes: FieldTypes;
|
|
140
|
-
readonly stats: Record<ColumnName, Partial<ColumnHeaderStats>>;
|
|
141
|
-
readonly binValues: Record<ColumnName, BinValues>;
|
|
142
|
-
readonly valueCounts: Record<ColumnName, ValueCounts>;
|
|
140
|
+
public readonly stats: Record<ColumnName, Partial<ColumnHeaderStats>>;
|
|
141
|
+
public readonly binValues: Record<ColumnName, BinValues>;
|
|
142
|
+
public readonly valueCounts: Record<ColumnName, ValueCounts>;
|
|
143
143
|
private readonly opts: {
|
|
144
144
|
includeCharts: boolean;
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
constructor(
|
|
147
|
+
public constructor(
|
|
148
148
|
data: T[] | string,
|
|
149
149
|
fieldTypes: FieldTypes,
|
|
150
150
|
stats: Record<ColumnName, Partial<ColumnHeaderStats>>,
|
|
@@ -86,7 +86,7 @@ interface DataTableProps<TData> extends Partial<ExportActionProps> {
|
|
|
86
86
|
// Pagination
|
|
87
87
|
totalRows: number | TooManyRows;
|
|
88
88
|
// JSON-serialized size of the currently-rendered data. Forwarded to
|
|
89
|
-
//
|
|
89
|
+
// ExportActions so hosts can size-gate the Export button via downloadSizeLimitAtom.
|
|
90
90
|
sizeBytes?: number | null;
|
|
91
91
|
sizeBytesIsLoading?: boolean;
|
|
92
92
|
totalColumns: number;
|