@caoguo/maplibre-pipeline 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/burst/index.cjs +708 -0
- package/dist/burst/index.cjs.map +1 -0
- package/dist/burst/index.d.cts +74 -0
- package/dist/burst/index.d.ts +74 -0
- package/dist/burst/index.js +4 -0
- package/dist/burst/index.js.map +1 -0
- package/dist/burstClass-CGMjcAYy.d.cts +161 -0
- package/dist/burstClass-Cf2p71LE.d.ts +161 -0
- package/dist/chunk-CDEYJ67B.js +80 -0
- package/dist/chunk-CDEYJ67B.js.map +1 -0
- package/dist/chunk-GCDA7KJM.js +289 -0
- package/dist/chunk-GCDA7KJM.js.map +1 -0
- package/dist/chunk-GEJRE2OR.js +351 -0
- package/dist/chunk-GEJRE2OR.js.map +1 -0
- package/dist/chunk-HCT6NSNS.js +532 -0
- package/dist/chunk-HCT6NSNS.js.map +1 -0
- package/dist/chunk-HIRNJVCV.js +13 -0
- package/dist/chunk-HIRNJVCV.js.map +1 -0
- package/dist/chunk-J3AEVXT4.js +164 -0
- package/dist/chunk-J3AEVXT4.js.map +1 -0
- package/dist/chunk-QVY4WJLM.js +256 -0
- package/dist/chunk-QVY4WJLM.js.map +1 -0
- package/dist/chunk-VA2TQWL3.js +340 -0
- package/dist/chunk-VA2TQWL3.js.map +1 -0
- package/dist/chunk-YBLESEN4.js +133 -0
- package/dist/chunk-YBLESEN4.js.map +1 -0
- package/dist/chunk-YS2ICFVK.js +101 -0
- package/dist/chunk-YS2ICFVK.js.map +1 -0
- package/dist/graph/index.cjs +382 -0
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +211 -0
- package/dist/graph/index.d.ts +211 -0
- package/dist/graph/index.js +4 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/health/index.cjs +348 -0
- package/dist/health/index.cjs.map +1 -0
- package/dist/health/index.d.cts +210 -0
- package/dist/health/index.d.ts +210 -0
- package/dist/health/index.js +3 -0
- package/dist/health/index.js.map +1 -0
- package/dist/index.cjs +2295 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/leakage/index.cjs +358 -0
- package/dist/leakage/index.cjs.map +1 -0
- package/dist/leakage/index.d.cts +212 -0
- package/dist/leakage/index.d.ts +212 -0
- package/dist/leakage/index.js +3 -0
- package/dist/leakage/index.js.map +1 -0
- package/dist/nlpg/index.cjs +136 -0
- package/dist/nlpg/index.cjs.map +1 -0
- package/dist/nlpg/index.d.cts +51 -0
- package/dist/nlpg/index.d.ts +51 -0
- package/dist/nlpg/index.js +3 -0
- package/dist/nlpg/index.js.map +1 -0
- package/dist/style/index.cjs +379 -0
- package/dist/style/index.cjs.map +1 -0
- package/dist/style/index.d.cts +119 -0
- package/dist/style/index.d.ts +119 -0
- package/dist/style/index.js +4 -0
- package/dist/style/index.js.map +1 -0
- package/dist/topology/index.cjs +317 -0
- package/dist/topology/index.cjs.map +1 -0
- package/dist/topology/index.d.cts +69 -0
- package/dist/topology/index.d.ts +69 -0
- package/dist/topology/index.js +4 -0
- package/dist/topology/index.js.map +1 -0
- package/dist/types/index.cjs +15 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +214 -0
- package/dist/types/index.d.ts +214 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 草果地图管网组件包 - 类型定义
|
|
3
|
+
*
|
|
4
|
+
* 地下管网 MVP 数据模型:
|
|
5
|
+
* - 节点(Node):管段的交汇点/设备点(阀门/泵/表/源头)
|
|
6
|
+
* - 管段(Pipe/Edge):连接两个节点的物理管线
|
|
7
|
+
* - 用户(User):连接到节点的消费方(居民/商业/工业)
|
|
8
|
+
*
|
|
9
|
+
* 拓扑数据结构参见 PRD phase-1-pipeline §4.1.2
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* 管网大类
|
|
13
|
+
* - gas:燃气
|
|
14
|
+
* - water:供水
|
|
15
|
+
* - drainage:排水
|
|
16
|
+
* - heating:供热
|
|
17
|
+
* - power:电力(管沟)
|
|
18
|
+
* - telecom:通信(管沟)
|
|
19
|
+
*/
|
|
20
|
+
type PipelineType = 'gas' | 'water' | 'drainage' | 'heating' | 'power' | 'telecom';
|
|
21
|
+
/** 所有支持的管线大类(便于运行时校验) */
|
|
22
|
+
declare const PIPELINE_TYPES: readonly PipelineType[];
|
|
23
|
+
/**
|
|
24
|
+
* 节点类型
|
|
25
|
+
* - junction:普通连接点(三通/四通/弯头等)
|
|
26
|
+
* - valve:阀门(可关闭以隔离故障段)
|
|
27
|
+
* - pump:泵站(供水加压/供热循环)
|
|
28
|
+
* - meter:计量表/用户表
|
|
29
|
+
* - source:源头(制水厂/燃气门站/热源厂)
|
|
30
|
+
* - tank:储水罐/储气罐
|
|
31
|
+
* - junction_box:电缆/光缆接线井
|
|
32
|
+
*/
|
|
33
|
+
type NodeKind = 'junction' | 'valve' | 'pump' | 'meter' | 'source' | 'tank' | 'junction_box';
|
|
34
|
+
/** 阀门子类型 */
|
|
35
|
+
type ValveType = 'gate' | 'butterfly' | 'check' | 'pressure_reduction' | 'control';
|
|
36
|
+
/** 阀门状态(用于爆管推演隔离方案) */
|
|
37
|
+
type ValveStatus = 'open' | 'closed' | 'partial';
|
|
38
|
+
/**
|
|
39
|
+
* 管段材质
|
|
40
|
+
* - cast_iron:铸铁(旧管网主力)
|
|
41
|
+
* - ductile_iron:球墨铸铁(当前主流)
|
|
42
|
+
* - steel:钢管(高压/燃气主干)
|
|
43
|
+
* - pe:聚乙烯(PE,现代供水/燃气)
|
|
44
|
+
* - pvc:聚氯乙烯(PVC,排水)
|
|
45
|
+
* - concrete:混凝土(排水/给水主干)
|
|
46
|
+
* - hdpe:高密度聚乙烯
|
|
47
|
+
* - copper:铜管(室内引入管)
|
|
48
|
+
* - unknown:未知
|
|
49
|
+
*/
|
|
50
|
+
type PipeMaterial = 'cast_iron' | 'ductile_iron' | 'steel' | 'pe' | 'pvc' | 'concrete' | 'hdpe' | 'copper' | 'unknown';
|
|
51
|
+
/**
|
|
52
|
+
* 管段状态
|
|
53
|
+
* - normal:正常运行
|
|
54
|
+
* - aging:老化(建议关注)
|
|
55
|
+
* - damaged:损坏(泄漏/破裂)
|
|
56
|
+
* - under_repair:维修中(部分阀门/路段暂停使用)
|
|
57
|
+
* - abandoned:废弃
|
|
58
|
+
* - unknown:未知
|
|
59
|
+
*/
|
|
60
|
+
type PipeStatus = 'normal' | 'aging' | 'damaged' | 'under_repair' | 'abandoned' | 'unknown';
|
|
61
|
+
interface PipeProperties {
|
|
62
|
+
/** 公称直径(mm),如 DN150 = 150 */
|
|
63
|
+
diameter?: number;
|
|
64
|
+
/** 管材 */
|
|
65
|
+
material?: PipeMaterial;
|
|
66
|
+
/** 安装日期(ISO 字符串) */
|
|
67
|
+
installDate?: string;
|
|
68
|
+
/** 工作压力(MPa) */
|
|
69
|
+
pressure?: number;
|
|
70
|
+
/** 最高允许压力(MPa) */
|
|
71
|
+
ratedPressure?: number;
|
|
72
|
+
/** 当前状态 */
|
|
73
|
+
status?: PipeStatus;
|
|
74
|
+
/** 埋深(m) */
|
|
75
|
+
depth?: number;
|
|
76
|
+
/** 建设单位 */
|
|
77
|
+
owner?: string;
|
|
78
|
+
/** 自由扩展(运维记录/检测报告 URL 等) */
|
|
79
|
+
extra?: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
interface NodeProperties {
|
|
82
|
+
/** 设备编号 */
|
|
83
|
+
code?: string;
|
|
84
|
+
/** 阀门类型(仅 valve) */
|
|
85
|
+
valveType?: ValveType;
|
|
86
|
+
/** 阀门状态(仅 valve) */
|
|
87
|
+
valveStatus?: ValveStatus;
|
|
88
|
+
/** 流量/供气能力(m³/h,仅 source/pump) */
|
|
89
|
+
capacity?: number;
|
|
90
|
+
/** 安装日期 */
|
|
91
|
+
installDate?: string;
|
|
92
|
+
/** 产权单位 */
|
|
93
|
+
owner?: string;
|
|
94
|
+
/** 海拔(m,用于地形修正) */
|
|
95
|
+
elevation?: number;
|
|
96
|
+
/** 自由扩展 */
|
|
97
|
+
extra?: Record<string, unknown>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 管网节点
|
|
101
|
+
* position 为 [lng, lat](GeoJSON 习惯),不是 [lat, lng]
|
|
102
|
+
*/
|
|
103
|
+
interface PipelineNode {
|
|
104
|
+
id: string;
|
|
105
|
+
/** 节点类型 */
|
|
106
|
+
kind: NodeKind;
|
|
107
|
+
/** 经度(WGS84) */
|
|
108
|
+
lng: number;
|
|
109
|
+
/** 纬度(WGS84) */
|
|
110
|
+
lat: number;
|
|
111
|
+
/** 所属管线大类(燃气/供水等) */
|
|
112
|
+
pipelineType?: PipelineType;
|
|
113
|
+
/** 行政区/区域(用于层级钻取) */
|
|
114
|
+
region?: string;
|
|
115
|
+
/** 自定义属性 */
|
|
116
|
+
properties?: NodeProperties;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 管网管段
|
|
120
|
+
* from_node / to_node 是有向连接,但物理上双向导通。
|
|
121
|
+
* 地理 LineString 用 [[lng,lat], ...] 表示。
|
|
122
|
+
*/
|
|
123
|
+
interface PipelinePipe {
|
|
124
|
+
id: string;
|
|
125
|
+
/** 起点节点 id */
|
|
126
|
+
fromNode: string;
|
|
127
|
+
/** 终点节点 id */
|
|
128
|
+
toNode: string;
|
|
129
|
+
/** 管段类型,固定为 'pipe'(预留扩展如 'channel'/'duct') */
|
|
130
|
+
type: 'pipe';
|
|
131
|
+
/** 所属管线大类 */
|
|
132
|
+
pipelineType?: PipelineType;
|
|
133
|
+
/** 区域编码(用于 LOD 按需加载) */
|
|
134
|
+
region?: string;
|
|
135
|
+
/** 几何(可选,未提供时按 from/to 拉直线) */
|
|
136
|
+
geometry?: [number, number][];
|
|
137
|
+
/** 长度(m),可选,由 geometry 计算 */
|
|
138
|
+
length?: number;
|
|
139
|
+
/** 管段属性 */
|
|
140
|
+
properties?: PipeProperties;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 用户类型
|
|
144
|
+
* - residential:居民
|
|
145
|
+
* - commercial:商业
|
|
146
|
+
* - industrial:工业
|
|
147
|
+
* - important:重要用户(医院/学校/政府部门/消防)
|
|
148
|
+
*/
|
|
149
|
+
type UserKind = 'residential' | 'commercial' | 'industrial' | 'important';
|
|
150
|
+
interface PipelineUser {
|
|
151
|
+
id: string;
|
|
152
|
+
/** 用户名 */
|
|
153
|
+
name?: string;
|
|
154
|
+
/** 类型 */
|
|
155
|
+
kind: UserKind;
|
|
156
|
+
/** 所属节点 id(直接或间接连接) */
|
|
157
|
+
nodeId?: string;
|
|
158
|
+
/** 位置 */
|
|
159
|
+
lng: number;
|
|
160
|
+
lat: number;
|
|
161
|
+
/** 区域 */
|
|
162
|
+
region?: string;
|
|
163
|
+
/** 人口/用量(可选) */
|
|
164
|
+
scale?: number;
|
|
165
|
+
/** 备注 */
|
|
166
|
+
note?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* 管网拓扑数据集(完整 MVP 输入)
|
|
170
|
+
* - nodes:节点列表
|
|
171
|
+
* - pipes:管段列表
|
|
172
|
+
* - users:用户列表(可选,爆管推演需要)
|
|
173
|
+
*/
|
|
174
|
+
interface PipelineTopologyDataset {
|
|
175
|
+
nodes: PipelineNode[];
|
|
176
|
+
pipes: PipelinePipe[];
|
|
177
|
+
users?: PipelineUser[];
|
|
178
|
+
}
|
|
179
|
+
/** 选中节点 */
|
|
180
|
+
interface NodeSelectEvent {
|
|
181
|
+
node: PipelineNode;
|
|
182
|
+
/** 在鼠标事件中的屏幕坐标(可选) */
|
|
183
|
+
point?: {
|
|
184
|
+
x: number;
|
|
185
|
+
y: number;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/** 选中管段 */
|
|
189
|
+
interface PipeSelectEvent {
|
|
190
|
+
pipe: PipelinePipe;
|
|
191
|
+
point?: {
|
|
192
|
+
x: number;
|
|
193
|
+
y: number;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/** 钻取事件(区域层级下钻) */
|
|
197
|
+
interface DrillDownEvent {
|
|
198
|
+
/** 上一级区域 */
|
|
199
|
+
from: string | null;
|
|
200
|
+
/** 目标区域 */
|
|
201
|
+
to: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* 着色模式(管线渲染)
|
|
205
|
+
* - type:按管线大类着色(燃气黄/供水蓝等)
|
|
206
|
+
* - diameter:按管径着色(PRD §4.1.4)
|
|
207
|
+
* - status:按管段状态着色
|
|
208
|
+
* - material:按管材着色
|
|
209
|
+
* - health:按健康度着色(PipelineHealth 集成)
|
|
210
|
+
* - uniform:单一颜色
|
|
211
|
+
*/
|
|
212
|
+
type ColorByMode = 'type' | 'diameter' | 'status' | 'material' | 'health' | 'uniform';
|
|
213
|
+
|
|
214
|
+
export { type ColorByMode, type DrillDownEvent, type NodeKind, type NodeProperties, type NodeSelectEvent, PIPELINE_TYPES, type PipeMaterial, type PipeProperties, type PipeSelectEvent, type PipeStatus, type PipelineNode, type PipelinePipe, type PipelineTopologyDataset, type PipelineType, type PipelineUser, type UserKind, type ValveStatus, type ValveType };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 草果地图管网组件包 - 类型定义
|
|
3
|
+
*
|
|
4
|
+
* 地下管网 MVP 数据模型:
|
|
5
|
+
* - 节点(Node):管段的交汇点/设备点(阀门/泵/表/源头)
|
|
6
|
+
* - 管段(Pipe/Edge):连接两个节点的物理管线
|
|
7
|
+
* - 用户(User):连接到节点的消费方(居民/商业/工业)
|
|
8
|
+
*
|
|
9
|
+
* 拓扑数据结构参见 PRD phase-1-pipeline §4.1.2
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* 管网大类
|
|
13
|
+
* - gas:燃气
|
|
14
|
+
* - water:供水
|
|
15
|
+
* - drainage:排水
|
|
16
|
+
* - heating:供热
|
|
17
|
+
* - power:电力(管沟)
|
|
18
|
+
* - telecom:通信(管沟)
|
|
19
|
+
*/
|
|
20
|
+
type PipelineType = 'gas' | 'water' | 'drainage' | 'heating' | 'power' | 'telecom';
|
|
21
|
+
/** 所有支持的管线大类(便于运行时校验) */
|
|
22
|
+
declare const PIPELINE_TYPES: readonly PipelineType[];
|
|
23
|
+
/**
|
|
24
|
+
* 节点类型
|
|
25
|
+
* - junction:普通连接点(三通/四通/弯头等)
|
|
26
|
+
* - valve:阀门(可关闭以隔离故障段)
|
|
27
|
+
* - pump:泵站(供水加压/供热循环)
|
|
28
|
+
* - meter:计量表/用户表
|
|
29
|
+
* - source:源头(制水厂/燃气门站/热源厂)
|
|
30
|
+
* - tank:储水罐/储气罐
|
|
31
|
+
* - junction_box:电缆/光缆接线井
|
|
32
|
+
*/
|
|
33
|
+
type NodeKind = 'junction' | 'valve' | 'pump' | 'meter' | 'source' | 'tank' | 'junction_box';
|
|
34
|
+
/** 阀门子类型 */
|
|
35
|
+
type ValveType = 'gate' | 'butterfly' | 'check' | 'pressure_reduction' | 'control';
|
|
36
|
+
/** 阀门状态(用于爆管推演隔离方案) */
|
|
37
|
+
type ValveStatus = 'open' | 'closed' | 'partial';
|
|
38
|
+
/**
|
|
39
|
+
* 管段材质
|
|
40
|
+
* - cast_iron:铸铁(旧管网主力)
|
|
41
|
+
* - ductile_iron:球墨铸铁(当前主流)
|
|
42
|
+
* - steel:钢管(高压/燃气主干)
|
|
43
|
+
* - pe:聚乙烯(PE,现代供水/燃气)
|
|
44
|
+
* - pvc:聚氯乙烯(PVC,排水)
|
|
45
|
+
* - concrete:混凝土(排水/给水主干)
|
|
46
|
+
* - hdpe:高密度聚乙烯
|
|
47
|
+
* - copper:铜管(室内引入管)
|
|
48
|
+
* - unknown:未知
|
|
49
|
+
*/
|
|
50
|
+
type PipeMaterial = 'cast_iron' | 'ductile_iron' | 'steel' | 'pe' | 'pvc' | 'concrete' | 'hdpe' | 'copper' | 'unknown';
|
|
51
|
+
/**
|
|
52
|
+
* 管段状态
|
|
53
|
+
* - normal:正常运行
|
|
54
|
+
* - aging:老化(建议关注)
|
|
55
|
+
* - damaged:损坏(泄漏/破裂)
|
|
56
|
+
* - under_repair:维修中(部分阀门/路段暂停使用)
|
|
57
|
+
* - abandoned:废弃
|
|
58
|
+
* - unknown:未知
|
|
59
|
+
*/
|
|
60
|
+
type PipeStatus = 'normal' | 'aging' | 'damaged' | 'under_repair' | 'abandoned' | 'unknown';
|
|
61
|
+
interface PipeProperties {
|
|
62
|
+
/** 公称直径(mm),如 DN150 = 150 */
|
|
63
|
+
diameter?: number;
|
|
64
|
+
/** 管材 */
|
|
65
|
+
material?: PipeMaterial;
|
|
66
|
+
/** 安装日期(ISO 字符串) */
|
|
67
|
+
installDate?: string;
|
|
68
|
+
/** 工作压力(MPa) */
|
|
69
|
+
pressure?: number;
|
|
70
|
+
/** 最高允许压力(MPa) */
|
|
71
|
+
ratedPressure?: number;
|
|
72
|
+
/** 当前状态 */
|
|
73
|
+
status?: PipeStatus;
|
|
74
|
+
/** 埋深(m) */
|
|
75
|
+
depth?: number;
|
|
76
|
+
/** 建设单位 */
|
|
77
|
+
owner?: string;
|
|
78
|
+
/** 自由扩展(运维记录/检测报告 URL 等) */
|
|
79
|
+
extra?: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
interface NodeProperties {
|
|
82
|
+
/** 设备编号 */
|
|
83
|
+
code?: string;
|
|
84
|
+
/** 阀门类型(仅 valve) */
|
|
85
|
+
valveType?: ValveType;
|
|
86
|
+
/** 阀门状态(仅 valve) */
|
|
87
|
+
valveStatus?: ValveStatus;
|
|
88
|
+
/** 流量/供气能力(m³/h,仅 source/pump) */
|
|
89
|
+
capacity?: number;
|
|
90
|
+
/** 安装日期 */
|
|
91
|
+
installDate?: string;
|
|
92
|
+
/** 产权单位 */
|
|
93
|
+
owner?: string;
|
|
94
|
+
/** 海拔(m,用于地形修正) */
|
|
95
|
+
elevation?: number;
|
|
96
|
+
/** 自由扩展 */
|
|
97
|
+
extra?: Record<string, unknown>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 管网节点
|
|
101
|
+
* position 为 [lng, lat](GeoJSON 习惯),不是 [lat, lng]
|
|
102
|
+
*/
|
|
103
|
+
interface PipelineNode {
|
|
104
|
+
id: string;
|
|
105
|
+
/** 节点类型 */
|
|
106
|
+
kind: NodeKind;
|
|
107
|
+
/** 经度(WGS84) */
|
|
108
|
+
lng: number;
|
|
109
|
+
/** 纬度(WGS84) */
|
|
110
|
+
lat: number;
|
|
111
|
+
/** 所属管线大类(燃气/供水等) */
|
|
112
|
+
pipelineType?: PipelineType;
|
|
113
|
+
/** 行政区/区域(用于层级钻取) */
|
|
114
|
+
region?: string;
|
|
115
|
+
/** 自定义属性 */
|
|
116
|
+
properties?: NodeProperties;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 管网管段
|
|
120
|
+
* from_node / to_node 是有向连接,但物理上双向导通。
|
|
121
|
+
* 地理 LineString 用 [[lng,lat], ...] 表示。
|
|
122
|
+
*/
|
|
123
|
+
interface PipelinePipe {
|
|
124
|
+
id: string;
|
|
125
|
+
/** 起点节点 id */
|
|
126
|
+
fromNode: string;
|
|
127
|
+
/** 终点节点 id */
|
|
128
|
+
toNode: string;
|
|
129
|
+
/** 管段类型,固定为 'pipe'(预留扩展如 'channel'/'duct') */
|
|
130
|
+
type: 'pipe';
|
|
131
|
+
/** 所属管线大类 */
|
|
132
|
+
pipelineType?: PipelineType;
|
|
133
|
+
/** 区域编码(用于 LOD 按需加载) */
|
|
134
|
+
region?: string;
|
|
135
|
+
/** 几何(可选,未提供时按 from/to 拉直线) */
|
|
136
|
+
geometry?: [number, number][];
|
|
137
|
+
/** 长度(m),可选,由 geometry 计算 */
|
|
138
|
+
length?: number;
|
|
139
|
+
/** 管段属性 */
|
|
140
|
+
properties?: PipeProperties;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 用户类型
|
|
144
|
+
* - residential:居民
|
|
145
|
+
* - commercial:商业
|
|
146
|
+
* - industrial:工业
|
|
147
|
+
* - important:重要用户(医院/学校/政府部门/消防)
|
|
148
|
+
*/
|
|
149
|
+
type UserKind = 'residential' | 'commercial' | 'industrial' | 'important';
|
|
150
|
+
interface PipelineUser {
|
|
151
|
+
id: string;
|
|
152
|
+
/** 用户名 */
|
|
153
|
+
name?: string;
|
|
154
|
+
/** 类型 */
|
|
155
|
+
kind: UserKind;
|
|
156
|
+
/** 所属节点 id(直接或间接连接) */
|
|
157
|
+
nodeId?: string;
|
|
158
|
+
/** 位置 */
|
|
159
|
+
lng: number;
|
|
160
|
+
lat: number;
|
|
161
|
+
/** 区域 */
|
|
162
|
+
region?: string;
|
|
163
|
+
/** 人口/用量(可选) */
|
|
164
|
+
scale?: number;
|
|
165
|
+
/** 备注 */
|
|
166
|
+
note?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* 管网拓扑数据集(完整 MVP 输入)
|
|
170
|
+
* - nodes:节点列表
|
|
171
|
+
* - pipes:管段列表
|
|
172
|
+
* - users:用户列表(可选,爆管推演需要)
|
|
173
|
+
*/
|
|
174
|
+
interface PipelineTopologyDataset {
|
|
175
|
+
nodes: PipelineNode[];
|
|
176
|
+
pipes: PipelinePipe[];
|
|
177
|
+
users?: PipelineUser[];
|
|
178
|
+
}
|
|
179
|
+
/** 选中节点 */
|
|
180
|
+
interface NodeSelectEvent {
|
|
181
|
+
node: PipelineNode;
|
|
182
|
+
/** 在鼠标事件中的屏幕坐标(可选) */
|
|
183
|
+
point?: {
|
|
184
|
+
x: number;
|
|
185
|
+
y: number;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/** 选中管段 */
|
|
189
|
+
interface PipeSelectEvent {
|
|
190
|
+
pipe: PipelinePipe;
|
|
191
|
+
point?: {
|
|
192
|
+
x: number;
|
|
193
|
+
y: number;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/** 钻取事件(区域层级下钻) */
|
|
197
|
+
interface DrillDownEvent {
|
|
198
|
+
/** 上一级区域 */
|
|
199
|
+
from: string | null;
|
|
200
|
+
/** 目标区域 */
|
|
201
|
+
to: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* 着色模式(管线渲染)
|
|
205
|
+
* - type:按管线大类着色(燃气黄/供水蓝等)
|
|
206
|
+
* - diameter:按管径着色(PRD §4.1.4)
|
|
207
|
+
* - status:按管段状态着色
|
|
208
|
+
* - material:按管材着色
|
|
209
|
+
* - health:按健康度着色(PipelineHealth 集成)
|
|
210
|
+
* - uniform:单一颜色
|
|
211
|
+
*/
|
|
212
|
+
type ColorByMode = 'type' | 'diameter' | 'status' | 'material' | 'health' | 'uniform';
|
|
213
|
+
|
|
214
|
+
export { type ColorByMode, type DrillDownEvent, type NodeKind, type NodeProperties, type NodeSelectEvent, PIPELINE_TYPES, type PipeMaterial, type PipeProperties, type PipeSelectEvent, type PipeStatus, type PipelineNode, type PipelinePipe, type PipelineTopologyDataset, type PipelineType, type PipelineUser, type UserKind, type ValveStatus, type ValveType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@caoguo/maplibre-pipeline",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "草果地图管网组件包 - Pipeline topology / Burst simulation / Leakage plume / Health assessment",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./style": {
|
|
16
|
+
"types": "./dist/style/index.d.ts",
|
|
17
|
+
"import": "./dist/style/index.js",
|
|
18
|
+
"require": "./dist/style/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./graph": {
|
|
21
|
+
"types": "./dist/graph/index.d.ts",
|
|
22
|
+
"import": "./dist/graph/index.js",
|
|
23
|
+
"require": "./dist/graph/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./burst": {
|
|
26
|
+
"types": "./dist/burst/index.d.ts",
|
|
27
|
+
"import": "./dist/burst/index.js",
|
|
28
|
+
"require": "./dist/burst/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./leakage": {
|
|
31
|
+
"types": "./dist/leakage/index.d.ts",
|
|
32
|
+
"import": "./dist/leakage/index.js",
|
|
33
|
+
"require": "./dist/leakage/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./health": {
|
|
36
|
+
"types": "./dist/health/index.d.ts",
|
|
37
|
+
"import": "./dist/health/index.js",
|
|
38
|
+
"require": "./dist/health/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./topology": {
|
|
41
|
+
"types": "./dist/topology/index.d.ts",
|
|
42
|
+
"import": "./dist/topology/index.js",
|
|
43
|
+
"require": "./dist/topology/index.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./nlpg": {
|
|
46
|
+
"types": "./dist/nlpg/index.d.ts",
|
|
47
|
+
"import": "./dist/nlpg/index.js",
|
|
48
|
+
"require": "./dist/nlpg/index.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./types": {
|
|
51
|
+
"types": "./dist/types/index.d.ts",
|
|
52
|
+
"import": "./dist/types/index.js",
|
|
53
|
+
"require": "./dist/types/index.cjs"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"dist"
|
|
58
|
+
],
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@caoguo/maplibre": "0.0.2",
|
|
61
|
+
"@caoguo/theme": "0.0.1"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public",
|
|
65
|
+
"registry": "https://registry.npmjs.org/"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"maplibre-gl": "^4.7.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"jsdom": "^25.0.1",
|
|
72
|
+
"tsup": "^8.3.5",
|
|
73
|
+
"typescript": "^5.6.3",
|
|
74
|
+
"vitest": "^2.1.8"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsup",
|
|
78
|
+
"test": "vitest run",
|
|
79
|
+
"test:watch": "vitest"
|
|
80
|
+
}
|
|
81
|
+
}
|