@celljs/ta 4.15.0 → 4.15.1
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/cli.mjs +77 -3
- package/dist/pi/CHANGELOG.md +7 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-3d/README.en.md +11 -0
- package/dist/pi/packages/ta-3d/README.md +11 -0
- package/dist/pi/packages/ta-3d/extension/index.mjs +120 -0
- package/dist/pi/packages/ta-3d/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-3d/lib/extension.js +24 -0
- package/dist/pi/packages/ta-3d/lib/i18n.d.ts +19 -0
- package/dist/pi/packages/ta-3d/lib/i18n.js +50 -0
- package/dist/pi/packages/ta-3d/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-3d/lib/index.js +22 -0
- package/dist/pi/packages/ta-3d/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-3d/lib/react.js +8 -0
- package/dist/pi/packages/ta-3d/lib/scene-card.d.ts +4 -0
- package/dist/pi/packages/ta-3d/lib/scene-card.js +60 -0
- package/dist/pi/packages/ta-3d/lib/scene-prompt.d.ts +7 -0
- package/dist/pi/packages/ta-3d/lib/scene-prompt.js +15 -0
- package/dist/pi/packages/ta-3d/lib/scene-protocol.d.ts +5 -0
- package/dist/pi/packages/ta-3d/lib/scene-protocol.js +8 -0
- package/dist/pi/packages/ta-3d/lib/scene-spec.d.ts +59 -0
- package/dist/pi/packages/ta-3d/lib/scene-spec.js +141 -0
- package/dist/pi/packages/ta-3d/lib/scene-view.d.ts +57 -0
- package/dist/pi/packages/ta-3d/lib/scene-view.js +339 -0
- package/dist/pi/packages/ta-3d/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-3d/lib/style.js +33 -0
- package/dist/pi/packages/ta-3d/package.json +58 -0
- package/dist/pi/packages/ta-3d/web/index.js +660 -0
- package/dist/pi/packages/ta-agents/README.en.md +2 -2
- package/dist/pi/packages/ta-agents/README.md +2 -2
- package/dist/pi/packages/ta-agents/extension/index.mjs +198 -6
- package/dist/pi/packages/ta-agents/lib/acp-agent.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.js +20 -2
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +14 -5
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +13 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +29 -4
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +5 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +16 -4
- package/dist/pi/packages/ta-agents/lib/agent-session.js +34 -4
- package/dist/pi/packages/ta-agents/lib/agent-sign-in.d.ts +28 -0
- package/dist/pi/packages/ta-agents/lib/agent-sign-in.js +62 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.d.ts +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +40 -3
- package/dist/pi/packages/ta-agents/lib/extension.js +12 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +43 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +47 -0
- package/dist/pi/packages/ta-agents/package.json +1 -1
- package/dist/pi/packages/ta-bots/host/index.mjs +33 -4
- package/dist/pi/packages/ta-bots/lib/bot-service.d.ts +6 -0
- package/dist/pi/packages/ta-bots/lib/bot-service.js +27 -2
- package/dist/pi/packages/ta-bots/lib/bot-store.d.ts +8 -1
- package/dist/pi/packages/ta-bots/lib/bot-store.js +16 -2
- package/dist/pi/packages/ta-bots/lib/weixin-channel.js +3 -1
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-computer-use/package.json +1 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +4 -2
- package/dist/pi/packages/ta-cron/package.json +1 -1
- package/dist/pi/packages/ta-cron/web/index.js +8 -4
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-games/package.json +1 -1
- package/dist/pi/packages/ta-glance/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +1 -0
- package/dist/pi/packages/ta-glance/package.json +1 -1
- package/dist/pi/packages/ta-initiative/lib/inbox.js +47 -29
- package/dist/pi/packages/ta-initiative/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-initiative/lib/style.js +27 -14
- package/dist/pi/packages/ta-initiative/package.json +1 -1
- package/dist/pi/packages/ta-initiative/web/index.js +92 -50
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-moments/package.json +1 -1
- package/dist/pi/packages/ta-nearby/lib/page.js +1 -1
- package/dist/pi/packages/ta-nearby/package.json +1 -1
- package/dist/pi/packages/ta-nearby/web/index.js +3 -4
- package/dist/pi/packages/ta-notify/lib/settings.js +9 -2
- package/dist/pi/packages/ta-notify/package.json +1 -1
- package/dist/pi/packages/ta-notify/web/index.js +18 -6
- package/dist/pi/packages/ta-plot/README.en.md +12 -0
- package/dist/pi/packages/ta-plot/README.md +12 -0
- package/dist/pi/packages/ta-plot/extension/index.mjs +121 -0
- package/dist/pi/packages/ta-plot/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-plot/lib/extension.js +24 -0
- package/dist/pi/packages/ta-plot/lib/i18n.d.ts +14 -0
- package/dist/pi/packages/ta-plot/lib/i18n.js +30 -0
- package/dist/pi/packages/ta-plot/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-plot/lib/index.js +25 -0
- package/dist/pi/packages/ta-plot/lib/plot-expression.d.ts +16 -0
- package/dist/pi/packages/ta-plot/lib/plot-expression.js +209 -0
- package/dist/pi/packages/ta-plot/lib/plot-painter.d.ts +28 -0
- package/dist/pi/packages/ta-plot/lib/plot-painter.js +208 -0
- package/dist/pi/packages/ta-plot/lib/plot-prompt.d.ts +7 -0
- package/dist/pi/packages/ta-plot/lib/plot-prompt.js +16 -0
- package/dist/pi/packages/ta-plot/lib/plot-protocol.d.ts +7 -0
- package/dist/pi/packages/ta-plot/lib/plot-protocol.js +10 -0
- package/dist/pi/packages/ta-plot/lib/plot-scene.d.ts +65 -0
- package/dist/pi/packages/ta-plot/lib/plot-scene.js +427 -0
- package/dist/pi/packages/ta-plot/lib/plot-spec.d.ts +86 -0
- package/dist/pi/packages/ta-plot/lib/plot-spec.js +165 -0
- package/dist/pi/packages/ta-plot/lib/plot-view.d.ts +4 -0
- package/dist/pi/packages/ta-plot/lib/plot-view.js +205 -0
- package/dist/pi/packages/ta-plot/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-plot/lib/react.js +8 -0
- package/dist/pi/packages/ta-plot/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-plot/lib/style.js +47 -0
- package/dist/pi/packages/ta-plot/package.json +57 -0
- package/dist/pi/packages/ta-plot/web/index.js +1320 -0
- package/dist/pi/packages/ta-recall/package.json +1 -1
- package/dist/pi/packages/ta-rooms/lib/doubles-view.js +8 -1
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-rooms/lib/style.js +1 -0
- package/dist/pi/packages/ta-rooms/package.json +1 -1
- package/dist/pi/packages/ta-rooms/web/index.js +17 -5
- package/dist/pi/packages/ta-share/lib/share-dialog.js +3 -1
- package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-share/lib/style.js +1 -0
- package/dist/pi/packages/ta-share/package.json +1 -1
- package/dist/pi/packages/ta-share/web/index.js +6 -2
- package/dist/pi/packages/ta-sync/lib/panel.js +4 -1
- package/dist/pi/packages/ta-sync/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-sync/lib/style.js +1 -0
- package/dist/pi/packages/ta-sync/package.json +1 -1
- package/dist/pi/packages/ta-sync/web/index.js +9 -3
- package/dist/pi/packages/ta-sync-cloud/package.json +1 -1
- package/dist/pi/packages/ta-team/lib/dialogs.js +6 -3
- package/dist/pi/packages/ta-team/package.json +1 -1
- package/dist/pi/packages/ta-team/web/index.js +11 -6
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-sclOP11q.js → abnfDiagram-S7VZAUFO-CD8CaArq.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-Bitg4Dpy.js → architecture-WOLXFQ4H-f2a9bodL.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-Hc0W5khF.js → architectureDiagram-YGSQEFNW-BCWH9CwO.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-D2ZWatLV.js → blockDiagram-APKKGZFW-fUamQMeJ.js} +1 -1
- package/dist/public/assets/{browser-D-etIMuL.js → browser-CrMa174j.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CWEcyfwV.js → c4Diagram-KJ2TOQU5-CkLtnwp1.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-CWbrJHxK.js → chunk-6MUBBAK2-cwcGPuAH.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-DJQdD4iX.js → chunk-AXFCVDMN-DNkmkYfC.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-CYiiJcBj.js → chunk-BG4553SI-C8qbbr2Z.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-NrNC1UeX.js → chunk-DQASFODM-C-PJ2CrJ.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-BIHXOwS2.js → chunk-HFQBQIA3-BYcgxNEL.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-CcU_AFwQ.js → chunk-KQLB2F66-BTDNzrRl.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-DGfNbbcL.js → chunk-KS47KZWR-1sGg1pKP.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-B4PSS_Pp.js → chunk-LEVMRMFU-7lAsFwHT.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-1555_mm4.js → chunk-M57EVK23-C8K-ltig.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-zbNEbYJ8.js → chunk-OY52VR5R-CBe1QL_V.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-C-nNDGuN.js → chunk-QB3YPZ4I-COhYyyE_.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-DcXXuhbl.js → chunk-R3KSYZAL-CREAgaSS.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-Bb77QkUj.js → chunk-STOXU5M4-CTl0P8_C.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-D8IJkNq5.js → chunk-TU62E6Q5-B_GG7baF.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BzejexgB.js → chunk-X4PVCEUW-CDrSpVOj.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-D2GPHyll.js → chunk-XXDRQBXY-sKeiDEnC.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-CUEzxxI8.js → classDiagram-v2-L25IHNXF-Cqo1O5FQ.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-CJdgJyUw.js → cose-bilkent-JH36ORCC-CTSKeRBe.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-CP12ndt7.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-D0F_9jN8.js → cynefinDiagram-L36ESFBY-67xEPyP9.js} +1 -1
- package/dist/public/assets/{d3-selection-BoARy1rP.js → d3-selection-BUiX-3qh.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-CzI5gZOv.js → dagre-SPEB5RXH-DDw-u3Kg.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-BCtNcE7M.js → diagram-3B7GL73J-BBFInaCs.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-DV9U4KeH.js → diagram-DNEMPZML-ZdnFKM7-.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-DHU45Sd4.js → diagram-L3MUGCDN-CPb04hOv.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-Ba5oVP56.js → diagram-LA4NIPWU-P9wHFGDS.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-B1Nk6qet.js → diagram-MHCOC4E2-Ce_Cr-t6.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-DFwA3q09.js → diagram-XPFHEONP-CfS34OHW.js} +1 -1
- package/dist/public/assets/{dist-Col1xVDT.js → dist-6pZqZEaM.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-BuBgxBJ2.js → ebnfDiagram-UZSYDL2S-BkHabCn2.js} +1 -1
- package/dist/public/assets/{editor.api-BLlyFz5x.js → editor.api-CO4Q0NKb.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-BPEI--zX.js → elk-XV6XMXQE-JpreOVeR.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-Cci0kYUw.js → erDiagram-EYBAPDEH-DDFJwzHx.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-B0eT5X1_.js → eventmodeling-K75KTNOO-DsnkF6Zc.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Djxeacjw.js +1 -0
- package/dist/public/assets/{freemarker2-CAZGFA3W.js → freemarker2-Cm4NK652.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-DEm85e1I.js → ganttDiagram-23REXITY-C7eedoYb.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-qlWN7ijl.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-DJAZD2LR.js → gitGraphDiagram-STJD7YCW-Cuh3ih-z.js} +1 -1
- package/dist/public/assets/{handlebars-Agkl4nGr.js → handlebars-BnE51DUi.js} +1 -1
- package/dist/public/assets/{html-Cu-CsqZI.js → html-7koekDfa.js} +1 -1
- package/dist/public/assets/{index-TeLHaE4u.js → index-CQG1XddL.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-jN69V28z.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-4zHsBnIy.js → infoDiagram-KBXO4MBG-BY3iq7I8.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-Bg8OYLGr.js → ishikawaDiagram-M35NCXHK-COjlz24y.js} +1 -1
- package/dist/public/assets/{javascript-BdMDRX8l.js → javascript-BUZgUhdn.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-B2xtzmpE.js → journeyDiagram-OPLOXDXO-DReJE04Q.js} +1 -1
- package/dist/public/assets/{jsonMode-Dg92qQvX.js → jsonMode-qPeVDBDp.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-DQ4N7t_w.js → kanban-definition-BZKZHSQY-BB0_ePvg.js} +1 -1
- package/dist/public/assets/{liquid-BydEnYkh.js → liquid-CNKL9dLX.js} +1 -1
- package/dist/public/assets/{mdx-XZXeM7ll.js → mdx-D1_UzrBc.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-H24--uw9.js → mermaid-parser.core-DiE3z_tV.js} +3 -3
- package/dist/public/assets/{mermaid.core-BmCrSjUU.js → mermaid.core-CBCRrLdl.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-CGQXKItp.js → mindmap-definition-I2QAS2VK-D-Y5fKl1.js} +1 -1
- package/dist/public/assets/module-BEbKICB1.js +2475 -0
- package/dist/public/assets/module-Egyx6Otv.js +1 -0
- package/dist/public/assets/{monaco-DP8M_Ttp.js → monaco--czRbHhk.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-Cl8QuXQJ.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CXKRGFUs.js → pegDiagram-FD4XPPHP-1jx5jc73.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-kVGJsGZe.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-9XEDP1wR.js → pieDiagram-J4AKIIQI-DGv_WCCu.js} +1 -1
- package/dist/public/assets/{python-C-0PA82u.js → python-DNZu5LjV.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-C-uxTp-5.js → quadrantDiagram-XTYBLID2-BgY0lf8V.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-Dw71L-n8.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-DkaUvI4_.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-CTft_ST0.js → railroad-abnf-LNEFI6M7-tZ7rJxwM.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-DfRJhL7G.js → railroad-ebnf-DWYD2UWJ-JO6n_1TK.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-DFePx4YD.js → railroad-peg-JR7BVNR7-Bf0PG2YJ.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-BmK1KUsT.js → railroadDiagram-MRQ6NCDL-BMjog84X.js} +1 -1
- package/dist/public/assets/{razor-DEKNSiT7.js → razor-DU-x8qSP.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-Ds27pS9Y.js → requirementDiagram-Y7LWUY3S-CktbbWjr.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-e2OTzBma.js → sankeyDiagram-WGJFYUXA-CQonOre7.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-BcoIpxF6.js → sequenceDiagram-5NDRBG5M-CAe8-JvA.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-CNr67mC9.js → stateDiagram-v2-FJ4FJNEA-BrkqOuRm.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-DKPgHCev.js → swimlanes-UMQ2AFYF-sLpgHBKo.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-amBdr5Wc.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-BcCmuE6C.js → timeline-definition-SEUHKTQE-CHE0x-WN.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-DKLyFqZk.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-CRG6ogj8.js +1 -0
- package/dist/public/assets/{typescript-B1Uk3m6A.js → typescript-BrNT2oWW.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-BpCD8dP7.js → usecaseDiagram-AFA6YXN4-DwkFRI5R.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-CQjX5_-8.js → vennDiagram-NNMJR3RB-BquQVmJq.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-D2jQfflX.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-D7gYo9fV.js → wardleyDiagram-S7YFUSEH-sNYFUfMe.js} +1 -1
- package/dist/public/assets/{xml-DBh_LekU.js → xml-BY65QKv7.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-B_1aOZKU.js → xychartDiagram-GGNKY7IX-CnWEYuid.js} +1 -1
- package/dist/public/assets/{yaml-BE55tHva.js → yaml-BMovUwzO.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +1959 -466
- package/package.json +39 -37
- package/dist/public/assets/cynefin-EF2NZ3EQ-DBnkPRHn.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-CmMdmAxj.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-DKo3OVhR.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-tKl26QqM.js +0 -1
- package/dist/public/assets/module-1mERtQ0Z.js +0 -1
- package/dist/public/assets/module-BxIQdJqY.js +0 -2449
- package/dist/public/assets/packet-JDAUHWVQ-CnBx3hR7.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-hogxgeR2.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-CdWiN8Cw.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DnYOBI5V.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-U0uzjboz.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-4ppY0Rs5.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-CAvLAs7q.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-D_F3qmRJ.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = activate;
|
|
4
|
+
const plot_protocol_1 = require("./plot-protocol");
|
|
5
|
+
const plot_view_1 = require("./plot-view");
|
|
6
|
+
const react_1 = require("./react");
|
|
7
|
+
const style_1 = require("./style");
|
|
8
|
+
/**
|
|
9
|
+
* The page side of Function plot: a `ta-plot` block of a reply drawn as an animated plot. The pi extension
|
|
10
|
+
* (extension.ts) tells the model to write such a block for functions and curves.
|
|
11
|
+
*/
|
|
12
|
+
function activate(pi) {
|
|
13
|
+
(0, react_1.bind)(pi.React);
|
|
14
|
+
// An older app shows the block as code.
|
|
15
|
+
if (!pi.registerCodeRenderer) {
|
|
16
|
+
return () => undefined;
|
|
17
|
+
}
|
|
18
|
+
const removeStyle = (0, style_1.injectStyle)();
|
|
19
|
+
const view = (0, plot_view_1.plotView)(pi);
|
|
20
|
+
for (const language of [plot_protocol_1.LANGUAGE, ...plot_protocol_1.ALIASES]) {
|
|
21
|
+
pi.registerCodeRenderer(language, view);
|
|
22
|
+
}
|
|
23
|
+
return removeStyle;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The value of an expression for the values of its variables, in the order they were named. */
|
|
2
|
+
export type PlotEvaluate = (scope: readonly number[]) => number;
|
|
3
|
+
/**
|
|
4
|
+
* The expressions of a plot: numbers, + - * / % ^ (or **), parentheses, the variables named and the functions and
|
|
5
|
+
* constants of Math. Parsed here, never run as code, so that a block of a reply can do nothing but compute.
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace PlotExpression {
|
|
8
|
+
interface Compiled {
|
|
9
|
+
evaluate: PlotEvaluate;
|
|
10
|
+
/** The variables it reads. */
|
|
11
|
+
uses: ReadonlySet<string>;
|
|
12
|
+
}
|
|
13
|
+
/** Throws an Error that says what is wrong for an expression it cannot read. */
|
|
14
|
+
function compile(text: string | number, names: readonly string[]): Compiled;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=plot-expression.d.ts.map
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlotExpression = void 0;
|
|
4
|
+
/** Functions of Math an expression may call, with how many arguments each takes (`undefined`: one or more). */
|
|
5
|
+
const FUNCTIONS = new Map(Object.entries({
|
|
6
|
+
sin: [Math.sin, 1],
|
|
7
|
+
cos: [Math.cos, 1],
|
|
8
|
+
tan: [Math.tan, 1],
|
|
9
|
+
asin: [Math.asin, 1],
|
|
10
|
+
acos: [Math.acos, 1],
|
|
11
|
+
atan: [Math.atan, 1],
|
|
12
|
+
atan2: [Math.atan2, 2],
|
|
13
|
+
sinh: [Math.sinh, 1],
|
|
14
|
+
cosh: [Math.cosh, 1],
|
|
15
|
+
tanh: [Math.tanh, 1],
|
|
16
|
+
asinh: [Math.asinh, 1],
|
|
17
|
+
acosh: [Math.acosh, 1],
|
|
18
|
+
atanh: [Math.atanh, 1],
|
|
19
|
+
sqrt: [Math.sqrt, 1],
|
|
20
|
+
cbrt: [Math.cbrt, 1],
|
|
21
|
+
abs: [Math.abs, 1],
|
|
22
|
+
exp: [Math.exp, 1],
|
|
23
|
+
log: [Math.log, 1],
|
|
24
|
+
ln: [Math.log, 1],
|
|
25
|
+
log2: [Math.log2, 1],
|
|
26
|
+
log10: [Math.log10, 1],
|
|
27
|
+
pow: [Math.pow, 2],
|
|
28
|
+
min: [Math.min, undefined],
|
|
29
|
+
max: [Math.max, undefined],
|
|
30
|
+
floor: [Math.floor, 1],
|
|
31
|
+
ceil: [Math.ceil, 1],
|
|
32
|
+
round: [Math.round, 1],
|
|
33
|
+
sign: [Math.sign, 1],
|
|
34
|
+
hypot: [Math.hypot, undefined],
|
|
35
|
+
}));
|
|
36
|
+
const CONSTANTS = new Map(Object.entries({ pi: Math.PI, PI: Math.PI, e: Math.E, E: Math.E }));
|
|
37
|
+
/** A number, a name or an operator, after any space. */
|
|
38
|
+
const TOKEN = /\s*(?:(\d+(?:\.\d*)?(?:[eE][+-]?\d+)?|\.\d+(?:[eE][+-]?\d+)?)|([A-Za-z_]\w*)|(\*\*|[-+*/%^(),]))/y;
|
|
39
|
+
/** Longer than any expression of a plot; a longer one is refused rather than parsed. */
|
|
40
|
+
const MAX_LENGTH = 2000;
|
|
41
|
+
/**
|
|
42
|
+
* The expressions of a plot: numbers, + - * / % ^ (or **), parentheses, the variables named and the functions and
|
|
43
|
+
* constants of Math. Parsed here, never run as code, so that a block of a reply can do nothing but compute.
|
|
44
|
+
*/
|
|
45
|
+
var PlotExpression;
|
|
46
|
+
(function (PlotExpression) {
|
|
47
|
+
/** Throws an Error that says what is wrong for an expression it cannot read. */
|
|
48
|
+
function compile(text, names) {
|
|
49
|
+
return new PlotParser(String(text), names).parse();
|
|
50
|
+
}
|
|
51
|
+
PlotExpression.compile = compile;
|
|
52
|
+
})(PlotExpression || (exports.PlotExpression = PlotExpression = {}));
|
|
53
|
+
class PlotParser {
|
|
54
|
+
constructor(text, names) {
|
|
55
|
+
this.text = text;
|
|
56
|
+
this.names = names;
|
|
57
|
+
this.at = 0;
|
|
58
|
+
this.uses = new Set();
|
|
59
|
+
this.tokens = PlotParser.tokenize(text);
|
|
60
|
+
}
|
|
61
|
+
parse() {
|
|
62
|
+
const evaluate = this.sum();
|
|
63
|
+
if (this.at < this.tokens.length) {
|
|
64
|
+
throw this.unexpected();
|
|
65
|
+
}
|
|
66
|
+
return { evaluate, uses: this.uses };
|
|
67
|
+
}
|
|
68
|
+
sum() {
|
|
69
|
+
let left = this.product();
|
|
70
|
+
for (let operator = this.operator('+', '-'); operator; operator = this.operator('+', '-')) {
|
|
71
|
+
const a = left;
|
|
72
|
+
const b = this.product();
|
|
73
|
+
left = operator === '+' ? scope => a(scope) + b(scope) : scope => a(scope) - b(scope);
|
|
74
|
+
}
|
|
75
|
+
return left;
|
|
76
|
+
}
|
|
77
|
+
product() {
|
|
78
|
+
let left = this.unary();
|
|
79
|
+
for (let operator = this.operator('*', '/', '%'); operator; operator = this.operator('*', '/', '%')) {
|
|
80
|
+
const a = left;
|
|
81
|
+
const b = this.unary();
|
|
82
|
+
left = operator === '*' ? scope => a(scope) * b(scope) : operator === '/' ? scope => a(scope) / b(scope) : scope => a(scope) % b(scope);
|
|
83
|
+
}
|
|
84
|
+
return left;
|
|
85
|
+
}
|
|
86
|
+
/** A sign binds looser than a power: -x^2 is -(x^2). */
|
|
87
|
+
unary() {
|
|
88
|
+
const sign = this.operator('-', '+');
|
|
89
|
+
if (sign) {
|
|
90
|
+
const value = this.unary();
|
|
91
|
+
return sign === '-' ? scope => -value(scope) : value;
|
|
92
|
+
}
|
|
93
|
+
return this.power();
|
|
94
|
+
}
|
|
95
|
+
/** Right to left: 2^3^2 is 2^(3^2). */
|
|
96
|
+
power() {
|
|
97
|
+
const base = this.primary();
|
|
98
|
+
if (this.operator('^', '**')) {
|
|
99
|
+
const exponent = this.unary();
|
|
100
|
+
return scope => base(scope) ** exponent(scope);
|
|
101
|
+
}
|
|
102
|
+
return base;
|
|
103
|
+
}
|
|
104
|
+
primary() {
|
|
105
|
+
const token = this.tokens[this.at++];
|
|
106
|
+
if (!token) {
|
|
107
|
+
throw new Error(`Unfinished expression: ${this.text}`);
|
|
108
|
+
}
|
|
109
|
+
if (token.kind === 'number') {
|
|
110
|
+
const value = token.value;
|
|
111
|
+
return () => value;
|
|
112
|
+
}
|
|
113
|
+
if (token.kind === 'operator') {
|
|
114
|
+
if (token.value !== '(') {
|
|
115
|
+
this.at--;
|
|
116
|
+
throw this.unexpected();
|
|
117
|
+
}
|
|
118
|
+
const inner = this.sum();
|
|
119
|
+
this.expect(')');
|
|
120
|
+
return inner;
|
|
121
|
+
}
|
|
122
|
+
return this.operator('(') ? this.call(token.value) : this.variable(token.value);
|
|
123
|
+
}
|
|
124
|
+
variable(name) {
|
|
125
|
+
const index = this.names.indexOf(name);
|
|
126
|
+
if (index >= 0) {
|
|
127
|
+
this.uses.add(name);
|
|
128
|
+
return scope => scope[index];
|
|
129
|
+
}
|
|
130
|
+
const constant = CONSTANTS.get(name);
|
|
131
|
+
if (constant !== undefined) {
|
|
132
|
+
const value = constant;
|
|
133
|
+
return () => value;
|
|
134
|
+
}
|
|
135
|
+
throw new Error(`Unknown name: ${name}`);
|
|
136
|
+
}
|
|
137
|
+
call(name) {
|
|
138
|
+
const known = FUNCTIONS.get(name);
|
|
139
|
+
if (!known) {
|
|
140
|
+
throw new Error(`Unknown function: ${name}`);
|
|
141
|
+
}
|
|
142
|
+
const [fn, arity] = known;
|
|
143
|
+
const args = [this.sum()];
|
|
144
|
+
while (this.operator(',')) {
|
|
145
|
+
args.push(this.sum());
|
|
146
|
+
}
|
|
147
|
+
this.expect(')');
|
|
148
|
+
if (arity !== undefined && args.length !== arity) {
|
|
149
|
+
throw new Error(`${name} takes ${arity} argument${arity === 1 ? '' : 's'}`);
|
|
150
|
+
}
|
|
151
|
+
if (args.length === 1) {
|
|
152
|
+
const [a] = args;
|
|
153
|
+
return scope => fn(a(scope));
|
|
154
|
+
}
|
|
155
|
+
if (args.length === 2) {
|
|
156
|
+
const [a, b] = args;
|
|
157
|
+
return scope => fn(a(scope), b(scope));
|
|
158
|
+
}
|
|
159
|
+
return scope => fn(...args.map(arg => arg(scope)));
|
|
160
|
+
}
|
|
161
|
+
/** The next token, taken, when it is one of `operators`. */
|
|
162
|
+
operator(...operators) {
|
|
163
|
+
const token = this.tokens[this.at];
|
|
164
|
+
if ((token === null || token === void 0 ? void 0 : token.kind) === 'operator' && operators.includes(token.value)) {
|
|
165
|
+
this.at++;
|
|
166
|
+
return token.value;
|
|
167
|
+
}
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
expect(operator) {
|
|
171
|
+
if (!this.operator(operator)) {
|
|
172
|
+
throw this.unexpected(operator);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
unexpected(expected) {
|
|
176
|
+
const token = this.tokens[this.at];
|
|
177
|
+
const found = token ? `"${token.value}"` : 'the end';
|
|
178
|
+
return new Error(`${expected ? `Expected "${expected}" but found` : 'Unexpected'} ${found} in: ${this.text}`);
|
|
179
|
+
}
|
|
180
|
+
static tokenize(text) {
|
|
181
|
+
if (text.length > MAX_LENGTH) {
|
|
182
|
+
throw new Error('Expression too long');
|
|
183
|
+
}
|
|
184
|
+
const tokens = [];
|
|
185
|
+
let at = 0;
|
|
186
|
+
while (at < text.length) {
|
|
187
|
+
TOKEN.lastIndex = at;
|
|
188
|
+
const match = TOKEN.exec(text);
|
|
189
|
+
if (!match) {
|
|
190
|
+
if (!text.slice(at).trim()) {
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
throw new Error(`Unsupported character "${text.slice(at).trim()[0]}" in: ${text}`);
|
|
194
|
+
}
|
|
195
|
+
at = TOKEN.lastIndex;
|
|
196
|
+
if (match[1] !== undefined) {
|
|
197
|
+
tokens.push({ kind: 'number', value: Number(match[1]) });
|
|
198
|
+
}
|
|
199
|
+
else if (match[2] !== undefined) {
|
|
200
|
+
tokens.push({ kind: 'name', value: match[2] });
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
tokens.push({ kind: 'operator', value: match[3] });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return tokens;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=plot-expression.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Plot, type PlotCurve } from './plot-spec';
|
|
2
|
+
/** Seconds a curve takes to draw in, and the delay between curves. */
|
|
3
|
+
export declare const DRAW_IN = 1.1;
|
|
4
|
+
export declare const STAGGER = 0.25;
|
|
5
|
+
/** The color of the text of the page, at an alpha. */
|
|
6
|
+
export type PlotInk = (alpha: number) => string;
|
|
7
|
+
/** Draws a plot on a canvas, a frame at a time. */
|
|
8
|
+
export declare class PlotPainter {
|
|
9
|
+
protected readonly context: CanvasRenderingContext2D;
|
|
10
|
+
protected readonly plot: Plot;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
ink: PlotInk;
|
|
14
|
+
constructor(context: CanvasRenderingContext2D, plot: Plot);
|
|
15
|
+
/** Seconds from when it is shown until every curve is drawn in and the points shown. */
|
|
16
|
+
get intro(): number;
|
|
17
|
+
/** Draws the frame at t seconds since shown, the sliders where the user put them; returns the values of the params. */
|
|
18
|
+
paint(t: number, sliders: readonly (number | undefined)[]): number[];
|
|
19
|
+
protected x(x: number): number;
|
|
20
|
+
protected y(y: number): number;
|
|
21
|
+
protected grid(): void;
|
|
22
|
+
/** A curve, drawn in up to `eased` of its range; `faint` (an alpha) for one of a family. */
|
|
23
|
+
protected stroke(curve: PlotCurve, values: readonly number[], t: number, eased: number, faint: number): void;
|
|
24
|
+
protected dot(curve: PlotCurve, values: readonly number[], t: number, index: number): void;
|
|
25
|
+
/** The points fade in once the curves are drawn. */
|
|
26
|
+
protected points(values: readonly number[], t: number): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=plot-painter.d.ts.map
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlotPainter = exports.STAGGER = exports.DRAW_IN = void 0;
|
|
4
|
+
const plot_spec_1 = require("./plot-spec");
|
|
5
|
+
/** Seconds a curve takes to draw in, and the delay between curves. */
|
|
6
|
+
exports.DRAW_IN = 1.1;
|
|
7
|
+
exports.STAGGER = 0.25;
|
|
8
|
+
const SAMPLES = 480;
|
|
9
|
+
/** Draws a plot on a canvas, a frame at a time. */
|
|
10
|
+
class PlotPainter {
|
|
11
|
+
constructor(context, plot) {
|
|
12
|
+
this.context = context;
|
|
13
|
+
this.plot = plot;
|
|
14
|
+
this.width = 0;
|
|
15
|
+
this.height = 0;
|
|
16
|
+
this.ink = alpha => `rgba(128,128,128,${alpha})`;
|
|
17
|
+
}
|
|
18
|
+
/** Seconds from when it is shown until every curve is drawn in and the points shown. */
|
|
19
|
+
get intro() {
|
|
20
|
+
return this.plot.curves.length * exports.STAGGER + exports.DRAW_IN + 0.6;
|
|
21
|
+
}
|
|
22
|
+
/** Draws the frame at t seconds since shown, the sliders where the user put them; returns the values of the params. */
|
|
23
|
+
paint(t, sliders) {
|
|
24
|
+
const { context, plot, width, height } = this;
|
|
25
|
+
const values = plot_spec_1.PlotSpec.values(plot, t, sliders);
|
|
26
|
+
context.clearRect(0, 0, width, height);
|
|
27
|
+
context.font = '11px system-ui, sans-serif';
|
|
28
|
+
this.grid();
|
|
29
|
+
plot.curves.forEach((curve, index) => {
|
|
30
|
+
const shown = Math.min(Math.max((t - index * exports.STAGGER) / exports.DRAW_IN, 0), 1);
|
|
31
|
+
if (shown <= 0) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const eased = 1 - (1 - shown) ** 3;
|
|
35
|
+
if (curve.family) {
|
|
36
|
+
const { index: param, count } = curve.family;
|
|
37
|
+
const slider = plot.params[param].slider;
|
|
38
|
+
for (let k = 0; k < count; k++) {
|
|
39
|
+
const others = sliders.slice();
|
|
40
|
+
others[param] = slider.min + ((slider.max - slider.min) * k) / (count - 1);
|
|
41
|
+
this.stroke(curve, plot_spec_1.PlotSpec.values(plot, t, others), t, eased, 0.28);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
this.stroke(curve, values, t, eased, 0);
|
|
45
|
+
if (plot.dot && !curve.dash && shown >= 1) {
|
|
46
|
+
this.dot(curve, values, t, index);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
this.points(values, t);
|
|
50
|
+
return values;
|
|
51
|
+
}
|
|
52
|
+
x(x) {
|
|
53
|
+
const [x0, x1] = this.plot.x;
|
|
54
|
+
return ((x - x0) / (x1 - x0)) * this.width;
|
|
55
|
+
}
|
|
56
|
+
y(y) {
|
|
57
|
+
const [y0, y1] = this.plot.y;
|
|
58
|
+
return this.height - ((y - y0) / (y1 - y0)) * this.height;
|
|
59
|
+
}
|
|
60
|
+
grid() {
|
|
61
|
+
const { context, width, height } = this;
|
|
62
|
+
const [x0, x1] = this.plot.x;
|
|
63
|
+
const [y0, y1] = this.plot.y;
|
|
64
|
+
const step = plot_spec_1.PlotSpec.niceStep(Math.max(x1 - x0, y1 - y0));
|
|
65
|
+
context.lineWidth = 1;
|
|
66
|
+
context.strokeStyle = this.ink(0.08);
|
|
67
|
+
context.beginPath();
|
|
68
|
+
for (let gx = Math.ceil(x0 / step) * step; gx <= x1; gx += step) {
|
|
69
|
+
context.moveTo(this.x(gx), 0);
|
|
70
|
+
context.lineTo(this.x(gx), height);
|
|
71
|
+
}
|
|
72
|
+
for (let gy = Math.ceil(y0 / step) * step; gy <= y1; gy += step) {
|
|
73
|
+
context.moveTo(0, this.y(gy));
|
|
74
|
+
context.lineTo(width, this.y(gy));
|
|
75
|
+
}
|
|
76
|
+
context.stroke();
|
|
77
|
+
const axisX = Math.min(Math.max(this.x(0), 0), width);
|
|
78
|
+
const axisY = Math.min(Math.max(this.y(0), 0), height);
|
|
79
|
+
context.strokeStyle = this.ink(0.45);
|
|
80
|
+
context.beginPath();
|
|
81
|
+
context.moveTo(0, axisY);
|
|
82
|
+
context.lineTo(width, axisY);
|
|
83
|
+
context.moveTo(axisX, 0);
|
|
84
|
+
context.lineTo(axisX, height);
|
|
85
|
+
context.stroke();
|
|
86
|
+
context.fillStyle = this.ink(0.5);
|
|
87
|
+
context.textAlign = 'center';
|
|
88
|
+
context.textBaseline = 'top';
|
|
89
|
+
for (let gx = Math.ceil(x0 / step) * step; gx <= x1; gx += step) {
|
|
90
|
+
const px = this.x(gx);
|
|
91
|
+
if (Math.abs(gx) > 1e-9 && px > 10 && px < width - 10) {
|
|
92
|
+
context.fillText(plot_spec_1.PlotSpec.format(gx), px, Math.min(axisY + 3, height - 14));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
context.textAlign = 'right';
|
|
96
|
+
context.textBaseline = 'middle';
|
|
97
|
+
for (let gy = Math.ceil(y0 / step) * step; gy <= y1; gy += step) {
|
|
98
|
+
const py = this.y(gy);
|
|
99
|
+
if (Math.abs(gy) > 1e-9 && py > 8 && py < height - 8) {
|
|
100
|
+
context.fillText(plot_spec_1.PlotSpec.format(gy), Math.max(axisX - 4, 24), py);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** A curve, drawn in up to `eased` of its range; `faint` (an alpha) for one of a family. */
|
|
105
|
+
stroke(curve, values, t, eased, faint) {
|
|
106
|
+
const { context } = this;
|
|
107
|
+
const [y0, y1] = this.plot.y;
|
|
108
|
+
const span = y1 - y0;
|
|
109
|
+
const [s0, s1] = curve.range;
|
|
110
|
+
const count = Math.max(2, Math.round(SAMPLES * eased));
|
|
111
|
+
const scope = plot_spec_1.PlotSpec.scope(0, 0, 0, t, values);
|
|
112
|
+
context.save();
|
|
113
|
+
context.strokeStyle = curve.color;
|
|
114
|
+
context.lineWidth = curve.dash || faint ? 1.25 : 2.5;
|
|
115
|
+
context.lineJoin = 'round';
|
|
116
|
+
context.lineCap = 'round';
|
|
117
|
+
if (faint) {
|
|
118
|
+
context.globalAlpha = faint;
|
|
119
|
+
}
|
|
120
|
+
if (curve.dash) {
|
|
121
|
+
context.setLineDash([6, 5]);
|
|
122
|
+
}
|
|
123
|
+
else if (!faint) {
|
|
124
|
+
context.shadowColor = curve.color;
|
|
125
|
+
context.shadowBlur = 6;
|
|
126
|
+
}
|
|
127
|
+
context.beginPath();
|
|
128
|
+
let open = false;
|
|
129
|
+
let last;
|
|
130
|
+
for (let i = 0; i <= count; i++) {
|
|
131
|
+
const s = s0 + ((s1 - s0) * eased * i) / count;
|
|
132
|
+
scope[0] = s;
|
|
133
|
+
scope[2] = s;
|
|
134
|
+
const x = curve.x ? curve.x.evaluate(scope) : s;
|
|
135
|
+
const y = curve.y.evaluate(scope);
|
|
136
|
+
// Off far above or below, or a jump across the view (an asymptote): the line breaks there.
|
|
137
|
+
if (!Number.isFinite(x) || !Number.isFinite(y) || Math.abs(y - y0 - span / 2) > span * 4) {
|
|
138
|
+
open = false;
|
|
139
|
+
last = undefined;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (open && last !== undefined && Math.abs(y - last) > span) {
|
|
143
|
+
open = false;
|
|
144
|
+
}
|
|
145
|
+
if (open) {
|
|
146
|
+
context.lineTo(this.x(x), this.y(y));
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
context.moveTo(this.x(x), this.y(y));
|
|
150
|
+
}
|
|
151
|
+
open = true;
|
|
152
|
+
last = y;
|
|
153
|
+
}
|
|
154
|
+
context.stroke();
|
|
155
|
+
context.restore();
|
|
156
|
+
}
|
|
157
|
+
dot(curve, values, t, index) {
|
|
158
|
+
const { context } = this;
|
|
159
|
+
const [s0, s1] = curve.range;
|
|
160
|
+
const s = s0 + (s1 - s0) * (0.5 + 0.5 * Math.sin(t * 0.9 + index * 1.3));
|
|
161
|
+
const scope = plot_spec_1.PlotSpec.scope(s, 0, s, t, values);
|
|
162
|
+
const x = curve.x ? curve.x.evaluate(scope) : s;
|
|
163
|
+
const y = curve.y.evaluate(scope);
|
|
164
|
+
if (!Number.isFinite(x) || !Number.isFinite(y)) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
context.save();
|
|
168
|
+
context.fillStyle = curve.color;
|
|
169
|
+
context.shadowColor = curve.color;
|
|
170
|
+
context.shadowBlur = 14;
|
|
171
|
+
context.beginPath();
|
|
172
|
+
context.arc(this.x(x), this.y(y), 5, 0, Math.PI * 2);
|
|
173
|
+
context.fill();
|
|
174
|
+
context.restore();
|
|
175
|
+
}
|
|
176
|
+
/** The points fade in once the curves are drawn. */
|
|
177
|
+
points(values, t) {
|
|
178
|
+
const { context, plot, width } = this;
|
|
179
|
+
const settled = Math.min(Math.max((t - plot.curves.length * exports.STAGGER) / 0.6, 0), 1);
|
|
180
|
+
if (settled <= 0) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const scope = plot_spec_1.PlotSpec.scope(0, 0, 0, t, values);
|
|
184
|
+
context.globalAlpha = settled;
|
|
185
|
+
for (const point of plot.points) {
|
|
186
|
+
const x = point.x.evaluate(scope);
|
|
187
|
+
const y = point.y.evaluate(scope);
|
|
188
|
+
if (!Number.isFinite(x) || !Number.isFinite(y)) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const px = this.x(x);
|
|
192
|
+
const py = this.y(y);
|
|
193
|
+
context.fillStyle = this.ink(0.85);
|
|
194
|
+
context.beginPath();
|
|
195
|
+
context.arc(px, py, 3.5, 0, Math.PI * 2);
|
|
196
|
+
context.fill();
|
|
197
|
+
if (point.label) {
|
|
198
|
+
const right = px > width - 80;
|
|
199
|
+
context.textAlign = right ? 'right' : 'left';
|
|
200
|
+
context.textBaseline = 'bottom';
|
|
201
|
+
context.fillText(point.label, px + (right ? -6 : 6), py - 4);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
context.globalAlpha = 1;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.PlotPainter = PlotPainter;
|
|
208
|
+
//# sourceMappingURL=plot-painter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the model is told on every turn under ta serve, the section `<ta-plot>` of the system prompt: show functions
|
|
3
|
+
* and curves as a `ta-plot` block, which the web extension draws. In English, as the rest of the system prompt; kept
|
|
4
|
+
* the same from turn to turn, so that the cache of the prompt holds.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PLOT_PROMPT = "To show the user a function or a curve (a parabola, a hyperbola, sin x, a family of curves with a parameter to drag, a surface z = f(x, y), a curve in space, a graph to explain a point), write a fenced block of language ta-plot holding JSON rather than describing it or drawing it with a chart of points; Ta draws it, animated:\n{\"title\"?: string, \"x\": [min, max], \"y\": [min, max], \"params\"?: {\"a\": \"1.5 + 0.5*sin(t)\", \"b\": 1}, \"curves\": [...], \"points\"?: [{\"x\": 0, \"y\": 0, \"label\": \"vertex\"}], \"dot\"?: true}\nA param may instead be a slider the user drags, {\"c\": {\"value\": 1, \"min\": -2, \"max\": 3, \"step\"?: 0.1, \"label\"?: string}}, also dragged by moving across the plot; give one whenever the user wants to see how a param changes a curve. A curve with \"family\": \"c\" (or {\"param\": \"c\", \"count\": 11}) also draws itself faintly for evenly spaced values of the slider c, the current one bold: a family of curves; add its envelope as a dashed curve when there is one.\nA curve is {\"y\": \"a*x^2\"} (y of x, over the x range) or {\"x\": \"a*cosh(s)\", \"y\": \"b*sinh(s)\", \"s\": [-2, 2]} (parametric, s over its range), with \"label\"?, \"dash\"?: true (asymptotes, axes of symmetry, guides) and \"color\"? (a CSS color).\nIn space: \"surfaces\": [{\"z\": \"sin(x)*cos(y)\", \"label\"?, \"color\"?}] (z of x and y, over the x and y ranges, colored by height without a color), a curve with \"z\" too ({\"x\": \"cos(s)\", \"y\": \"sin(s)\", \"z\": \"s/4\", \"s\": [0, 12]}) and points with \"z\"; an optional \"z\": [min, max]. Ta draws it in 3D, turning slowly, the user turns it by dragging; params, sliders and t work the same.\nExpressions: numbers, + - * / ^ %, parentheses, x, y (of a surface), s, t (seconds since shown: a param or curve that uses it moves), the params (a param may use the sliders and the params before it), and sin cos tan asin acos atan atan2 sinh cosh tanh asinh acosh atanh sqrt cbrt abs exp log log2 log10 pow min max floor ceil round sign hypot pi e. Curves draw in when shown; dot puts a point running along the solid curves. Point coordinates may be expressions too. Labels and title in the user's language, short.";
|
|
7
|
+
//# sourceMappingURL=plot-prompt.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PLOT_PROMPT = void 0;
|
|
4
|
+
const plot_protocol_1 = require("./plot-protocol");
|
|
5
|
+
/**
|
|
6
|
+
* What the model is told on every turn under ta serve, the section `<ta-plot>` of the system prompt: show functions
|
|
7
|
+
* and curves as a `ta-plot` block, which the web extension draws. In English, as the rest of the system prompt; kept
|
|
8
|
+
* the same from turn to turn, so that the cache of the prompt holds.
|
|
9
|
+
*/
|
|
10
|
+
exports.PLOT_PROMPT = `To show the user a function or a curve (a parabola, a hyperbola, sin x, a family of curves with a parameter to drag, a surface z = f(x, y), a curve in space, a graph to explain a point), write a fenced block of language ${plot_protocol_1.LANGUAGE} holding JSON rather than describing it or drawing it with a chart of points; Ta draws it, animated:
|
|
11
|
+
{"title"?: string, "x": [min, max], "y": [min, max], "params"?: {"a": "1.5 + 0.5*sin(t)", "b": 1}, "curves": [...], "points"?: [{"x": 0, "y": 0, "label": "vertex"}], "dot"?: true}
|
|
12
|
+
A param may instead be a slider the user drags, {"c": {"value": 1, "min": -2, "max": 3, "step"?: 0.1, "label"?: string}}, also dragged by moving across the plot; give one whenever the user wants to see how a param changes a curve. A curve with "family": "c" (or {"param": "c", "count": 11}) also draws itself faintly for evenly spaced values of the slider c, the current one bold: a family of curves; add its envelope as a dashed curve when there is one.
|
|
13
|
+
A curve is {"y": "a*x^2"} (y of x, over the x range) or {"x": "a*cosh(s)", "y": "b*sinh(s)", "s": [-2, 2]} (parametric, s over its range), with "label"?, "dash"?: true (asymptotes, axes of symmetry, guides) and "color"? (a CSS color).
|
|
14
|
+
In space: "surfaces": [{"z": "sin(x)*cos(y)", "label"?, "color"?}] (z of x and y, over the x and y ranges, colored by height without a color), a curve with "z" too ({"x": "cos(s)", "y": "sin(s)", "z": "s/4", "s": [0, 12]}) and points with "z"; an optional "z": [min, max]. Ta draws it in 3D, turning slowly, the user turns it by dragging; params, sliders and t work the same.
|
|
15
|
+
Expressions: numbers, + - * / ^ %, parentheses, x, y (of a surface), s, t (seconds since shown: a param or curve that uses it moves), the params (a param may use the sliders and the params before it), and sin cos tan asin acos atan atan2 sinh cosh tanh asinh acosh atanh sqrt cbrt abs exp log log2 log10 pow min max floor ceil round sign hypot pi e. Curves draw in when shown; dot puts a point running along the solid curves. Point coordinates may be expressions too. Labels and title in the user's language, short.`;
|
|
16
|
+
//# sourceMappingURL=plot-prompt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The name of the package. */
|
|
2
|
+
export declare const NAME = "@celljs/ta-plot";
|
|
3
|
+
/** The language of the fenced block of a plot in a reply: ```ta-plot, with JSON in it. */
|
|
4
|
+
export declare const LANGUAGE = "ta-plot";
|
|
5
|
+
/** Languages a plot is written in too: `plot`, as the user's extension Function plot had it before it came with Ta. */
|
|
6
|
+
export declare const ALIASES: string[];
|
|
7
|
+
//# sourceMappingURL=plot-protocol.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ALIASES = exports.LANGUAGE = exports.NAME = void 0;
|
|
4
|
+
/** The name of the package. */
|
|
5
|
+
exports.NAME = '@celljs/ta-plot';
|
|
6
|
+
/** The language of the fenced block of a plot in a reply: ```ta-plot, with JSON in it. */
|
|
7
|
+
exports.LANGUAGE = 'ta-plot';
|
|
8
|
+
/** Languages a plot is written in too: `plot`, as the user's extension Function plot had it before it came with Ta. */
|
|
9
|
+
exports.ALIASES = ['plot'];
|
|
10
|
+
//# sourceMappingURL=plot-protocol.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Game3DContext, Game3DLoop, GamePage } from '@celljs/ta-web/lib/browser/extension/web-extension-api';
|
|
2
|
+
import type * as Three from 'three';
|
|
3
|
+
import { type Plot, type PlotRange } from './plot-spec';
|
|
4
|
+
/** The latest of the card a 3D plot reads at each frame: where the sliders are, and what it tells back. */
|
|
5
|
+
export interface PlotSceneInput {
|
|
6
|
+
sliders: readonly (number | undefined)[];
|
|
7
|
+
/** Set by the card when a slider moved, so that a still plot is drawn again. */
|
|
8
|
+
dirty: boolean;
|
|
9
|
+
/** The values of the params, as drawn. */
|
|
10
|
+
shown(values: number[]): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A plot in space (Plot.space) drawn with the Three.js of the page (`ui.Game3D`): a box of the ranges of x, y and z
|
|
14
|
+
* with its floor gridded, surfaces colored by height, curves and points, turned by dragging. Math's z is the
|
|
15
|
+
* height (Three's y). What moves with t or a slider is computed again each frame; a still plot is not.
|
|
16
|
+
*/
|
|
17
|
+
export declare class PlotScene implements Game3DLoop {
|
|
18
|
+
protected readonly context: Game3DContext;
|
|
19
|
+
protected readonly plot: Plot;
|
|
20
|
+
protected readonly input: PlotSceneInput;
|
|
21
|
+
protected readonly THREE: typeof Three;
|
|
22
|
+
protected readonly root: Three.Group;
|
|
23
|
+
protected readonly controls: InstanceType<Game3DContext['OrbitControls']>;
|
|
24
|
+
protected readonly surfaces: {
|
|
25
|
+
geometry: Three.BufferGeometry;
|
|
26
|
+
colored: boolean;
|
|
27
|
+
mesh: Three.Mesh;
|
|
28
|
+
}[];
|
|
29
|
+
protected readonly curves: {
|
|
30
|
+
geometry: Three.BufferGeometry;
|
|
31
|
+
line: Three.LineSegments;
|
|
32
|
+
}[];
|
|
33
|
+
protected readonly points: Three.Mesh[];
|
|
34
|
+
protected readonly dots: Three.Mesh[];
|
|
35
|
+
protected readonly labels: Three.Sprite[];
|
|
36
|
+
protected readonly frame: Three.Group;
|
|
37
|
+
protected readonly z: PlotRange;
|
|
38
|
+
protected drawn: number;
|
|
39
|
+
protected shownAt: number;
|
|
40
|
+
constructor(context: Game3DContext, plot: Plot, input: PlotSceneInput);
|
|
41
|
+
/** Where a point of the plot is in the scene: x and y across, z up, each range to the box. */
|
|
42
|
+
protected at(x: number, y: number, z: number, target: Three.Vector3): Three.Vector3;
|
|
43
|
+
protected build(): void;
|
|
44
|
+
/** The box, its gridded floor, the names of the axes and the ends of their ranges, in the colors of the page. */
|
|
45
|
+
protected drawFrame(page: GamePage): void;
|
|
46
|
+
/** Computes what is drawn at `elapsed` seconds: the surfaces rise and the curves draw in as it is shown. */
|
|
47
|
+
protected draw(elapsed: number): number[];
|
|
48
|
+
/** A point of a curve in the scene: (x, y) on the floor for a curve y of x, (x, y, z) of s for one in space. */
|
|
49
|
+
protected curvePoint(curve: Plot['curves'][number], scope: number[], s: number, target: Three.Vector3): Three.Vector3 | undefined;
|
|
50
|
+
update(_seconds: number, elapsed: number): void;
|
|
51
|
+
page(page: GamePage): void;
|
|
52
|
+
dispose(): void;
|
|
53
|
+
protected readonly wheel: (event: WheelEvent) => void;
|
|
54
|
+
/** How far the surfaces and curves in space reach in z, as they start: the range of z when none was written. */
|
|
55
|
+
static reach(plot: Plot, sliders: readonly (number | undefined)[]): PlotRange;
|
|
56
|
+
/** The color of a height between 0 (the bottom of the box) and 1 (its top). */
|
|
57
|
+
static ramp(height: number, target: Three.Color): Three.Color;
|
|
58
|
+
static eased(shown: number): number;
|
|
59
|
+
/** A word that always faces the camera. */
|
|
60
|
+
static label(THREE: typeof Three, text: string, color?: string, scale?: number): Three.Sprite;
|
|
61
|
+
static textOf(sprite: Three.Sprite): string;
|
|
62
|
+
static texture(THREE: typeof Three, text: string, color: string): Three.CanvasTexture;
|
|
63
|
+
static dispose(object: Three.Object3D): void;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=plot-scene.d.ts.map
|