@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6

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.
Files changed (158) hide show
  1. package/README.md +79 -8
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +340 -217
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,127 @@
1
+ const e = `# Object table (objectTable)
2
+
3
+ Lists one type of object as a detail table that can be sorted, paged and ticked; clicking a row selects the object. Use it to check items one by one and to pick a batch for other components or actions.
4
+
5
+ ## When to use it and when not
6
+
7
+ - Use it to see the details of one object type, narrow them by conditions and pick some of them. For example: order details, work order details, an equipment register.
8
+ - Do not use it:
9
+ - To see only grouped totals: use the pivot table (\`pivotTable\`).
10
+ - For a to-do or inbox style list of cards with a title and a few lines each: use the object list (\`objectList\`).
11
+ - To see all properties and related records of one object: use object detail (\`objectDetail\`), opened by clicking a row here.
12
+ - To schedule tasks on resources over time: use the schedule Gantt (\`scheduleGantt\`).
13
+
14
+ ## Ontology contract
15
+
16
+ | Role | Object type | Required properties | Relations | Required |
17
+ | --- | --- | --- | --- | --- |
18
+ | Detail object | The type of object to list, as the page's data source | The key property (the object's name and key); at least one property to show, up to 20 columns | — | Yes |
19
+ | Quick filter field | The same object type | A property with a limited set of values, or a "status" computed column | — | No |
20
+ | Related data column | An object type related to the detail object | The property to read (count, sum, value and so on) | Detail object → related object, read along a relation path | No |
21
+ | Progress | The same object type | Dates of the steps, a due date | — | No |
22
+
23
+ When the object type has no data bound in the knowledge network, the table says that the object type has no data bound yet. The data source is read into the browser whole; see Limits for the cap.
24
+
25
+ ## Built-in checks
26
+
27
+ Independent of industry, the component does these itself:
28
+
29
+ | Check | Rule |
30
+ | --- | --- |
31
+ | Days overdue | A column that is the progress's overdue days and above 0 shows in red |
32
+ | Tag colors | A column in the "tag" format shows the colors of the status column's values, or of the progress status |
33
+ | Cell colors | The color rules set for the field in the source's display format; the first rule that holds gives the color |
34
+ | Quick filter buttons | For a status computed column, its values in their order; otherwise the 5 most frequent values, blanks not counted |
35
+
36
+ What a business means by "overdue", "high risk" or "short of material" is not judged in the table.
37
+
38
+ ## Extension points
39
+
40
+ ### Logical properties and computed columns
41
+
42
+ - **What for**: business states the table shows, colors or filters by, such as "risk level", "rush order", "stock enough".
43
+ - **Where**: properties or logical properties of the knowledge network, used directly as columns; the page's columns and progress tab adds computed columns (status, days between, arithmetic, read related data) and display formats for fields.
44
+ - **What it connects to**: the judgement itself lives in the knowledge network (logical properties, metrics); the table only shows the values. Computed columns only tidy up what is shown; do not write industry rules in them.
45
+ - **Input**: a row's property values; computed columns can also read the base date.
46
+ - **Output**: one column of values. Each value of a status column can carry a color (neutral, blue, green, orange, red) for tags and badges.
47
+ - **Failure and timeout**: a "read related data" column is read together with the data source; when one column's query fails, only that column is empty (a count does not show 0 either), a note above the table names the columns that could not be read, and the other columns show as usual; the column does not follow the base date.
48
+ - **How results are shown**: a column in the "tag" format shows colored tags; other columns show text, dates or numbers by their format.
49
+
50
+ ### Actions on click
51
+
52
+ - **What for**: ask the Agent from the table, try out scenario operations, or run knowledge network actions on the rows picked.
53
+ - **Where**: "Actions on click" on the link tab, up to 8 items with up to 5 steps each; the trigger is the row.
54
+ - **What it connects to**: asking the Agent; the scenario operations defined on the data source; actions of the knowledge network that act on this object type.
55
+ - **Input**: the clicked row. Placeholders a question may use: \`{count}\` and any field name of the row. An action's parameters come from one of three places: filled in at confirmation, a filter's value, or a fixed value.
56
+ - **Output**: the question goes to the analysis Agent; an action first opens the execution confirmation, which lists the objects, takes the parameters and checks execution permission, then runs on each object as the current user.
57
+ - **Failure and timeout**: actions go through the platform's execution confirmation and approval; they cannot run without permission or with parameters not filled in.
58
+ - **How results are shown**: buttons appear at the end of each row. When the data source has scenario operations, a "simulate" button is offered at the end of the row automatically; no simulate step is needed.
59
+
60
+ ## Interaction and links
61
+
62
+ - **Writes**:
63
+ - Row click: selects the object's key; the detail drawer and the related graph show it. Without it, clicking a row does nothing.
64
+ - Ticks: a tick box appears before each row; the ticked objects are written as one group so other components can look at only that group; ticks stay across pages.
65
+ - Header quick filter: buttons by the values of the chosen field; a click writes that value.
66
+ - Header search: shows a search box; it searches the columns in the text or tag format.
67
+ - Cell click filters: up to 4; clicking a column's value writes the matching filter; clicking the same value again clears it.
68
+ - **Reads**: follows the page's shared filters and base date; when filters change it goes back to the first page, while clicking a row or ticking does not change the page.
69
+ - **Scenarios**: when a scenario is open and the source supports it, the first column marks objects as changed, followed or related, and the header gets "only objects in the scenario".
70
+ - **Model results**: when the source is a model result with a landing and no scenario is open, the header gets "Act on this result…", usable once the result is up to date.
71
+
72
+ ## Recipes
73
+
74
+ ### Order tracking: which orders need attention
75
+
76
+ | Role | Maps to |
77
+ | --- | --- |
78
+ | Detail object | Sales order (order number, customer, amount, delivery date, status) |
79
+ | Quick filter field | The order's "delivery status" (a logical property or a status computed column) |
80
+ | Related data column | Order → customer name |
81
+
82
+ **The knowledge network needs:**
83
+
84
+ - A relation order → customer.
85
+ - A logical property "delivery status" on orders (for example normal, near due, overdue); what counts as overdue is defined in this property.
86
+ - Optional: an action "chase delivery" that acts on orders.
87
+
88
+ **What goes on the extension points:** pick "delivery status" as the quick filter field; add one action on click: run "chase delivery" on the row; write the ticks to a group so other components can look at only the ticked orders.
89
+
90
+ **To check:** click the "overdue" button and the table keeps only overdue orders; tick two rows and other components can show only those two; clicking "chase delivery" opens a confirmation that lists the objects.
91
+
92
+ ### Equipment register: check machine by machine by status
93
+
94
+ | Role | Maps to |
95
+ | --- | --- |
96
+ | Detail object | Equipment (code, name, workshop, status, next service date) |
97
+ | Cell click filter | The "workshop" column |
98
+
99
+ **The knowledge network needs:** the equipment object type and a logical property such as "service status".
100
+
101
+ **What goes on the extension points:** set a cell click filter on the "workshop" column, writing the workshop filter, so other components on the page look at that workshop only.
102
+
103
+ **To check:** click a workshop name and the other components narrow down; click the same name again and they come back.
104
+
105
+ ## Guidance for AI
106
+
107
+ 1. Ask the user first: which object type the table lists; which columns; what a row click should drive (details, graph, another table); whether to tick a batch for other components or actions. Ask about anything missing; do not guess.
108
+ 2. The page must have this object type as a data source before the table is configured. When the object type is not in the knowledge network, list what must be added; do not make do with other objects.
109
+ 3. Put business states (risk, rush, overdue) in logical properties of the knowledge network, and only show them in the table; do not write industry rules as conditions in columns.
110
+ 4. To have a row click drive other components, set "Row click writes" and have the detail or graph read the same filter; the two variables must match.
111
+ 5. Common mistakes:
112
+ - A variable chosen for "Header quick filter" but no "Header quick filter field": the config is rejected.
113
+ - "Row click writes" and "Ticks write" set to the same variable: one holds a selected object, the other a group of objects; they are different kinds.
114
+ - Amounts and dates given the "text" format: pick the number or date format so they align right, sort and show correctly.
115
+ - Rows per page outside 5 to 50.
116
+ - Wanting a column's value to filter the whole page but only setting the row click, not a cell click filter.
117
+
118
+ ## Limits
119
+
120
+ - Up to 20 columns; 5 to 50 rows per page (default 10); up to 4 cell click filters.
121
+ - At most 5000 objects are read per object type data source, and at most 10,000 rows per Cypher data source (1,000 when its query sets no LIMIT); beyond that a note above the table says only the first N of M were read (a Cypher data source does not know M, so the note only says there may be more), and the table and its figures cover only what was read.
122
+ - Actions on click: up to 8 items with up to 5 steps each; one execution confirmation covers at most 100 objects, and a single action config defaults to 20.
123
+ - Search runs only on the objects already read into the browser; it does not query the knowledge network again.
124
+ `;
125
+ export {
126
+ e as default
127
+ };
@@ -0,0 +1,95 @@
1
+ import { g as l, r as m, d as a } from "./chunk-2E7WHVMD-Ba3svxgx.js";
2
+ import { p } from "./chunk-JWPE2WC7-CDBrSjU7.js";
3
+ import { _ as t, l as o } from "./mermaid.core-yQghUlIz.js";
4
+ import { M as u, d as c } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
5
+ var f = c().RailroadPeg.parser.LangiumParser, i = /* @__PURE__ */ t((e) => {
6
+ const r = e.alternatives.map(d);
7
+ return r.length === 1 ? r[0] : {
8
+ type: "choice",
9
+ alternatives: r
10
+ };
11
+ }, "transformOrderedChoice"), d = /* @__PURE__ */ t((e) => {
12
+ const r = e.elements.map(P);
13
+ return r.length === 1 ? r[0] : {
14
+ type: "sequence",
15
+ elements: r
16
+ };
17
+ }, "transformSequence"), P = /* @__PURE__ */ t((e) => {
18
+ const r = g(e.suffix);
19
+ return e.operator ? {
20
+ type: "special",
21
+ text: e.operator === "&" ? `&${s(r)}` : `!${s(r)}`
22
+ } : r;
23
+ }, "transformPrefix"), s = /* @__PURE__ */ t((e) => {
24
+ switch (e.type) {
25
+ case "terminal":
26
+ return `"${e.value}"`;
27
+ case "nonterminal":
28
+ return e.name;
29
+ case "special":
30
+ return e.text;
31
+ default:
32
+ return "(...)";
33
+ }
34
+ }, "nodeToLabel"), g = /* @__PURE__ */ t((e) => {
35
+ const r = v(e.primary);
36
+ if (!e.operator)
37
+ return r;
38
+ switch (e.operator) {
39
+ case "?":
40
+ return { type: "optional", element: r };
41
+ case "*":
42
+ return { type: "repetition", element: r, min: 0, max: 1 / 0 };
43
+ case "+":
44
+ return { type: "repetition", element: r, min: 1, max: 1 / 0 };
45
+ default:
46
+ throw new Error(`Unsupported PEG suffix operator: ${e.operator}`);
47
+ }
48
+ }, "transformSuffix"), v = /* @__PURE__ */ t((e) => {
49
+ switch (e.$type) {
50
+ case "PegLiteral":
51
+ return {
52
+ type: "terminal",
53
+ value: e.value
54
+ };
55
+ case "PegIdentifier":
56
+ return {
57
+ type: "nonterminal",
58
+ name: e.name
59
+ };
60
+ case "PegGroup":
61
+ return i(e.element);
62
+ case "PegAny":
63
+ return {
64
+ type: "special",
65
+ text: e.dot
66
+ };
67
+ default:
68
+ throw new Error(`Unsupported PEG primary node: ${e.$type}`);
69
+ }
70
+ }, "transformPrimary"), y = /* @__PURE__ */ t((e) => ({
71
+ name: e.name,
72
+ definition: i(e.definition)
73
+ }), "transformRule"), h = /* @__PURE__ */ t((e) => {
74
+ p(e, a), e.title && a.setTitle(e.title), e.rules.map((r) => a.addRule(y(r)));
75
+ }, "populateDb"), b = {
76
+ parse: /* @__PURE__ */ t((e) => {
77
+ a.clear(), o.debug("[PEG Parser] Starting Langium parse");
78
+ const r = f.parse(e);
79
+ if (r.lexerErrors.length > 0 || r.parserErrors.length > 0)
80
+ throw new u(r);
81
+ const n = r.value;
82
+ o.debug("[PEG Parser] Parsed rules:", n.rules.length), h(n), o.debug("[PEG Parser] Parse complete");
83
+ }, "parse"),
84
+ parser: {
85
+ yy: a
86
+ }
87
+ }, $ = {
88
+ parser: b,
89
+ db: a,
90
+ renderer: m,
91
+ styles: l
92
+ };
93
+ export {
94
+ $ as diagram
95
+ };
@@ -0,0 +1,165 @@
1
+ import { p as tt } from "./chunk-JWPE2WC7-CDBrSjU7.js";
2
+ import { g as et, s as at, a as rt, b as it, x as nt, v as ot, _ as l, l as E, c as st, Q as lt, T as ct, V as dt, W as I, d as gt, D as ht, X as pt, R as ft } from "./mermaid.core-yQghUlIz.js";
3
+ import { p as ut } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
4
+ import { o as mt } from "./d3-scale-DA8IHmf0.js";
5
+ var vt = ft.pie, R = {
6
+ sections: /* @__PURE__ */ new Map(),
7
+ showData: !1
8
+ }, T = R.sections, W = R.showData, St = structuredClone(vt), xt = /* @__PURE__ */ l(() => structuredClone(St), "getConfig"), wt = /* @__PURE__ */ l(() => {
9
+ T = /* @__PURE__ */ new Map(), W = R.showData, ht();
10
+ }, "clear"), $t = /* @__PURE__ */ l(({ label: t, value: a }) => {
11
+ if (a < 0)
12
+ throw new Error(
13
+ `"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
14
+ );
15
+ T.has(t) || (T.set(t, a), E.debug(`added new section: ${t}, with value: ${a}`));
16
+ }, "addSection"), Ct = /* @__PURE__ */ l(() => T, "getSections"), Dt = /* @__PURE__ */ l((t) => {
17
+ W = t;
18
+ }, "setShowData"), yt = /* @__PURE__ */ l(() => W, "getShowData"), U = {
19
+ getConfig: xt,
20
+ clear: wt,
21
+ setDiagramTitle: ot,
22
+ getDiagramTitle: nt,
23
+ setAccTitle: it,
24
+ getAccTitle: rt,
25
+ setAccDescription: at,
26
+ getAccDescription: et,
27
+ addSection: $t,
28
+ getSections: Ct,
29
+ setShowData: Dt,
30
+ getShowData: yt
31
+ }, Tt = /* @__PURE__ */ l((t, a) => {
32
+ tt(t, a), a.setShowData(t.showData), t.sections.map(a.addSection);
33
+ }, "populateDb"), bt = {
34
+ parse: /* @__PURE__ */ l(async (t) => {
35
+ const a = await ut("pie", t);
36
+ E.debug(a), Tt(a, U);
37
+ }, "parse")
38
+ }, At = /* @__PURE__ */ l((t) => `
39
+ .pieCircle{
40
+ stroke: ${t.pieStrokeColor};
41
+ stroke-width : ${t.pieStrokeWidth};
42
+ opacity : ${t.pieOpacity};
43
+ }
44
+ .pieCircle.highlighted{
45
+ scale: 1.05;
46
+ opacity: 1;
47
+ }
48
+ .pieCircle.highlightedOnHover:hover{
49
+ transition-duration: 250ms;
50
+ scale: 1.05;
51
+ opacity: 1;
52
+ }
53
+ .pieOuterCircle{
54
+ stroke: ${t.pieOuterStrokeColor};
55
+ stroke-width: ${t.pieOuterStrokeWidth};
56
+ fill: none;
57
+ }
58
+ .pieTitleText {
59
+ text-anchor: middle;
60
+ font-size: ${t.pieTitleTextSize};
61
+ fill: ${t.pieTitleTextColor};
62
+ font-family: ${t.fontFamily};
63
+ }
64
+ .slice {
65
+ font-family: ${t.fontFamily};
66
+ fill: ${t.pieSectionTextColor};
67
+ font-size:${t.pieSectionTextSize};
68
+ // fill: white;
69
+ }
70
+ .legend text {
71
+ fill: ${t.pieLegendTextColor};
72
+ font-family: ${t.fontFamily};
73
+ font-size: ${t.pieLegendTextSize};
74
+ }
75
+ `, "getStyles"), _t = At, kt = /* @__PURE__ */ l((t) => {
76
+ const a = [...t.values()].reduce((o, m) => o + m, 0), L = [...t.entries()].map(([o, m]) => ({ label: o, value: m })).filter((o) => o.value / a * 100 >= 1);
77
+ return pt().value((o) => o.value).sort(null)(L);
78
+ }, "createPieArcs"), zt = /* @__PURE__ */ l((t, a, L, F) => {
79
+ E.debug(`rendering pie chart
80
+ ` + t);
81
+ const o = F.db, m = st(), p = lt(o.getConfig(), m.pie), H = 40, i = 18, c = 4, $ = 450, S = $, b = ct(a), C = b.append("g");
82
+ C.attr("transform", "translate(" + S / 2 + "," + $ / 2 + ")");
83
+ const { themeVariables: n } = m;
84
+ let [M] = dt(n.pieOuterStrokeWidth);
85
+ M ??= 2;
86
+ const V = p.legendPosition, O = p.textPosition, X = p.donutHole > 0 && p.donutHole <= 0.9 ? p.donutHole : 0, f = Math.min(S, $) / 2 - H, Q = I().innerRadius(X * f).outerRadius(f), Z = I().innerRadius(f * O).outerRadius(f * O), x = C.append("g");
87
+ x.append("circle").attr("cx", 0).attr("cy", 0).attr("r", f + M / 2).attr("class", "pieOuterCircle");
88
+ const D = o.getSections(), j = kt(D), q = [
89
+ n.pie1,
90
+ n.pie2,
91
+ n.pie3,
92
+ n.pie4,
93
+ n.pie5,
94
+ n.pie6,
95
+ n.pie7,
96
+ n.pie8,
97
+ n.pie9,
98
+ n.pie10,
99
+ n.pie11,
100
+ n.pie12
101
+ ];
102
+ let A = 0;
103
+ D.forEach((e) => {
104
+ A += e;
105
+ });
106
+ const P = j.filter((e) => (e.data.value / A * 100).toFixed(0) !== "0"), _ = mt(q).domain([
107
+ ...D.keys()
108
+ ]);
109
+ x.selectAll("mySlices").data(P).enter().append("path").attr("d", Q).attr("fill", (e) => _(e.data.label)).attr("class", (e) => {
110
+ let r = "pieCircle";
111
+ return p.highlightSlice === "hover" ? r += " highlightedOnHover" : p.highlightSlice === e.data.label && (r += " highlighted"), r;
112
+ }), x.selectAll("mySlices").data(P).enter().append("text").text((e) => (e.data.value / A * 100).toFixed(0) + "%").attr("transform", (e) => "translate(" + Z.centroid(e) + ")").style("text-anchor", "middle").attr("class", "slice");
113
+ const J = C.append("text").text(o.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText"), w = [...D.entries()].map(([e, r]) => ({
114
+ label: e,
115
+ value: r
116
+ })), u = C.selectAll(".legend").data(w).enter().append("g").attr("class", "legend");
117
+ u.append("rect").attr("width", i).attr("height", i).style("fill", (e) => _(e.label)).style("stroke", (e) => _(e.label)), u.append("text").attr("x", i + c).attr("y", i - c).text((e) => o.getShowData() ? `${e.label} [${e.value}]` : e.label);
118
+ const v = Math.max(
119
+ ...u.selectAll("text").nodes().map((e) => e?.getBoundingClientRect().width ?? 0)
120
+ );
121
+ let y = $, k = S + H;
122
+ const s = i + c, z = w.length * s;
123
+ switch (V) {
124
+ case "center":
125
+ u.attr("transform", (e, r) => {
126
+ const d = s * w.length / 2, g = -v / 2 - (i + c), h = r * s - d;
127
+ return "translate(" + g + "," + h + ")";
128
+ });
129
+ break;
130
+ case "top":
131
+ y += z, u.attr("transform", (e, r) => {
132
+ const d = f, g = -v / 2 - (i + c), h = r * s - d;
133
+ return `translate(${g}, ${h})`;
134
+ }), x.attr("transform", () => `translate(0, ${z + s})`);
135
+ break;
136
+ case "bottom":
137
+ y += z, u.attr("transform", (e, r) => {
138
+ const d = -f - s, g = -v / 2 - (i + c), h = r * s - d;
139
+ return "translate(" + g + "," + h + ")";
140
+ });
141
+ break;
142
+ case "left":
143
+ k += i + c + v, u.attr("transform", (e, r) => {
144
+ const d = s * w.length / 2, g = -f - (i + c), h = r * s - d;
145
+ return "translate(" + g + "," + h + ")";
146
+ }), x.attr("transform", () => `translate(${v + i + c}, 0)`);
147
+ break;
148
+ default:
149
+ k += i + c + v, u.attr("transform", (e, r) => {
150
+ const d = s * w.length / 2, g = 12 * i, h = r * s - d;
151
+ return "translate(" + g + "," + h + ")";
152
+ });
153
+ break;
154
+ }
155
+ const G = J.node()?.getBoundingClientRect().width ?? 0, K = S / 2 - G / 2, Y = S / 2 + G / 2, B = Math.min(0, K), N = Math.max(k, Y) - B;
156
+ b.attr("viewBox", `${B} 0 ${N} ${y}`), gt(b, y, N, p.useMaxWidth);
157
+ }, "draw"), Et = { draw: zt }, Mt = {
158
+ parser: bt,
159
+ db: U,
160
+ renderer: Et,
161
+ styles: _t
162
+ };
163
+ export {
164
+ Mt as diagram
165
+ };
@@ -0,0 +1,102 @@
1
+ const n = `# 透视表(pivotTable)
2
+
3
+ 按一个属性把对象分组,每组一行,每列一个统计数;点一行,整页只看这一组。用来回答“各类里分别有多少、多少金额、占比多少”,并从汇总点进明细。
4
+
5
+ ## 适用与不适用
6
+
7
+ - 适用:一类对象按某个属性(地区、状态、类别、负责人)分组后,比较各组的数量、总额、平均、占比。
8
+ - 不适用:
9
+ - 要逐个对象看明细:用对象表(\`objectTable\`)。
10
+ - 要按时间看变化,或画成柱线饼图:用图表(\`trendChart\`)。
11
+ - 要按省份或国家在地图上着色:用地图(\`regionMap\`)。
12
+ - 只要几个总数:用指标卡组(\`metricCards\`)。
13
+
14
+ ## 本体契约
15
+
16
+ | 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
17
+ | --- | --- | --- | --- | --- |
18
+ | 被统计对象 | 要分组汇总的一类对象,作为页面的数据源 | 标识属性;分组属性(取值有限的文本,如地区、状态);统计用的数字属性(求和、平均、最大、最小时需要) | — | 是 |
19
+ | 条件属性 | 同一对象类 | “仅统计满足以下条件的”用到的属性,可以是逻辑属性 | — | 否 |
20
+
21
+ 只读一个对象类。要按关联对象的属性分组(例如按订单的客户名称),在数据源上加“读取关联数据”计算列,再把它选作分组属性。
22
+
23
+ ## 组件内置的判断
24
+
25
+ | 判断 | 规则 |
26
+ | --- | --- |
27
+ | 分组 | 按分组属性的文本取值分组;取值为空的归为一行,显示“—” |
28
+ | 排序 | 按第一个度量从大到小;没有值的排最后 |
29
+ | 统计方式 | 计数、求和、平均、最小、最大、去重计数、占比(组内满足条件的 ÷ 组内全部) |
30
+ | 数值格式 | 整数加千分位;有小数的最多保留 1 位;占比显示为百分数;没有值显示“—” |
31
+ | 条形 | 打开“数值显示条形”时,每列数值下方画一条,长度是该数占本列最大值的比例 |
32
+
33
+ 求和、平均、最小、最大要选数字属性;计数与占比不需要。选了去重计数时,统计字段决定按什么去重。
34
+
35
+ ## 扩展点
36
+
37
+ ### 逻辑属性与条件
38
+
39
+ - **用途**:让某一列只统计满足业务条件的对象,例如“超期的订单数”“高风险设备占比”。
40
+ - **在哪里配**:度量里的“仅统计满足以下条件的”;分组属性本身也可以是逻辑属性。
41
+ - **接什么**:知识网络里的属性或逻辑属性。“超期”“高风险”这类判断写成逻辑属性,度量的条件只比较它的取值。
42
+ - **输入**:每个对象的属性值和基准日期。
43
+ - **输出**:每组一个数。
44
+ - **失败与超时**:数据源读取失败时显示“读取失败”;没有对象时表为空。
45
+ - **结果怎样显示**:每组一行,度量名作列名。
46
+
47
+ ### 点击后的动作
48
+
49
+ - **用途**:在汇总行上直接问 Agent,或对这一组的对象执行知识网络里的行动。
50
+ - **在哪里配**:链接页的“点击后的动作”,最多 8 项,每项最多 5 个动作;触发点为“行”。透视表不提供推演。
51
+ - **接什么**:问 Agent;知识网络里作用于这类对象的行动。
52
+ - **输入**:这一行代表的全部对象。问题可用 \`{count}\`,以及分组属性的字段名(填入这一组的取值)。
53
+ - **输出**:问题发给分析 Agent;行动先打开执行确认,列出这一组的对象、填写参数、检查执行权限,确认后以当前用户的身份执行。
54
+ - **失败与超时**:由平台的执行确认与审批把关。
55
+ - **结果怎样显示**:行末出现按钮。
56
+
57
+ ## 交互与联动
58
+
59
+ - **写入**:点击行写入该组的取值;再点同一行清除。不配则点行没有反应。
60
+ - **读取**:跟随页面的共享筛选和基准日期;被选中的行高亮。
61
+ - **与其他组件**:被写入的取值筛选对其他读取同一变量的组件生效,例如对象表、图表、地图只看这一组。
62
+
63
+ ## 场景配方
64
+
65
+ ### 订单按客户等级汇总:哪一级的订单最多、超期占比多高
66
+
67
+ | 角色 | 对应 |
68
+ | --- | --- |
69
+ | 被统计对象 | 销售订单 |
70
+ | 分组属性 | 订单的“客户等级”(读取关联数据列,或订单上的属性) |
71
+ | 度量 | 订单数;金额合计;超期占比(条件:交付状态等于已超期) |
72
+
73
+ **知识网络中要有:**
74
+
75
+ - 订单 → 客户的关系,客户上有“等级”属性。
76
+ - 订单的逻辑属性“交付状态”,“已超期”的判断写在其中。
77
+
78
+ **扩展点挂什么:** 度量“超期占比”用统计方式“占比”,条件为“交付状态 等于 已超期”;点击行写入“客户等级”筛选,对象表读同一个筛选,只看该等级的订单。
79
+
80
+ **检查项:** 各行订单数相加等于总数;点“金牌”行,对象表只剩金牌客户的订单;再点一次恢复。
81
+
82
+ ## 给 AI 的指引
83
+
84
+ 1. 先问用户:按什么分组;每列要统计什么(数量、金额、占比);点一行后要联动哪些组件。
85
+ 2. 分组属性应是取值有限的文本(地区、状态、类别)。选了日期或编号类字段会得到几十行甚至每个对象一行;要按时间看,改用图表。
86
+ 3. “占比”是组内满足条件的 ÷ 组内全部,必须配条件才有意义;不配条件占比恒为 100%。
87
+ 4. 求和、平均、最小、最大必须选数字属性,否则结果没有意义;计数不用选统计字段。
88
+ 5. 常见错误:
89
+ - 度量超出 1 到 5 个,或“最多行数”超出 5 到 50。
90
+ - 想按时间或关联对象分组,却直接选了不存在的属性:先加计算列。
91
+ - 没配“点击行写入”,却期待点行联动其他组件。
92
+ - 把度量的业务判断写在条件里重复一遍,而不是引用知识网络里的逻辑属性。
93
+
94
+ ## 限制
95
+
96
+ - 度量最多 5 个;最多显示 5 到 50 行(默认 10),超出的组不显示。
97
+ - 对象类数据源最多读入 5000 个对象,Cypher 数据源最多 10000 行(查询没写 LIMIT 时 1000 行),超过时上方提示,统计只覆盖已读取部分。
98
+ - 点击后的动作最多 8 项,每项最多 5 个动作;一次执行确认最多 100 个对象。
99
+ `;
100
+ export {
101
+ n as default
102
+ };
@@ -0,0 +1,102 @@
1
+ const e = `# Pivot table (pivotTable)
2
+
3
+ Groups objects by one property, one row per group and one statistic per column; clicking a row makes the whole page look at that group only. Use it to answer "how many, how much and what share in each class", and to move from a total to its details.
4
+
5
+ ## When to use it and when not
6
+
7
+ - Use it to compare the count, total, average or share of each group when one object type is grouped by a property (region, status, category, owner).
8
+ - Do not use it:
9
+ - To see objects one by one: use the object table (\`objectTable\`).
10
+ - To see change over time, or to draw bars, lines or a pie: use the chart (\`trendChart\`).
11
+ - To color provinces or countries on a map: use the map (\`regionMap\`).
12
+ - To show only a few totals: use the metric cards (\`metricCards\`).
13
+
14
+ ## Ontology contract
15
+
16
+ | Role | Object type | Required properties | Relations | Required |
17
+ | --- | --- | --- | --- | --- |
18
+ | Counted object | The type of object to group and total, as the page's data source | The key property; a grouping property (text with a limited set of values, such as region or status); the number property to total (needed for sum, average, greatest, least) | — | Yes |
19
+ | Condition property | The same object type | Properties used in "Count only those that meet", which can be logical properties | — | No |
20
+
21
+ It reads one object type. To group by a property of a related object (for example the customer name of an order), add a "read related data" computed column on the data source and choose it as the grouping property.
22
+
23
+ ## Built-in checks
24
+
25
+ | Check | Rule |
26
+ | --- | --- |
27
+ | Grouping | Groups by the text value of the grouping property; objects with no value go in one row shown as a dash |
28
+ | Order | By the first measure, largest first; groups with no value come last |
29
+ | Statistics | Count, sum, average, least, greatest, distinct count, share (those in the group that meet the condition ÷ all in the group) |
30
+ | Number format | Integers with thousands separators; decimals to at most 1 place; shares as percentages; no value shows a dash |
31
+ | Bars | With "Show bars on values" on, each value gets a bar under it, as long as its share of the column's largest |
32
+
33
+ Sum, average, least and greatest need a number property; count and share do not. For distinct count, the statistic field says what to take distinct values of.
34
+
35
+ ## Extension points
36
+
37
+ ### Logical properties and conditions
38
+
39
+ - **What for**: make a column count only objects that meet a business condition, such as "overdue orders" or "share of high-risk equipment".
40
+ - **Where**: "Count only those that meet" inside a measure; the grouping property can itself be a logical property.
41
+ - **What it connects to**: properties or logical properties of the knowledge network. Write judgements such as overdue or high risk as logical properties; the measure's condition only compares their values.
42
+ - **Input**: each object's property values and the base date.
43
+ - **Output**: one number per group.
44
+ - **Failure and timeout**: when the data source fails to read the table shows "read failed"; with no objects the table is empty.
45
+ - **How results are shown**: one row per group, the measure's name as the column name.
46
+
47
+ ### Actions on click
48
+
49
+ - **What for**: ask the Agent from a summary row, or run knowledge network actions on the objects of that group.
50
+ - **Where**: "Actions on click" on the link tab, up to 8 items with up to 5 steps each; the trigger is the row. The pivot table does not offer scenario simulation.
51
+ - **What it connects to**: asking the Agent; actions of the knowledge network that act on this object type.
52
+ - **Input**: all the objects the row stands for. A question may use \`{count}\` and the grouping property's field name (filled with the group's value).
53
+ - **Output**: the question goes to the analysis Agent; an action first opens the execution confirmation, which lists the group's objects, takes the parameters and checks execution permission, then runs as the current user.
54
+ - **Failure and timeout**: the platform's execution confirmation and approval decide.
55
+ - **How results are shown**: buttons appear at the end of the row.
56
+
57
+ ## Interaction and links
58
+
59
+ - **Writes**: "Click row writes" writes the group's value; clicking the same row again clears it. Without it, clicking a row does nothing.
60
+ - **Reads**: follows the page's shared filters and base date; the selected row is highlighted.
61
+ - **With other components**: the written value filter applies to every component that reads the same variable, such as the object table, the chart and the map, which then look at that group only.
62
+
63
+ ## Recipes
64
+
65
+ ### Orders by customer grade: which grade has the most orders and how high is the overdue share
66
+
67
+ | Role | Maps to |
68
+ | --- | --- |
69
+ | Counted object | Sales order |
70
+ | Grouping property | The order's "customer grade" (a read-related-data column, or a property on the order) |
71
+ | Measures | Order count; total amount; overdue share (condition: delivery status equals overdue) |
72
+
73
+ **The knowledge network needs:**
74
+
75
+ - A relation order → customer, with a "grade" property on the customer.
76
+ - A logical property "delivery status" on orders, with the overdue judgement written in it.
77
+
78
+ **What goes on the extension points:** the measure "overdue share" uses the statistic "share" with the condition "delivery status equals overdue"; "Click row writes" sets the "customer grade" filter, and the object table reads the same filter to show only that grade's orders.
79
+
80
+ **To check:** the order counts of all rows add up to the total; click the "gold" row and the object table keeps only gold customers' orders; click again to restore.
81
+
82
+ ## Guidance for AI
83
+
84
+ 1. Ask the user first: what to group by; what each column should count (quantity, amount, share); which components a row click should drive.
85
+ 2. The grouping property should be text with a limited set of values (region, status, category). A date or an ID gives dozens of rows, even one per object; to see change over time use the chart instead.
86
+ 3. "Share" is those in the group that meet the condition ÷ all in the group, so it only means something with a condition; without one the share is always 100%.
87
+ 4. Sum, average, least and greatest must use a number property, or the result means nothing; count needs no statistic field.
88
+ 5. Common mistakes:
89
+ - More than 5 measures, or "Most rows" outside 5 to 50.
90
+ - Wanting to group by time or by a related object but choosing a property that does not exist: add a computed column first.
91
+ - No "Click row writes" while expecting a click to drive other components.
92
+ - Writing a business judgement again in the condition instead of using the knowledge network's logical property.
93
+
94
+ ## Limits
95
+
96
+ - Up to 5 measures; 5 to 50 rows shown (default 10), further groups are not shown.
97
+ - At most 5000 objects are read per object type data source, and at most 10,000 rows per Cypher data source (1,000 when its query sets no LIMIT); beyond that a note shows above and the figures cover only what was read.
98
+ - Actions on click: up to 8 items with up to 5 steps each; one execution confirmation covers at most 100 objects.
99
+ `;
100
+ export {
101
+ e as default
102
+ };