@marimo-team/frontend 0.25.1-dev3 → 0.25.1-dev31
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-DeqCS430.js → ConnectedDataExplorerComponent-udUY_cVV.js} +1 -1
- package/dist/assets/{ErrorBoundary-DDm0F3Ge.js → ErrorBoundary-DU9X9ktG.js} +2 -2
- package/dist/assets/{ImageComparisonComponent-DLxkuRy3.js → ImageComparisonComponent-pCLPT6RA.js} +1 -1
- package/dist/assets/{LazyAnyLanguageCodeMirror-DPoyi1KJ.js → LazyAnyLanguageCodeMirror-CQdQHMxt.js} +2 -2
- package/dist/assets/{RunButton-1O-85ifv.js → RunButton-CIxAj01l.js} +8 -8
- package/dist/assets/{abnfDiagram-VCTEODGH-DhJEqQ9k.js → abnfDiagram-VCTEODGH-BfLRkjG6.js} +1 -1
- package/dist/assets/add-cell-with-ai-Cg23faw-.js +76 -0
- package/dist/assets/{agent-panel-nJz0jCo0.js → agent-panel-C-o00y2k.js} +4 -4
- package/dist/assets/ai-model-dropdown-BPMrBvJI.js +5 -0
- package/dist/assets/{any-language-editor-CxgTzMTD.js → any-language-editor-GarAZZ0F.js} +1 -1
- package/dist/assets/app-config-button-AYB1pelg.js +1 -0
- package/dist/assets/{architectureDiagram-5GKGNRK7-BwF4-SE1.js → architectureDiagram-5GKGNRK7-D6yIyzt2.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-B7xaFbfk.js → blockDiagram-I7D4REHJ-AeNyA9f7.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-BbMz-zwF.js → c4Diagram-7LVT6UL2-CMQEYn6T.js} +1 -1
- package/dist/assets/{cache-panel-Bd7XcHQd.js → cache-panel-NwDYxLSV.js} +1 -1
- package/dist/assets/{cells-Cu3p4E4U.js → cells-B3WiM6w3.js} +3 -3
- package/dist/assets/channel-CGdeorQk.js +1 -0
- package/dist/assets/{chat-display-CKr8MVOE.js → chat-display-C3AR_hMq.js} +1 -1
- package/dist/assets/chat-panel-sk2UDGU0.js +4 -0
- package/dist/assets/{chat-ui-BH1aZhD7.js → chat-ui-B5emUm0i.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-Cypkx_kh.js → chunk-IMKFNOWR-BI1s1f6A.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-V37g5TGQ.js → chunk-SHT3W25Y-C_QEZvyN.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-CTD0ZEkK.js → chunk-SVP7TREG-DatsBSS6.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-BmUJmjwl.js → chunk-TICWLB2K-C9CpTOkM.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-hebgKVy4.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-hebgKVy4.js +1 -0
- package/dist/assets/{code-visibility-7811giS9.js → code-visibility-BeRg7UF8.js} +1 -1
- package/dist/assets/{command-palette-ZCeZiFkl.js → command-palette-B-bSvOst.js} +1 -1
- package/dist/assets/{common-BdqirnCM.js → common-w6BfuBwC.js} +1 -1
- package/dist/assets/{components-CzFNo5Dk.js → components-CzGcBorn.js} +1 -1
- package/dist/assets/{components-BFIaoBwJ.js → components-DJgWwFKZ.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-CTXT8KNm.js → cynefinDiagram-5FMLGOSQ-K72fUOLW.js} +1 -1
- package/dist/assets/dagre-DTta7jpy.js +1 -0
- package/dist/assets/{dagre-GXQ25YYZ-6LiieueL.js → dagre-GXQ25YYZ-C88kjVwA.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-87bCN9IO.js → data-grid-overlay-editor-DsSRMApC.js} +1 -1
- package/dist/assets/{dependency-graph-panel-CHbDGV22.js → dependency-graph-panel-C55Dhoh3.js} +3 -3
- package/dist/assets/{diagram-S7CK7UJ4-BZL5Ql7I.js → diagram-S7CK7UJ4-DH_lSV_Y.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-AhAtqSJG.js → diagram-UQ7AKVKN-oBdNuXP7.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DOQllF_r.js → diagram-VSXAHHWV-CK4GkM-q.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-COX-CxL0.js → diagram-VX7I27RA-BVtc8GgH.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-DXw7fg_D.js → diagram-Z3DM3KII-DE1--pGH.js} +1 -1
- package/dist/assets/{dist-0HQ0BMF5.js → dist-CQvJDryh.js} +1 -1
- package/dist/assets/{documentation-panel-DUlFjJdz.js → documentation-panel-GB0Szc5R.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-Ds-CB5Z_.js → ebnfDiagram-PWID7BFC-Z4aPnApQ.js} +1 -1
- package/dist/assets/edit-page-TfUoZYYQ.js +174 -0
- package/dist/assets/{erDiagram-RLTQ6QDP-RdxnwvNA.js → erDiagram-RLTQ6QDP-Bbt-nBnx.js} +1 -1
- package/dist/assets/{error-entries-BUsiy4Fq.js → error-entries-BpXezjVq.js} +1 -1
- package/dist/assets/{error-panel-DmaQ2MSS.js → error-panel-BN7MBpEM.js} +1 -1
- package/dist/assets/{feedback-button-DJMAFZ1t.js → feedback-button-DGMsNfSL.js} +2 -2
- package/dist/assets/{file-explorer-panel-BZ4A-j8a.js → file-explorer-panel-C3U1Obcn.js} +1 -1
- package/dist/assets/file-name-input-Vfy6-ZpU.js +3 -0
- package/dist/assets/filename-CVTfpc8L.js +1 -0
- package/dist/assets/flowDiagram-HODETNUW-DmUN-RBx.js +1 -0
- package/dist/assets/{gallery-page-DFoyByKn.js → gallery-page-DGVsSSzP.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-A5jFMgYE.js +131 -0
- package/dist/assets/{graphlib-CWJvl2Lb.js → graphlib-NBIj2Kfp.js} +1 -1
- package/dist/assets/has-D5hx-VdG.js +1 -0
- package/dist/assets/{home-page-D_6gPong.js → home-page-ZW1NJzws.js} +2 -2
- package/dist/assets/index-CwgxYBE_.css +2 -0
- package/dist/assets/index-Zs38iNAG.js +62 -0
- package/dist/assets/{infoDiagram-27XIBGKW-B0jMwBBO.js → infoDiagram-27XIBGKW-rs2zTVPc.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-4eji-_U4.js → ishikawaDiagram-5VMMS53U-CwKWXMNK.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-Cp4mxQrE.js → journeyDiagram-3NMN7TZE-DRc8ACzh.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-BYgV-VZ3.js → kanban-definition-UXKFOSKX-DLr-4ocd.js} +1 -1
- package/dist/assets/katex-DkE0ukCy.js +257 -0
- package/dist/assets/{logs-panel-CvwX6Xnb.js → logs-panel-Dqs_vVC_.js} +1 -1
- package/dist/assets/{mermaid-BmcDudwo.js → mermaid-C1kG065l.js} +4 -4
- package/dist/assets/mhchem-CmzEtQj8.js +1 -0
- package/dist/assets/{mindmap-definition-YA3MSWOX-Cz5xXQnv.js → mindmap-definition-YA3MSWOX-B1C1gz8B.js} +1 -1
- package/dist/assets/{number-overlay-editor-Jcf1i5Xj.js → number-overlay-editor-DqGAR_ww.js} +1 -1
- package/dist/assets/{outline-panel-4icYQ4vr.js → outline-panel-B9dNfe9q.js} +1 -1
- package/dist/assets/packages-panel-BdTU1bBv.js +1 -0
- package/dist/assets/{panels-CM1tqwz-.js → panels-D5aVxy-E.js} +9 -9
- package/dist/assets/{pegDiagram-XKGWAZYB-CCOAs3UH.js → pegDiagram-XKGWAZYB-BFvG7D2O.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-BBxiPx1C.js → pieDiagram-E7YTZNPT-74qoS1R2.js} +1 -1
- package/dist/assets/{process-output-CXjf0zEE.js → process-output-CtQkLZVy.js} +1 -1
- package/dist/assets/{quadrantDiagram-AXDQQJYC-BE-xlTLH.js → quadrantDiagram-AXDQQJYC-D_wrOwLk.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-BRv2wsAz.js → railroadDiagram-O6MQD6OU-Dai_lKbV.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-HAdL90iQ.js → requirementDiagram-BXWQKSXE-CiKina3x.js} +1 -1
- package/dist/assets/{reveal-component-CiQEczuZ.js → reveal-component-D4htvrrq.js} +3 -3
- package/dist/assets/run-page-DdcSXYQd.js +1 -0
- package/dist/assets/{sankeyDiagram-P5KCCOFB-BWLQCyjK.js → sankeyDiagram-P5KCCOFB-CvvUY6tS.js} +1 -1
- package/dist/assets/{scratchpad-panel-Btg5EoIW.js → scratchpad-panel-DGYFLAo7.js} +1 -1
- package/dist/assets/{secrets-panel-C-17vrf1.js → secrets-panel-CJJjGsuj.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-Bs66qtoH.js → sequenceDiagram-WJ2MYXX4-CDhaii-1.js} +1 -1
- package/dist/assets/session-panel-CmCj0NtQ.js +1 -0
- package/dist/assets/{SelectionIndicator-DLJBcP4e.js → shell-BSnvn9t7.js} +1 -1
- package/dist/assets/snippets-panel-kQ1WZG0S.js +1 -0
- package/dist/assets/{stateDiagram-D77RDMKH-CZZcOZaL.js → stateDiagram-D77RDMKH-BtQ2OtwX.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-xaoiOfCL.js +1 -0
- package/dist/assets/{swimlanes-42K2YHIH-DmvAwXeY.js → swimlanes-42K2YHIH-C0Cw-Tka.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-CHL36w8d.js +8 -0
- package/dist/assets/{swiper-component-C-iHKt3a.js → swiper-component-Gt3Wh0WE.js} +1 -1
- package/dist/assets/{terminal-BJXvwDtX.js → terminal-DtHInUNN.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-DMBmrnDz.js → timeline-definition-24CTP7MA-C7EutK_-.js} +1 -1
- package/dist/assets/tooltip-PLkI_UfK.js +61 -0
- package/dist/assets/{tracing-C1gfnMTz.js → tracing-DlzNhnai.js} +1 -1
- package/dist/assets/tracing-panel-C3SuXZCf.js +2 -0
- package/dist/assets/{useCellActionButton-ChAk7KSd.js → useCellActionButton-CDfnQ-sN.js} +1 -1
- package/dist/assets/{vega-component-Dyn2ovlw.js → vega-component-BENjQM3D.js} +1 -1
- package/dist/assets/{vega-embed-container-SaZMhvDB.js → vega-embed-container-CDuaQJOb.js} +1 -1
- package/dist/assets/{vennDiagram-4TSXK5OY-CU4ZQxbP.js → vennDiagram-4TSXK5OY-2eNGjMK5.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-CqJhzIbP.js → wardleyDiagram-VM6X3IG4-ChtVzrz8.js} +1 -1
- package/dist/assets/{write-secret-modal-CBUZw27N.js → write-secret-modal-BiG2tahJ.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-CS6EJwUz.js → xychartDiagram-S5SC5T6Z-CG-PhCjW.js} +1 -1
- package/dist/index.html +8 -7
- 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/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/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/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/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/share-modal.tsx +2 -1
- 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/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/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/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 +130 -126
- 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 +3 -3
- 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/add-cell-with-ai-B_rl7cPp.js +0 -76
- package/dist/assets/ai-model-dropdown-BmCwaRek.js +0 -3
- package/dist/assets/app-config-button-CtDuDui6.js +0 -1
- package/dist/assets/channel-ni7ei-yz.js +0 -1
- package/dist/assets/chat-panel-J4XhiL6i.js +0 -4
- package/dist/assets/classDiagram-ZZMXUADV-BS3U2jc1.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY-BS3U2jc1.js +0 -1
- package/dist/assets/dagre-B5pirN9r.js +0 -1
- package/dist/assets/edit-page-D--nkMAI.js +0 -176
- package/dist/assets/file-name-input-CCRQJdng.js +0 -3
- package/dist/assets/flowDiagram-HODETNUW-DN8oq7vL.js +0 -1
- package/dist/assets/glide-data-editor-jH9-4ffy.js +0 -131
- package/dist/assets/has-W-yPT2HD.js +0 -1
- package/dist/assets/index-2TQenOiQ.css +0 -2
- package/dist/assets/index-Bjli4tSW.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-pQzYAoH5.js +0 -1
- package/dist/assets/run-page-BTAjlR7y.js +0 -1
- package/dist/assets/session-panel-BYf4LDAo.js +0 -1
- package/dist/assets/snippets-panel-BAYAZKCH.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-sU5f30Vy.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-CNzkvYiI.js +0 -8
- package/dist/assets/tooltip-B1vGi-z4.js +0 -61
- package/dist/assets/tracing-panel-CzJ8ckHz.js +0 -2
package/dist/assets/{xychartDiagram-S5SC5T6Z-CS6EJwUz.js → xychartDiagram-S5SC5T6Z-CG-PhCjW.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./linear-0eij_aAG.js";import{n as t}from"./ordinal-BdBDtYTt.js";import{t as n}from"./range-EplFIxc7.js";import{v as r}from"./step-CriubqJO.js";import{i}from"./chunk-75Z2AOVW-
|
|
1
|
+
import{t as e}from"./linear-0eij_aAG.js";import{n as t}from"./ordinal-BdBDtYTt.js";import{t as n}from"./range-EplFIxc7.js";import{v as r}from"./step-CriubqJO.js";import{i}from"./chunk-75Z2AOVW-BzzYECN7.js";import{n as a}from"./init-ZlXS9mIS.js";import{n as o}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as s}from"./src-Cyu5G-Tr.js";import{D as c,H as l,K as u,U as d,a as f,b as p,c as m,f as h,v as g,w as _,y as v,z as y}from"./chunk-DU6HZSFF-BlpgvKzl.js";import"./chunk-PWAF6VOD-BZoBqp8x.js";import{t as b}from"./chunk-GMAD6QVW-hv6IsAru.js";import{p as x}from"./mermaid-C1kG065l.js";function S(){var e=t().unknown(void 0),r=e.domain,i=e.range,o=0,s=1,c,l,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var e=r().length,t=s<o,a=t?s:o,m=t?o:s;c=(m-a)/Math.max(1,e-d+f*2),u&&(c=Math.floor(c)),a+=(m-a-c*(e-d))*p,l=c*(1-d),u&&(a=Math.round(a),l=Math.round(l));var h=n(e).map(function(e){return a+c*e});return i(t?h.reverse():h)}return e.domain=function(e){return arguments.length?(r(e),m()):r()},e.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,m()):[o,s]},e.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,u=!0,m()},e.bandwidth=function(){return l},e.step=function(){return c},e.round=function(e){return arguments.length?(u=!!e,m()):u},e.padding=function(e){return arguments.length?(d=Math.min(1,f=+e),m()):d},e.paddingInner=function(e){return arguments.length?(d=Math.min(1,e),m()):d},e.paddingOuter=function(e){return arguments.length?(f=+e,m()):f},e.align=function(e){return arguments.length?(p=Math.max(0,Math.min(1,e)),m()):p},e.copy=function(){return S(r(),[o,s]).round(u).paddingInner(d).paddingOuter(f).align(p)},a.apply(m(),arguments)}var C=(function(){var e=o(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],a=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:o(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:o(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[e(t,n,{3:1,4:2,7:4,5:r,36:i,37:a,38:s}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:r,36:i,37:a,38:s}),e(t,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,36]),e(c,[2,37]),e(c,[2,38]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:r,36:i,37:a,38:s}),{1:[2,3]},e(c,[2,5]),e(t,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),e(E,[2,40]),e(E,[2,41]),e(D,[2,42]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),e(D,[2,53]),e(T,[2,10]),e(T,[2,24],{32:41,31:56,24:x,29:S}),e(T,[2,26]),e(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,11]),e(T,[2,32],{35:60,29:C}),e(T,[2,34]),{33:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},e(T,[2,14]),{17:66,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,43]),e(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(T,[2,33]),{29:[1,70]},e(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(k,[2,23],{30:[1,73]}),e(T,[2,15]),e(T,[2,28]),e(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,35]),e(T,[2,19]),{25:75,27:64,29:O},e(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:o(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:o(function(e){var t=this,n=[0],r=[],i=[null],a=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}o(b,`popStack`);function x(){var e=r.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}o(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],i,a].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:o(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:o(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:o(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:o(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:o(function(){return this._more=!0,this},`more`),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:o(function(e){this.unput(this.match.slice(e))},`less`),pastInput:o(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:o(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:o(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-Zs38iNAG.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-B0Z9INg1.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/react-CUdNIagt.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BQ9S8nyo.js">
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<link rel="modulepreload" crossorigin href="./assets/use-toast-CC89xOwH.js">
|
|
117
117
|
<link rel="modulepreload" crossorigin href="./assets/requests-yTHMxhVa.js">
|
|
118
118
|
<link rel="modulepreload" crossorigin href="./assets/uuid-k9DpjH68.js">
|
|
119
|
-
<link rel="modulepreload" crossorigin href="./assets/write-secret-modal-
|
|
119
|
+
<link rel="modulepreload" crossorigin href="./assets/write-secret-modal-BiG2tahJ.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/plus-gbN72xHe.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-BJG-7Qob.js">
|
|
122
122
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-HclGiUj8.js">
|
|
@@ -139,16 +139,16 @@
|
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/useTheme-DcnXlv0_.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-DucTwMkf.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/purify.es-CYRiAeUx.js">
|
|
142
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
142
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-B3WiM6w3.js">
|
|
143
143
|
<link rel="modulepreload" crossorigin href="./assets/get-DjNf4SIX.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/copy-RyCOE8jo.js">
|
|
145
145
|
<link rel="modulepreload" crossorigin href="./assets/copy-BhJktFeI.js">
|
|
146
146
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-DFhUGBjO.js">
|
|
147
|
-
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-
|
|
147
|
+
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-DU9X9ktG.js">
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/config-B4VJJibu.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-DOPs2jx8.js">
|
|
150
150
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-VuyoeQOD.js">
|
|
151
|
-
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-
|
|
151
|
+
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-CQdQHMxt.js">
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/hat-glasses-DVgK5i5l.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/package-BeYhVWvM.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/errors-D9vyuMar.js">
|
|
@@ -156,11 +156,12 @@
|
|
|
156
156
|
<link rel="modulepreload" crossorigin href="./assets/precisionRound-Bq_nmf5u.js">
|
|
157
157
|
<link rel="modulepreload" crossorigin href="./assets/defaultLocale-D5bOh7g6.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/vega-loader.browser-CLRkNgm7.js">
|
|
159
|
-
<link rel="modulepreload" crossorigin href="./assets/tooltip-
|
|
159
|
+
<link rel="modulepreload" crossorigin href="./assets/tooltip-PLkI_UfK.js">
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/filename-CVTfpc8L.js">
|
|
160
161
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-D9Dr-k4J.js">
|
|
161
162
|
<link rel="modulepreload" crossorigin href="./assets/chunk-YOKDWASO-CaoEAGJk.js">
|
|
162
163
|
<link rel="stylesheet" crossorigin href="./assets/cells-0PFKL3SH.css">
|
|
163
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
164
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CwgxYBE_.css">
|
|
164
165
|
</head>
|
|
165
166
|
<body>
|
|
166
167
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marimo-team/frontend",
|
|
3
|
-
"version": "0.25.1-
|
|
3
|
+
"version": "0.25.1-dev31",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -198,7 +198,6 @@
|
|
|
198
198
|
"@testing-library/jest-dom": "^7.0.1",
|
|
199
199
|
"@testing-library/react": "^16.3.2",
|
|
200
200
|
"@types/dompurify": "^3.2.0",
|
|
201
|
-
"@types/katex": "^0.16.8",
|
|
202
201
|
"@types/lodash-es": "^4.17.12",
|
|
203
202
|
"@types/node": "^24.13.3",
|
|
204
203
|
"@types/plotly.js": "^2.35.16",
|
package/src/__mocks__/common.ts
CHANGED
|
@@ -101,9 +101,9 @@ export const SetupMocks = {
|
|
|
101
101
|
const unobserve = vi.fn();
|
|
102
102
|
const disconnect = vi.fn();
|
|
103
103
|
global.ResizeObserver = class MockResizeObserver {
|
|
104
|
-
observe = observe;
|
|
105
|
-
unobserve = unobserve;
|
|
106
|
-
disconnect = disconnect;
|
|
104
|
+
public observe = observe;
|
|
105
|
+
public unobserve = unobserve;
|
|
106
|
+
public disconnect = disconnect;
|
|
107
107
|
} as unknown as typeof ResizeObserver;
|
|
108
108
|
return { observe, unobserve, disconnect };
|
|
109
109
|
},
|
package/src/__tests__/setup.ts
CHANGED
|
@@ -9,29 +9,29 @@ import "blob-polyfill";
|
|
|
9
9
|
// if we need to test ResizeObserver functionality
|
|
10
10
|
// we can use a library like "resize-observer-polyfill"
|
|
11
11
|
globalThis.ResizeObserver ??= class {
|
|
12
|
-
observe(_target: Element) {
|
|
12
|
+
public observe(_target: Element) {
|
|
13
13
|
/* noop */
|
|
14
14
|
}
|
|
15
|
-
unobserve(_target: Element) {
|
|
15
|
+
public unobserve(_target: Element) {
|
|
16
16
|
/* noop */
|
|
17
17
|
}
|
|
18
|
-
disconnect() {
|
|
18
|
+
public disconnect() {
|
|
19
19
|
/* noop */
|
|
20
20
|
}
|
|
21
21
|
} as never;
|
|
22
22
|
|
|
23
23
|
// mock implementation because jsdom doesn't support IntersectionObserver
|
|
24
24
|
globalThis.IntersectionObserver ??= class {
|
|
25
|
-
observe(_target: Element) {
|
|
25
|
+
public observe(_target: Element) {
|
|
26
26
|
/* noop */
|
|
27
27
|
}
|
|
28
|
-
unobserve(_target: Element) {
|
|
28
|
+
public unobserve(_target: Element) {
|
|
29
29
|
/* noop */
|
|
30
30
|
}
|
|
31
|
-
disconnect() {
|
|
31
|
+
public disconnect() {
|
|
32
32
|
/* noop */
|
|
33
33
|
}
|
|
34
|
-
takeRecords() {
|
|
34
|
+
public takeRecords() {
|
|
35
35
|
return [];
|
|
36
36
|
}
|
|
37
37
|
} as never;
|
|
@@ -59,6 +59,7 @@ import {
|
|
|
59
59
|
listModelsForAiSettings,
|
|
60
60
|
} from "../ai/ai-utils";
|
|
61
61
|
import { getTagColour } from "../ai/display-helpers";
|
|
62
|
+
import { PairWithAgentBanner } from "../editor/actions/pair-with-agent";
|
|
62
63
|
import {
|
|
63
64
|
Accordion,
|
|
64
65
|
AccordionContent,
|
|
@@ -2005,6 +2006,7 @@ export const AiConfig: React.FC<AiConfigProps> = ({
|
|
|
2005
2006
|
{aiEnabled !== false && (
|
|
2006
2007
|
<>
|
|
2007
2008
|
<TabsContent value="ai-providers">
|
|
2009
|
+
<PairWithAgentBanner className="mb-4" />
|
|
2008
2010
|
<AiProvidersConfig
|
|
2009
2011
|
form={form}
|
|
2010
2012
|
config={config}
|
|
@@ -107,7 +107,7 @@ const OPTIONAL_DEPENDENCIES: OptionalFeature[] = [
|
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
id: "lens",
|
|
110
|
-
packagesRequired: [{ name: "marimo-lens", minVersion: "0.2.
|
|
110
|
+
packagesRequired: [{ name: "marimo-lens", minVersion: "0.2.3" }],
|
|
111
111
|
additionalPackageInstalls: [],
|
|
112
112
|
description: "Select outputs for agents",
|
|
113
113
|
},
|
|
@@ -64,6 +64,10 @@ import { cn } from "@/utils/cn";
|
|
|
64
64
|
import { Logger } from "@/utils/Logger";
|
|
65
65
|
import { AIModelDropdown } from "../ai/ai-model-dropdown";
|
|
66
66
|
import { useOpenSettingsToTab } from "../app-config/state";
|
|
67
|
+
import {
|
|
68
|
+
PairWithAgentBanner,
|
|
69
|
+
PairWithAgentButton,
|
|
70
|
+
} from "../editor/actions/pair-with-agent";
|
|
67
71
|
import { PairWithAgentModal } from "../editor/actions/pair-with-agent-modal";
|
|
68
72
|
import { PromptInput } from "../editor/ai/add-cell-with-ai";
|
|
69
73
|
import {
|
|
@@ -163,6 +167,9 @@ const ChatHeader: React.FC<ChatHeaderProps> = ({
|
|
|
163
167
|
</Button>
|
|
164
168
|
</Tooltip>
|
|
165
169
|
<div className="flex items-center gap-2">
|
|
170
|
+
<Tooltip content="Connect your agent">
|
|
171
|
+
<PairWithAgentButton className="mr-1" label="Connect" />
|
|
172
|
+
</Tooltip>
|
|
166
173
|
<MCPStatusIndicator />
|
|
167
174
|
<Tooltip content="AI Settings">
|
|
168
175
|
<Button
|
|
@@ -493,7 +500,7 @@ const PairWithAgentCallout: React.FC<{
|
|
|
493
500
|
onClick={onPairWithAgent}
|
|
494
501
|
>
|
|
495
502
|
<SparklesIcon className="h-3.5 w-3.5 shrink-0" />
|
|
496
|
-
<span>
|
|
503
|
+
<span>Connect your own agent to this notebook</span>
|
|
497
504
|
<ArrowRightIcon className="h-3 w-3 shrink-0" />
|
|
498
505
|
</Button>
|
|
499
506
|
);
|
|
@@ -509,13 +516,17 @@ const ChatPanel = () => {
|
|
|
509
516
|
title="Chat with AI"
|
|
510
517
|
description="No AI provider configured or Chat model not selected"
|
|
511
518
|
action={
|
|
512
|
-
<
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
+
<div className="flex flex-col gap-3">
|
|
520
|
+
<Button
|
|
521
|
+
variant="outline"
|
|
522
|
+
size="sm"
|
|
523
|
+
className="self-start"
|
|
524
|
+
onClick={() => handleClick("ai", "ai-providers")}
|
|
525
|
+
>
|
|
526
|
+
Edit AI settings
|
|
527
|
+
</Button>
|
|
528
|
+
<PairWithAgentBanner />
|
|
529
|
+
</div>
|
|
519
530
|
}
|
|
520
531
|
icon={<BotMessageSquareIcon />}
|
|
521
532
|
/>
|
|
@@ -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>>,
|