gis-view-webgl2 0.1.0 → 0.1.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 +40 -8
- package/dist/gis-view.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1036 -249
- package/dist/index.js +1 -1
- package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +194 -0
- package/docs/GisView.md +9 -8
- package/docs/GisView/345/256/236/347/216/260/345/216/237/347/220/206.md +2 -2
- package/docs/ai/06-/344/274/232/350/257/235/347/264/242/345/274/225/344/270/216/345/244/215/346/237/245/346/226/271/346/263/225.md +172 -0
- package/docs/api/index.html +545 -59
- package/docs/demos/BackendSyncDemo.vue +10 -8
- package/docs/demos/BasicDemo.vue +101 -101
- package/docs/demos/BatchAddDemo.vue +5 -5
- package/docs/demos/ChannelDemo.vue +617 -10
- package/docs/demos/ConnectDemo.vue +392 -0
- package/docs/demos/CopyMergeDemo.vue +980 -929
- package/docs/demos/DecorationDraftDemo.vue +1300 -0
- package/docs/demos/DemoShell.vue +569 -240
- package/docs/demos/DragDropDemo.vue +11 -11
- package/docs/demos/EffectsDemo.vue +6 -6
- package/docs/demos/EventDemo.vue +327 -327
- package/docs/demos/ExtensionDemo.vue +458 -0
- package/docs/demos/GisViewDemo.vue +61 -48
- package/docs/demos/GraphicDemo.vue +338 -0
- package/docs/demos/LabelDemo.vue +553 -497
- package/docs/demos/MinimapDemo.vue +358 -0
- package/docs/demos/PerfDemo.vue +29 -0
- package/docs/demos/SearchFilterDemo.vue +412 -0
- package/docs/demos/StyleDemo.vue +121 -121
- package/docs/demos/api-index.js +98 -77
- package/docs/demos/demos.js +159 -135
- package/docs/demos/shared/demoData.js +107 -107
- package/docs/demos/shared/demoStyle.css +249 -249
- package/docs/demos/shared/fakeBackend.js +93 -6
- package/docs/format/03-/346/213/220/347/202/271/350/243/205/351/245/260/344/270/216/346/240/267/345/274/217.md +28 -8
- package/docs/format/04-/351/200/232/351/201/223/344/270/216/346/240/207/347/255/276.md +5 -4
- package/docs/format/06-/345/257/274/345/205/245/345/257/274/345/207/272/344/270/216/346/240/207/345/207/206/346/226/207/346/241/243.md +8 -6
- package/docs/format/07-/344/272/213/344/273/266/350/275/275/350/215/267/344/270/216/347/244/272/344/276/213/346/225/260/346/215/256.md +6 -6
- package/docs/guide/sample-document.html +4 -4
- package/docs/index.html +180 -9
- package/docs/internals/11-/350/246/206/347/233/226/345/261/202/346/240/207/347/255/276/344/270/216/346/217/220/347/244/272.md +1 -1
- package/docs/internals/13-/351/271/260/347/234/274/345/233/276.md +3 -2
- package/docs/internals/15-03-/351/200/220/350/275/256/350/256/260/345/275/225-/346/200/247/350/203/275/344/270/216/344/277/256/345/244/215-/344/270/213.md +16 -0
- package/docs/internals/16-03-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/213.md +11 -0
- package/docs/internals/17-/350/260/203/350/257/225/344/270/216/346/211/251/345/261/225/345/273/272/350/256/256.md +1 -1
- package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +18 -4
- package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +110 -25
- package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +13 -8
- package/docs/manual/06-/346/225/260/346/215/256/344/270/216/345/234/272/346/231/257/346/233/264/346/226/260.md +111 -10
- package/docs/manual/07-/346/214/207/351/222/210/344/270/216/350/246/201/347/264/240/347/274/226/350/276/221.md +47 -9
- package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +17 -15
- package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +61 -11
- package/docs/manual/10-/351/200/232/351/201/223/347/274/226/350/276/221/344/270/216/346/226/260/345/242/236.md +74 -7
- package/docs/manual/11-/346/240/267/345/274/217/344/270/216/350/247/204/345/210/231.md +3 -2
- package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +260 -3
- package/docs/manual/13-/345/212/250/346/225/210/344/270/216/345/233/276/345/205/203.md +6 -5
- package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +27 -14
- package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +142 -49
- package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +31 -29
- package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +55 -39
- package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +189 -64
- package/docs/manual/19-/350/257/273/346/225/260/344/270/216/346/213/226/346/213/275/351/242/204/350/247/210.md +4 -4
- package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +42 -2
- package/docs/manual/21-/350/257/264/346/230/216/344/270/216/345/270/270/350/247/201/351/227/256/351/242/230.md +22 -6
- package/docs/playground/index.html +5 -5
- package/docs/steps/README.md +14 -10
- package/docs/steps/check-doc-truth.mjs +1 -1
- package/docs/steps/selftest-actions.html +10 -10
- package/docs/steps/selftest-data.html +96 -14
- package/docs/steps/selftest-decoration.html +577 -0
- package/docs/steps/selftest-demo.html +6 -5
- package/docs/steps/selftest-demos.html +2201 -1612
- package/docs/steps/selftest-docs.html +89 -16
- package/docs/steps/selftest-effects.html +5 -5
- package/docs/steps/selftest-features.html +757 -86
- package/docs/steps/selftest-full.html +583 -583
- package/docs/steps/selftest-labels.html +1034 -652
- package/docs/steps/selftest-perf.html +1899 -1844
- package/docs/steps/selftest-scale.html +117 -7
- package/docs/steps/selftest-select.html +24 -17
- package/docs/steps/step-10-full.js +1 -1
- package/docs//346/216/245/345/217/243/345/215/217/350/256/256.md +167 -17
- package/docs//346/225/260/346/215/256/346/240/274/345/274/217.md +1 -1
- package/package.json +43 -43
- package/docs/demos/HistoryDemo.vue +0 -230
- package/docs/demos/InterfaceDemo.vue +0 -309
- package/docs/demos/SampleDemo.vue +0 -283
package/docs/demos/demos.js
CHANGED
|
@@ -1,105 +1,113 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 演示注册表:一个功能一个演示,各自独立成组件(自己的画布 + 控件 + 读数),
|
|
3
|
-
* 由 DemoShell.vue 按页签懒加载 —— 想看哪一块就进哪一块,不用在一屏里翻几十个面板。
|
|
4
|
-
*
|
|
5
|
-
* `component` 是动态 import:切到哪个演示才加载哪个组件(综合示例最大,不进来就不下载)。
|
|
6
|
-
* `group` 是页签的分组(见 DEMO_GROUPS:基础 / 交互 / 样式 / 数据 / 性能 / 综合),
|
|
7
|
-
* `doc` 是「这块功能对应哪一份文档」的直达链接,外壳把那句说明旁边挂一个小链接。
|
|
8
|
-
*/
|
|
9
|
-
const docsBase = `${import.meta.env?.BASE_URL ?? '/'}docs/index.html`
|
|
10
|
-
/** 文档直达链接:`#` 后面是文档中心认识的 markdown 文件名(见 docs/index.html 的 load) */
|
|
11
|
-
const DOC_GUIDE = { href: `${docsBase}#GisView.md`, label: 'GisView.md' }
|
|
12
|
-
const DOC_FORMAT = { href: `${docsBase}#数据格式.md`, label: '数据格式.md' }
|
|
1
|
+
/**
|
|
2
|
+
* 演示注册表:一个功能一个演示,各自独立成组件(自己的画布 + 控件 + 读数),
|
|
3
|
+
* 由 DemoShell.vue 按页签懒加载 —— 想看哪一块就进哪一块,不用在一屏里翻几十个面板。
|
|
4
|
+
*
|
|
5
|
+
* `component` 是动态 import:切到哪个演示才加载哪个组件(综合示例最大,不进来就不下载)。
|
|
6
|
+
* `group` 是页签的分组(见 DEMO_GROUPS:基础 / 交互 / 样式 / 数据 / 性能 / 综合),
|
|
7
|
+
* `doc` 是「这块功能对应哪一份文档」的直达链接,外壳把那句说明旁边挂一个小链接。
|
|
8
|
+
*/
|
|
9
|
+
const docsBase = `${import.meta.env?.BASE_URL ?? '/'}docs/index.html`
|
|
10
|
+
/** 文档直达链接:`#` 后面是文档中心认识的 markdown 文件名(见 docs/index.html 的 load) */
|
|
11
|
+
const DOC_GUIDE = { href: `${docsBase}#GisView.md`, label: 'GisView.md' }
|
|
13
12
|
const DOC_INTERNALS = { href: `${docsBase}#GisView实现原理.md`, label: '实现原理' }
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
13
|
+
const DOC_EDIT = { href: `${docsBase}#manual/07-指针与要素编辑.md`, label: '07 指针与要素编辑' }
|
|
14
|
+
const DOC_UPDATE = { href: `${docsBase}#manual/06-数据与场景更新.md`, label: '06 数据与场景更新' }
|
|
15
|
+
const DOC_LABELS = { href: `${docsBase}#manual/12-标签与装饰.md`, label: '12 标签与装饰' }
|
|
16
|
+
const DOC_VIEW = { href: `${docsBase}#manual/14-视图与筛选.md`, label: '14 视图与筛选' }
|
|
18
17
|
const DOC_API = { href: `${docsBase}#接口协议.md`, label: '编辑接口协议' }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{ id: '
|
|
24
|
-
{ id: '
|
|
25
|
-
{ id: '
|
|
26
|
-
{ id: '
|
|
27
|
-
{ id: '
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
18
|
+
const DOC_EXTEND = { href: `${docsBase}#manual/15-导出与集成.md`, label: '15 导出与集成' }
|
|
19
|
+
|
|
20
|
+
/** 页签分组的固定次序与组名(每组里的演示按 DEMOS 里的顺序排) */
|
|
21
|
+
export const DEMO_GROUPS = [
|
|
22
|
+
{ id: 'basic', label: '基础' },
|
|
23
|
+
{ id: 'interact', label: '交互' },
|
|
24
|
+
{ id: 'style', label: '样式' },
|
|
25
|
+
{ id: 'data', label: '数据' },
|
|
26
|
+
{ id: 'perf', label: '性能' },
|
|
27
|
+
{ id: 'full', label: '综合' }
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
export const DEMOS = [
|
|
31
|
+
{
|
|
32
|
+
id: 'basic',
|
|
33
|
+
title: '基础视图',
|
|
34
|
+
group: 'basic',
|
|
35
|
+
blurb: '点 / 线 / 通道最少的起手式:一份数据进来、相机出去,拾取与读数都摆在台面上。',
|
|
36
|
+
doc: DOC_GUIDE,
|
|
37
|
+
component: () => import('./BasicDemo.vue')
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'labels',
|
|
41
|
+
title: '标签交互',
|
|
42
|
+
group: 'interact',
|
|
43
|
+
blurb: '标签点选 / 拖拽 / 右键菜单(编辑、改位置、删除),以及用一套 API 给选中集批量加标签。',
|
|
44
|
+
doc: DOC_GUIDE,
|
|
45
|
+
component: () => import('./LabelDemo.vue')
|
|
46
|
+
},
|
|
47
47
|
{
|
|
48
48
|
id: 'label-display',
|
|
49
49
|
title: '标签显示',
|
|
50
|
-
group: 'interact',
|
|
51
|
-
blurb: '动态切换节点 / 线路标签内容:名称、电压、负载率、自定义模板,还能分别改一类或自动轮播。',
|
|
50
|
+
group: 'interact',
|
|
51
|
+
blurb: '动态切换节点 / 线路标签内容:名称、电压、负载率、自定义模板,还能分别改一类或自动轮播。',
|
|
52
52
|
doc: DOC_LABELS,
|
|
53
53
|
component: () => import('./LabelDisplayDemo.vue')
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
id: '
|
|
57
|
-
title: '
|
|
58
|
-
group: 'style',
|
|
59
|
-
blurb: '按属性配色、规则 JSON 现场改、逐点样式与选中高亮的优先级,改完立刻重画。',
|
|
60
|
-
doc: DOC_GUIDE,
|
|
61
|
-
component: () => import('./StyleDemo.vue')
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 'hover-tooltip',
|
|
65
|
-
title: '悬停与提示',
|
|
66
|
-
group: 'style',
|
|
67
|
-
blurb: '悬浮节点 / 线路的高亮样式现场调;tooltip 内容可用模板、函数或 DOM 元素,悬停期间也能立刻刷新。',
|
|
68
|
-
doc: DOC_LABELS,
|
|
69
|
-
component: () => import('./HoverTooltipDemo.vue')
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'channel',
|
|
73
|
-
title: '通道与数据',
|
|
74
|
-
group: 'data',
|
|
75
|
-
blurb: '通道分组拆合、拐点增删拖,以及整份 groups / path 覆盖的假接口联调(版本号、opId 幂等、失败重试);另带定向更新与整份数据导出 / 回灌。',
|
|
76
|
-
doc: DOC_API,
|
|
77
|
-
component: () => import('./ChannelDemo.vue')
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'backend',
|
|
81
|
-
title: '编辑与保存',
|
|
82
|
-
group: 'data',
|
|
83
|
-
blurb: '分组增删改、拐点增删改、场站改坐标:每一步要发给后端的请求体都摊在面板上,配上待提交队列 / 版本号 / 409 与整份保存。',
|
|
84
|
-
doc: DOC_API,
|
|
85
|
-
component: () => import('./BackendSyncDemo.vue')
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: 'events',
|
|
89
|
-
title: '事件与方法',
|
|
56
|
+
id: 'minimap',
|
|
57
|
+
title: '鹰眼图配置',
|
|
90
58
|
group: 'interact',
|
|
91
|
-
blurb: '
|
|
92
|
-
doc:
|
|
93
|
-
component: () => import('./
|
|
59
|
+
blurb: '尺寸 / 位置 / 范围 / 规则 / 层级 / 小图缩放与备份倍率一页调完;另有两层自定义绘制演示 layers 的扩展方式。',
|
|
60
|
+
doc: DOC_VIEW,
|
|
61
|
+
component: () => import('./MinimapDemo.vue')
|
|
94
62
|
},
|
|
95
63
|
{
|
|
96
|
-
id: '
|
|
97
|
-
title: '
|
|
98
|
-
group: '
|
|
99
|
-
blurb: '
|
|
100
|
-
doc:
|
|
101
|
-
component: () => import('./
|
|
102
|
-
},
|
|
64
|
+
id: 'style',
|
|
65
|
+
title: '样式与规则',
|
|
66
|
+
group: 'style',
|
|
67
|
+
blurb: '按属性配色、规则 JSON 现场改、逐点样式与选中高亮的优先级,改完立刻重画。',
|
|
68
|
+
doc: DOC_GUIDE,
|
|
69
|
+
component: () => import('./StyleDemo.vue')
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'hover-tooltip',
|
|
73
|
+
title: '悬停与提示',
|
|
74
|
+
group: 'style',
|
|
75
|
+
blurb: '悬浮节点 / 线路的高亮样式现场调;tooltip 内容可用模板、函数或 DOM 元素,悬停期间也能立刻刷新。',
|
|
76
|
+
doc: DOC_LABELS,
|
|
77
|
+
component: () => import('./HoverTooltipDemo.vue')
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'channel',
|
|
81
|
+
title: '通道与数据',
|
|
82
|
+
group: 'data',
|
|
83
|
+
blurb: '通道分组拆合、拐点增删拖,以及整份 groups / path 覆盖的假接口联调(版本号、opId 幂等、失败重试);另带定向更新与整份数据导出 / 回灌。',
|
|
84
|
+
doc: DOC_API,
|
|
85
|
+
component: () => import('./ChannelDemo.vue')
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'backend',
|
|
89
|
+
title: '编辑与保存',
|
|
90
|
+
group: 'data',
|
|
91
|
+
blurb: '分组增删改、拐点增删改、场站改坐标:每一步要发给后端的请求体都摊在面板上,配上待提交队列 / 版本号 / 409 与整份保存。',
|
|
92
|
+
doc: DOC_API,
|
|
93
|
+
component: () => import('./BackendSyncDemo.vue')
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'events',
|
|
97
|
+
title: '事件与方法',
|
|
98
|
+
group: 'interact',
|
|
99
|
+
blurb: '一条 * 订阅看全部事件,配上常用方法按钮 —— 事件载荷与方法返回值都打在日志里。',
|
|
100
|
+
doc: DOC_GUIDE,
|
|
101
|
+
component: () => import('./EventDemo.vue')
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'copy-merge',
|
|
105
|
+
title: '批量复制与合并',
|
|
106
|
+
group: 'interact',
|
|
107
|
+
blurb: '在画布 Shift 框选后整组复制或合并:复制 / 合并都接假后端,演示版本号、opId 幂等、失败重试与本地回滚;合并可切碰撞 / 中心进入目标区域两种触发时机,Alt 点击 / Ctrl+V 的复制事件也可直接回滚或用 addPoint 接管。',
|
|
108
|
+
doc: DOC_API,
|
|
109
|
+
component: () => import('./CopyMergeDemo.vue')
|
|
110
|
+
},
|
|
103
111
|
{
|
|
104
112
|
id: 'drag',
|
|
105
113
|
title: '拖拽落点',
|
|
@@ -109,45 +117,53 @@ export const DEMOS = [
|
|
|
109
117
|
component: () => import('./DragDropDemo.vue')
|
|
110
118
|
},
|
|
111
119
|
{
|
|
112
|
-
id: '
|
|
113
|
-
title: '
|
|
114
|
-
group: '
|
|
115
|
-
blurb: '
|
|
116
|
-
doc:
|
|
117
|
-
component: () => import('./
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: 'batch-add',
|
|
121
|
-
title: '批量新增',
|
|
122
|
-
group: 'data',
|
|
123
|
-
blurb: '五个批量入口各一颗按钮:多节点、多线路、多通道、多拐点、多分组;每次只记一步历史、只发一条数据变更,返回读数与当前规模都摊在面板上。',
|
|
124
|
-
doc: DOC_UPDATE,
|
|
125
|
-
component: () => import('./BatchAddDemo.vue')
|
|
120
|
+
id: 'connect',
|
|
121
|
+
title: '可视化连线',
|
|
122
|
+
group: 'interact',
|
|
123
|
+
blurb: '没有通道也能只用点与线:当场配置直线 / 正交折线、箭头、颜色与线宽,再分别用默认提交、addLines 或 addChannels 落地。',
|
|
124
|
+
doc: DOC_GUIDE,
|
|
125
|
+
component: () => import('./ConnectDemo.vue')
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
|
-
id: '
|
|
129
|
-
title: '
|
|
130
|
-
group: '
|
|
131
|
-
blurb: '
|
|
132
|
-
doc:
|
|
133
|
-
component: () => import('./
|
|
134
|
-
},
|
|
128
|
+
id: 'decoration',
|
|
129
|
+
title: '动态装饰器',
|
|
130
|
+
group: 'interact',
|
|
131
|
+
blurb: '线路与节点可分开或同时开启:悬停目标就出临时装饰,移开收掉、松手命中才发 ready;节点可调偏移 / 固定 / 鼠标吸附、连接线与白名单,线路可调平行方向与单线 / 分组 / 通道范围,确认才写数据。',
|
|
132
|
+
doc: DOC_LABELS,
|
|
133
|
+
component: () => import('./DecorationDraftDemo.vue')
|
|
134
|
+
},
|
|
135
135
|
{
|
|
136
|
-
id: '
|
|
137
|
-
title: '
|
|
136
|
+
id: 'batch-add',
|
|
137
|
+
title: '批量新增',
|
|
138
|
+
group: 'data',
|
|
139
|
+
blurb: '五个批量入口各一颗按钮:多节点、多线路、多通道、多拐点、多分组;每次只记一步历史、只发一条数据变更,返回读数与当前规模都摊在面板上。',
|
|
140
|
+
doc: DOC_UPDATE,
|
|
141
|
+
component: () => import('./BatchAddDemo.vue')
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'search-filter',
|
|
145
|
+
title: '搜索与筛选',
|
|
146
|
+
group: 'data',
|
|
147
|
+
blurb: '关键字 / scope / fields / limit 现场调,同步搜索与 Worker 异步搜索对照;筛选条件、getFilterResult 与 getVisibleData 同屏读数。',
|
|
148
|
+
doc: DOC_VIEW,
|
|
149
|
+
component: () => import('./SearchFilterDemo.vue')
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 'extension',
|
|
153
|
+
title: '扩展能力',
|
|
138
154
|
group: 'data',
|
|
139
|
-
blurb: '
|
|
140
|
-
doc:
|
|
141
|
-
component: () => import('./
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'perf',
|
|
145
|
-
title: '性能与质量',
|
|
146
|
-
group: 'perf',
|
|
147
|
-
blurb: '几千 / 十万级数据切换、筛选走 Worker、质量档自动升降,交互期细线与 MSAA 两个开关现场对比帧耗时。',
|
|
148
|
-
doc: DOC_INTERNALS,
|
|
149
|
-
component: () => import('./PerfDemo.vue')
|
|
150
|
-
},
|
|
155
|
+
blurb: '四个扩展点同屏:view.use 运行时插件、自定义图元、自定义条件运算符与 defineExportFormat 业务导出。',
|
|
156
|
+
doc: DOC_EXTEND,
|
|
157
|
+
component: () => import('./ExtensionDemo.vue')
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: 'perf',
|
|
161
|
+
title: '性能与质量',
|
|
162
|
+
group: 'perf',
|
|
163
|
+
blurb: '几千 / 十万级数据切换、筛选走 Worker、质量档自动升降,交互期细线与 MSAA 两个开关现场对比帧耗时。',
|
|
164
|
+
doc: DOC_INTERNALS,
|
|
165
|
+
component: () => import('./PerfDemo.vue')
|
|
166
|
+
},
|
|
151
167
|
{
|
|
152
168
|
id: 'effects',
|
|
153
169
|
title: '动画效果',
|
|
@@ -156,15 +172,23 @@ export const DEMOS = [
|
|
|
156
172
|
doc: DOC_GUIDE,
|
|
157
173
|
component: () => import('./EffectsDemo.vue')
|
|
158
174
|
},
|
|
175
|
+
{
|
|
176
|
+
id: 'graphic',
|
|
177
|
+
title: '扩展图形',
|
|
178
|
+
group: 'style',
|
|
179
|
+
blurb: 'SVG 路径 / 图片 / 外部 Canvas 三类图形同屏:世界坐标锚定、相机联动、透明度 / 旋转 / 层级与运行时增删改。',
|
|
180
|
+
doc: DOC_LABELS,
|
|
181
|
+
component: () => import('./GraphicDemo.vue')
|
|
182
|
+
},
|
|
159
183
|
{
|
|
160
184
|
id: 'full',
|
|
161
|
-
title: '综合示例(全功能)',
|
|
162
|
-
group: 'full',
|
|
163
|
-
blurb: '所有面板都在这一个演示里:十万级数据、热力图、鹰眼图、通道编辑、历史与快捷键。',
|
|
164
|
-
doc: { href: docsBase, label: '文档中心' },
|
|
165
|
-
component: () => import('./GisViewDemo.vue')
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
|
|
169
|
-
/** 默认进综合示例:它信息量最全,也是文档里到处引用的那一个 */
|
|
170
|
-
export const DEFAULT_DEMO_ID = 'full'
|
|
185
|
+
title: '综合示例(全功能)',
|
|
186
|
+
group: 'full',
|
|
187
|
+
blurb: '所有面板都在这一个演示里:十万级数据、热力图、鹰眼图、通道编辑、历史与快捷键。',
|
|
188
|
+
doc: { href: docsBase, label: '文档中心' },
|
|
189
|
+
component: () => import('./GisViewDemo.vue')
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
/** 默认进综合示例:它信息量最全,也是文档里到处引用的那一个 */
|
|
194
|
+
export const DEFAULT_DEMO_ID = 'full'
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 几个功能演示(Basic / Label / Style / Channel / Event / Perf)共用的一份小规模演示数据:
|
|
3
|
-
* 字段名与真实样例数据保持一致(节点 id / name / x / y / vn_kv / station_type / zone_name,
|
|
4
|
-
* 线路 id / name / from / to / vn_kv / max_loading_rate),换成真实数据时写法不用改。
|
|
5
|
-
*
|
|
6
|
-
* 数据量刻意压在几十个节点:每个演示只讲一件事,读数与事件日志一眼能对上;
|
|
7
|
-
* 想看十万级规模的性能表现去「性能与质量」演示(它自己放大数据)。
|
|
8
|
-
*/
|
|
9
|
-
import { createChannels } from '../../../src/index.js'
|
|
10
|
-
|
|
11
|
-
/** 与真实样例同一套电压等级与站点类型 */
|
|
12
|
-
export const VOLTAGE_LEVELS = [1050, 525, 230, 15.7]
|
|
13
|
-
export const STATION_TYPES = ['station', 'storage', 'coal', 'gas', 'solar', 'wind', 'nuclear', 'load']
|
|
14
|
-
/** 电压等级配色:规则 / 图例 / 标签三处共用一份,改这里到处一致 */
|
|
15
|
-
export const VOLTAGE_COLORS = {
|
|
16
|
-
1050: '#ff4fa3',
|
|
17
|
-
525: '#a06bff',
|
|
18
|
-
230: '#3fa7ff',
|
|
19
|
-
15.7: '#4fd1a5'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** 固定种子的随机数:每次刷新布局一致,方便对着文档看效果 */
|
|
23
|
-
export const createRandom = (seed) => () => {
|
|
24
|
-
seed = (seed * 1664525 + 1013904223) % 4294967296
|
|
25
|
-
return seed / 4294967296
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** 演示数据落在这块范围里:fitView 一次全看到 */
|
|
29
|
-
export const DEMO_CENTER = [116.35, 39.0]
|
|
30
|
-
export const DEMO_RADIUS = 2.2
|
|
31
|
-
/**
|
|
32
|
-
* 演示节点:环上撒点(半径按序号轻微起伏,不是标准圆),
|
|
33
|
-
* 电压 / 类型 / 分区按序号取模,分布均匀 —— 按属性配色、按规则改样式一眼能看出效果。
|
|
34
|
-
*/
|
|
35
|
-
export const createDemoPoints = (count = 28, seed = 20240915) => {
|
|
36
|
-
const random = createRandom(seed)
|
|
37
|
-
const points = []
|
|
38
|
-
for (let index = 0; index < count; index += 1) {
|
|
39
|
-
const angle = (index / count) * Math.PI * 2
|
|
40
|
-
const radius = DEMO_RADIUS * (0.6 + ((index % 5) / 5) * 0.4)
|
|
41
|
-
points.push({
|
|
42
|
-
id: `node-${index}`,
|
|
43
|
-
x: Number((DEMO_CENTER[0] + Math.cos(angle) * radius).toFixed(5)),
|
|
44
|
-
y: Number((DEMO_CENTER[1] + Math.sin(angle) * radius).toFixed(5)),
|
|
45
|
-
name: `变电站 ${index + 1}`,
|
|
46
|
-
vn_kv: VOLTAGE_LEVELS[index % VOLTAGE_LEVELS.length],
|
|
47
|
-
station_type: STATION_TYPES[(index * 3) % STATION_TYPES.length],
|
|
48
|
-
zone_name: `分区 ${(index % 4) + 1}`,
|
|
49
|
-
max_loading_rate: Number((0.4 + random() * 1.1).toFixed(3))
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
return points
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* 演示线路:沿环把相邻节点连起来(每点两条,度数均匀),
|
|
56
|
-
* 再补几条「辐条」连到 0 号节点 —— 环 + 辐条比纯环更像一张网,框选 / 拾取都有东西可点。
|
|
57
|
-
* 每 7 条里有一条标成直流线路(type: 'dc_line'),给装饰 / 规则演示用。
|
|
58
|
-
*/
|
|
59
|
-
export const connectDemoLines = (points) => {
|
|
60
|
-
const lines = []
|
|
61
|
-
const push = (fromIndex, toIndex) => {
|
|
62
|
-
const from = points[fromIndex]
|
|
63
|
-
const to = points[toIndex]
|
|
64
|
-
lines.push({
|
|
65
|
-
id: `line-${lines.length}`,
|
|
66
|
-
name: `线路 ${lines.length + 1}`,
|
|
67
|
-
from: from.id,
|
|
68
|
-
to: to.id,
|
|
69
|
-
vn_kv: from.vn_kv,
|
|
70
|
-
max_loading_rate: Number(((from.max_loading_rate + to.max_loading_rate) / 2).toFixed(3)),
|
|
71
|
-
...(lines.length % 7 === 3 ? { type: 'dc_line' } : {})
|
|
72
|
-
})
|
|
73
|
-
}
|
|
74
|
-
points.forEach((point, index) => push(index, (index + 1) % points.length))
|
|
75
|
-
points.forEach((point, index) => {
|
|
76
|
-
if (index > 0 && index % 5 === 0) {
|
|
77
|
-
push(0, index)
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
return lines
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* 一次拿齐:节点 + 线路(含通道回线)+ 通道。
|
|
84
|
-
* `lines` 已经带上通道回线,直接交给 createGisView({ points, lines, channels }) 就行;
|
|
85
|
-
* 只想演示普通线路时用 `linesWithoutChannel`。
|
|
86
|
-
*/
|
|
87
|
-
export const buildDemoData = (options = {}) => {
|
|
88
|
-
const { count = 28, seed = 20240915, channels = 3 } = options
|
|
89
|
-
const points = createDemoPoints(count, seed)
|
|
90
|
-
const lines = connectDemoLines(points)
|
|
91
|
-
if (!channels) {
|
|
92
|
-
return { points, lines, linesWithoutChannel: lines, channelLines: [], channels: [] }
|
|
93
|
-
}
|
|
94
|
-
const specs = [
|
|
95
|
-
{ id: 'channel-a', name: '甲通道', from: points[0].id, to: points[7 % count].id, circuits: 3, lineProps: { vn_kv: 1050, max_loading_rate: 1.12 } },
|
|
96
|
-
{ id: 'channel-b', name: '乙通道', from: points[12 % count].id, to: points[19 % count].id, circuits: 2, lineProps: { vn_kv: 525, max_loading_rate: 0.72 } },
|
|
97
|
-
{ id: 'channel-c', name: '丙通道', from: points[3 % count].id, to: points[15 % count].id, circuits: 4, lineProps: { vn_kv: 230, max_loading_rate: 0.51 } }
|
|
98
|
-
].slice(0, channels)
|
|
99
|
-
const built = createChannels(specs)
|
|
100
|
-
return {
|
|
101
|
-
points,
|
|
102
|
-
lines: [...lines, ...built.lines],
|
|
103
|
-
linesWithoutChannel: lines,
|
|
104
|
-
channelLines: built.lines,
|
|
105
|
-
channels: built.channels
|
|
106
|
-
}
|
|
107
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 几个功能演示(Basic / Label / Style / Channel / Event / Perf)共用的一份小规模演示数据:
|
|
3
|
+
* 字段名与真实样例数据保持一致(节点 id / name / x / y / vn_kv / station_type / zone_name,
|
|
4
|
+
* 线路 id / name / from / to / vn_kv / max_loading_rate),换成真实数据时写法不用改。
|
|
5
|
+
*
|
|
6
|
+
* 数据量刻意压在几十个节点:每个演示只讲一件事,读数与事件日志一眼能对上;
|
|
7
|
+
* 想看十万级规模的性能表现去「性能与质量」演示(它自己放大数据)。
|
|
8
|
+
*/
|
|
9
|
+
import { createChannels } from '../../../src/index.js'
|
|
10
|
+
|
|
11
|
+
/** 与真实样例同一套电压等级与站点类型 */
|
|
12
|
+
export const VOLTAGE_LEVELS = [1050, 525, 230, 15.7]
|
|
13
|
+
export const STATION_TYPES = ['station', 'storage', 'coal', 'gas', 'solar', 'wind', 'nuclear', 'load']
|
|
14
|
+
/** 电压等级配色:规则 / 图例 / 标签三处共用一份,改这里到处一致 */
|
|
15
|
+
export const VOLTAGE_COLORS = {
|
|
16
|
+
1050: '#ff4fa3',
|
|
17
|
+
525: '#a06bff',
|
|
18
|
+
230: '#3fa7ff',
|
|
19
|
+
15.7: '#4fd1a5'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** 固定种子的随机数:每次刷新布局一致,方便对着文档看效果 */
|
|
23
|
+
export const createRandom = (seed) => () => {
|
|
24
|
+
seed = (seed * 1664525 + 1013904223) % 4294967296
|
|
25
|
+
return seed / 4294967296
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 演示数据落在这块范围里:fitView 一次全看到 */
|
|
29
|
+
export const DEMO_CENTER = [116.35, 39.0]
|
|
30
|
+
export const DEMO_RADIUS = 2.2
|
|
31
|
+
/**
|
|
32
|
+
* 演示节点:环上撒点(半径按序号轻微起伏,不是标准圆),
|
|
33
|
+
* 电压 / 类型 / 分区按序号取模,分布均匀 —— 按属性配色、按规则改样式一眼能看出效果。
|
|
34
|
+
*/
|
|
35
|
+
export const createDemoPoints = (count = 28, seed = 20240915) => {
|
|
36
|
+
const random = createRandom(seed)
|
|
37
|
+
const points = []
|
|
38
|
+
for (let index = 0; index < count; index += 1) {
|
|
39
|
+
const angle = (index / count) * Math.PI * 2
|
|
40
|
+
const radius = DEMO_RADIUS * (0.6 + ((index % 5) / 5) * 0.4)
|
|
41
|
+
points.push({
|
|
42
|
+
id: `node-${index}`,
|
|
43
|
+
x: Number((DEMO_CENTER[0] + Math.cos(angle) * radius).toFixed(5)),
|
|
44
|
+
y: Number((DEMO_CENTER[1] + Math.sin(angle) * radius).toFixed(5)),
|
|
45
|
+
name: `变电站 ${index + 1}`,
|
|
46
|
+
vn_kv: VOLTAGE_LEVELS[index % VOLTAGE_LEVELS.length],
|
|
47
|
+
station_type: STATION_TYPES[(index * 3) % STATION_TYPES.length],
|
|
48
|
+
zone_name: `分区 ${(index % 4) + 1}`,
|
|
49
|
+
max_loading_rate: Number((0.4 + random() * 1.1).toFixed(3))
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
return points
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 演示线路:沿环把相邻节点连起来(每点两条,度数均匀),
|
|
56
|
+
* 再补几条「辐条」连到 0 号节点 —— 环 + 辐条比纯环更像一张网,框选 / 拾取都有东西可点。
|
|
57
|
+
* 每 7 条里有一条标成直流线路(type: 'dc_line'),给装饰 / 规则演示用。
|
|
58
|
+
*/
|
|
59
|
+
export const connectDemoLines = (points) => {
|
|
60
|
+
const lines = []
|
|
61
|
+
const push = (fromIndex, toIndex) => {
|
|
62
|
+
const from = points[fromIndex]
|
|
63
|
+
const to = points[toIndex]
|
|
64
|
+
lines.push({
|
|
65
|
+
id: `line-${lines.length}`,
|
|
66
|
+
name: `线路 ${lines.length + 1}`,
|
|
67
|
+
from: from.id,
|
|
68
|
+
to: to.id,
|
|
69
|
+
vn_kv: from.vn_kv,
|
|
70
|
+
max_loading_rate: Number(((from.max_loading_rate + to.max_loading_rate) / 2).toFixed(3)),
|
|
71
|
+
...(lines.length % 7 === 3 ? { type: 'dc_line' } : {})
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
points.forEach((point, index) => push(index, (index + 1) % points.length))
|
|
75
|
+
points.forEach((point, index) => {
|
|
76
|
+
if (index > 0 && index % 5 === 0) {
|
|
77
|
+
push(0, index)
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
return lines
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 一次拿齐:节点 + 线路(含通道回线)+ 通道。
|
|
84
|
+
* `lines` 已经带上通道回线,直接交给 createGisView({ points, lines, channels }) 就行;
|
|
85
|
+
* 只想演示普通线路时用 `linesWithoutChannel`。
|
|
86
|
+
*/
|
|
87
|
+
export const buildDemoData = (options = {}) => {
|
|
88
|
+
const { count = 28, seed = 20240915, channels = 3 } = options
|
|
89
|
+
const points = createDemoPoints(count, seed)
|
|
90
|
+
const lines = connectDemoLines(points)
|
|
91
|
+
if (!channels) {
|
|
92
|
+
return { points, lines, linesWithoutChannel: lines, channelLines: [], channels: [] }
|
|
93
|
+
}
|
|
94
|
+
const specs = [
|
|
95
|
+
{ id: 'channel-a', name: '甲通道', from: points[0].id, to: points[7 % count].id, circuits: 3, lineProps: { vn_kv: 1050, max_loading_rate: 1.12 } },
|
|
96
|
+
{ id: 'channel-b', name: '乙通道', from: points[12 % count].id, to: points[19 % count].id, circuits: 2, lineProps: { vn_kv: 525, max_loading_rate: 0.72 } },
|
|
97
|
+
{ id: 'channel-c', name: '丙通道', from: points[3 % count].id, to: points[15 % count].id, circuits: 4, lineProps: { vn_kv: 230, max_loading_rate: 0.51 } }
|
|
98
|
+
].slice(0, channels)
|
|
99
|
+
const built = createChannels(specs)
|
|
100
|
+
return {
|
|
101
|
+
points,
|
|
102
|
+
lines: [...lines, ...built.lines],
|
|
103
|
+
linesWithoutChannel: lines,
|
|
104
|
+
channelLines: built.lines,
|
|
105
|
+
channels: built.channels
|
|
106
|
+
}
|
|
107
|
+
}
|