@marimo-team/frontend 0.19.10-dev3 → 0.19.10-dev30
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/{CellStatus-CZlcjSUO.js → CellStatus-BAeLnQ68.js} +1 -1
- package/dist/assets/{JsonOutput-PE5ko4gi.js → JsonOutput-BYZnEjkl.js} +14 -14
- package/dist/assets/{LazyAnyLanguageCodeMirror-DgZ8iknE.js → LazyAnyLanguageCodeMirror-BTO7DS3k.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-Lf9P8Fhl.js → MarimoErrorOutput-C90djx1V.js} +1 -1
- package/dist/assets/{react-plotly-kw5W3sN8.js → Plot-CN9AM0tY.js} +92 -92
- package/dist/assets/{RenderHTML-D-of_-s7.js → RenderHTML-ByTXWSgj.js} +1 -1
- package/dist/assets/{add-cell-with-ai-e_HMl7UU.js → add-cell-with-ai-CnyhGSdf.js} +2 -2
- package/dist/assets/{add-database-form-DvnhmpaG.js → add-database-form-DqVwhh_K.js} +1 -1
- package/dist/assets/{agent-panel-bOQya9ER.js → agent-panel-DrhcPPKF.js} +1 -1
- package/dist/assets/{ai-model-dropdown-Dk2SdB3C.js → ai-model-dropdown-C_pphOGv.js} +1 -1
- package/dist/assets/{any-language-editor-BODEG_5g.js → any-language-editor-BdrnE_3i.js} +1 -1
- package/dist/assets/{app-config-button-DMsJtN9b.js → app-config-button-BariZTN8.js} +1 -1
- package/dist/assets/{architecture-U656AL7Q-DENTsr7c.js → architecture-U656AL7Q-DQB1ihe9.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-CDeVogFv.js → architectureDiagram-VXUJARFQ-aV-hwsKI.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-Bol-uwBO.js → blockDiagram-VD42YOAC-CJeGIMJm.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-C-eNQ40H.js → c4Diagram-YG6GDRKO-aLqv1M3N.js} +1 -1
- package/dist/assets/{cell-editor-BW4w46wt.js → cell-editor-B-wR_JRR.js} +12 -12
- package/dist/assets/{cell-link-B9b7J8QK.js → cell-link-D46k36Xe.js} +1 -1
- package/dist/assets/{cells-DPp5cDaO.js → cells-DG7rjkOQ.js} +14 -14
- package/dist/assets/channel-C1Usuv02.js +1 -0
- package/dist/assets/{chat-display--jAB7huF.js → chat-display-hQ2Dy5fa.js} +1 -1
- package/dist/assets/{chat-panel-DzMwk8Wu.js → chat-panel-D4Bcz2Sv.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-KawmK-5L.js → chunk-4BX2VUAB-BP-RGZn9.js} +1 -1
- package/dist/assets/chunk-55IACEB6-DJOXjhUm.js +1 -0
- package/dist/assets/{chunk-ABZYJK2D-0jga8uiE.js → chunk-ABZYJK2D-CNf44YbG.js} +1 -1
- package/dist/assets/{chunk-ATLVNIR6-B17dg7Ry.js → chunk-ATLVNIR6-dMFR1SFQ.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-DoVbcCDm.js → chunk-B4BG7PRW-CtXWCWTB.js} +1 -1
- package/dist/assets/{chunk-CVBHYZKI-DU48rJVu.js → chunk-CVBHYZKI-Brsoob-W.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-rLpl7joX.js → chunk-DI55MBZ5-BAPPLtVz.js} +1 -1
- package/dist/assets/{chunk-EXTU4WIE-Dmu97ZvI.js → chunk-EXTU4WIE-DhUL3hgE.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-CHJv683r.js → chunk-FMBD7UC4-kejklSRQ.js} +1 -1
- package/dist/assets/{chunk-HN2XXSSU-Bdbi3Mns.js → chunk-HN2XXSSU-BBxJMYrA.js} +1 -1
- package/dist/assets/{chunk-JA3XYJ7Z-DOm8KfKa.js → chunk-JA3XYJ7Z-BBDBNwto.js} +1 -1
- package/dist/assets/{chunk-JZLCHNYA-48QVgmR4.js → chunk-JZLCHNYA-BXs7PoCi.js} +1 -1
- package/dist/assets/{chunk-MI3HLSF2-n3vxgSbN.js → chunk-MI3HLSF2-D6we5Ftb.js} +1 -1
- package/dist/assets/{chunk-N4CR4FBY-BNoQB557.js → chunk-N4CR4FBY-G8sTCjxn.js} +2 -2
- package/dist/assets/{chunk-QN33PNHL-BOQncxfy.js → chunk-QN33PNHL-BXnZwF56.js} +1 -1
- package/dist/assets/{chunk-QXUST7PY-DkCIa8tJ.js → chunk-QXUST7PY-DaTIHluG.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-Cp_TxrNJ.js → chunk-QZHKN3VN-DCq7JxLD.js} +1 -1
- package/dist/assets/{chunk-S3R3BYOJ-8loRaCFh.js → chunk-S3R3BYOJ-OezEEdUG.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-CPHBPwrM.js → chunk-TZMSLE5B-BUnfEuEz.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-DQZw7BDP.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-BBniC-qJ.js +1 -0
- package/dist/assets/{column-preview-CXjSXUhP.js → column-preview-DFroYRmp.js} +1 -1
- package/dist/assets/{command-2ElA5IkO.js → command-Djb6VJ8T.js} +1 -1
- package/dist/assets/{command-palette-DrD2qhGV.js → command-palette-Dt2DT2AT.js} +1 -1
- package/dist/assets/{common-DSlhalAu.js → common-B9j0Q2gP.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-tFAvjCRW.js → cose-bilkent-S5V4N54A-BjwT10E5.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-DOB6anec.js → dagre-6UL2VRFP-oY6KaDGH.js} +1 -1
- package/dist/assets/{datasource-CtyqtITR.js → datasource-w1NuMzfo.js} +1 -1
- package/dist/assets/dependency-graph-panel-DED_3Q6I.js +4 -0
- package/dist/assets/{diagram-PSM6KHXK-DpuCiAS7.js → diagram-PSM6KHXK-D3RUn56c.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-IlkvvuKX.js → diagram-QEK2KX5R-BDPgp5cV.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-DJt_T1Gq.js → diagram-S2PKOQOG-NhFH98y0.js} +1 -1
- package/dist/assets/dist--lWkNwLa.js +1 -0
- package/dist/assets/{dist-CRjEDsfC.js → dist-8qtC33as.js} +1 -1
- package/dist/assets/{dist-CsRJPnA9.js → dist-B0T008FI.js} +1 -1
- package/dist/assets/dist-B1Jd_IvQ.js +1 -0
- package/dist/assets/dist-B5vqrkGM.js +1 -0
- package/dist/assets/dist-BDTS_4tQ.js +1 -0
- package/dist/assets/{dist-C5H5qIvq.js → dist-BHxWJlYy.js} +1 -1
- package/dist/assets/{dist-sMh6mJ2d.js → dist-BNkRH34W.js} +2 -2
- package/dist/assets/{dist-tLOz534J.js → dist-BP9zs-JA.js} +1 -1
- package/dist/assets/dist-BeHHM5ER.js +1 -0
- package/dist/assets/dist-BkTLZYtq.js +1 -0
- package/dist/assets/dist-Bl-MdZlw.js +1 -0
- package/dist/assets/dist-Bouhdq2b.js +1 -0
- package/dist/assets/{dist-CtrmRz20.js → dist-BqBWjk9M.js} +3 -3
- package/dist/assets/{dist-Gqv0jSNr.js → dist-Bt3KRZho.js} +1 -1
- package/dist/assets/dist-BtnFSOCN.js +1 -0
- package/dist/assets/{dist-B62Xo7-b.js → dist-C0vFollF.js} +1 -1
- package/dist/assets/dist-CBgJfRVh.js +1 -0
- package/dist/assets/{dist-CEaOyZOW.js → dist-CCX32maQ.js} +1 -1
- package/dist/assets/dist-CDTDwVaL.js +1 -0
- package/dist/assets/dist-CF9gSfGe.js +2 -0
- package/dist/assets/{dist-BpuNldXk.js → dist-CShMY7yu.js} +1 -1
- package/dist/assets/{dist-CEEqzIVj.js → dist-CUeuuHG_.js} +1 -1
- package/dist/assets/dist-CY47RP0T.js +1 -0
- package/dist/assets/dist-D1HV0xoM.js +1 -0
- package/dist/assets/{dist-BZWmfQbq.js → dist-DDhEwFtR.js} +1 -1
- package/dist/assets/{dist-BXnpRw3d.js → dist-DDoTyiJg.js} +1 -1
- package/dist/assets/{dist-DLgWirXg.js → dist-DKmfcej2.js} +1 -1
- package/dist/assets/{dist-Dv0MupEh.js → dist-DPQdWUrU.js} +1 -1
- package/dist/assets/dist-DYjR2ilN.js +1 -0
- package/dist/assets/{dist-8kKeYgOg.js → dist-D_DbFqxl.js} +1 -1
- package/dist/assets/dist-DdDowPeI.js +1 -0
- package/dist/assets/{dist-B83wRp_v.js → dist-Dt1by2kD.js} +1 -1
- package/dist/assets/dist-Dt_gLA9L.js +1 -0
- package/dist/assets/dist-DxWb3aMV.js +13 -0
- package/dist/assets/dist-Dz922FNY.js +1 -0
- package/dist/assets/dist-GRPM_OuL.js +1 -0
- package/dist/assets/{dist-CF4gkF4y.js → dist-K8bI26Ke.js} +1 -1
- package/dist/assets/{dist-Btv5Rh1v.js → dist-LUpffRIq.js} +1 -1
- package/dist/assets/{dist-bBwmhqty.js → dist-MyTWYTLd.js} +4 -4
- package/dist/assets/dist-NOntBqny.js +1 -0
- package/dist/assets/{dist-Dcqqg9UU.js → dist-PzrizfuL.js} +1 -1
- package/dist/assets/{dist-CNW1zLeq.js → dist-dnoBqBf0.js} +1 -1
- package/dist/assets/{dist-CLc5WXWw.js → dist-kjrKkhgz.js} +1 -1
- package/dist/assets/{dist-CoCQUAeM.js → dist-maX8rbyb.js} +1 -1
- package/dist/assets/{documentation-panel-BDQNa1xE.js → documentation-panel-CG2t9UyE.js} +1 -1
- package/dist/assets/{download-os8QlW6l.js → download-B6duieQs.js} +1 -1
- package/dist/assets/{edit-page-Bx2U8f0j.js → edit-page-D8-gDPT2.js} +7 -7
- package/dist/assets/{erDiagram-Q2GNP2WA-CekwCx1v.js → erDiagram-Q2GNP2WA-DKwbR5cV.js} +1 -1
- package/dist/assets/{error-panel-B_234Lt3.js → error-panel-CDGOPmKx.js} +1 -1
- package/dist/assets/{esm-D82gQH1f.js → esm-BeuExXY6.js} +1 -1
- package/dist/assets/{esm-Bmu2DhPy.js → esm-BqiVbELQ.js} +1 -1
- package/dist/assets/{file-explorer-panel-T3oL7Bzx.js → file-explorer-panel-CAtnXwC4.js} +1 -1
- package/dist/assets/{floating-outline-BtdqbkUq.js → floating-outline--UenxIj3.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-BhCyaqwV.js → flowDiagram-NV44I4VS-uysyk7eQ.js} +1 -1
- package/dist/assets/{focus-C1YokgL7.js → focus-n0WPxeOV.js} +1 -1
- package/dist/assets/{form-BidPUZUn.js → form-C59_eE2a.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-Ct2B_ci4.js → ganttDiagram-JELNMOA3-Dl5P96jD.js} +1 -1
- package/dist/assets/{gitGraph-F6HP7TQM-BwJPuiCH.js → gitGraph-F6HP7TQM-ULnyMCh9.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-DOBPUqeq.js → gitGraphDiagram-NY62KEGX-66npzzTR.js} +1 -1
- package/dist/assets/{glide-data-editor-D1ZoJKPr.js → glide-data-editor-DXeMF5KH.js} +3 -3
- package/dist/assets/{globals-BgACvYmr.js → globals-CP-h_Os3.js} +1 -1
- package/dist/assets/{home-page-DUMF8ZY4.js → home-page-DnqxPw6c.js} +1 -1
- package/dist/assets/{hooks-BGeojgid.js → hooks-DW6SBMlZ.js} +1 -1
- package/dist/assets/{html-to-image-CIQqSu-S.js → html-to-image-BXhYNOMC.js} +1 -1
- package/dist/assets/{index-CD6Gw4UH.js → index-BMHyx2Yb.js} +10 -10
- package/dist/assets/{info-NVLQJR56-Ccg18Lpe.js → info-NVLQJR56-gsco60Pt.js} +1 -1
- package/dist/assets/{infoDiagram-WHAUD3N6-Cytag0-K.js → infoDiagram-WHAUD3N6-DneTtUPV.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-CPDnALH5.js → journeyDiagram-XKPGCS4Q-Cpn7DMNv.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-D0-Tthpw.js → kanban-definition-3W4ZIXB7-Dt7HC9K8.js} +1 -1
- package/dist/assets/{kiosk-mode-WmM7aFkh.js → kiosk-mode-CPN0mq4M.js} +1 -1
- package/dist/assets/{layout-_O8thjaV.js → layout-Bv1HRnh6.js} +3 -3
- package/dist/assets/{logs-panel-C3cavnFO.js → logs-panel-CZIVXROt.js} +1 -1
- package/dist/assets/{markdown-renderer-DJy8ww5d.js → markdown-renderer-CnImn_qm.js} +1 -1
- package/dist/assets/{mermaid-y-IBDpJK.js → mermaid-8YdCU498.js} +3 -3
- package/dist/assets/{mermaid-parser.core-BLHYb13y.js → mermaid-parser.core-DWPZKg0k.js} +2 -2
- package/dist/assets/{mindmap-definition-VGOIOE7T-BflEJS3A.js → mindmap-definition-VGOIOE7T-D81SsTqK.js} +1 -1
- package/dist/assets/{mode-Bn7pdJvO.js → mode-a9XOBfse.js} +1 -1
- package/dist/assets/{name-cell-input-Bc7geMVf.js → name-cell-input-BhJdGpGA.js} +1 -1
- package/dist/assets/{outline-panel-Bxt_JABC.js → outline-panel-BGroTTXd.js} +1 -1
- package/dist/assets/{packages-panel-yEp7rAYf.js → packages-panel-CQGOcCdz.js} +1 -1
- package/dist/assets/{packet-BFZMPI3H-C_EwQwCX.js → packet-BFZMPI3H-CnHEXEVi.js} +1 -1
- package/dist/assets/{panels-DW8vF5Az.js → panels-DGXXeSZl.js} +1 -1
- package/dist/assets/{pie-7BOR55EZ-B2NFlNeo.js → pie-7BOR55EZ-C5Sp4r8f.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DXRnX2TS.js → pieDiagram-ADFJNKIX-DhavwtGF.js} +1 -1
- package/dist/assets/{process-output-ByfLnk6j.js → process-output-C4GYMI00.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-e3OVACTV.js → quadrantDiagram-AYHSOK5B-DMBGpNwx.js} +1 -1
- package/dist/assets/{radar-NHE76QYJ-C3XGuwbG.js → radar-NHE76QYJ-DAElyE_r.js} +1 -1
- package/dist/assets/{readonly-python-code-WjTf6Pdd.js → readonly-python-code-BvJmyMxd.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-DMbzgjKI.js → requirementDiagram-UZGBJVZJ-Cjwe-82R.js} +1 -1
- package/dist/assets/{run-page-D4d7rFuk.js → run-page-CTcZo7xh.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-B90PTMUW.js → sankeyDiagram-TZEHDZUN-5-vnnmzf.js} +1 -1
- package/dist/assets/{scratchpad-panel-C6thsU6k.js → scratchpad-panel-2TxCLFo3.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-DKFGl_80.js → sequenceDiagram-WL72ISMW-Co6SHGCI.js} +1 -1
- package/dist/assets/{session-panel-3zs_-lnF.js → session-panel-WAp0J0nc.js} +1 -1
- package/dist/assets/{snippets-panel-Bbk7MFBI.js → snippets-panel-Dg7V8q_w.js} +1 -1
- package/dist/assets/{state-D4T75eZb.js → state-C-B637hX.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-Czf6mxbq.js → stateDiagram-FKZM4ZOC-Bhirefzg.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-CJnByxam.js +1 -0
- package/dist/assets/{switch-dWLWbbtg.js → switch-B-UXYPJj.js} +1 -1
- package/dist/assets/{textarea-CRI7xDBj.js → textarea-gBSp2Bx0.js} +1 -1
- package/dist/assets/{timeline-definition-IT6M3QCI-Cr57imdX.js → timeline-definition-IT6M3QCI-C5mDI6KK.js} +1 -1
- package/dist/assets/{tracing-U3RlLbPJ.js → tracing-Dy8UdLvI.js} +1 -1
- package/dist/assets/{tracing-panel-D6GhZuLA.js → tracing-panel-BKDVrccB.js} +2 -2
- package/dist/assets/{treemap-KMMF4GRG-CQXdJ2ER.js → treemap-KMMF4GRG-Bf9yeA5X.js} +1 -1
- package/dist/assets/{types-BRfQN3HL.js → types-Cggdh96K.js} +1 -1
- package/dist/assets/{useAddCell-CmuX2hOk.js → useAddCell-CkxiWxI4.js} +1 -1
- package/dist/assets/{useCellActionButton-DUDHPTmq.js → useCellActionButton-BCYKogBW.js} +1 -1
- package/dist/assets/{useDeleteCell-DdRX94yC.js → useDeleteCell-CU4wVnMY.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-CeDmKn0Z.js → useDependencyPanelTab-Dc4i3G5R.js} +1 -1
- package/dist/assets/{useNotebookActions-BFGSBiOA.js → useNotebookActions-CztwRVhn.js} +1 -1
- package/dist/assets/{useRunCells-D2HBb4DB.js → useRunCells-DnyQs7_N.js} +1 -1
- package/dist/assets/{useSplitCell-C4khe6eU.js → useSplitCell-CSr3as14.js} +1 -1
- package/dist/assets/{utilities.esm-dm9SQStE.js → utilities.esm-CwjMWc5G.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-DtYN6-1-.js → xychartDiagram-PRI3JC2R-BhdCuImZ.js} +1 -1
- package/dist/index.html +41 -41
- package/package.json +11 -12
- package/src/components/data-table/__tests__/columns.test.tsx +47 -0
- package/src/components/data-table/column-header.tsx +3 -0
- package/src/components/data-table/columns.tsx +17 -2
- package/src/components/dependency-graph/dependency-graph-tree.tsx +10 -1
- package/src/components/dependency-graph/dependency-graph.tsx +1 -0
- package/src/components/dependency-graph/elements.ts +20 -9
- package/src/components/dependency-graph/panels.tsx +27 -11
- package/src/components/dependency-graph/types.ts +1 -0
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
- package/src/components/editor/package-alert.tsx +4 -4
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +3 -5
- package/src/core/codemirror/misc/__tests__/paste.test.ts +18 -0
- package/src/core/codemirror/misc/paste.ts +14 -10
- package/src/plugins/impl/chat/ChatPlugin.tsx +2 -0
- package/src/plugins/impl/chat/chat-ui.tsx +10 -1
- package/src/plugins/impl/plotly/Plot.tsx +171 -0
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +5 -10
- package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +1 -0
- package/src/plugins/impl/plotly/__tests__/usePlotlyLayout.test.ts +2 -1
- package/src/plugins/impl/plotly/parse-from-template.ts +1 -0
- package/src/plugins/impl/plotly/usePlotlyLayout.ts +2 -1
- package/src/theme/ThemeProvider.tsx +2 -0
- package/dist/assets/channel-CdzZX-OR.js +0 -1
- package/dist/assets/chunk-55IACEB6-njZIr50E.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-CUlU7OLD.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-DAwrDtTO.js +0 -1
- package/dist/assets/dependency-graph-panel-Cbke_QgZ.js +0 -4
- package/dist/assets/dist-4mAhUzty.js +0 -1
- package/dist/assets/dist-5CXgzdUa.js +0 -1
- package/dist/assets/dist-B27MCO52.js +0 -1
- package/dist/assets/dist-Bc7uxGRW.js +0 -1
- package/dist/assets/dist-BtJZmWkg.js +0 -1
- package/dist/assets/dist-ByjGU_ag.js +0 -1
- package/dist/assets/dist-C-V6lvxH.js +0 -1
- package/dist/assets/dist-C6SivM7z.js +0 -1
- package/dist/assets/dist-C9k2RMmO.js +0 -1
- package/dist/assets/dist-ChS0Dc_R.js +0 -1
- package/dist/assets/dist-CtsanegT.js +0 -2
- package/dist/assets/dist-Cx8mOJOB.js +0 -1
- package/dist/assets/dist-DBwNzi3C.js +0 -13
- package/dist/assets/dist-DOZ8nmkC.js +0 -1
- package/dist/assets/dist-DUlOLsKi.js +0 -1
- package/dist/assets/dist-OlCHPNfN.js +0 -1
- package/dist/assets/dist-Z4EybR_c.js +0 -1
- package/dist/assets/dist-fO1a06Tp.js +0 -1
- package/dist/assets/dist-iXB2pOUD.js +0 -1
- package/dist/assets/dist-lTwzYaMX.js +0 -1
- package/dist/assets/dist-wS1s8MYb.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-DT577w6p.js +0 -1
- /package/dist/assets/{asterisk-B04IJwAt.js → asterisk-Cy-53Fu-.js} +0 -0
- /package/dist/assets/{chunk-76Q3JFCE-BAZ3z-Fu.js → chunk-76Q3JFCE-B261Xkae.js} +0 -0
- /package/dist/assets/{chunk-FWNWRKHM-DzIkWreD.js → chunk-FWNWRKHM-C0b0DIG0.js} +0 -0
- /package/dist/assets/{chunk-LBM3YZW2-BRBe7ZaP.js → chunk-LBM3YZW2-D3uTpSOd.js} +0 -0
- /package/dist/assets/{chunk-LHMN2FUI-C4onQD9F.js → chunk-LHMN2FUI-2FK1AIwU.js} +0 -0
- /package/dist/assets/{chunk-O7ZBX7Z2-CFqB9i7k.js → chunk-O7ZBX7Z2-DoE29Zoe.js} +0 -0
- /package/dist/assets/{chunk-S6J4BHB3-C4KwSfr_.js → chunk-S6J4BHB3-Cvr0itXK.js} +0 -0
- /package/dist/assets/{chunk-T53DSG4Q-Bhd043Cg.js → chunk-T53DSG4Q-C7bPrBIt.js} +0 -0
- /package/dist/assets/{chunk-XAJISQIX-0gvwv13B.js → chunk-XAJISQIX-TwS9jXHm.js} +0 -0
- /package/dist/assets/{common-keywords-D6ImdZX8.js → common-keywords-CU-S2Vqm.js} +0 -0
- /package/dist/assets/{cytoscape.esm-BauVghWH.js → cytoscape.esm-BihqZ2_-.js} +0 -0
- /package/dist/assets/{data-grid-overlay-editor-D8lE4fym.js → data-grid-overlay-editor-lP_r54zS.js} +0 -0
- /package/dist/assets/{dist-C1VXabOr.js → dist-DxxvVPQH.js} +0 -0
- /package/dist/assets/{dockerfile-BmwSYxi2.js → dockerfile-Cq6vOmt3.js} +0 -0
- /package/dist/assets/{duckdb-keywords-5i8us9ML.js → duckdb-keywords-CR9f4wu5.js} +0 -0
- /package/dist/assets/{ebnf--2SLsnbd.js → ebnf-BdwTqLUx.js} +0 -0
- /package/dist/assets/{fcl-CcJxrJDr.js → fcl-BFWIADMy.js} +0 -0
- /package/dist/assets/{http-BBXW5Cu0.js → http-CgzOAOXj.js} +0 -0
- /package/dist/assets/{mhchem-ICopO0mb.js → mhchem-CJmb5HsA.js} +0 -0
- /package/dist/assets/{nginx-CiiHaY6Q.js → nginx-CFpObAqg.js} +0 -0
- /package/dist/assets/{node-sql-parser-Bzh-sm1v.js → node-sql-parser-UQ9Ur_LP.js} +0 -0
- /package/dist/assets/{number-overlay-editor-Dylprn80.js → number-overlay-editor-CY6Dxl9c.js} +0 -0
- /package/dist/assets/{solr-DYYuHZ7Q.js → solr-BkyoAXqg.js} +0 -0
- /package/dist/assets/{spreadsheet-hVThRh5Z.js → spreadsheet-7FZkhkVo.js} +0 -0
- /package/dist/assets/{sql-DG1AJQLP.js → sql-BNnXxKXA.js} +0 -0
- /package/dist/assets/{src-CsZby044.js → src-CmKhyEBC.js} +0 -0
- /package/dist/assets/{tiddlywiki-Dc8c_QaF.js → tiddlywiki-DE5lnTl3.js} +0 -0
- /package/dist/assets/{tiki-CwGnGueS.js → tiki-Dt9oCY2i.js} +0 -0
- /package/dist/assets/{vega-component-D4L27L4Y.js → vega-component-BxXt5fsA.js} +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { Atom } from "jotai";
|
|
4
4
|
import { type Edge, MarkerType, type Node, type NodeProps } from "reactflow";
|
|
5
|
+
import { getNotebook } from "@/core/cells/cells";
|
|
5
6
|
import type { CellId } from "@/core/cells/ids";
|
|
6
7
|
import type { CellData } from "@/core/cells/types";
|
|
7
8
|
import { store } from "@/core/state/jotai";
|
|
@@ -29,6 +30,7 @@ interface ElementsBuilder {
|
|
|
29
30
|
cellAtoms: Atom<CellData>[],
|
|
30
31
|
variables: Variables,
|
|
31
32
|
hidePureMarkdown: boolean,
|
|
33
|
+
hideReusableFunctions: boolean,
|
|
32
34
|
) => { nodes: Node<NodeData>[]; edges: Edge[] };
|
|
33
35
|
}
|
|
34
36
|
|
|
@@ -76,6 +78,7 @@ export class VerticalElementsBuilder implements ElementsBuilder {
|
|
|
76
78
|
cellAtoms: Atom<CellData>[],
|
|
77
79
|
variables: Variables,
|
|
78
80
|
_hidePureMarkdown: boolean,
|
|
81
|
+
_hideReusableFunctions: boolean,
|
|
79
82
|
) {
|
|
80
83
|
let prevY = 0;
|
|
81
84
|
const nodes: Node<NodeData>[] = [];
|
|
@@ -143,6 +146,7 @@ export class TreeElementsBuilder implements ElementsBuilder {
|
|
|
143
146
|
cellAtoms: Atom<CellData>[],
|
|
144
147
|
variables: Variables,
|
|
145
148
|
hidePureMarkdown: boolean,
|
|
149
|
+
hideReusableFunctions: boolean,
|
|
146
150
|
) {
|
|
147
151
|
const nodes: Node<NodeData>[] = [];
|
|
148
152
|
const edges: Edge[] = [];
|
|
@@ -171,18 +175,25 @@ export class TreeElementsBuilder implements ElementsBuilder {
|
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
177
|
|
|
174
|
-
|
|
175
|
-
// Show every cell
|
|
176
|
-
if (!hidePureMarkdown) {
|
|
177
|
-
nodes.push(this.createNode(cellId, cellAtom));
|
|
178
|
-
}
|
|
178
|
+
const cellRuntime = getNotebook().cellRuntime;
|
|
179
179
|
|
|
180
|
+
for (const [cellId, cellAtom] of Arrays.zip(cellIds, cellAtoms)) {
|
|
181
|
+
const code = store.get(cellAtom).code.trim();
|
|
180
182
|
const hasEdge = nodesWithEdges.has(cellId);
|
|
181
|
-
const isMarkdown =
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
const isMarkdown = code.startsWith("mo.md");
|
|
184
|
+
const runtime = cellRuntime[cellId];
|
|
185
|
+
const isReusable = runtime?.serialization?.toLowerCase() === "valid";
|
|
186
|
+
|
|
187
|
+
// Apply filters
|
|
188
|
+
if (hidePureMarkdown && isMarkdown && !hasEdge) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (hideReusableFunctions && isReusable && !hasEdge) {
|
|
192
|
+
continue;
|
|
185
193
|
}
|
|
194
|
+
|
|
195
|
+
// Show every cell that wasn't filtered out
|
|
196
|
+
nodes.push(this.createNode(cellId, cellAtom));
|
|
186
197
|
}
|
|
187
198
|
|
|
188
199
|
return { nodes, edges };
|
|
@@ -43,7 +43,8 @@ export const GraphToolbar: React.FC<Props> = memo(
|
|
|
43
43
|
onSettingsChange({ ...settings, [key]: value });
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const
|
|
46
|
+
const markdownCheckboxId = useId();
|
|
47
|
+
const functionsCheckboxId = useId();
|
|
47
48
|
|
|
48
49
|
const settingsButton = (
|
|
49
50
|
<Popover>
|
|
@@ -54,16 +55,31 @@ export const GraphToolbar: React.FC<Props> = memo(
|
|
|
54
55
|
</PopoverTrigger>
|
|
55
56
|
<PopoverContent className="w-auto p-2 text-muted-foreground">
|
|
56
57
|
<div className="font-semibold pb-4">Settings</div>
|
|
57
|
-
<div className="flex
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
<div className="flex flex-col gap-2">
|
|
59
|
+
<div className="flex items-center gap-2">
|
|
60
|
+
<Checkbox
|
|
61
|
+
data-testid="hide-pure-markdown-checkbox"
|
|
62
|
+
id={markdownCheckboxId}
|
|
63
|
+
checked={settings.hidePureMarkdown}
|
|
64
|
+
onCheckedChange={(checked) =>
|
|
65
|
+
handleSettingChange("hidePureMarkdown", Boolean(checked))
|
|
66
|
+
}
|
|
67
|
+
/>
|
|
68
|
+
<Label htmlFor={markdownCheckboxId}>Hide pure markdown</Label>
|
|
69
|
+
</div>
|
|
70
|
+
<div className="flex items-center gap-2">
|
|
71
|
+
<Checkbox
|
|
72
|
+
data-testid="hide-reusable-functions-checkbox"
|
|
73
|
+
id={functionsCheckboxId}
|
|
74
|
+
checked={settings.hideReusableFunctions}
|
|
75
|
+
onCheckedChange={(checked) =>
|
|
76
|
+
handleSettingChange("hideReusableFunctions", Boolean(checked))
|
|
77
|
+
}
|
|
78
|
+
/>
|
|
79
|
+
<Label htmlFor={functionsCheckboxId}>
|
|
80
|
+
Hide reusable functions
|
|
81
|
+
</Label>
|
|
82
|
+
</div>
|
|
67
83
|
</div>
|
|
68
84
|
</PopoverContent>
|
|
69
85
|
</Popover>
|
|
@@ -226,6 +226,7 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
|
|
|
226
226
|
|
|
227
227
|
const helperResizeHandle = (
|
|
228
228
|
<PanelResizeHandle
|
|
229
|
+
disabled={!isSidebarOpen}
|
|
229
230
|
onDragging={handleDragging}
|
|
230
231
|
className={cn(
|
|
231
232
|
"border-border print:hidden z-10",
|
|
@@ -237,6 +238,7 @@ export const AppChrome: React.FC<PropsWithChildren> = ({ children }) => {
|
|
|
237
238
|
|
|
238
239
|
const panelResizeHandle = (
|
|
239
240
|
<PanelResizeHandle
|
|
241
|
+
disabled={!isDeveloperPanelOpen}
|
|
240
242
|
onDragging={handleDragging}
|
|
241
243
|
className={cn(
|
|
242
244
|
"border-border print:hidden z-20",
|
|
@@ -96,10 +96,10 @@ export const PackageAlert: React.FC = () => {
|
|
|
96
96
|
|
|
97
97
|
if (isMissingPackageAlert(packageAlert)) {
|
|
98
98
|
return (
|
|
99
|
-
<div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95 max-w-[600px]">
|
|
99
|
+
<div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95 max-w-[600px] pointer-events-none">
|
|
100
100
|
<Banner
|
|
101
101
|
kind="danger"
|
|
102
|
-
className="flex flex-col rounded py-3 px-5 animate-in slide-in-from-left overflow-auto max-h-[80vh] scrollbar-thin"
|
|
102
|
+
className="flex flex-col rounded py-3 px-5 animate-in slide-in-from-left overflow-auto max-h-[80vh] scrollbar-thin pointer-events-auto"
|
|
103
103
|
>
|
|
104
104
|
<div className="flex justify-between">
|
|
105
105
|
<span className="font-bold text-lg flex items-center mb-2">
|
|
@@ -207,10 +207,10 @@ export const PackageAlert: React.FC = () => {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
return (
|
|
210
|
-
<div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95 max-w-[600px] ">
|
|
210
|
+
<div className="flex flex-col gap-4 mb-5 fixed top-5 left-12 min-w-[400px] z-200 opacity-95 max-w-[600px] pointer-events-none">
|
|
211
211
|
<Banner
|
|
212
212
|
kind={status === "failed" ? "danger" : "info"}
|
|
213
|
-
className="flex flex-col rounded pt-3 pb-4 px-5 overflow-auto max-h-[80vh] scrollbar-thin"
|
|
213
|
+
className="flex flex-col rounded pt-3 pb-4 px-5 overflow-auto max-h-[80vh] scrollbar-thin pointer-events-auto"
|
|
214
214
|
>
|
|
215
215
|
<div className="flex justify-between">
|
|
216
216
|
<span className="font-bold text-lg flex items-center mb-2">
|
|
@@ -172,11 +172,9 @@ const VerticalLayoutRenderer: React.FC<VerticalLayoutProps> = ({
|
|
|
172
172
|
// spacing is handled elsewhere
|
|
173
173
|
return (
|
|
174
174
|
<VerticalLayoutWrapper invisible={invisible} appConfig={appConfig}>
|
|
175
|
-
{showCode && canShowCode
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
renderCells()
|
|
179
|
-
)}
|
|
175
|
+
<div className={cn("flex flex-col", showCode && canShowCode && "gap-5")}>
|
|
176
|
+
{renderCells()}
|
|
177
|
+
</div>
|
|
180
178
|
{mode === "read" && (
|
|
181
179
|
<ActionButtons
|
|
182
180
|
canShowCode={canShowCode}
|
|
@@ -140,6 +140,24 @@ def _(
|
|
|
140
140
|
expect(extractCells(input)).toEqual(["x = a + b + c"]);
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
+
it("preserves return statements inside nested functions", () => {
|
|
144
|
+
const input = `
|
|
145
|
+
@app.cell
|
|
146
|
+
def _(mo, px):
|
|
147
|
+
def make_fig():
|
|
148
|
+
data = {'category': ['foo', 'bar'], 'value': [10, 20]}
|
|
149
|
+
fig = px.bar(data, x='category', y='value')
|
|
150
|
+
return fig
|
|
151
|
+
|
|
152
|
+
fig = make_fig()
|
|
153
|
+
mo.ui.plotly(fig)
|
|
154
|
+
return
|
|
155
|
+
`;
|
|
156
|
+
expect(extractCells(input)).toEqual([
|
|
157
|
+
"def make_fig():\n data = {'category': ['foo', 'bar'], 'value': [10, 20]}\n fig = px.bar(data, x='category', y='value')\n return fig\n\nfig = make_fig()\nmo.ui.plotly(fig)",
|
|
158
|
+
]);
|
|
159
|
+
});
|
|
160
|
+
|
|
143
161
|
it("handles cells with config", () => {
|
|
144
162
|
const input = `
|
|
145
163
|
@app.cell(hide_code=True, column=2)
|
|
@@ -42,6 +42,7 @@ export function extractCells(text: string): string[] {
|
|
|
42
42
|
let inMultilineArgs = false;
|
|
43
43
|
let inMultilineReturn = false;
|
|
44
44
|
let parenCount = 0;
|
|
45
|
+
let cellBaseIndent: number | null = null;
|
|
45
46
|
|
|
46
47
|
// Pre-compile regex patterns
|
|
47
48
|
const leadingParenRegex = /\(/g;
|
|
@@ -55,19 +56,16 @@ export function extractCells(text: string): string[] {
|
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
function getIndent(line: string): number {
|
|
60
|
+
const match = line.match(/^\s*/);
|
|
61
|
+
return match ? match[0].length : 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
function finalizeCellIfNeeded() {
|
|
59
65
|
if (currentCell.length === 0) {
|
|
60
66
|
return;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
// Remove trailing returns
|
|
64
|
-
while (
|
|
65
|
-
currentCell.length > 0 &&
|
|
66
|
-
currentCell[currentCell.length - 1].trim().startsWith("return")
|
|
67
|
-
) {
|
|
68
|
-
currentCell.pop();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
69
|
// Only add non-empty cells
|
|
72
70
|
if (currentCell.some((l) => l.trim() !== "")) {
|
|
73
71
|
cells.push(dedent(currentCell.join("\n")));
|
|
@@ -88,6 +86,7 @@ export function extractCells(text: string): string[] {
|
|
|
88
86
|
finalizeCellIfNeeded();
|
|
89
87
|
inCell = true;
|
|
90
88
|
skipLines = 1; // Skip the def line
|
|
89
|
+
cellBaseIndent = null;
|
|
91
90
|
continue;
|
|
92
91
|
}
|
|
93
92
|
|
|
@@ -125,8 +124,13 @@ export function extractCells(text: string): string[] {
|
|
|
125
124
|
continue;
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
//
|
|
129
|
-
if (trimmed
|
|
127
|
+
// Detect base indentation of cell body from first content line
|
|
128
|
+
if (cellBaseIndent === null && trimmed) {
|
|
129
|
+
cellBaseIndent = getIndent(line);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Handle return statements — only strip cell-level returns
|
|
133
|
+
if (trimmed.startsWith("return") && getIndent(line) === cellBaseIndent) {
|
|
130
134
|
if (trimmed.includes("(") && !trimmed.endsWith(")")) {
|
|
131
135
|
inMultilineReturn = true;
|
|
132
136
|
parenCount = countParens(trimmed);
|
|
@@ -47,6 +47,7 @@ export const ChatPlugin = createPlugin<{ messages: UIMessage[] }>(
|
|
|
47
47
|
maxHeight: z.number().optional(),
|
|
48
48
|
config: configSchema,
|
|
49
49
|
allowAttachments: z.union([z.boolean(), z.string().array()]),
|
|
50
|
+
disabled: z.boolean().default(false),
|
|
50
51
|
}),
|
|
51
52
|
)
|
|
52
53
|
.withFunctions<PluginFunctions>({
|
|
@@ -76,6 +77,7 @@ export const ChatPlugin = createPlugin<{ messages: UIMessage[] }>(
|
|
|
76
77
|
showConfigurationControls={props.data.showConfigurationControls}
|
|
77
78
|
maxHeight={props.data.maxHeight}
|
|
78
79
|
allowAttachments={props.data.allowAttachments}
|
|
80
|
+
disabled={props.data.disabled}
|
|
79
81
|
config={props.data.config}
|
|
80
82
|
get_chat_history={props.functions.get_chat_history}
|
|
81
83
|
delete_chat_history={props.functions.delete_chat_history}
|
|
@@ -67,6 +67,7 @@ interface Props extends PluginFunctions {
|
|
|
67
67
|
showConfigurationControls: boolean;
|
|
68
68
|
maxHeight: number | undefined;
|
|
69
69
|
allowAttachments: boolean | string[];
|
|
70
|
+
disabled: boolean;
|
|
70
71
|
value: UIMessage[];
|
|
71
72
|
setValue: (messages: UIMessage[]) => void;
|
|
72
73
|
host: HTMLElement;
|
|
@@ -450,6 +451,9 @@ export const Chatbot: React.FC<Props> = (props) => {
|
|
|
450
451
|
<form
|
|
451
452
|
onSubmit={async (evt) => {
|
|
452
453
|
evt.preventDefault();
|
|
454
|
+
if (props.disabled) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
453
457
|
|
|
454
458
|
const fileParts = files
|
|
455
459
|
? await convertToFileUIPart(files)
|
|
@@ -462,7 +466,12 @@ export const Chatbot: React.FC<Props> = (props) => {
|
|
|
462
466
|
resetInput();
|
|
463
467
|
}}
|
|
464
468
|
ref={formRef}
|
|
465
|
-
|
|
469
|
+
// biome-ignore lint/a11y/useSemanticElements: inert is used to disable the entire form
|
|
470
|
+
inert={props.disabled || undefined}
|
|
471
|
+
className={cn(
|
|
472
|
+
"flex w-full border-t border-(--slate-6) px-2 py-1 items-center",
|
|
473
|
+
props.disabled && "opacity-50 cursor-not-allowed",
|
|
474
|
+
)}
|
|
466
475
|
>
|
|
467
476
|
{props.showConfigurationControls && (
|
|
468
477
|
<ConfigPopup config={config} onChange={setConfig} />
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import type * as PlotlyTypes from "plotly.js";
|
|
4
|
+
// Import the pre-built dist bundle, not the source entry point.
|
|
5
|
+
// The source entry point requires Node.js polyfills (e.g. `buffer/`)
|
|
6
|
+
// that are unavailable in the browser/bundler environment.
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
|
+
// @ts-expect-error — no type declarations for dist path, we use PlotlyTypes above
|
|
9
|
+
import Plotly from "plotly.js/dist/plotly";
|
|
10
|
+
import { useEffect, useRef } from "react";
|
|
11
|
+
|
|
12
|
+
// Plotly attaches `on` and `removeListener` to the DOM element at runtime.
|
|
13
|
+
// The @types/plotly.js PlotlyHTMLElement type includes `on` and `removeAllListeners`
|
|
14
|
+
// but not the per-handler `removeListener`. We extend the type to include it.
|
|
15
|
+
interface PlotlyElement extends PlotlyTypes.PlotlyHTMLElement {
|
|
16
|
+
removeListener(event: string, handler: (...args: never[]) => void): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface Figure {
|
|
20
|
+
data: PlotlyTypes.Data[];
|
|
21
|
+
layout: Partial<PlotlyTypes.Layout>;
|
|
22
|
+
frames: PlotlyTypes.Frame[] | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PlotProps {
|
|
26
|
+
data: PlotlyTypes.Data[];
|
|
27
|
+
layout: Partial<PlotlyTypes.Layout>;
|
|
28
|
+
frames?: PlotlyTypes.Frame[];
|
|
29
|
+
config?: Partial<PlotlyTypes.Config>;
|
|
30
|
+
className?: string;
|
|
31
|
+
style?: React.CSSProperties;
|
|
32
|
+
useResizeHandler?: boolean;
|
|
33
|
+
divId?: string;
|
|
34
|
+
onRelayout?: (event: PlotlyTypes.PlotRelayoutEvent) => void;
|
|
35
|
+
onRelayouting?: (event: PlotlyTypes.PlotRelayoutEvent) => void;
|
|
36
|
+
onSelected?: (event: PlotlyTypes.PlotSelectionEvent) => void;
|
|
37
|
+
onDeselect?: () => void;
|
|
38
|
+
onSunburstClick?: (event: PlotlyTypes.PlotMouseEvent) => void;
|
|
39
|
+
onTreemapClick?: (event: PlotlyTypes.PlotMouseEvent) => void;
|
|
40
|
+
onError?: (err: Error) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Plotly event name convention:
|
|
44
|
+
// - events are attached as `'plotly_' + name.toLowerCase()`
|
|
45
|
+
// - react props are `'on' + name`
|
|
46
|
+
const EVENT_NAMES = [
|
|
47
|
+
"Relayout",
|
|
48
|
+
"Relayouting",
|
|
49
|
+
"Selected",
|
|
50
|
+
"Deselect",
|
|
51
|
+
"SunburstClick",
|
|
52
|
+
"TreemapClick",
|
|
53
|
+
] as const;
|
|
54
|
+
|
|
55
|
+
type EventName = (typeof EVENT_NAMES)[number];
|
|
56
|
+
|
|
57
|
+
function propName(event: EventName): keyof PlotProps {
|
|
58
|
+
return `on${event}` as keyof PlotProps;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function plotlyEventName(event: EventName): string {
|
|
62
|
+
return `plotly_${event.toLowerCase()}`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const Plot = (props: PlotProps) => {
|
|
66
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
67
|
+
|
|
68
|
+
const {
|
|
69
|
+
data,
|
|
70
|
+
layout,
|
|
71
|
+
config,
|
|
72
|
+
frames,
|
|
73
|
+
className,
|
|
74
|
+
style,
|
|
75
|
+
useResizeHandler,
|
|
76
|
+
divId,
|
|
77
|
+
onError,
|
|
78
|
+
} = props;
|
|
79
|
+
|
|
80
|
+
// Render / update the plot
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const el = containerRef.current;
|
|
83
|
+
if (!el) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Plotly.react(el, data, layout, config)
|
|
88
|
+
.then(() => {
|
|
89
|
+
if (frames && frames.length > 0) {
|
|
90
|
+
return Plotly.addFrames(el as unknown as PlotlyTypes.Root, frames);
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
.catch((error: Error) => {
|
|
94
|
+
onError?.(error);
|
|
95
|
+
});
|
|
96
|
+
}, [data, layout, config, frames, onError]);
|
|
97
|
+
|
|
98
|
+
// Sync event handlers
|
|
99
|
+
useEffect(
|
|
100
|
+
() => {
|
|
101
|
+
const el = containerRef.current;
|
|
102
|
+
if (!el) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const plotlyEl = el as unknown as PlotlyElement;
|
|
107
|
+
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/ban-types -- Plotly's event API uses generic function references
|
|
109
|
+
const attached: {
|
|
110
|
+
plotlyName: string;
|
|
111
|
+
handler: (...args: never[]) => void;
|
|
112
|
+
}[] = [];
|
|
113
|
+
|
|
114
|
+
for (const name of EVENT_NAMES) {
|
|
115
|
+
const handler = props[propName(name)];
|
|
116
|
+
if (typeof handler === "function") {
|
|
117
|
+
const plotlyName = plotlyEventName(name);
|
|
118
|
+
plotlyEl.on(plotlyName as never, handler as never);
|
|
119
|
+
attached.push({
|
|
120
|
+
plotlyName,
|
|
121
|
+
handler: handler as (...args: never[]) => void,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return () => {
|
|
127
|
+
for (const { plotlyName, handler } of attached) {
|
|
128
|
+
plotlyEl.removeListener(plotlyName, handler as never);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// Re-sync whenever any event handler prop changes
|
|
132
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
133
|
+
},
|
|
134
|
+
EVENT_NAMES.map((name) => props[propName(name)]),
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
// Window resize handler
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (!useResizeHandler) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const el = containerRef.current;
|
|
144
|
+
if (!el) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const handler = () => {
|
|
149
|
+
Plotly.Plots.resize(el as unknown as PlotlyTypes.Root);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
window.addEventListener("resize", handler);
|
|
153
|
+
return () => {
|
|
154
|
+
window.removeEventListener("resize", handler);
|
|
155
|
+
};
|
|
156
|
+
}, [useResizeHandler]);
|
|
157
|
+
|
|
158
|
+
// Cleanup on unmount
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
const el = containerRef.current;
|
|
161
|
+
return () => {
|
|
162
|
+
if (el) {
|
|
163
|
+
Plotly.purge(el as unknown as PlotlyTypes.Root);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}, []);
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div id={divId} className={className} style={style} ref={containerRef} />
|
|
170
|
+
);
|
|
171
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
-
import type
|
|
3
|
+
import type * as Plotly from "plotly.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import type { IPlugin, IPluginProps, Setter } from "@/plugins/types";
|
|
6
6
|
import { Logger } from "@/utils/Logger";
|
|
7
|
+
import type { Figure } from "./Plot";
|
|
7
8
|
|
|
8
9
|
import "./plotly.css";
|
|
9
10
|
import "./mapbox.css";
|
|
@@ -70,13 +71,8 @@ interface PlotlyPluginProps extends Data {
|
|
|
70
71
|
host: HTMLElement;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
import("react-plotly.js").then((module) => {
|
|
76
|
-
return module.default as unknown as {
|
|
77
|
-
default: React.ComponentType<PlotParams>;
|
|
78
|
-
};
|
|
79
|
-
}),
|
|
74
|
+
const LazyPlot = lazy(() =>
|
|
75
|
+
import("./Plot").then((mod) => ({ default: mod.Plot })),
|
|
80
76
|
);
|
|
81
77
|
|
|
82
78
|
const SUNBURST_DATA_KEYS: (keyof Plotly.SunburstPlotDatum)[] = [
|
|
@@ -176,7 +172,6 @@ export const PlotlyComponent = memo(
|
|
|
176
172
|
};
|
|
177
173
|
});
|
|
178
174
|
})}
|
|
179
|
-
// @ts-expect-error We patched this prop here so it doesn't exist in the types
|
|
180
175
|
onTreemapClick={useEvent((evt: Readonly<Plotly.PlotMouseEvent>) => {
|
|
181
176
|
if (!evt) {
|
|
182
177
|
return;
|
|
@@ -215,7 +210,7 @@ export const PlotlyComponent = memo(
|
|
|
215
210
|
className="w-full"
|
|
216
211
|
useResizeHandler={true}
|
|
217
212
|
frames={figure.frames ?? undefined}
|
|
218
|
-
onError={useEvent((err) => {
|
|
213
|
+
onError={useEvent((err: Error) => {
|
|
219
214
|
Logger.error("PlotlyPlugin: ", err);
|
|
220
215
|
})}
|
|
221
216
|
/>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
-
import type
|
|
3
|
+
import type * as Plotly from "plotly.js";
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
|
+
import type { Figure } from "../Plot";
|
|
5
6
|
import {
|
|
6
7
|
computeLayoutOnFigureChange,
|
|
7
8
|
computeLayoutUpdate,
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { usePrevious } from "@uidotdev/usehooks";
|
|
4
4
|
import { isEqual, pick } from "lodash-es";
|
|
5
|
+
import type * as Plotly from "plotly.js";
|
|
5
6
|
import { useEffect, useState } from "react";
|
|
6
|
-
import type { Figure } from "react-plotly.js";
|
|
7
7
|
import { Objects } from "@/utils/objects";
|
|
8
|
+
import type { Figure } from "./Plot";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Keys that are preserved across figure updates when set by user interaction.
|
|
@@ -10,8 +10,10 @@ export const ThemeProvider: React.FC<PropsWithChildren> = memo(
|
|
|
10
10
|
const { theme } = useTheme();
|
|
11
11
|
useLayoutEffect(() => {
|
|
12
12
|
document.body.classList.add(theme, `${theme}-theme`);
|
|
13
|
+
document.body.dataset.theme = theme;
|
|
13
14
|
return () => {
|
|
14
15
|
document.body.classList.remove(theme, `${theme}-theme`);
|
|
16
|
+
delete document.body.dataset.theme;
|
|
15
17
|
};
|
|
16
18
|
}, [theme]);
|
|
17
19
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{et as r,tt as e}from"./chunk-ABZYJK2D-0jga8uiE.js";var o=(t,a)=>e.lang.round(r.parse(t)[a]);export{o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as r}from"./src-CvyFXpBy.js";import{n}from"./src-CsZby044.js";var a=n((e,o)=>{let t;return o==="sandbox"&&(t=r("#i"+e)),r(o==="sandbox"?t.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`)},"getDiagramElement");export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./purify.es-DZrAQFIu.js";import"./src-CvyFXpBy.js";import"./chunk-S3R3BYOJ-8loRaCFh.js";import{n as t}from"./src-CsZby044.js";import"./chunk-ABZYJK2D-0jga8uiE.js";import"./chunk-HN2XXSSU-Bdbi3Mns.js";import"./chunk-CVBHYZKI-DU48rJVu.js";import"./chunk-ATLVNIR6-B17dg7Ry.js";import"./dist-C1VXabOr.js";import"./chunk-JA3XYJ7Z-DOm8KfKa.js";import"./chunk-JZLCHNYA-48QVgmR4.js";import"./chunk-QXUST7PY-DkCIa8tJ.js";import"./chunk-N4CR4FBY-BNoQB557.js";import"./chunk-FMBD7UC4-CHJv683r.js";import"./chunk-55IACEB6-njZIr50E.js";import"./chunk-QN33PNHL-BOQncxfy.js";import{i,n as o,r as m,t as p}from"./chunk-B4BG7PRW-DoVbcCDm.js";var a={parser:o,get db(){return new p},renderer:m,styles:i,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./purify.es-DZrAQFIu.js";import"./src-CvyFXpBy.js";import"./chunk-S3R3BYOJ-8loRaCFh.js";import{n as t}from"./src-CsZby044.js";import"./chunk-ABZYJK2D-0jga8uiE.js";import"./chunk-HN2XXSSU-Bdbi3Mns.js";import"./chunk-CVBHYZKI-DU48rJVu.js";import"./chunk-ATLVNIR6-B17dg7Ry.js";import"./dist-C1VXabOr.js";import"./chunk-JA3XYJ7Z-DOm8KfKa.js";import"./chunk-JZLCHNYA-48QVgmR4.js";import"./chunk-QXUST7PY-DkCIa8tJ.js";import"./chunk-N4CR4FBY-BNoQB557.js";import"./chunk-FMBD7UC4-CHJv683r.js";import"./chunk-55IACEB6-njZIr50E.js";import"./chunk-QN33PNHL-BOQncxfy.js";import{i,n as o,r as m,t as p}from"./chunk-B4BG7PRW-DoVbcCDm.js";var a={parser:o,get db(){return new p},renderer:m,styles:i,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{a as diagram};
|