@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,379 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/style/pipelineTheme.ts
|
|
4
|
+
var PIPELINE_TYPE_COLORS = {
|
|
5
|
+
gas: "#f59e0b",
|
|
6
|
+
// 琥珀(燃气)
|
|
7
|
+
water: "#3b82f6",
|
|
8
|
+
// 蓝(供水)
|
|
9
|
+
drainage: "#6b7280",
|
|
10
|
+
// 灰(排水)
|
|
11
|
+
heating: "#ef4444",
|
|
12
|
+
// 红(供热)
|
|
13
|
+
power: "#8b5cf6",
|
|
14
|
+
// 紫(电力管沟)
|
|
15
|
+
telecom: "#10b981"
|
|
16
|
+
// 绿(通信管沟)
|
|
17
|
+
};
|
|
18
|
+
var PIPELINE_TYPE_LABELS = {
|
|
19
|
+
gas: "\u71C3\u6C14\u7BA1",
|
|
20
|
+
water: "\u4F9B\u6C34\u7BA1",
|
|
21
|
+
drainage: "\u6392\u6C34\u7BA1",
|
|
22
|
+
heating: "\u4F9B\u70ED\u7BA1",
|
|
23
|
+
power: "\u7535\u529B\u7BA1\u6C9F",
|
|
24
|
+
telecom: "\u901A\u4FE1\u7BA1\u6C9F"
|
|
25
|
+
};
|
|
26
|
+
var PIPELINE_TYPE_ICONS = {
|
|
27
|
+
gas: "\u{1F525}",
|
|
28
|
+
water: "\u{1F4A7}",
|
|
29
|
+
drainage: "\u{1F6B0}",
|
|
30
|
+
heating: "\u{1F534}",
|
|
31
|
+
power: "\u26A1",
|
|
32
|
+
telecom: "\u{1F4E1}"
|
|
33
|
+
};
|
|
34
|
+
var PIPE_STATUS_COLORS = {
|
|
35
|
+
normal: "#4ade80",
|
|
36
|
+
// 绿
|
|
37
|
+
aging: "#fbbf24",
|
|
38
|
+
// 黄
|
|
39
|
+
damaged: "#ef4444",
|
|
40
|
+
// 红
|
|
41
|
+
under_repair: "#8b5cf6",
|
|
42
|
+
// 紫
|
|
43
|
+
abandoned: "#4b5563",
|
|
44
|
+
// 深灰
|
|
45
|
+
unknown: "#6b7280"
|
|
46
|
+
// 灰
|
|
47
|
+
};
|
|
48
|
+
var PIPE_STATUS_META = {
|
|
49
|
+
normal: { label: "\u6B63\u5E38", animation: "none" },
|
|
50
|
+
aging: { label: "\u8001\u5316", animation: "none" },
|
|
51
|
+
damaged: { label: "\u635F\u574F", animation: "pulse" },
|
|
52
|
+
under_repair: { label: "\u7EF4\u4FEE\u4E2D", animation: "dashed" },
|
|
53
|
+
abandoned: { label: "\u5E9F\u5F03", animation: "none" },
|
|
54
|
+
unknown: { label: "\u672A\u77E5", animation: "none" }
|
|
55
|
+
};
|
|
56
|
+
var PIPE_MATERIAL_COLORS = {
|
|
57
|
+
cast_iron: "#94a3b8",
|
|
58
|
+
// 蓝灰(旧铸铁)
|
|
59
|
+
ductile_iron: "#0ea5e9",
|
|
60
|
+
// 天蓝(球墨铸铁)
|
|
61
|
+
steel: "#64748b",
|
|
62
|
+
// 钢蓝
|
|
63
|
+
pe: "#22c55e",
|
|
64
|
+
// 绿(PE 现代管材)
|
|
65
|
+
pvc: "#a78bfa",
|
|
66
|
+
// 紫(PVC)
|
|
67
|
+
concrete: "#a8a29e",
|
|
68
|
+
// 米灰(混凝土)
|
|
69
|
+
hdpe: "#16a34a",
|
|
70
|
+
// 深绿(HDPE)
|
|
71
|
+
copper: "#d97706",
|
|
72
|
+
// 橙(铜)
|
|
73
|
+
unknown: "#6b7280"
|
|
74
|
+
};
|
|
75
|
+
var NODE_KIND_ICONS = {
|
|
76
|
+
junction: "M -6 0 L 6 0 M 0 -6 L 0 6",
|
|
77
|
+
// 十字
|
|
78
|
+
valve: "M -8 -4 L 8 4 M 0 -4 L 0 4",
|
|
79
|
+
// X
|
|
80
|
+
pump: "M -6 0 A 6 6 0 1 0 6 0 A 6 6 0 1 0 -6 0",
|
|
81
|
+
// 圆
|
|
82
|
+
meter: "M -6 -6 L 6 -6 L 6 6 L -6 6 Z",
|
|
83
|
+
// 方
|
|
84
|
+
source: "M 0 -10 L 6 6 L -6 6 Z",
|
|
85
|
+
// 三角
|
|
86
|
+
tank: "M -8 -6 Q 0 -10 8 -6 L 8 6 L -8 6 Z",
|
|
87
|
+
// 圆角
|
|
88
|
+
junction_box: "M -7 -4 L 7 -4 L 7 4 L -7 4 Z"
|
|
89
|
+
// 小方
|
|
90
|
+
};
|
|
91
|
+
var NODE_KIND_COLORS = {
|
|
92
|
+
junction: "#94a3b8",
|
|
93
|
+
valve: "#ef4444",
|
|
94
|
+
// 阀门=红(控制关键)
|
|
95
|
+
pump: "#f59e0b",
|
|
96
|
+
meter: "#3b82f6",
|
|
97
|
+
source: "#22c55e",
|
|
98
|
+
tank: "#06b6d4",
|
|
99
|
+
junction_box: "#8b5cf6"
|
|
100
|
+
};
|
|
101
|
+
var HEALTH_LEVEL_COLORS = {
|
|
102
|
+
excellent: "#22c55e",
|
|
103
|
+
// 绿 80-100
|
|
104
|
+
good: "#3b82f6",
|
|
105
|
+
// 蓝 60-80
|
|
106
|
+
fair: "#eab308",
|
|
107
|
+
// 黄 40-60
|
|
108
|
+
poor: "#f97316",
|
|
109
|
+
// 橙 20-40
|
|
110
|
+
critical: "#ef4444"
|
|
111
|
+
// 红 0-20
|
|
112
|
+
};
|
|
113
|
+
var HEALTH_LEVEL_LABELS = {
|
|
114
|
+
excellent: "\u4F18",
|
|
115
|
+
good: "\u826F",
|
|
116
|
+
fair: "\u4E2D",
|
|
117
|
+
poor: "\u5DEE",
|
|
118
|
+
critical: "\u5371"
|
|
119
|
+
};
|
|
120
|
+
function healthLevel(score) {
|
|
121
|
+
if (score >= 80) return "excellent";
|
|
122
|
+
if (score >= 60) return "good";
|
|
123
|
+
if (score >= 40) return "fair";
|
|
124
|
+
if (score >= 20) return "poor";
|
|
125
|
+
return "critical";
|
|
126
|
+
}
|
|
127
|
+
function pipelineTypeColor(type) {
|
|
128
|
+
if (!type) return "#94a3b8";
|
|
129
|
+
return PIPELINE_TYPE_COLORS[type];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// src/style/paintRules.ts
|
|
133
|
+
function paintPipeByType(types) {
|
|
134
|
+
if (!types || types.length === 0) {
|
|
135
|
+
return [
|
|
136
|
+
"match",
|
|
137
|
+
["get", "pipelineType"],
|
|
138
|
+
...Object.entries(PIPELINE_TYPE_COLORS).flatMap(([k, v]) => [k, v]),
|
|
139
|
+
"#94a3b8"
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
return [
|
|
143
|
+
"match",
|
|
144
|
+
["get", "pipelineType"],
|
|
145
|
+
...types.flatMap((t) => [t, PIPELINE_TYPE_COLORS[t]]),
|
|
146
|
+
"#94a3b8"
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
function paintPipeByDiameter() {
|
|
150
|
+
return [
|
|
151
|
+
"interpolate",
|
|
152
|
+
["linear"],
|
|
153
|
+
["coalesce", ["get", "diameter"], 0],
|
|
154
|
+
0,
|
|
155
|
+
"#4ade80",
|
|
156
|
+
// 极细管 绿
|
|
157
|
+
50,
|
|
158
|
+
"#4ade80",
|
|
159
|
+
// DN50 以下 绿(支管)
|
|
160
|
+
150,
|
|
161
|
+
"#60a5fa",
|
|
162
|
+
// DN150 蓝(配水管)
|
|
163
|
+
300,
|
|
164
|
+
"#f59e0b",
|
|
165
|
+
// DN300 黄(干管)
|
|
166
|
+
600,
|
|
167
|
+
"#ef4444",
|
|
168
|
+
// DN600+ 红(主管)
|
|
169
|
+
1500,
|
|
170
|
+
"#7f1d1d"
|
|
171
|
+
// 极大管 深红
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
function paintPipeByStatus() {
|
|
175
|
+
return [
|
|
176
|
+
"match",
|
|
177
|
+
["coalesce", ["get", "status"], "unknown"],
|
|
178
|
+
...Object.entries(PIPE_STATUS_COLORS).flatMap(([k, v]) => [k, v]),
|
|
179
|
+
"#6b7280"
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
function paintPipeByMaterial() {
|
|
183
|
+
return [
|
|
184
|
+
"match",
|
|
185
|
+
["coalesce", ["get", "material"], "unknown"],
|
|
186
|
+
...Object.entries(PIPE_MATERIAL_COLORS).flatMap(([k, v]) => [k, v]),
|
|
187
|
+
"#6b7280"
|
|
188
|
+
];
|
|
189
|
+
}
|
|
190
|
+
function paintPipeByHealth() {
|
|
191
|
+
return [
|
|
192
|
+
"step",
|
|
193
|
+
["coalesce", ["get", "healthScore"], 100],
|
|
194
|
+
HEALTH_LEVEL_COLORS.critical,
|
|
195
|
+
// <20
|
|
196
|
+
20,
|
|
197
|
+
HEALTH_LEVEL_COLORS.poor,
|
|
198
|
+
40,
|
|
199
|
+
HEALTH_LEVEL_COLORS.fair,
|
|
200
|
+
60,
|
|
201
|
+
HEALTH_LEVEL_COLORS.good,
|
|
202
|
+
80,
|
|
203
|
+
HEALTH_LEVEL_COLORS.excellent
|
|
204
|
+
];
|
|
205
|
+
}
|
|
206
|
+
function paintPipeBy(mode, opts) {
|
|
207
|
+
switch (mode) {
|
|
208
|
+
case "type":
|
|
209
|
+
return paintPipeByType(opts?.types);
|
|
210
|
+
case "diameter":
|
|
211
|
+
return paintPipeByDiameter();
|
|
212
|
+
case "status":
|
|
213
|
+
return paintPipeByStatus();
|
|
214
|
+
case "material":
|
|
215
|
+
return paintPipeByMaterial();
|
|
216
|
+
case "health":
|
|
217
|
+
return paintPipeByHealth();
|
|
218
|
+
case "uniform":
|
|
219
|
+
default:
|
|
220
|
+
return "#60a5fa";
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function paintNodeByKind() {
|
|
224
|
+
return [
|
|
225
|
+
"match",
|
|
226
|
+
["get", "kind"],
|
|
227
|
+
"junction",
|
|
228
|
+
"#94a3b8",
|
|
229
|
+
"valve",
|
|
230
|
+
"#ef4444",
|
|
231
|
+
"pump",
|
|
232
|
+
"#f59e0b",
|
|
233
|
+
"meter",
|
|
234
|
+
"#3b82f6",
|
|
235
|
+
"source",
|
|
236
|
+
"#22c55e",
|
|
237
|
+
"tank",
|
|
238
|
+
"#06b6d4",
|
|
239
|
+
"junction_box",
|
|
240
|
+
"#8b5cf6",
|
|
241
|
+
"#cbd5e1"
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
function paintPipeWidthByDiameter(minWidth = 1.5, maxWidth = 6) {
|
|
245
|
+
return [
|
|
246
|
+
"interpolate",
|
|
247
|
+
["linear"],
|
|
248
|
+
["coalesce", ["get", "diameter"], 100],
|
|
249
|
+
0,
|
|
250
|
+
minWidth,
|
|
251
|
+
1500,
|
|
252
|
+
maxWidth
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// src/style/legend.ts
|
|
257
|
+
function legendByType() {
|
|
258
|
+
return {
|
|
259
|
+
title: "\u7BA1\u7EBF\u7C7B\u578B",
|
|
260
|
+
items: Object.keys(PIPELINE_TYPE_COLORS).map((k) => ({
|
|
261
|
+
label: PIPELINE_TYPE_LABELS[k],
|
|
262
|
+
color: PIPELINE_TYPE_COLORS[k]
|
|
263
|
+
}))
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function legendByDiameter() {
|
|
267
|
+
return {
|
|
268
|
+
title: "\u7BA1\u5F84\uFF08mm\uFF09",
|
|
269
|
+
items: [
|
|
270
|
+
{ label: "\u226450 \u652F\u7BA1", color: "#4ade80" },
|
|
271
|
+
{ label: "50-150 \u914D\u6C34/\u914D\u6C14", color: "#60a5fa" },
|
|
272
|
+
{ label: "150-300 \u5E72\u7BA1", color: "#f59e0b" },
|
|
273
|
+
{ label: "300-600 \u4E3B\u7BA1", color: "#ef4444" },
|
|
274
|
+
{ label: "\u2265600 \u4E3B\u5E72", color: "#7f1d1d" }
|
|
275
|
+
]
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function legendByStatus() {
|
|
279
|
+
return {
|
|
280
|
+
title: "\u7BA1\u6BB5\u72B6\u6001",
|
|
281
|
+
items: Object.keys(PIPE_STATUS_COLORS).map(
|
|
282
|
+
(k) => {
|
|
283
|
+
const meta = PIPE_STATUS_META[k];
|
|
284
|
+
return {
|
|
285
|
+
label: meta.label,
|
|
286
|
+
color: PIPE_STATUS_COLORS[k],
|
|
287
|
+
style: meta.animation === "dashed" ? "dashed" : "solid"
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function legendByMaterial() {
|
|
294
|
+
return {
|
|
295
|
+
title: "\u7BA1\u6750",
|
|
296
|
+
items: Object.entries(PIPE_MATERIAL_COLORS).map(([k, v]) => ({
|
|
297
|
+
label: materialLabel(k),
|
|
298
|
+
color: v
|
|
299
|
+
}))
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function legendByHealth() {
|
|
303
|
+
return {
|
|
304
|
+
title: "\u5065\u5EB7\u7B49\u7EA7",
|
|
305
|
+
items: Object.entries(HEALTH_LEVEL_COLORS).map(([k, v]) => ({
|
|
306
|
+
label: `${HEALTH_LEVEL_LABELS[k]}\uFF08${healthRangeLabel(k)}\uFF09`,
|
|
307
|
+
color: v
|
|
308
|
+
}))
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function materialLabel(k) {
|
|
312
|
+
const map = {
|
|
313
|
+
cast_iron: "\u94F8\u94C1",
|
|
314
|
+
ductile_iron: "\u7403\u58A8\u94F8\u94C1",
|
|
315
|
+
steel: "\u94A2",
|
|
316
|
+
pe: "PE",
|
|
317
|
+
pvc: "PVC",
|
|
318
|
+
concrete: "\u6DF7\u51DD\u571F",
|
|
319
|
+
hdpe: "HDPE",
|
|
320
|
+
copper: "\u94DC",
|
|
321
|
+
unknown: "\u672A\u77E5"
|
|
322
|
+
};
|
|
323
|
+
return map[k] ?? k;
|
|
324
|
+
}
|
|
325
|
+
function healthRangeLabel(k) {
|
|
326
|
+
const map = {
|
|
327
|
+
excellent: "80-100",
|
|
328
|
+
good: "60-80",
|
|
329
|
+
fair: "40-60",
|
|
330
|
+
poor: "20-40",
|
|
331
|
+
critical: "0-20"
|
|
332
|
+
};
|
|
333
|
+
return map[k] ?? "";
|
|
334
|
+
}
|
|
335
|
+
function buildLegend(mode) {
|
|
336
|
+
switch (mode) {
|
|
337
|
+
case "type":
|
|
338
|
+
return legendByType();
|
|
339
|
+
case "diameter":
|
|
340
|
+
return legendByDiameter();
|
|
341
|
+
case "status":
|
|
342
|
+
return legendByStatus();
|
|
343
|
+
case "material":
|
|
344
|
+
return legendByMaterial();
|
|
345
|
+
case "health":
|
|
346
|
+
return legendByHealth();
|
|
347
|
+
default:
|
|
348
|
+
return legendByType();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
exports.HEALTH_LEVEL_COLORS = HEALTH_LEVEL_COLORS;
|
|
353
|
+
exports.HEALTH_LEVEL_LABELS = HEALTH_LEVEL_LABELS;
|
|
354
|
+
exports.NODE_KIND_COLORS = NODE_KIND_COLORS;
|
|
355
|
+
exports.NODE_KIND_ICONS = NODE_KIND_ICONS;
|
|
356
|
+
exports.PIPELINE_TYPE_COLORS = PIPELINE_TYPE_COLORS;
|
|
357
|
+
exports.PIPELINE_TYPE_ICONS = PIPELINE_TYPE_ICONS;
|
|
358
|
+
exports.PIPELINE_TYPE_LABELS = PIPELINE_TYPE_LABELS;
|
|
359
|
+
exports.PIPE_MATERIAL_COLORS = PIPE_MATERIAL_COLORS;
|
|
360
|
+
exports.PIPE_STATUS_COLORS = PIPE_STATUS_COLORS;
|
|
361
|
+
exports.PIPE_STATUS_META = PIPE_STATUS_META;
|
|
362
|
+
exports.buildLegend = buildLegend;
|
|
363
|
+
exports.healthLevel = healthLevel;
|
|
364
|
+
exports.legendByDiameter = legendByDiameter;
|
|
365
|
+
exports.legendByHealth = legendByHealth;
|
|
366
|
+
exports.legendByMaterial = legendByMaterial;
|
|
367
|
+
exports.legendByStatus = legendByStatus;
|
|
368
|
+
exports.legendByType = legendByType;
|
|
369
|
+
exports.paintNodeByKind = paintNodeByKind;
|
|
370
|
+
exports.paintPipeBy = paintPipeBy;
|
|
371
|
+
exports.paintPipeByDiameter = paintPipeByDiameter;
|
|
372
|
+
exports.paintPipeByHealth = paintPipeByHealth;
|
|
373
|
+
exports.paintPipeByMaterial = paintPipeByMaterial;
|
|
374
|
+
exports.paintPipeByStatus = paintPipeByStatus;
|
|
375
|
+
exports.paintPipeByType = paintPipeByType;
|
|
376
|
+
exports.paintPipeWidthByDiameter = paintPipeWidthByDiameter;
|
|
377
|
+
exports.pipelineTypeColor = pipelineTypeColor;
|
|
378
|
+
//# sourceMappingURL=index.cjs.map
|
|
379
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/style/pipelineTheme.ts","../../src/style/paintRules.ts","../../src/style/legend.ts"],"names":[],"mappings":";;;AAcO,IAAM,oBAAA,GAAqD;AAAA,EAChE,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,KAAA,EAAO,SAAA;AAAA;AAAA,EACP,QAAA,EAAU,SAAA;AAAA;AAAA,EACV,OAAA,EAAS,SAAA;AAAA;AAAA,EACT,KAAA,EAAO,SAAA;AAAA;AAAA,EACP,OAAA,EAAS;AAAA;AACX;AAGO,IAAM,oBAAA,GAAqD;AAAA,EAChE,GAAA,EAAK,oBAAA;AAAA,EACL,KAAA,EAAO,oBAAA;AAAA,EACP,QAAA,EAAU,oBAAA;AAAA,EACV,OAAA,EAAS,oBAAA;AAAA,EACT,KAAA,EAAO,0BAAA;AAAA,EACP,OAAA,EAAS;AACX;AAGO,IAAM,mBAAA,GAAoD;AAAA,EAC/D,GAAA,EAAK,WAAA;AAAA,EACL,KAAA,EAAO,WAAA;AAAA,EACP,QAAA,EAAU,WAAA;AAAA,EACV,OAAA,EAAS,WAAA;AAAA,EACT,KAAA,EAAO,QAAA;AAAA,EACP,OAAA,EAAS;AACX;AAGO,IAAM,kBAAA,GAAiD;AAAA,EAC5D,MAAA,EAAQ,SAAA;AAAA;AAAA,EACR,KAAA,EAAO,SAAA;AAAA;AAAA,EACP,OAAA,EAAS,SAAA;AAAA;AAAA,EACT,YAAA,EAAc,SAAA;AAAA;AAAA,EACd,SAAA,EAAW,SAAA;AAAA;AAAA,EACX,OAAA,EAAS;AAAA;AACX;AAGO,IAAM,gBAAA,GAGT;AAAA,EACF,MAAA,EAAQ,EAAE,KAAA,EAAO,cAAA,EAAM,WAAW,MAAA,EAAO;AAAA,EACzC,KAAA,EAAO,EAAE,KAAA,EAAO,cAAA,EAAM,WAAW,MAAA,EAAO;AAAA,EACxC,OAAA,EAAS,EAAE,KAAA,EAAO,cAAA,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,QAAA,EAAU;AAAA,GACZ;AACA,EAAA,OAAO,GAAA,CAAI,CAAC,CAAA,IAAK,EAAA;AACnB;AAGO,SAAS,YAAY,IAAA,EAAkC;AAC5D,EAAA,QAAQ,IAAA;AAAM,IACZ,KAAK,MAAA;AACH,MAAA,OAAO,YAAA,EAAa;AAAA,IACtB,KAAK,UAAA;AACH,MAAA,OAAO,gBAAA,EAAiB;AAAA,IAC1B,KAAK,QAAA;AACH,MAAA,OAAO,cAAA,EAAe;AAAA,IACxB,KAAK,UAAA;AACH,MAAA,OAAO,gBAAA,EAAiB;AAAA,IAC1B,KAAK,QAAA;AACH,MAAA,OAAO,cAAA,EAAe;AAAA,IACxB;AACE,MAAA,OAAO,YAAA,EAAa;AAAA;AAE1B","file":"index.cjs","sourcesContent":["/**\n * 草果地图管网专用样式 - `caoguo-pipeline`\n *\n * 设计目标:\n * - 行业辨识度高:燃气=琥珀、供水=蓝、供热=红、电力=紫、通信=绿、排水=灰\n * - 状态语义强:正常/老化/损坏/维修中 各有专属色 + 动画\n * - 与 caoguo-dark/light 主题协调:在亮/暗模式下都可读\n *\n * 颜色规范依据 PRD §4.5。\n */\n\nimport type { PipelineType, PipeMaterial, PipeStatus, NodeKind } from '../types';\n\n/** 管线大类配色(caoguo-pipeline) */\nexport const PIPELINE_TYPE_COLORS: Record<PipelineType, string> = {\n gas: '#f59e0b', // 琥珀(燃气)\n water: '#3b82f6', // 蓝(供水)\n drainage: '#6b7280', // 灰(排水)\n heating: '#ef4444', // 红(供热)\n power: '#8b5cf6', // 紫(电力管沟)\n telecom: '#10b981', // 绿(通信管沟)\n};\n\n/** 管线大类的中文标签(地图图例/卡片显示) */\nexport const PIPELINE_TYPE_LABELS: Record<PipelineType, string> = {\n gas: '燃气管',\n water: '供水管',\n drainage: '排水管',\n heating: '供热管',\n power: '电力管沟',\n telecom: '通信管沟',\n};\n\n/** 管线大类的 Emoji 图标(轻量可视化标识,用于卡片/Tag) */\nexport const PIPELINE_TYPE_ICONS: Record<PipelineType, string> = {\n gas: '🔥',\n water: '💧',\n drainage: '🚰',\n heating: '🔴',\n power: '⚡',\n telecom: '📡',\n};\n\n/** 管段状态配色 */\nexport const PIPE_STATUS_COLORS: Record<PipeStatus, string> = {\n normal: '#4ade80', // 绿\n aging: '#fbbf24', // 黄\n damaged: '#ef4444', // 红\n under_repair: '#8b5cf6', // 紫\n abandoned: '#4b5563', // 深灰\n unknown: '#6b7280', // 灰\n};\n\n/** 状态的语义 + 动画 */\nexport const PIPE_STATUS_META: Record<\n PipeStatus,\n { label: string; animation?: 'pulse' | 'dashed' | 'none' }\n> = {\n normal: { label: '正常', animation: 'none' },\n aging: { label: '老化', animation: 'none' },\n damaged: { label: '损坏', animation: 'pulse' },\n under_repair: { label: '维修中', animation: 'dashed' },\n abandoned: { label: '废弃', animation: 'none' },\n unknown: { label: '未知', animation: 'none' },\n};\n\n/** 管材配色(maplibre style 用) */\nexport const PIPE_MATERIAL_COLORS: Record<PipeMaterial, string> = {\n cast_iron: '#94a3b8', // 蓝灰(旧铸铁)\n ductile_iron: '#0ea5e9', // 天蓝(球墨铸铁)\n steel: '#64748b', // 钢蓝\n pe: '#22c55e', // 绿(PE 现代管材)\n pvc: '#a78bfa', // 紫(PVC)\n concrete: '#a8a29e', // 米灰(混凝土)\n hdpe: '#16a34a', // 深绿(HDPE)\n copper: '#d97706', // 橙(铜)\n unknown: '#6b7280',\n};\n\n/** 节点图标(用 SVG path 描点,地图渲染层用) */\nexport const NODE_KIND_ICONS: Record<NodeKind, string> = {\n junction: 'M -6 0 L 6 0 M 0 -6 L 0 6', // 十字\n valve: 'M -8 -4 L 8 4 M 0 -4 L 0 4', // X\n pump: 'M -6 0 A 6 6 0 1 0 6 0 A 6 6 0 1 0 -6 0', // 圆\n meter: 'M -6 -6 L 6 -6 L 6 6 L -6 6 Z', // 方\n source: 'M 0 -10 L 6 6 L -6 6 Z', // 三角\n tank: 'M -8 -6 Q 0 -10 8 -6 L 8 6 L -8 6 Z', // 圆角\n junction_box: 'M -7 -4 L 7 -4 L 7 4 L -7 4 Z',// 小方\n};\n\n/** 节点配色(默认按 type 衍生) */\nexport const NODE_KIND_COLORS: Record<NodeKind, string> = {\n junction: '#94a3b8',\n valve: '#ef4444', // 阀门=红(控制关键)\n pump: '#f59e0b',\n meter: '#3b82f6',\n source: '#22c55e',\n tank: '#06b6d4',\n junction_box: '#8b5cf6',\n};\n\n/** 健康度等级配色(PipelineHealth 用) */\nexport const HEALTH_LEVEL_COLORS: Record<string, string> = {\n excellent: '#22c55e', // 绿 80-100\n good: '#3b82f6', // 蓝 60-80\n fair: '#eab308', // 黄 40-60\n poor: '#f97316', // 橙 20-40\n critical: '#ef4444', // 红 0-20\n};\n\n/** 健康等级 label */\nexport const HEALTH_LEVEL_LABELS: Record<string, string> = {\n excellent: '优',\n good: '良',\n fair: '中',\n poor: '差',\n critical: '危',\n};\n\n/**\n * 健康度 → 等级(保留闭区间,遵守 PRD §4.4.2)\n * @param score 0-100 健康分\n */\nexport function healthLevel(score: number): 'excellent' | 'good' | 'fair' | 'poor' | 'critical' {\n if (score >= 80) return 'excellent';\n if (score >= 60) return 'good';\n if (score >= 40) return 'fair';\n if (score >= 20) return 'poor';\n return 'critical';\n}\n\n/** 按管线类型取默认色(兜底用) */\nexport function pipelineTypeColor(type: PipelineType | undefined): string {\n if (!type) return '#94a3b8';\n return PIPELINE_TYPE_COLORS[type];\n}\n","/**\n * 管网 MapLibre paint 规则(caoguo-pipeline)\n *\n * 把\"管线/节点如何着色\"的业务规则翻译成 MapLibre style spec,\n * 业务方可直接 addLayer / setPaintProperty 使用。\n *\n * 规则集:\n * - 管线按管线大类着色(type)\n * - 管线按管径着色(diameter,PRD §4.1.4)\n * - 管线按状态着色(status)\n * - 管线按材质着色(material)\n * - 管线按健康度着色(health,PipelineHealth 集成)\n *\n * 节点按节点类型着色 + 图标。\n */\n\nimport type {\n PipelineType,\n PipeMaterial,\n PipeStatus,\n ColorByMode,\n} from '../types';\nimport { PIPELINE_TYPE_COLORS, PIPE_STATUS_COLORS, HEALTH_LEVEL_COLORS, PIPE_MATERIAL_COLORS } from './pipelineTheme';\n\n/**\n * MapLibre style spec 的 color function DSL(typed),\n * 业务方可直接 `map.addLayer({type:'line', paint: {'line-color': rule} })`\n *\n * MapLibre 表达式其实接受 string | number | 嵌套数组,所以我们用 unknown 让 TS 放行\n */\nexport type PaintRule = unknown;\n\n/** 管线按\"管线大类\"着色 */\nexport function paintPipeByType(types?: PipelineType[]): PaintRule {\n if (!types || types.length === 0) {\n // 全部类型都涂色\n return [\n 'match',\n ['get', 'pipelineType'],\n ...Object.entries(PIPELINE_TYPE_COLORS).flatMap(([k, v]) => [k, v]),\n '#94a3b8',\n ];\n }\n return [\n 'match',\n ['get', 'pipelineType'],\n ...types.flatMap((t) => [t, PIPELINE_TYPE_COLORS[t]]),\n '#94a3b8',\n ];\n}\n\n/** 管线按\"管径\"渐变着色(PRD §4.1.4) */\nexport function paintPipeByDiameter(): PaintRule {\n return [\n 'interpolate',\n ['linear'],\n ['coalesce', ['get', 'diameter'], 0],\n 0, '#4ade80', // 极细管 绿\n 50, '#4ade80', // DN50 以下 绿(支管)\n 150, '#60a5fa', // DN150 蓝(配水管)\n 300, '#f59e0b', // DN300 黄(干管)\n 600, '#ef4444', // DN600+ 红(主管)\n 1500, '#7f1d1d', // 极大管 深红\n ];\n}\n\n/** 管线按\"状态\"着色 */\nexport function paintPipeByStatus(): PaintRule {\n return [\n 'match',\n ['coalesce', ['get', 'status'], 'unknown'],\n ...Object.entries(PIPE_STATUS_COLORS).flatMap(([k, v]) => [k, v]),\n '#6b7280',\n ];\n}\n\n/** 管线按\"材质\"着色 */\nexport function paintPipeByMaterial(): PaintRule {\n return [\n 'match',\n ['coalesce', ['get', 'material'], 'unknown'],\n ...Object.entries(PIPE_MATERIAL_COLORS).flatMap(([k, v]) => [k, v]),\n '#6b7280',\n ];\n}\n\n/** 管线按\"健康度\"着色(健康分 0-100,规则按 healthLevel 离散) */\nexport function paintPipeByHealth(): PaintRule {\n return [\n 'step',\n ['coalesce', ['get', 'healthScore'], 100],\n HEALTH_LEVEL_COLORS.critical, // <20\n 20, HEALTH_LEVEL_COLORS.poor,\n 40, HEALTH_LEVEL_COLORS.fair,\n 60, HEALTH_LEVEL_COLORS.good,\n 80, HEALTH_LEVEL_COLORS.excellent,\n ];\n}\n\n/** 根据模式返回 paint rule 工厂 */\nexport function paintPipeBy(mode: ColorByMode, opts?: { types?: PipelineType[] }): PaintRule {\n switch (mode) {\n case 'type':\n return paintPipeByType(opts?.types);\n case 'diameter':\n return paintPipeByDiameter();\n case 'status':\n return paintPipeByStatus();\n case 'material':\n return paintPipeByMaterial();\n case 'health':\n return paintPipeByHealth();\n case 'uniform':\n default:\n return '#60a5fa';\n }\n}\n\n/** 节点按 kind 着色(maplibre style circle-color 用) */\nexport function paintNodeByKind(): PaintRule {\n return [\n 'match',\n ['get', 'kind'],\n 'junction', '#94a3b8',\n 'valve', '#ef4444',\n 'pump', '#f59e0b',\n 'meter', '#3b82f6',\n 'source', '#22c55e',\n 'tank', '#06b6d4',\n 'junction_box', '#8b5cf6',\n '#cbd5e1',\n ];\n}\n\n/** 默认管段宽度(按管径递推) */\nexport function paintPipeWidthByDiameter(minWidth = 1.5, maxWidth = 6): PaintRule {\n return [\n 'interpolate',\n ['linear'],\n ['coalesce', ['get', 'diameter'], 100],\n 0, minWidth,\n 1500, maxWidth,\n ];\n}\n","/**\n * 管网图例(Legend)\n *\n * 每个组件都可以在浮层面板显示一份图例。本文件是图例数据生成器,\n * 业务方可拿到后用任意 UI 库渲染。\n */\n\nimport type { ColorByMode } from '../types';\nimport {\n PIPELINE_TYPE_COLORS,\n PIPELINE_TYPE_LABELS,\n PIPE_STATUS_COLORS,\n PIPE_STATUS_META,\n HEALTH_LEVEL_COLORS,\n HEALTH_LEVEL_LABELS,\n PIPE_MATERIAL_COLORS,\n} from './pipelineTheme';\n\nexport interface LegendItem {\n label: string;\n color: string;\n /** 可选样式(实线/虚线) */\n style?: 'solid' | 'dashed';\n /** 圆形图标用(设备点) */\n shape?: 'rect' | 'circle' | 'triangle';\n}\n\nexport interface LegendSection {\n title: string;\n items: LegendItem[];\n}\n\n/** 按\"管线大类\"生成图例 */\nexport function legendByType(): LegendSection {\n return {\n title: '管线类型',\n items: Object.keys(PIPELINE_TYPE_COLORS).map((k) => ({\n label: PIPELINE_TYPE_LABELS[k as keyof typeof PIPELINE_TYPE_LABELS],\n color: PIPELINE_TYPE_COLORS[k as keyof typeof PIPELINE_TYPE_COLORS],\n })),\n };\n}\n\n/** 按\"管径\"生成图例 */\nexport function legendByDiameter(): LegendSection {\n return {\n title: '管径(mm)',\n items: [\n { label: '≤50 支管', color: '#4ade80' },\n { label: '50-150 配水/配气', color: '#60a5fa' },\n { label: '150-300 干管', color: '#f59e0b' },\n { label: '300-600 主管', color: '#ef4444' },\n { label: '≥600 主干', color: '#7f1d1d' },\n ],\n };\n}\n\n/** 按\"状态\"生成图例(含动画标识) */\nexport function legendByStatus(): LegendSection {\n return {\n title: '管段状态',\n items: (Object.keys(PIPE_STATUS_COLORS) as Array<keyof typeof PIPE_STATUS_COLORS>).map(\n (k) => {\n const meta = PIPE_STATUS_META[k];\n return {\n label: meta.label,\n color: PIPE_STATUS_COLORS[k],\n style: meta.animation === 'dashed' ? ('dashed' as const) : ('solid' as const),\n };\n }\n ),\n };\n}\n\n/** 按\"材质\"生成图例 */\nexport function legendByMaterial(): LegendSection {\n return {\n title: '管材',\n items: Object.entries(PIPE_MATERIAL_COLORS).map(([k, v]) => ({\n label: materialLabel(k),\n color: v,\n })),\n };\n}\n\n/** 按\"健康度\"生成图例 */\nexport function legendByHealth(): LegendSection {\n return {\n title: '健康等级',\n items: Object.entries(HEALTH_LEVEL_COLORS).map(([k, v]) => ({\n label: `${HEALTH_LEVEL_LABELS[k]}(${healthRangeLabel(k)})`,\n color: v,\n })),\n };\n}\n\nfunction materialLabel(k: string): string {\n const map: Record<string, string> = {\n cast_iron: '铸铁',\n ductile_iron: '球墨铸铁',\n steel: '钢',\n pe: 'PE',\n pvc: 'PVC',\n concrete: '混凝土',\n hdpe: 'HDPE',\n copper: '铜',\n unknown: '未知',\n };\n return map[k] ?? k;\n}\n\nfunction healthRangeLabel(k: string): string {\n const map: Record<string, string> = {\n excellent: '80-100',\n good: '60-80',\n fair: '40-60',\n poor: '20-40',\n critical: '0-20',\n };\n return map[k] ?? '';\n}\n\n/** 通用入口:按模式取图例 */\nexport function buildLegend(mode: ColorByMode): LegendSection {\n switch (mode) {\n case 'type':\n return legendByType();\n case 'diameter':\n return legendByDiameter();\n case 'status':\n return legendByStatus();\n case 'material':\n return legendByMaterial();\n case 'health':\n return legendByHealth();\n default:\n return legendByType();\n }\n}\n"]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { NodeKind, PipelineType, PipeMaterial, PipeStatus, ColorByMode } from '../types/index.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 草果地图管网专用样式 - `caoguo-pipeline`
|
|
5
|
+
*
|
|
6
|
+
* 设计目标:
|
|
7
|
+
* - 行业辨识度高:燃气=琥珀、供水=蓝、供热=红、电力=紫、通信=绿、排水=灰
|
|
8
|
+
* - 状态语义强:正常/老化/损坏/维修中 各有专属色 + 动画
|
|
9
|
+
* - 与 caoguo-dark/light 主题协调:在亮/暗模式下都可读
|
|
10
|
+
*
|
|
11
|
+
* 颜色规范依据 PRD §4.5。
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** 管线大类配色(caoguo-pipeline) */
|
|
15
|
+
declare const PIPELINE_TYPE_COLORS: Record<PipelineType, string>;
|
|
16
|
+
/** 管线大类的中文标签(地图图例/卡片显示) */
|
|
17
|
+
declare const PIPELINE_TYPE_LABELS: Record<PipelineType, string>;
|
|
18
|
+
/** 管线大类的 Emoji 图标(轻量可视化标识,用于卡片/Tag) */
|
|
19
|
+
declare const PIPELINE_TYPE_ICONS: Record<PipelineType, string>;
|
|
20
|
+
/** 管段状态配色 */
|
|
21
|
+
declare const PIPE_STATUS_COLORS: Record<PipeStatus, string>;
|
|
22
|
+
/** 状态的语义 + 动画 */
|
|
23
|
+
declare const PIPE_STATUS_META: Record<PipeStatus, {
|
|
24
|
+
label: string;
|
|
25
|
+
animation?: 'pulse' | 'dashed' | 'none';
|
|
26
|
+
}>;
|
|
27
|
+
/** 管材配色(maplibre style 用) */
|
|
28
|
+
declare const PIPE_MATERIAL_COLORS: Record<PipeMaterial, string>;
|
|
29
|
+
/** 节点图标(用 SVG path 描点,地图渲染层用) */
|
|
30
|
+
declare const NODE_KIND_ICONS: Record<NodeKind, string>;
|
|
31
|
+
/** 节点配色(默认按 type 衍生) */
|
|
32
|
+
declare const NODE_KIND_COLORS: Record<NodeKind, string>;
|
|
33
|
+
/** 健康度等级配色(PipelineHealth 用) */
|
|
34
|
+
declare const HEALTH_LEVEL_COLORS: Record<string, string>;
|
|
35
|
+
/** 健康等级 label */
|
|
36
|
+
declare const HEALTH_LEVEL_LABELS: Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* 健康度 → 等级(保留闭区间,遵守 PRD §4.4.2)
|
|
39
|
+
* @param score 0-100 健康分
|
|
40
|
+
*/
|
|
41
|
+
declare function healthLevel(score: number): 'excellent' | 'good' | 'fair' | 'poor' | 'critical';
|
|
42
|
+
/** 按管线类型取默认色(兜底用) */
|
|
43
|
+
declare function pipelineTypeColor(type: PipelineType | undefined): string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 管网 MapLibre paint 规则(caoguo-pipeline)
|
|
47
|
+
*
|
|
48
|
+
* 把"管线/节点如何着色"的业务规则翻译成 MapLibre style spec,
|
|
49
|
+
* 业务方可直接 addLayer / setPaintProperty 使用。
|
|
50
|
+
*
|
|
51
|
+
* 规则集:
|
|
52
|
+
* - 管线按管线大类着色(type)
|
|
53
|
+
* - 管线按管径着色(diameter,PRD §4.1.4)
|
|
54
|
+
* - 管线按状态着色(status)
|
|
55
|
+
* - 管线按材质着色(material)
|
|
56
|
+
* - 管线按健康度着色(health,PipelineHealth 集成)
|
|
57
|
+
*
|
|
58
|
+
* 节点按节点类型着色 + 图标。
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* MapLibre style spec 的 color function DSL(typed),
|
|
63
|
+
* 业务方可直接 `map.addLayer({type:'line', paint: {'line-color': rule} })`
|
|
64
|
+
*
|
|
65
|
+
* MapLibre 表达式其实接受 string | number | 嵌套数组,所以我们用 unknown 让 TS 放行
|
|
66
|
+
*/
|
|
67
|
+
type PaintRule = unknown;
|
|
68
|
+
/** 管线按"管线大类"着色 */
|
|
69
|
+
declare function paintPipeByType(types?: PipelineType[]): PaintRule;
|
|
70
|
+
/** 管线按"管径"渐变着色(PRD §4.1.4) */
|
|
71
|
+
declare function paintPipeByDiameter(): PaintRule;
|
|
72
|
+
/** 管线按"状态"着色 */
|
|
73
|
+
declare function paintPipeByStatus(): PaintRule;
|
|
74
|
+
/** 管线按"材质"着色 */
|
|
75
|
+
declare function paintPipeByMaterial(): PaintRule;
|
|
76
|
+
/** 管线按"健康度"着色(健康分 0-100,规则按 healthLevel 离散) */
|
|
77
|
+
declare function paintPipeByHealth(): PaintRule;
|
|
78
|
+
/** 根据模式返回 paint rule 工厂 */
|
|
79
|
+
declare function paintPipeBy(mode: ColorByMode, opts?: {
|
|
80
|
+
types?: PipelineType[];
|
|
81
|
+
}): PaintRule;
|
|
82
|
+
/** 节点按 kind 着色(maplibre style circle-color 用) */
|
|
83
|
+
declare function paintNodeByKind(): PaintRule;
|
|
84
|
+
/** 默认管段宽度(按管径递推) */
|
|
85
|
+
declare function paintPipeWidthByDiameter(minWidth?: number, maxWidth?: number): PaintRule;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 管网图例(Legend)
|
|
89
|
+
*
|
|
90
|
+
* 每个组件都可以在浮层面板显示一份图例。本文件是图例数据生成器,
|
|
91
|
+
* 业务方可拿到后用任意 UI 库渲染。
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
interface LegendItem {
|
|
95
|
+
label: string;
|
|
96
|
+
color: string;
|
|
97
|
+
/** 可选样式(实线/虚线) */
|
|
98
|
+
style?: 'solid' | 'dashed';
|
|
99
|
+
/** 圆形图标用(设备点) */
|
|
100
|
+
shape?: 'rect' | 'circle' | 'triangle';
|
|
101
|
+
}
|
|
102
|
+
interface LegendSection {
|
|
103
|
+
title: string;
|
|
104
|
+
items: LegendItem[];
|
|
105
|
+
}
|
|
106
|
+
/** 按"管线大类"生成图例 */
|
|
107
|
+
declare function legendByType(): LegendSection;
|
|
108
|
+
/** 按"管径"生成图例 */
|
|
109
|
+
declare function legendByDiameter(): LegendSection;
|
|
110
|
+
/** 按"状态"生成图例(含动画标识) */
|
|
111
|
+
declare function legendByStatus(): LegendSection;
|
|
112
|
+
/** 按"材质"生成图例 */
|
|
113
|
+
declare function legendByMaterial(): LegendSection;
|
|
114
|
+
/** 按"健康度"生成图例 */
|
|
115
|
+
declare function legendByHealth(): LegendSection;
|
|
116
|
+
/** 通用入口:按模式取图例 */
|
|
117
|
+
declare function buildLegend(mode: ColorByMode): LegendSection;
|
|
118
|
+
|
|
119
|
+
export { HEALTH_LEVEL_COLORS, HEALTH_LEVEL_LABELS, type LegendItem, type LegendSection, NODE_KIND_COLORS, NODE_KIND_ICONS, PIPELINE_TYPE_COLORS, PIPELINE_TYPE_ICONS, PIPELINE_TYPE_LABELS, PIPE_MATERIAL_COLORS, PIPE_STATUS_COLORS, PIPE_STATUS_META, type PaintRule, buildLegend, healthLevel, legendByDiameter, legendByHealth, legendByMaterial, legendByStatus, legendByType, paintNodeByKind, paintPipeBy, paintPipeByDiameter, paintPipeByHealth, paintPipeByMaterial, paintPipeByStatus, paintPipeByType, paintPipeWidthByDiameter, pipelineTypeColor };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { NodeKind, PipelineType, PipeMaterial, PipeStatus, ColorByMode } from '../types/index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 草果地图管网专用样式 - `caoguo-pipeline`
|
|
5
|
+
*
|
|
6
|
+
* 设计目标:
|
|
7
|
+
* - 行业辨识度高:燃气=琥珀、供水=蓝、供热=红、电力=紫、通信=绿、排水=灰
|
|
8
|
+
* - 状态语义强:正常/老化/损坏/维修中 各有专属色 + 动画
|
|
9
|
+
* - 与 caoguo-dark/light 主题协调:在亮/暗模式下都可读
|
|
10
|
+
*
|
|
11
|
+
* 颜色规范依据 PRD §4.5。
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** 管线大类配色(caoguo-pipeline) */
|
|
15
|
+
declare const PIPELINE_TYPE_COLORS: Record<PipelineType, string>;
|
|
16
|
+
/** 管线大类的中文标签(地图图例/卡片显示) */
|
|
17
|
+
declare const PIPELINE_TYPE_LABELS: Record<PipelineType, string>;
|
|
18
|
+
/** 管线大类的 Emoji 图标(轻量可视化标识,用于卡片/Tag) */
|
|
19
|
+
declare const PIPELINE_TYPE_ICONS: Record<PipelineType, string>;
|
|
20
|
+
/** 管段状态配色 */
|
|
21
|
+
declare const PIPE_STATUS_COLORS: Record<PipeStatus, string>;
|
|
22
|
+
/** 状态的语义 + 动画 */
|
|
23
|
+
declare const PIPE_STATUS_META: Record<PipeStatus, {
|
|
24
|
+
label: string;
|
|
25
|
+
animation?: 'pulse' | 'dashed' | 'none';
|
|
26
|
+
}>;
|
|
27
|
+
/** 管材配色(maplibre style 用) */
|
|
28
|
+
declare const PIPE_MATERIAL_COLORS: Record<PipeMaterial, string>;
|
|
29
|
+
/** 节点图标(用 SVG path 描点,地图渲染层用) */
|
|
30
|
+
declare const NODE_KIND_ICONS: Record<NodeKind, string>;
|
|
31
|
+
/** 节点配色(默认按 type 衍生) */
|
|
32
|
+
declare const NODE_KIND_COLORS: Record<NodeKind, string>;
|
|
33
|
+
/** 健康度等级配色(PipelineHealth 用) */
|
|
34
|
+
declare const HEALTH_LEVEL_COLORS: Record<string, string>;
|
|
35
|
+
/** 健康等级 label */
|
|
36
|
+
declare const HEALTH_LEVEL_LABELS: Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* 健康度 → 等级(保留闭区间,遵守 PRD §4.4.2)
|
|
39
|
+
* @param score 0-100 健康分
|
|
40
|
+
*/
|
|
41
|
+
declare function healthLevel(score: number): 'excellent' | 'good' | 'fair' | 'poor' | 'critical';
|
|
42
|
+
/** 按管线类型取默认色(兜底用) */
|
|
43
|
+
declare function pipelineTypeColor(type: PipelineType | undefined): string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 管网 MapLibre paint 规则(caoguo-pipeline)
|
|
47
|
+
*
|
|
48
|
+
* 把"管线/节点如何着色"的业务规则翻译成 MapLibre style spec,
|
|
49
|
+
* 业务方可直接 addLayer / setPaintProperty 使用。
|
|
50
|
+
*
|
|
51
|
+
* 规则集:
|
|
52
|
+
* - 管线按管线大类着色(type)
|
|
53
|
+
* - 管线按管径着色(diameter,PRD §4.1.4)
|
|
54
|
+
* - 管线按状态着色(status)
|
|
55
|
+
* - 管线按材质着色(material)
|
|
56
|
+
* - 管线按健康度着色(health,PipelineHealth 集成)
|
|
57
|
+
*
|
|
58
|
+
* 节点按节点类型着色 + 图标。
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* MapLibre style spec 的 color function DSL(typed),
|
|
63
|
+
* 业务方可直接 `map.addLayer({type:'line', paint: {'line-color': rule} })`
|
|
64
|
+
*
|
|
65
|
+
* MapLibre 表达式其实接受 string | number | 嵌套数组,所以我们用 unknown 让 TS 放行
|
|
66
|
+
*/
|
|
67
|
+
type PaintRule = unknown;
|
|
68
|
+
/** 管线按"管线大类"着色 */
|
|
69
|
+
declare function paintPipeByType(types?: PipelineType[]): PaintRule;
|
|
70
|
+
/** 管线按"管径"渐变着色(PRD §4.1.4) */
|
|
71
|
+
declare function paintPipeByDiameter(): PaintRule;
|
|
72
|
+
/** 管线按"状态"着色 */
|
|
73
|
+
declare function paintPipeByStatus(): PaintRule;
|
|
74
|
+
/** 管线按"材质"着色 */
|
|
75
|
+
declare function paintPipeByMaterial(): PaintRule;
|
|
76
|
+
/** 管线按"健康度"着色(健康分 0-100,规则按 healthLevel 离散) */
|
|
77
|
+
declare function paintPipeByHealth(): PaintRule;
|
|
78
|
+
/** 根据模式返回 paint rule 工厂 */
|
|
79
|
+
declare function paintPipeBy(mode: ColorByMode, opts?: {
|
|
80
|
+
types?: PipelineType[];
|
|
81
|
+
}): PaintRule;
|
|
82
|
+
/** 节点按 kind 着色(maplibre style circle-color 用) */
|
|
83
|
+
declare function paintNodeByKind(): PaintRule;
|
|
84
|
+
/** 默认管段宽度(按管径递推) */
|
|
85
|
+
declare function paintPipeWidthByDiameter(minWidth?: number, maxWidth?: number): PaintRule;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 管网图例(Legend)
|
|
89
|
+
*
|
|
90
|
+
* 每个组件都可以在浮层面板显示一份图例。本文件是图例数据生成器,
|
|
91
|
+
* 业务方可拿到后用任意 UI 库渲染。
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
interface LegendItem {
|
|
95
|
+
label: string;
|
|
96
|
+
color: string;
|
|
97
|
+
/** 可选样式(实线/虚线) */
|
|
98
|
+
style?: 'solid' | 'dashed';
|
|
99
|
+
/** 圆形图标用(设备点) */
|
|
100
|
+
shape?: 'rect' | 'circle' | 'triangle';
|
|
101
|
+
}
|
|
102
|
+
interface LegendSection {
|
|
103
|
+
title: string;
|
|
104
|
+
items: LegendItem[];
|
|
105
|
+
}
|
|
106
|
+
/** 按"管线大类"生成图例 */
|
|
107
|
+
declare function legendByType(): LegendSection;
|
|
108
|
+
/** 按"管径"生成图例 */
|
|
109
|
+
declare function legendByDiameter(): LegendSection;
|
|
110
|
+
/** 按"状态"生成图例(含动画标识) */
|
|
111
|
+
declare function legendByStatus(): LegendSection;
|
|
112
|
+
/** 按"材质"生成图例 */
|
|
113
|
+
declare function legendByMaterial(): LegendSection;
|
|
114
|
+
/** 按"健康度"生成图例 */
|
|
115
|
+
declare function legendByHealth(): LegendSection;
|
|
116
|
+
/** 通用入口:按模式取图例 */
|
|
117
|
+
declare function buildLegend(mode: ColorByMode): LegendSection;
|
|
118
|
+
|
|
119
|
+
export { HEALTH_LEVEL_COLORS, HEALTH_LEVEL_LABELS, type LegendItem, type LegendSection, NODE_KIND_COLORS, NODE_KIND_ICONS, PIPELINE_TYPE_COLORS, PIPELINE_TYPE_ICONS, PIPELINE_TYPE_LABELS, PIPE_MATERIAL_COLORS, PIPE_STATUS_COLORS, PIPE_STATUS_META, type PaintRule, buildLegend, healthLevel, legendByDiameter, legendByHealth, legendByMaterial, legendByStatus, legendByType, paintNodeByKind, paintPipeBy, paintPipeByDiameter, paintPipeByHealth, paintPipeByMaterial, paintPipeByStatus, paintPipeByType, paintPipeWidthByDiameter, pipelineTypeColor };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { buildLegend, legendByDiameter, legendByHealth, legendByMaterial, legendByStatus, legendByType } from '../chunk-YS2ICFVK.js';
|
|
2
|
+
export { HEALTH_LEVEL_COLORS, HEALTH_LEVEL_LABELS, NODE_KIND_COLORS, NODE_KIND_ICONS, PIPELINE_TYPE_COLORS, PIPELINE_TYPE_ICONS, PIPELINE_TYPE_LABELS, PIPE_MATERIAL_COLORS, PIPE_STATUS_COLORS, PIPE_STATUS_META, healthLevel, paintNodeByKind, paintPipeBy, paintPipeByDiameter, paintPipeByHealth, paintPipeByMaterial, paintPipeByStatus, paintPipeByType, paintPipeWidthByDiameter, pipelineTypeColor } from '../chunk-QVY4WJLM.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|