@marimo-team/frontend 0.19.10-dev5 → 0.19.10-dev9
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-BYjJCgaE.js} +1 -1
- package/dist/assets/{JsonOutput-PE5ko4gi.js → JsonOutput-CWXeFX63.js} +14 -14
- package/dist/assets/{MarimoErrorOutput-Lf9P8Fhl.js → MarimoErrorOutput-JyWZzx2m.js} +1 -1
- package/dist/assets/{react-plotly-kw5W3sN8.js → Plot-CN9AM0tY.js} +92 -92
- package/dist/assets/{RenderHTML-D-of_-s7.js → RenderHTML-CfzZdtCa.js} +1 -1
- package/dist/assets/{add-cell-with-ai-e_HMl7UU.js → add-cell-with-ai-kak40OU9.js} +1 -1
- package/dist/assets/{add-database-form-DvnhmpaG.js → add-database-form-CFtfw8CL.js} +1 -1
- package/dist/assets/{agent-panel-bOQya9ER.js → agent-panel-v3TnlrgF.js} +1 -1
- package/dist/assets/{ai-model-dropdown-Dk2SdB3C.js → ai-model-dropdown-BWLcucX9.js} +1 -1
- package/dist/assets/{app-config-button-DMsJtN9b.js → app-config-button-BZ_itkIb.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-QlfCJVx8.js} +1 -1
- package/dist/assets/{cell-link-B9b7J8QK.js → cell-link-CrgPSA5u.js} +1 -1
- package/dist/assets/{cells-DPp5cDaO.js → cells-B9Mw1aiY.js} +4 -4
- package/dist/assets/channel-C1Usuv02.js +1 -0
- package/dist/assets/{chat-display--jAB7huF.js → chat-display-dPv3uSbY.js} +1 -1
- package/dist/assets/{chat-panel-DzMwk8Wu.js → chat-panel-BH2bCr1s.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-JRDUZ_bG.js} +1 -1
- package/dist/assets/{command-2ElA5IkO.js → command-Ch5r6r1Z.js} +1 -1
- package/dist/assets/{command-palette-DrD2qhGV.js → command-palette-BtxKt_L8.js} +1 -1
- package/dist/assets/{common-DSlhalAu.js → common-Bpmeqynd.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-C-tSv_Wf.js} +1 -1
- package/dist/assets/{dependency-graph-panel-Cbke_QgZ.js → dependency-graph-panel-BDtbA3R5.js} +1 -1
- 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/{documentation-panel-BDQNa1xE.js → documentation-panel-DRZKFCxe.js} +1 -1
- package/dist/assets/{download-os8QlW6l.js → download-DcO8ZTeW.js} +1 -1
- package/dist/assets/{edit-page-Bx2U8f0j.js → edit-page-DFTXtpjP.js} +3 -3
- package/dist/assets/{erDiagram-Q2GNP2WA-CekwCx1v.js → erDiagram-Q2GNP2WA-DKwbR5cV.js} +1 -1
- package/dist/assets/{error-panel-B_234Lt3.js → error-panel-MncM7IO8.js} +1 -1
- package/dist/assets/{file-explorer-panel-T3oL7Bzx.js → file-explorer-panel-CIhpYw6d.js} +1 -1
- package/dist/assets/{floating-outline-BtdqbkUq.js → floating-outline-D7MmuvBX.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-BhCyaqwV.js → flowDiagram-NV44I4VS-uysyk7eQ.js} +1 -1
- package/dist/assets/{focus-C1YokgL7.js → focus-Cfq7Qx9L.js} +1 -1
- package/dist/assets/{form-BidPUZUn.js → form-D6wq0yzP.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-D08tPmbM.js} +1 -1
- package/dist/assets/{home-page-DUMF8ZY4.js → home-page-QeTbaVnU.js} +1 -1
- package/dist/assets/{hooks-BGeojgid.js → hooks-cYyUDg3L.js} +1 -1
- package/dist/assets/{html-to-image-CIQqSu-S.js → html-to-image-DTn-asee.js} +1 -1
- package/dist/assets/{index-CD6Gw4UH.js → index-jlWJTe49.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-DjIsTNjl.js} +1 -1
- package/dist/assets/{layout-_O8thjaV.js → layout-C7QMwOg5.js} +1 -1
- package/dist/assets/{logs-panel-C3cavnFO.js → logs-panel-DSlZEaRL.js} +1 -1
- package/dist/assets/{markdown-renderer-DJy8ww5d.js → markdown-renderer-bMEFR0Vj.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-DhrLOXrN.js} +1 -1
- package/dist/assets/{name-cell-input-Bc7geMVf.js → name-cell-input-to4l2uJD.js} +1 -1
- package/dist/assets/{outline-panel-Bxt_JABC.js → outline-panel-DKBT99sm.js} +1 -1
- package/dist/assets/{packages-panel-yEp7rAYf.js → packages-panel-SNt0KIcg.js} +1 -1
- package/dist/assets/{packet-BFZMPI3H-C_EwQwCX.js → packet-BFZMPI3H-CnHEXEVi.js} +1 -1
- package/dist/assets/{panels-DW8vF5Az.js → panels-CkoN1Cq9.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-CdFLcVbk.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-LF0diK_w.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-B7sRqeMN.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-SPOKVrq6.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-DotS45sN.js} +1 -1
- package/dist/assets/{snippets-panel-Bbk7MFBI.js → snippets-panel-tTRfQnC-.js} +1 -1
- package/dist/assets/{state-D4T75eZb.js → state-zfxByMml.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-CT0cCQMS.js} +1 -1
- package/dist/assets/{textarea-CRI7xDBj.js → textarea-e5AWinyy.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-BviqDXIW.js} +1 -1
- package/dist/assets/{tracing-panel-D6GhZuLA.js → tracing-panel-c7K0vhZ-.js} +2 -2
- package/dist/assets/{treemap-KMMF4GRG-CQXdJ2ER.js → treemap-KMMF4GRG-Bf9yeA5X.js} +1 -1
- package/dist/assets/{types-BRfQN3HL.js → types-BtZ02GBj.js} +1 -1
- package/dist/assets/{useAddCell-CmuX2hOk.js → useAddCell-CGoO3J0l.js} +1 -1
- package/dist/assets/{useCellActionButton-DUDHPTmq.js → useCellActionButton-fszU9atc.js} +1 -1
- package/dist/assets/{useDeleteCell-DdRX94yC.js → useDeleteCell-Du1ML1VC.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-CeDmKn0Z.js → useDependencyPanelTab-CU_8jikX.js} +1 -1
- package/dist/assets/{useNotebookActions-BFGSBiOA.js → useNotebookActions-DTWJT8eH.js} +1 -1
- package/dist/assets/{useRunCells-D2HBb4DB.js → useRunCells-CZG2blin.js} +1 -1
- package/dist/assets/{useSplitCell-C4khe6eU.js → useSplitCell-_kUqEKtd.js} +1 -1
- package/dist/assets/{utilities.esm-dm9SQStE.js → utilities.esm-JjvzgPvo.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-DtYN6-1-.js → xychartDiagram-PRI3JC2R-BhdCuImZ.js} +1 -1
- package/dist/index.html +30 -30
- package/package.json +2 -3
- 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/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/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/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/{dist-CEEqzIVj.js → dist-vTtrExIU.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
|
@@ -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.
|
|
@@ -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};
|
|
@@ -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-55IACEB6-njZIr50E.js";import"./chunk-QN33PNHL-BOQncxfy.js";import{i,n as o,r as m,t as p}from"./chunk-DI55MBZ5-rLpl7joX.js";var a={parser:o,get db(){return new p(2)},renderer:m,styles:i,init:t(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{a as diagram};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/{data-grid-overlay-editor-D8lE4fym.js → data-grid-overlay-editor-lP_r54zS.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/{number-overlay-editor-Dylprn80.js → number-overlay-editor-CY6Dxl9c.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|