@openbkn/workshop 0.2.2-rc.5 → 0.2.2
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/README.md +83 -13
- package/component.d.ts +10 -0
- package/dist/ActionConfirm-DJ91X3ml.js +236 -0
- package/dist/ActionFailure-ZgPt_3B-.js +37 -0
- package/dist/AgentChat-CRYai8ge.js +1062 -0
- package/dist/AppFormModal-D73ucaHK.js +4282 -0
- package/dist/AppListPage-D87piiOw.js +1364 -0
- package/dist/AskDrawer-BUMYsRnt.js +38 -0
- package/dist/ComputedView-CgYrDbx1.js +3221 -0
- package/dist/ConclusionApply-sjGfoEBY.js +153 -0
- package/dist/CypherEditor-lus6FA5L.js +485 -0
- package/dist/LandingList-6JI6864C.js +230 -0
- package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
- package/dist/ModelTrial-ClHFGTpQ.js +359 -0
- package/dist/PageRenderer-DBd_g6mN.js +85480 -0
- package/dist/README-DjRyTQSR.js +76 -0
- package/dist/ScenarioApply-DtW_hh47.js +590 -0
- package/dist/SimulateForm-C-i08Jjd.js +153 -0
- package/dist/Subgraph-CnrkH9AN.js +32586 -0
- package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
- package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
- package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
- package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
- package/dist/actionButton-DA5CNEzx.js +94 -0
- package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
- package/dist/agentChat-EoDznd58.js +116 -0
- package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
- package/dist/alertList-DqditwM8.js +84 -0
- package/dist/alertList.en-US-BAXAgltP.js +84 -0
- package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
- package/dist/asOfSlider-QPvHWUMV.js +83 -0
- package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
- package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
- package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
- package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
- package/dist/channel-B034hcOF.js +5 -0
- package/dist/china-C6m7zXIv.js +9 -0
- package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
- package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
- package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
- package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
- package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
- package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
- package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
- package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
- package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
- package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
- package/dist/component.d-DFoMKuUv.js +179 -0
- package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
- package/dist/customComponents-DasaZ6pq.js +4 -0
- package/dist/customComponents.en-US-CkabuCXg.js +79 -0
- package/dist/customParseFormat-C0uLEpdq.js +182 -0
- package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
- package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
- package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
- package/dist/d3-scale-DA8IHmf0.js +1841 -0
- package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
- package/dist/dateRange-BbkLMg8L.js +79 -0
- package/dist/dateRange.en-US-CV12Q02G.js +79 -0
- package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
- package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
- package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
- package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
- package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
- package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
- package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
- package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
- package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
- package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
- package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
- package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
- package/dist/eventList-CnsAwfDS.js +115 -0
- package/dist/eventList.en-US-Cof3rCLq.js +115 -0
- package/dist/eventReport-XS-HegnH.js +76 -0
- package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
- package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
- package/dist/ganttChart-DEeSvTJA.js +77 -0
- package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
- package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
- package/dist/generateCypher-Ch9_lQa6.js +399 -0
- package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
- package/dist/graph-CKJmgLki.js +1541 -0
- package/dist/index-BA-GzCXt.js +441 -0
- package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
- package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
- package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
- package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
- package/dist/katex-BsrBVQKd.js +11314 -0
- package/dist/manifest-BjV1PJ6u.js +41 -0
- package/dist/mermaid.core-yQghUlIz.js +17642 -0
- package/dist/metricCards-CSb-_cT2.js +104 -0
- package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
- package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
- package/dist/modelTrial-Bvb-RhGt.js +137 -0
- package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
- package/dist/models-DekiCOuZ.js +6 -0
- package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
- package/dist/object-metric.service-flZgBMRX.js +233 -0
- package/dist/objectDetail-SQUbp4Py.js +117 -0
- package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
- package/dist/objectList-D99wPtJH.js +97 -0
- package/dist/objectList.en-US-PBBNyVLW.js +97 -0
- package/dist/objectTable-0jsFFMN3.js +127 -0
- package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
- package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
- package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
- package/dist/pivotTable-CHmQw18-.js +102 -0
- package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
- package/dist/prompt-DYrjlEFr.js +373 -0
- package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
- package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
- package/dist/regionMap-Cme-JyV_.js +128 -0
- package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
- package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
- package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
- package/dist/scenarioBar-BV43p7n-.js +122 -0
- package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
- package/dist/scheduleGantt-CTYO-zYP.js +180 -0
- package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
- package/dist/searchBox-Ca7w0f_6.js +67 -0
- package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
- package/dist/segmentedFilter-MhjVcWo0.js +80 -0
- package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
- package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
- package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
- package/dist/stageChain-BxBafwjD.js +74 -0
- package/dist/stageChain.en-US-CP0G27n8.js +74 -0
- package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
- package/dist/subgraph-7n4SwliR.js +71 -0
- package/dist/subgraph.en-US-BNvY18IW.js +71 -0
- package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
- package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
- package/dist/taskInbox-DGWYeI2b.js +118 -0
- package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
- package/dist/text-BqSVQKS6.js +78 -0
- package/dist/text.en-US-BhAxy_LE.js +78 -0
- package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
- package/dist/trendChart-BjEeRS5_.js +135 -0
- package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
- package/dist/useLabData-Df-jEHKs.js +20470 -0
- package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
- package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
- package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
- package/dist/workshop-app-DnHNjBqy.js +86038 -0
- package/dist/workshop-app.css +1 -0
- package/dist/workshop-app.js +4 -0
- package/dist/world-Djau1JyJ.js +9 -0
- package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
- package/dist-cli/workshop.js +341 -218
- package/example/host.js +109 -0
- package/example/index.html +93 -0
- package/example/server.mjs +237 -0
- package/index.d.ts +48 -0
- package/lib/validate.js +47 -1
- package/package.json +17 -5
- package/runtime/frame-runtime.js +13 -1
- package/workshop-component.js +32 -12
- package/workshop.js +2 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { g as o, r as l, d as t } from "./chunk-2E7WHVMD-Ba3svxgx.js";
|
|
2
|
+
import { p as m } from "./chunk-JWPE2WC7-CDBrSjU7.js";
|
|
3
|
+
import { _ as n, l as s } from "./mermaid.core-yQghUlIz.js";
|
|
4
|
+
import { M as p, c as u } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
|
|
5
|
+
var d = u().Railroad.parser.LangiumParser, a = /* @__PURE__ */ n((e) => {
|
|
6
|
+
switch (e.$type) {
|
|
7
|
+
case "RailroadTerminalExpr":
|
|
8
|
+
return {
|
|
9
|
+
type: "terminal",
|
|
10
|
+
value: e.value
|
|
11
|
+
};
|
|
12
|
+
case "RailroadNonTerminalExpr":
|
|
13
|
+
return {
|
|
14
|
+
type: "nonterminal",
|
|
15
|
+
name: e.name
|
|
16
|
+
};
|
|
17
|
+
case "RailroadSpecialExpr":
|
|
18
|
+
return {
|
|
19
|
+
type: "special",
|
|
20
|
+
text: e.text
|
|
21
|
+
};
|
|
22
|
+
case "RailroadSequenceExpr": {
|
|
23
|
+
const r = e.elements.map(a);
|
|
24
|
+
return r.length === 1 ? r[0] : { type: "sequence", elements: r };
|
|
25
|
+
}
|
|
26
|
+
case "RailroadChoiceExpr": {
|
|
27
|
+
const r = e.alternatives.map(a);
|
|
28
|
+
return r.length === 1 ? r[0] : { type: "choice", alternatives: r };
|
|
29
|
+
}
|
|
30
|
+
case "RailroadOptionalExpr":
|
|
31
|
+
return {
|
|
32
|
+
type: "optional",
|
|
33
|
+
element: a(e.element)
|
|
34
|
+
};
|
|
35
|
+
case "RailroadOneOrMoreExpr":
|
|
36
|
+
return {
|
|
37
|
+
type: "repetition",
|
|
38
|
+
element: a(e.element),
|
|
39
|
+
min: 1,
|
|
40
|
+
max: 1 / 0
|
|
41
|
+
};
|
|
42
|
+
case "RailroadZeroOrMoreExpr":
|
|
43
|
+
return {
|
|
44
|
+
type: "repetition",
|
|
45
|
+
element: a(e.element),
|
|
46
|
+
min: 0,
|
|
47
|
+
max: 1 / 0
|
|
48
|
+
};
|
|
49
|
+
default:
|
|
50
|
+
throw new Error(`Unsupported railroad expression: ${e.$type}`);
|
|
51
|
+
}
|
|
52
|
+
}, "transformExpression"), c = /* @__PURE__ */ n((e) => ({
|
|
53
|
+
name: e.name,
|
|
54
|
+
definition: a(e.definition)
|
|
55
|
+
}), "transformRule"), g = /* @__PURE__ */ n((e) => {
|
|
56
|
+
m(e, t), e.title && t.setTitle(e.title), e.rules.map((r) => t.addRule(c(r)));
|
|
57
|
+
}, "populateDb"), y = {
|
|
58
|
+
parse: /* @__PURE__ */ n((e) => {
|
|
59
|
+
t.clear(), s.debug("[Railroad Parser] Starting Langium parse");
|
|
60
|
+
const r = d.parse(e);
|
|
61
|
+
if (r.lexerErrors.length > 0 || r.parserErrors.length > 0)
|
|
62
|
+
throw new p(r);
|
|
63
|
+
const i = r.value;
|
|
64
|
+
s.debug("[Railroad Parser] Parsed rules:", i.rules.length), g(i), s.debug("[Railroad Parser] Parse complete");
|
|
65
|
+
}, "parse"),
|
|
66
|
+
parser: {
|
|
67
|
+
yy: t
|
|
68
|
+
}
|
|
69
|
+
}, h = {
|
|
70
|
+
parser: y,
|
|
71
|
+
db: t,
|
|
72
|
+
renderer: l,
|
|
73
|
+
styles: o
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
h as diagram
|
|
77
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const n = `# 地图(regionMap)
|
|
2
|
+
|
|
3
|
+
按地区给地图着色:中国地图按省份,世界地图按国家,颜色深浅表示该地区对象的数量或金额;可画出关联对象到这些对象之间的连线,点一个地区,整页只看它。用来回答“这些对象分布在哪里、哪里最集中、货从哪里来到哪里去”。
|
|
4
|
+
|
|
5
|
+
## 适用与不适用
|
|
6
|
+
|
|
7
|
+
- 适用:对象带有地名(省份、国家,或客户名称、仓库名称这类含地名的文字),要看地区分布;或要看两类直接相关的对象在地理上的流向。例如各省客户订单、各国供应商、供应商到工厂的供货线。
|
|
8
|
+
- 不适用:
|
|
9
|
+
- 数据里没有地名:地图没有东西可画,不要用;改用透视表(\`pivotTable\`)或图表(\`trendChart\`)按其他属性汇总。
|
|
10
|
+
- 要精确到城市或经纬度:本组件只到省份或国家。
|
|
11
|
+
- 要看对象之间的关系网络、不要地理位置:用关系子图(\`subgraph\`)。
|
|
12
|
+
- 要看明细:用对象表(\`objectTable\`)。
|
|
13
|
+
|
|
14
|
+
## 本体契约
|
|
15
|
+
|
|
16
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| 地区对象 | 要按地区统计的一类对象,作为页面的数据源 | 标识属性;一个文本属性,里面是地名或含地名的文字(地区字段);求和、平均、最大、最小时一个数字属性 | — | 是 |
|
|
19
|
+
| 连线对象 | 与地区对象直接有关系的另一类对象,最多 2 条连线 | 一个文本属性,里面是位置(位置属性,用来识别省份或国家) | 地区对象与它直接相连的**一条**关系;连线由这条关系画出 | 否 |
|
|
20
|
+
| 标注条件属性 | 同一对象类 | “标注”用到的属性,可以是逻辑属性 | — | 否 |
|
|
21
|
+
|
|
22
|
+
连线只能画知识网络里真实存在的一条直接关系,不能沿多条关系拼出连线,也不能在页面里凭空造一条。
|
|
23
|
+
|
|
24
|
+
## 组件内置的判断
|
|
25
|
+
|
|
26
|
+
与行业无关,组件自己做:
|
|
27
|
+
|
|
28
|
+
| 判断 | 规则 |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| 识别地区 | 中国底图:从地区字段的文字里识别省份,可从客户名称这类含地名的文字推断;世界底图:认中英文国名、常见别称和 ISO 代码 |
|
|
31
|
+
| 着色 | 每个地区按度量着色,从浅到深,最深为数值最大的地区;没有对象的地区取 0 |
|
|
32
|
+
| 标注 | 设了“标注”条件时,地区里只要有一个对象满足全部条件,就给该地区加红色描边 |
|
|
33
|
+
| 未识别 | 认不出地区的对象不上图,右上角提示“N 条未识别地区” |
|
|
34
|
+
| 连线 | 从关联对象所在地区连到地区对象所在地区,只连两个不同地区;线越粗、对象越多;线与端点用连线对象类在知识网络里的颜色 |
|
|
35
|
+
| 南海诸岛 | 中国底图右下角附有南海诸岛小图 |
|
|
36
|
+
|
|
37
|
+
什么算“风险地区”“重点区域”不在地图里判断,由知识网络里的属性给出。
|
|
38
|
+
|
|
39
|
+
## 扩展点
|
|
40
|
+
|
|
41
|
+
### 逻辑属性与标注
|
|
42
|
+
|
|
43
|
+
- **用途**:在地图上标出“有问题的地区”,例如有超期订单的省份、有高风险设备的省份。
|
|
44
|
+
- **在哪里配**:“标注”条件。
|
|
45
|
+
- **接什么**:知识网络里的属性或逻辑属性。“超期”“高风险”这类判断写成逻辑属性,标注条件只比较它的取值。
|
|
46
|
+
- **输入**:每个对象的属性值和基准日期。
|
|
47
|
+
- **输出**:满足条件的对象所在的地区,加红色描边。
|
|
48
|
+
- **失败与超时**:数据源读取失败时显示“读取失败”。
|
|
49
|
+
- **结果怎样显示**:红色描边;选中的地区用较粗的深色描边。
|
|
50
|
+
|
|
51
|
+
### 关系连线
|
|
52
|
+
|
|
53
|
+
- **用途**:显示另一类对象与地区对象之间的地理流向,例如供应商所在地到工厂所在地。
|
|
54
|
+
- **在哪里配**:“关系连线”,最多 2 条;每条给名称、连到的对象类、关系(直接相连的一条)、位置属性。
|
|
55
|
+
- **接什么**:知识网络里与数据源对象类直接相连的关系,以及远端对象类上的位置文字属性。
|
|
56
|
+
- **输入**:地区对象的键、远端对象的位置属性。
|
|
57
|
+
- **输出**:每对地区之间的对象个数。
|
|
58
|
+
- **失败与超时**:关系不是直接相连的一条时这条线不画;查询失败时不显示连线,地图着色仍在。
|
|
59
|
+
- **结果怎样显示**:线越粗对象越多;悬停显示“名称:起点 → 终点,N 个对象”;标题右侧列出连线名称与对象类。连线按对象当前的实际数据读取,着色则跟随方案。
|
|
60
|
+
|
|
61
|
+
### 点击后的动作
|
|
62
|
+
|
|
63
|
+
- **用途**:点一个地区时问 Agent。
|
|
64
|
+
- **在哪里配**:链接页的“点击后的动作”,最多 8 项,每项最多 5 个动作;触发点为“地区”。地图只能问 Agent,不能执行行动或推演。
|
|
65
|
+
- **接什么**:问 Agent。
|
|
66
|
+
- **输入**:问题可用 \`{count}\`、\`{region}\`、\`{value}\`;随问题带上该地区的对象。
|
|
67
|
+
- **输出**:问题发给分析 Agent。
|
|
68
|
+
- **失败与超时**:与其他组件的提问相同。
|
|
69
|
+
- **结果怎样显示**:点击后在 Agent 对话里出现问题。
|
|
70
|
+
|
|
71
|
+
## 交互与联动
|
|
72
|
+
|
|
73
|
+
- **写入**:“点击省份写入”一个取值筛选:点一个地区(或连线的终点),写入该地区对应的地区字段取值;再点同一个地区,清除。
|
|
74
|
+
- **读取**:跟随页面的共享筛选和基准日期;默认不跟随自己写入的筛选。
|
|
75
|
+
- **筛选的含义**:写入的是地区字段里的原始文字。地区字段是“拼写不一”的文字时,一个省份可能对应多个取值,写入的是这些取值的列表。
|
|
76
|
+
|
|
77
|
+
## 场景配方
|
|
78
|
+
|
|
79
|
+
### 客户订单分布:各省订单量与超期地区
|
|
80
|
+
|
|
81
|
+
| 角色 | 对应 |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| 地区对象 | 销售订单 |
|
|
84
|
+
| 地区字段 | 订单的“收货省份”,或由客户名称识别出的地区列 |
|
|
85
|
+
| 度量 | 计数,或订单金额求和 |
|
|
86
|
+
| 标注 | 交付状态等于已超期 |
|
|
87
|
+
|
|
88
|
+
**知识网络中要有:** 订单上的收货省份(或客户名称);订单的逻辑属性“交付状态”。
|
|
89
|
+
|
|
90
|
+
**扩展点挂什么:** 标注条件为“交付状态 等于 已超期”;点击省份写入“收货省份”筛选,对象表读同一个筛选。
|
|
91
|
+
|
|
92
|
+
**检查项:** 订单最多的省份颜色最深;有超期订单的省份有红色描边;点一个省,对象表只剩该省订单;右上角没有大量“未识别地区”。
|
|
93
|
+
|
|
94
|
+
### 供应商到工厂:货从哪里来
|
|
95
|
+
|
|
96
|
+
| 角色 | 对应 |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| 地区对象 | 工厂(所在省份) |
|
|
99
|
+
| 连线对象 | 供应商,位置属性为“所在省份” |
|
|
100
|
+
| 关系 | 供应商 → 工厂的供货关系(直接相连的一条) |
|
|
101
|
+
|
|
102
|
+
**知识网络中要有:** 供应商与工厂之间直接的供货关系;供应商上的所在省份。
|
|
103
|
+
|
|
104
|
+
**检查项:** 每条线从供应商所在省连到工厂所在省;悬停显示对象个数;两端在同一省的不画线。
|
|
105
|
+
|
|
106
|
+
## 给 AI 的指引
|
|
107
|
+
|
|
108
|
+
1. 先问用户:要按省份还是按国家;地名在哪个属性里(或哪个属性里的文字含地名);统计什么;要不要标注;要不要连线、连哪两类对象。
|
|
109
|
+
2. 先确认数据里确实有地名:抽几条看地区字段的值。没有地名就不要用地图,说明改用别的组件。
|
|
110
|
+
3. 底图默认中国(按省份);地区字段是国家名、国家代码时要选世界底图,否则大量对象会显示“未识别地区”。
|
|
111
|
+
4. 连线要的是知识网络里真实存在、与地区对象直接相连的一条关系;找不到时列出要补的关系,不要用多跳拼,也不要在页面里自造。
|
|
112
|
+
5. 业务判断(风险、超期)用逻辑属性,标注条件只比较它。
|
|
113
|
+
6. 常见错误:
|
|
114
|
+
- 地区字段选了数字、日期,或不含地名的文本:配置不允许或大量未识别。
|
|
115
|
+
- 连线的位置属性选成了地区对象自己的属性:它应在连线对象类上。
|
|
116
|
+
- 连线超过 2 条,或选了多跳的关系路径。
|
|
117
|
+
- 度量选了求和、平均、最大、最小,却没选数字的统计字段。
|
|
118
|
+
|
|
119
|
+
## 限制
|
|
120
|
+
|
|
121
|
+
- 中国底图到省份,世界底图到国家;不到城市。
|
|
122
|
+
- 关系连线最多 2 条,每条只能是一条直接关系。
|
|
123
|
+
- 对象类数据源最多读入 5000 个对象,Cypher 数据源最多 10000 行(查询没写 LIMIT 时 1000 行),超过时上方提示,统计只覆盖已读取部分。
|
|
124
|
+
- 点击后的动作最多 8 项,每项最多 5 个动作。
|
|
125
|
+
`;
|
|
126
|
+
export {
|
|
127
|
+
n as default
|
|
128
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const e = `# Map (regionMap)
|
|
2
|
+
|
|
3
|
+
Colors a map by region: the China map by province, the world map by country, with deeper color for a greater count or amount of objects; it can draw lines between related objects and these objects, and clicking a region makes the whole page look at it only. Use it to answer "where are these objects, where are they most concentrated, where do goods come from and go to".
|
|
4
|
+
|
|
5
|
+
## When to use it and when not
|
|
6
|
+
|
|
7
|
+
- Use it when objects carry place names (provinces, countries, or text such as customer or warehouse names that contains a place) and you want the regional spread; or when you want the geographic flow between two directly related object types. For example: customer orders by province, suppliers by country, supply lines from suppliers to plants.
|
|
8
|
+
- Do not use it:
|
|
9
|
+
- When the data has no place names: the map has nothing to draw; summarize by other properties with the pivot table (\`pivotTable\`) or the chart (\`trendChart\`).
|
|
10
|
+
- For cities or coordinates: this component goes down to province or country only.
|
|
11
|
+
- To see the network of relations between objects without geography: use the related graph (\`subgraph\`).
|
|
12
|
+
- To see details: use the object table (\`objectTable\`).
|
|
13
|
+
|
|
14
|
+
## Ontology contract
|
|
15
|
+
|
|
16
|
+
| Role | Object type | Required properties | Relations | Required |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| Regional object | The type of object to count by region, as the page's data source | The key property; one text property holding a place name or text containing one (the region field); for sum, average, greatest or least, one number property | — | Yes |
|
|
19
|
+
| Line object | Another object type directly related to the regional object, up to 2 lines | One text property holding its location (the location property, used to recognize the province or country) | **One** relation directly joining the regional object and it; the line is drawn from that relation | No |
|
|
20
|
+
| Highlight property | The same object type | Properties used in "Highlight", which can be logical properties | — | No |
|
|
21
|
+
|
|
22
|
+
A line can only be drawn from one direct relation that really exists in the knowledge network; it cannot be pieced together from several relations, and cannot be invented on the page.
|
|
23
|
+
|
|
24
|
+
## Built-in checks
|
|
25
|
+
|
|
26
|
+
Independent of industry, the component does these itself:
|
|
27
|
+
|
|
28
|
+
| Check | Rule |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Recognizing the region | China map: finds the province in the region field's text, and can infer it from text such as a customer name; world map: knows country names in Chinese and English, common aliases and ISO codes |
|
|
31
|
+
| Coloring | Each region is colored by the measure, light to deep, deepest for the largest value; a region with no objects counts 0 |
|
|
32
|
+
| Highlight | When "Highlight" conditions are set, a region with at least one object meeting all of them gets a red outline |
|
|
33
|
+
| Unrecognized | Objects whose region cannot be recognized are not drawn; a note at the top right says how many |
|
|
34
|
+
| Lines | From the region of the related object to the region of the regional object, only between two different regions; the more objects, the thicker the line; lines and end points use the color of the line object type in the knowledge network |
|
|
35
|
+
| South China Sea islands | The China map carries a small inset of the South China Sea islands at the lower right |
|
|
36
|
+
|
|
37
|
+
What counts as a "risk region" or a "key area" is not judged on the map; properties of the knowledge network give it.
|
|
38
|
+
|
|
39
|
+
## Extension points
|
|
40
|
+
|
|
41
|
+
### Logical properties and highlight
|
|
42
|
+
|
|
43
|
+
- **What for**: mark "problem regions" on the map, such as provinces with overdue orders or with high-risk equipment.
|
|
44
|
+
- **Where**: the "Highlight" conditions.
|
|
45
|
+
- **What it connects to**: properties or logical properties of the knowledge network. Write judgements such as overdue or high risk as logical properties; the highlight condition only compares their values.
|
|
46
|
+
- **Input**: each object's property values and the base date.
|
|
47
|
+
- **Output**: the regions holding objects that meet the conditions, outlined in red.
|
|
48
|
+
- **Failure and timeout**: when the data source fails to read the map shows "read failed".
|
|
49
|
+
- **How results are shown**: a red outline; the selected region gets a thicker, dark outline.
|
|
50
|
+
|
|
51
|
+
### Relation lines
|
|
52
|
+
|
|
53
|
+
- **What for**: show the geographic flow between another object type and the regional objects, such as from where suppliers are to where plants are.
|
|
54
|
+
- **Where**: "Relation lines", up to 2; each takes a name, the object type it connects to, the relation (one directly joined) and the location property.
|
|
55
|
+
- **What it connects to**: a relation in the knowledge network directly joining the data source's object type, and a text location property on the far object type.
|
|
56
|
+
- **Input**: the regional objects' keys and the far objects' location property.
|
|
57
|
+
- **Output**: the number of objects between each pair of regions.
|
|
58
|
+
- **Failure and timeout**: a relation that is not one direct relation draws no line; when the query fails no lines show, while the map's coloring stays.
|
|
59
|
+
- **How results are shown**: the thicker the line, the more objects; hovering shows "name: start → end, N objects"; the names and object types of the lines are listed at the right of the title. Lines read the objects' actual current data, while the coloring follows the scenario.
|
|
60
|
+
|
|
61
|
+
### Actions on click
|
|
62
|
+
|
|
63
|
+
- **What for**: ask the Agent when a region is clicked.
|
|
64
|
+
- **Where**: "Actions on click" on the link tab, up to 8 items with up to 5 steps each; the trigger is the region. The map can only ask the Agent; it cannot run actions or simulations.
|
|
65
|
+
- **What it connects to**: asking the Agent.
|
|
66
|
+
- **Input**: a question may use \`{count}\`, \`{region}\` and \`{value}\`; the region's objects go with the question.
|
|
67
|
+
- **Output**: the question goes to the analysis Agent.
|
|
68
|
+
- **Failure and timeout**: same as asking from other components.
|
|
69
|
+
- **How results are shown**: the question appears in the Agent chat after the click.
|
|
70
|
+
|
|
71
|
+
## Interaction and links
|
|
72
|
+
|
|
73
|
+
- **Writes**: "Click province writes" sets a value filter: clicking a region (or the end of a line) writes the region field's value for that region; clicking the same region again clears it.
|
|
74
|
+
- **Reads**: follows the page's shared filters and base date; by default it does not follow the filter it writes itself.
|
|
75
|
+
- **What the filter holds**: the original text of the region field. When the field's text is spelled in several ways, one province may match several values and the list of those values is written.
|
|
76
|
+
|
|
77
|
+
## Recipes
|
|
78
|
+
|
|
79
|
+
### Customer order spread: orders per province and overdue regions
|
|
80
|
+
|
|
81
|
+
| Role | Maps to |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| Regional object | Sales order |
|
|
84
|
+
| Region field | The order's "delivery province", or a region column recognized from the customer name |
|
|
85
|
+
| Measure | Count, or the sum of the order amount |
|
|
86
|
+
| Highlight | Delivery status equals overdue |
|
|
87
|
+
|
|
88
|
+
**The knowledge network needs:** a delivery province (or customer name) on orders; a logical property "delivery status" on orders.
|
|
89
|
+
|
|
90
|
+
**What goes on the extension points:** the highlight condition "delivery status equals overdue"; "Click province writes" the "delivery province" filter, and the object table reads the same filter.
|
|
91
|
+
|
|
92
|
+
**To check:** the province with the most orders is the deepest color; provinces with overdue orders have a red outline; click a province and the object table keeps only that province's orders; the top right does not show a large number of unrecognized regions.
|
|
93
|
+
|
|
94
|
+
### Suppliers to plants: where goods come from
|
|
95
|
+
|
|
96
|
+
| Role | Maps to |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| Regional object | Plant (its province) |
|
|
99
|
+
| Line object | Supplier, location property "province" |
|
|
100
|
+
| Relation | The supply relation supplier → plant (one directly joined) |
|
|
101
|
+
|
|
102
|
+
**The knowledge network needs:** a direct supply relation between suppliers and plants; a province on suppliers.
|
|
103
|
+
|
|
104
|
+
**To check:** each line runs from the supplier's province to the plant's province; hovering shows the number of objects; no line is drawn when both ends are in one province.
|
|
105
|
+
|
|
106
|
+
## Guidance for AI
|
|
107
|
+
|
|
108
|
+
1. Ask the user first: by province or by country; which property holds the place name (or which property's text contains one); what to count; whether to highlight; whether to draw lines and between which two object types.
|
|
109
|
+
2. Make sure the data really has place names: look at a few values of the region field. With no place names do not use the map; say which other component to use.
|
|
110
|
+
3. The base map defaults to China (by province); when the region field holds country names or country codes, choose the world map, or many objects will show as unrecognized.
|
|
111
|
+
4. A line needs a relation that really exists in the knowledge network and joins directly to the regional object; when none is found, list the relations to add; do not piece it together over several hops and do not invent one on the page.
|
|
112
|
+
5. Put business judgements (risk, overdue) in logical properties; the highlight condition only compares them.
|
|
113
|
+
6. Common mistakes:
|
|
114
|
+
- A number, a date or a text without place names as the region field: it is rejected or most objects are unrecognized.
|
|
115
|
+
- The line's location property taken from the regional object itself: it must be on the line object type.
|
|
116
|
+
- More than 2 lines, or a multi-hop relation path.
|
|
117
|
+
- Sum, average, greatest or least chosen as the measure without a number statistic field.
|
|
118
|
+
|
|
119
|
+
## Limits
|
|
120
|
+
|
|
121
|
+
- The China map goes down to provinces and the world map to countries; no cities.
|
|
122
|
+
- Up to 2 relation lines, each one direct relation only.
|
|
123
|
+
- 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.
|
|
124
|
+
- Actions on click: up to 8 items with up to 5 steps each.
|
|
125
|
+
`;
|
|
126
|
+
export {
|
|
127
|
+
e as default
|
|
128
|
+
};
|