@motionscript/geo 0.0.0-stage → 0.1.0-alpha.3
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/CHANGELOG.md +21 -0
- package/LICENSE +201 -0
- package/dist/border/format.d.ts +73 -0
- package/dist/border/format.d.ts.map +1 -0
- package/dist/border/format.js +68 -0
- package/dist/border/format.js.map +1 -0
- package/dist/border/geo-border.d.ts +44 -0
- package/dist/border/geo-border.d.ts.map +1 -0
- package/dist/border/geo-border.js +234 -0
- package/dist/border/geo-border.js.map +1 -0
- package/dist/border/geometry.d.ts +40 -0
- package/dist/border/geometry.d.ts.map +1 -0
- package/dist/border/geometry.js +382 -0
- package/dist/border/geometry.js.map +1 -0
- package/dist/border/index.d.ts +15 -0
- package/dist/border/index.d.ts.map +1 -0
- package/dist/border/index.js +15 -0
- package/dist/border/index.js.map +1 -0
- package/dist/border/loader.d.ts +31 -0
- package/dist/border/loader.d.ts.map +1 -0
- package/dist/border/loader.js +87 -0
- package/dist/border/loader.js.map +1 -0
- package/dist/border/registry.d.ts +64 -0
- package/dist/border/registry.d.ts.map +1 -0
- package/dist/border/registry.js +152 -0
- package/dist/border/registry.js.map +1 -0
- package/dist/border/selection.d.ts +21 -0
- package/dist/border/selection.d.ts.map +1 -0
- package/dist/border/selection.js +86 -0
- package/dist/border/selection.js.map +1 -0
- package/dist/border/simplify.d.ts +12 -0
- package/dist/border/simplify.d.ts.map +1 -0
- package/dist/border/simplify.js +116 -0
- package/dist/border/simplify.js.map +1 -0
- package/dist/browser/index.js +25 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/manifest.json +11 -0
- package/dist/globe/atmosphere.d.ts +38 -0
- package/dist/globe/atmosphere.d.ts.map +1 -0
- package/dist/globe/atmosphere.js +91 -0
- package/dist/globe/atmosphere.js.map +1 -0
- package/dist/globe/borders.d.ts +39 -0
- package/dist/globe/borders.d.ts.map +1 -0
- package/dist/globe/borders.js +116 -0
- package/dist/globe/borders.js.map +1 -0
- package/dist/globe/data/ne-110m.d.ts +25 -0
- package/dist/globe/data/ne-110m.d.ts.map +1 -0
- package/dist/globe/data/ne-110m.js +198 -0
- package/dist/globe/data/ne-110m.js.map +1 -0
- package/dist/globe/globe-places.d.ts +140 -0
- package/dist/globe/globe-places.d.ts.map +1 -0
- package/dist/globe/globe-places.js +262 -0
- package/dist/globe/globe-places.js.map +1 -0
- package/dist/globe/globe.d.ts +193 -0
- package/dist/globe/globe.d.ts.map +1 -0
- package/dist/globe/globe.js +435 -0
- package/dist/globe/globe.js.map +1 -0
- package/dist/globe/index.d.ts +17 -0
- package/dist/globe/index.d.ts.map +1 -0
- package/dist/globe/index.js +17 -0
- package/dist/globe/index.js.map +1 -0
- package/dist/globe/places.d.ts +69 -0
- package/dist/globe/places.d.ts.map +1 -0
- package/dist/globe/places.js +94 -0
- package/dist/globe/places.js.map +1 -0
- package/dist/globe/projection.d.ts +182 -0
- package/dist/globe/projection.d.ts.map +1 -0
- package/dist/globe/projection.js +215 -0
- package/dist/globe/projection.js.map +1 -0
- package/dist/globe/world-map.d.ts +83 -0
- package/dist/globe/world-map.d.ts.map +1 -0
- package/dist/globe/world-map.js +169 -0
- package/dist/globe/world-map.js.map +1 -0
- package/dist/globe/world.d.ts +46 -0
- package/dist/globe/world.d.ts.map +1 -0
- package/dist/globe/world.js +71 -0
- package/dist/globe/world.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes.d.ts +19 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +19 -0
- package/dist/nodes.js.map +1 -0
- package/package.json +69 -3
- package/registry.json +31 -0
- package/src/border/format.ts +147 -0
- package/src/border/geo-border.ts +260 -0
- package/src/border/geometry.ts +463 -0
- package/src/border/index.ts +14 -0
- package/src/border/loader.ts +97 -0
- package/src/border/registry.ts +191 -0
- package/src/border/selection.ts +95 -0
- package/src/border/simplify.ts +110 -0
- package/src/globe/atmosphere.ts +98 -0
- package/src/globe/borders.ts +166 -0
- package/src/globe/data/ne-110m.ts +214 -0
- package/src/globe/globe-places.ts +352 -0
- package/src/globe/globe.ts +552 -0
- package/src/globe/index.ts +16 -0
- package/src/globe/places.ts +132 -0
- package/src/globe/projection.ts +261 -0
- package/src/globe/world-map.ts +227 -0
- package/src/globe/world.ts +111 -0
- package/src/index.ts +5 -0
- package/src/nodes.ts +19 -0
- package/README.md +0 -4
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Clip, Graphics2D, ShapeNode, node, property, } from "@motionscript/sdk";
|
|
8
|
+
import { snapValue } from "@motionscript/sdk/component";
|
|
9
|
+
import { geoGeometry } from "./geometry.js";
|
|
10
|
+
import { geoDataVersion, geoLoader } from "./loader.js";
|
|
11
|
+
import { geoRegistry } from "./registry.js";
|
|
12
|
+
import { geoFilesFor, normalizeIso, selectGeoFeatures } from "./selection.js";
|
|
13
|
+
// Skia's cost for one path grows faster than its contour count, and a shape
|
|
14
|
+
// drawn as several paths under one paint is unioned every frame — so a region
|
|
15
|
+
// is cut into paths of bounded size, each painted on its own.
|
|
16
|
+
const CONTOURS_PER_PATH = 256;
|
|
17
|
+
const POINTS_PER_PATH = 40_000;
|
|
18
|
+
const coordinate = (value) => String(Math.round(value * 100) / 100);
|
|
19
|
+
function chunk(contours, total, scale) {
|
|
20
|
+
const chunks = [];
|
|
21
|
+
let parts = [];
|
|
22
|
+
let count = 0;
|
|
23
|
+
let points = 0;
|
|
24
|
+
let from = 0;
|
|
25
|
+
let length = 0;
|
|
26
|
+
const flush = () => {
|
|
27
|
+
if (count === 0)
|
|
28
|
+
return;
|
|
29
|
+
const to = total > 0 ? Math.min(1, length / total) : 1;
|
|
30
|
+
chunks.push({ data: parts.join(""), from, to });
|
|
31
|
+
from = to;
|
|
32
|
+
parts = [];
|
|
33
|
+
count = 0;
|
|
34
|
+
points = 0;
|
|
35
|
+
};
|
|
36
|
+
for (const contour of contours) {
|
|
37
|
+
const p = contour.points;
|
|
38
|
+
// Path data is y-down; the unit geometry is y-up.
|
|
39
|
+
for (let i = 0; i < p.length; i += 2) {
|
|
40
|
+
parts.push(i === 0 ? "M" : "L", coordinate(p[i] * scale), " ", coordinate(-p[i + 1] * scale));
|
|
41
|
+
}
|
|
42
|
+
if (contour.closed)
|
|
43
|
+
parts.push("Z");
|
|
44
|
+
count++;
|
|
45
|
+
points += p.length / 2;
|
|
46
|
+
length += contour.length;
|
|
47
|
+
if (count >= CONTOURS_PER_PATH || points >= POINTS_PER_PATH)
|
|
48
|
+
flush();
|
|
49
|
+
}
|
|
50
|
+
flush();
|
|
51
|
+
return chunks;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Country and subdivision outlines by ISO 3166 code, fitted into the node's box.
|
|
55
|
+
*
|
|
56
|
+
* <GeoBorder iso={["FR", "DE"]} detail={0.4} stroke={{ weight: 2, fill: "white" }} />
|
|
57
|
+
*
|
|
58
|
+
* Geometry comes from whatever `geoRegistry` has been given — a URL, a loader,
|
|
59
|
+
* or shapes defined by hand — and loads as a declared asset, so a frame never
|
|
60
|
+
* draws half a country. Fill and stroke are separate geometry: the fill is each
|
|
61
|
+
* region's polygons, the stroke is every border once, which is why a border two
|
|
62
|
+
* selected regions share is not drawn twice and why `stroke.align` does not
|
|
63
|
+
* apply.
|
|
64
|
+
*/
|
|
65
|
+
let GeoBorder = class GeoBorder extends ShapeNode {
|
|
66
|
+
constructor(props) {
|
|
67
|
+
super(props);
|
|
68
|
+
}
|
|
69
|
+
declareAssets(assets) {
|
|
70
|
+
super.declareAssets(assets);
|
|
71
|
+
for (const file of geoFilesFor(this.iso, this.level)) {
|
|
72
|
+
assets.loader(`geo:${file}`, geoLoader(file), { gate: "render" });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
renderSelf(ctx) {
|
|
76
|
+
const drawn = this._drawn();
|
|
77
|
+
const fill = this.fill;
|
|
78
|
+
if (!drawn || drawn.fills.length === 0)
|
|
79
|
+
return;
|
|
80
|
+
const shadow = this.shadow;
|
|
81
|
+
const g = new Graphics2D();
|
|
82
|
+
for (const chunk of drawn.fills) {
|
|
83
|
+
if (!this._pathOp(g, chunk))
|
|
84
|
+
continue;
|
|
85
|
+
if (shadow.length > 0)
|
|
86
|
+
g.shadow(shadow);
|
|
87
|
+
g.fill(fill);
|
|
88
|
+
}
|
|
89
|
+
ctx.draw(g);
|
|
90
|
+
}
|
|
91
|
+
renderOverlay(ctx) {
|
|
92
|
+
const overlay = this.overlay;
|
|
93
|
+
if (overlay.length === 0)
|
|
94
|
+
return;
|
|
95
|
+
const drawn = this._drawn();
|
|
96
|
+
if (!drawn)
|
|
97
|
+
return;
|
|
98
|
+
const g = new Graphics2D();
|
|
99
|
+
for (const chunk of drawn.fills)
|
|
100
|
+
if (this._pathOp(g, chunk))
|
|
101
|
+
g.fill(overlay);
|
|
102
|
+
ctx.draw(g);
|
|
103
|
+
}
|
|
104
|
+
renderStroke(ctx) {
|
|
105
|
+
const stroke = this.stroke;
|
|
106
|
+
if (stroke.length === 0)
|
|
107
|
+
return;
|
|
108
|
+
const drawn = this._drawn();
|
|
109
|
+
if (!drawn || drawn.lines.length === 0)
|
|
110
|
+
return;
|
|
111
|
+
const centred = stroke.map((layer) => (layer.align === 0 ? layer : { ...layer, align: 0 }));
|
|
112
|
+
const shadow = this.shadow;
|
|
113
|
+
const castsShadow = shadow.length > 0 && !this.fill.some((layer) => (layer.opacity ?? 1) > 0);
|
|
114
|
+
const g = new Graphics2D();
|
|
115
|
+
for (const chunk of drawn.lines) {
|
|
116
|
+
if (!this._pathOp(g, chunk))
|
|
117
|
+
continue;
|
|
118
|
+
if (castsShadow)
|
|
119
|
+
g.shadow(shadow);
|
|
120
|
+
g.stroke(centred);
|
|
121
|
+
}
|
|
122
|
+
ctx.draw(g);
|
|
123
|
+
}
|
|
124
|
+
// The box, not the outline: a path clip has no winding test, and a country's
|
|
125
|
+
// bounding box is what the selection shows.
|
|
126
|
+
clipSelf() {
|
|
127
|
+
return new Clip().rect({
|
|
128
|
+
x: 0,
|
|
129
|
+
y: 0,
|
|
130
|
+
width: this.layoutBounds.width,
|
|
131
|
+
height: this.layoutBounds.height,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
_drawnCache = null;
|
|
135
|
+
_warned = new Set();
|
|
136
|
+
_pathOp(g, chunk) {
|
|
137
|
+
const start = this.start;
|
|
138
|
+
const end = this.end;
|
|
139
|
+
const width = this.layoutBounds.width;
|
|
140
|
+
const height = this.layoutBounds.height;
|
|
141
|
+
const centerBounds = [-width / 2, -height / 2, width / 2, height / 2];
|
|
142
|
+
if (start <= 0 && end >= 1) {
|
|
143
|
+
g.path({ data: chunk.data, centerBounds });
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
const span = chunk.to - chunk.from;
|
|
147
|
+
if (span <= 0)
|
|
148
|
+
return false;
|
|
149
|
+
const localStart = Math.max(0, (start - chunk.from) / span);
|
|
150
|
+
const localEnd = Math.min(1, (end - chunk.from) / span);
|
|
151
|
+
if (localEnd <= localStart)
|
|
152
|
+
return false;
|
|
153
|
+
g.path({ data: chunk.data, centerBounds, start: localStart, end: localEnd });
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
_drawn() {
|
|
157
|
+
const codes = this.iso;
|
|
158
|
+
const level = this.level;
|
|
159
|
+
const frame = this.frame;
|
|
160
|
+
const selection = selectGeoFeatures(codes, level, frame);
|
|
161
|
+
for (const code of selection.unknown) {
|
|
162
|
+
if (this._warned.has(code))
|
|
163
|
+
continue;
|
|
164
|
+
this._warned.add(code);
|
|
165
|
+
console.warn(`[GeoBorder] no region with code ${code}`);
|
|
166
|
+
}
|
|
167
|
+
if (selection.features.length === 0)
|
|
168
|
+
return null;
|
|
169
|
+
const geometry = geoGeometry({
|
|
170
|
+
selectionKey: `${geoRegistry.generation}:${geoDataVersion()}:${level}:${frame}:${codes.join(",")}`,
|
|
171
|
+
features: selection.features,
|
|
172
|
+
frame,
|
|
173
|
+
projection: this.projection,
|
|
174
|
+
borders: this.borders,
|
|
175
|
+
detail: this.detail,
|
|
176
|
+
});
|
|
177
|
+
if (!geometry)
|
|
178
|
+
return null;
|
|
179
|
+
const width = this.layoutBounds.width;
|
|
180
|
+
const height = this.layoutBounds.height;
|
|
181
|
+
const cached = this._drawnCache;
|
|
182
|
+
if (cached && cached.geometry === geometry && cached.width === width && cached.height === height) {
|
|
183
|
+
return cached;
|
|
184
|
+
}
|
|
185
|
+
const scale = Math.min(width / geometry.width, height / geometry.height);
|
|
186
|
+
const drawn = {
|
|
187
|
+
geometry,
|
|
188
|
+
width,
|
|
189
|
+
height,
|
|
190
|
+
fills: chunk(geometry.fills, geometry.fillLength, scale),
|
|
191
|
+
lines: chunk(geometry.lines, geometry.lineLength, scale),
|
|
192
|
+
};
|
|
193
|
+
this._drawnCache = drawn;
|
|
194
|
+
return drawn;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
__decorate([
|
|
198
|
+
property({ default: ["FR"], mapper: normalizeIso, tween: snapValue })
|
|
199
|
+
], GeoBorder.prototype, "iso", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ default: "country", tween: snapValue, options: ["country", "state"] })
|
|
202
|
+
], GeoBorder.prototype, "level", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ default: 0.5, min: 0, max: 1, step: 0.01 })
|
|
205
|
+
], GeoBorder.prototype, "detail", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({
|
|
208
|
+
default: "conic",
|
|
209
|
+
tween: snapValue,
|
|
210
|
+
options: ["conic", "mercator", "equirectangular", "orthographic"],
|
|
211
|
+
})
|
|
212
|
+
], GeoBorder.prototype, "projection", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
property({ default: "mainland", tween: snapValue, options: ["mainland", "all"] })
|
|
215
|
+
], GeoBorder.prototype, "frame", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
property({ default: "all", tween: snapValue, options: ["all", "outline"] })
|
|
218
|
+
], GeoBorder.prototype, "borders", void 0);
|
|
219
|
+
GeoBorder = __decorate([
|
|
220
|
+
node({
|
|
221
|
+
key: "geoBorder",
|
|
222
|
+
parentKey: "shape",
|
|
223
|
+
forkable: true,
|
|
224
|
+
layout: {
|
|
225
|
+
children: "freeform",
|
|
226
|
+
acceptsChildren: true,
|
|
227
|
+
defaultWidthMode: "fixed",
|
|
228
|
+
defaultHeightMode: "fixed",
|
|
229
|
+
},
|
|
230
|
+
seed: { width: 480, height: 480 },
|
|
231
|
+
})
|
|
232
|
+
], GeoBorder);
|
|
233
|
+
export { GeoBorder };
|
|
234
|
+
//# sourceMappingURL=geo-border.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo-border.js","sourceRoot":"","sources":["../../src/border/geo-border.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,IAAI,EACJ,UAAU,EACV,SAAS,EACT,IAAI,EACJ,QAAQ,GASX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAEvD,OAAO,EAAE,WAAW,EAA8E,MAAM,YAAY,CAAA;AACpH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;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C;AAG7B;IADP,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;wCAC3D;AAGf;IADP,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;0CACjD;AArBlB,SAAS;IAZrB,IAAI,CAAC;QACF,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE;YACJ,QAAQ,EAAE,UAAU;YACpB,eAAe,EAAE,IAAI;YACrB,gBAAgB,EAAE,OAAO;YACzB,iBAAiB,EAAE,OAAO;SAC7B;QACD,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;KACpC,CAAC;GACW,SAAS,CAmJrB","sourcesContent":["import {\n Clip,\n Graphics2D,\n ShapeNode,\n node,\n property,\n type AssetScope,\n type FillResolved,\n type NodeConfig,\n type PathBounds,\n type RenderContext2D,\n type ShadowResolved,\n type ShapeProps,\n type StrokeResolved,\n} from \"@motionscript/sdk\"\nimport { snapValue } from \"@motionscript/sdk/component\"\n\nimport { geoGeometry, type GeoBorders, type GeoContour, type GeoGeometry, type GeoProjectionKind } from \"./geometry\"\nimport { geoDataVersion, geoLoader } from \"./loader\"\nimport { geoRegistry } from \"./registry\"\nimport { geoFilesFor, normalizeIso, selectGeoFeatures, type GeoFrame, type GeoLevel } from \"./selection\"\n\nexport interface GeoBorderProps extends ShapeProps {\n /** ISO 3166-1 alpha-2 (`\"FR\"`) or ISO 3166-2 (`\"US-CA\"`) codes. */\n iso: string | readonly string[]\n level: GeoLevel\n /** 0–1: 1 is full resolution, lower is a more stylised outline. */\n detail: number\n projection: GeoProjectionKind\n frame: GeoFrame\n borders: GeoBorders\n}\n\ninterface Chunk {\n data: string\n /** Where this chunk's contours sit along the whole drawing, as fractions of its length. */\n from: number\n to: number\n}\n\ninterface Drawn {\n geometry: GeoGeometry\n width: number\n height: number\n fills: Chunk[]\n lines: Chunk[]\n}\n\n// Skia's cost for one path grows faster than its contour count, and a shape\n// drawn as several paths under one paint is unioned every frame — so a region\n// is cut into paths of bounded size, each painted on its own.\nconst CONTOURS_PER_PATH = 256\nconst POINTS_PER_PATH = 40_000\n\nconst coordinate = (value: number) => String(Math.round(value * 100) / 100)\n\nfunction chunk(contours: readonly GeoContour[], total: number, scale: number): Chunk[] {\n const chunks: Chunk[] = []\n let parts: string[] = []\n let count = 0\n let points = 0\n let from = 0\n let length = 0\n const flush = () => {\n if (count === 0) return\n const to = total > 0 ? Math.min(1, length / total) : 1\n chunks.push({ data: parts.join(\"\"), from, to })\n from = to\n parts = []\n count = 0\n points = 0\n }\n for (const contour of contours) {\n const p = contour.points\n // Path data is y-down; the unit geometry is y-up.\n for (let i = 0; i < p.length; i += 2) {\n parts.push(i === 0 ? \"M\" : \"L\", coordinate(p[i] * scale), \" \", coordinate(-p[i + 1] * scale))\n }\n if (contour.closed) parts.push(\"Z\")\n count++\n points += p.length / 2\n length += contour.length\n if (count >= CONTOURS_PER_PATH || points >= POINTS_PER_PATH) flush()\n }\n flush()\n return chunks\n}\n\n/**\n * Country and subdivision outlines by ISO 3166 code, fitted into the node's box.\n *\n * <GeoBorder iso={[\"FR\", \"DE\"]} detail={0.4} stroke={{ weight: 2, fill: \"white\" }} />\n *\n * Geometry comes from whatever `geoRegistry` has been given — a URL, a loader,\n * or shapes defined by hand — and loads as a declared asset, so a frame never\n * draws half a country. Fill and stroke are separate geometry: the fill is each\n * region's polygons, the stroke is every border once, which is why a border two\n * selected regions share is not drawn twice and why `stroke.align` does not\n * apply.\n */\n@node({\n key: \"geoBorder\",\n parentKey: \"shape\",\n forkable: true,\n layout: {\n children: \"freeform\",\n acceptsChildren: true,\n defaultWidthMode: \"fixed\",\n defaultHeightMode: \"fixed\",\n },\n seed: { width: 480, height: 480 },\n})\nexport class GeoBorder extends ShapeNode<GeoBorderProps> {\n @property({ default: [\"FR\"], mapper: normalizeIso, tween: snapValue })\n declare iso: string | readonly string[]\n\n @property({ default: \"country\", tween: snapValue, options: [\"country\", \"state\"] })\n declare level: GeoLevel\n\n @property({ default: 0.5, min: 0, max: 1, step: 0.01 })\n declare detail: number\n\n @property({\n default: \"conic\",\n tween: snapValue,\n options: [\"conic\", \"mercator\", \"equirectangular\", \"orthographic\"],\n })\n declare projection: GeoProjectionKind\n\n @property({ default: \"mainland\", tween: snapValue, options: [\"mainland\", \"all\"] })\n declare frame: GeoFrame\n\n @property({ default: \"all\", tween: snapValue, options: [\"all\", \"outline\"] })\n declare borders: GeoBorders\n\n constructor(props?: NodeConfig<GeoBorder, GeoBorderProps>) {\n super(props as NodeConfig<ShapeNode<GeoBorderProps>, GeoBorderProps>)\n }\n\n override declareAssets(assets: AssetScope): void {\n super.declareAssets(assets)\n for (const file of geoFilesFor(this.iso as string[], this.level)) {\n assets.loader(`geo:${file}`, geoLoader(file), { gate: \"render\" })\n }\n }\n\n protected override renderSelf(ctx: RenderContext2D): void {\n const drawn = this._drawn()\n const fill = this.fill as FillResolved[]\n if (!drawn || drawn.fills.length === 0) return\n const shadow = this.shadow as ShadowResolved[]\n const g = new Graphics2D()\n for (const chunk of drawn.fills) {\n if (!this._pathOp(g, chunk)) continue\n if (shadow.length > 0) g.shadow(shadow)\n g.fill(fill)\n }\n ctx.draw(g)\n }\n\n protected override renderOverlay(ctx: RenderContext2D): void {\n const overlay = this.overlay as FillResolved[]\n if (overlay.length === 0) return\n const drawn = this._drawn()\n if (!drawn) return\n const g = new Graphics2D()\n for (const chunk of drawn.fills) if (this._pathOp(g, chunk)) g.fill(overlay)\n ctx.draw(g)\n }\n\n protected override renderStroke(ctx: RenderContext2D): void {\n const stroke = this.stroke as StrokeResolved[]\n if (stroke.length === 0) return\n const drawn = this._drawn()\n if (!drawn || drawn.lines.length === 0) return\n const centred = stroke.map((layer) => (layer.align === 0 ? layer : { ...layer, align: 0 }))\n const shadow = this.shadow as ShadowResolved[]\n const castsShadow = shadow.length > 0 && !(this.fill as FillResolved[]).some((layer) => (layer.opacity ?? 1) > 0)\n const g = new Graphics2D()\n for (const chunk of drawn.lines) {\n if (!this._pathOp(g, chunk)) continue\n if (castsShadow) g.shadow(shadow)\n g.stroke(centred)\n }\n ctx.draw(g)\n }\n\n // The box, not the outline: a path clip has no winding test, and a country's\n // bounding box is what the selection shows.\n protected override clipSelf(): Clip {\n return new Clip().rect({\n x: 0,\n y: 0,\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n })\n }\n\n private _drawnCache: Drawn | null = null\n private readonly _warned = new Set<string>()\n\n private _pathOp(g: Graphics2D, chunk: Chunk): boolean {\n const start = this.start\n const end = this.end\n const width = this.layoutBounds.width\n const height = this.layoutBounds.height\n const centerBounds: PathBounds = [-width / 2, -height / 2, width / 2, height / 2]\n if (start <= 0 && end >= 1) {\n g.path({ data: chunk.data, centerBounds })\n return true\n }\n const span = chunk.to - chunk.from\n if (span <= 0) return false\n const localStart = Math.max(0, (start - chunk.from) / span)\n const localEnd = Math.min(1, (end - chunk.from) / span)\n if (localEnd <= localStart) return false\n g.path({ data: chunk.data, centerBounds, start: localStart, end: localEnd })\n return true\n }\n\n private _drawn(): Drawn | null {\n const codes = this.iso as string[]\n const level = this.level\n const frame = this.frame\n const selection = selectGeoFeatures(codes, level, frame)\n for (const code of selection.unknown) {\n if (this._warned.has(code)) continue\n this._warned.add(code)\n console.warn(`[GeoBorder] no region with code ${code}`)\n }\n if (selection.features.length === 0) return null\n\n const geometry = geoGeometry({\n selectionKey: `${geoRegistry.generation}:${geoDataVersion()}:${level}:${frame}:${codes.join(\",\")}`,\n features: selection.features,\n frame,\n projection: this.projection,\n borders: this.borders,\n detail: this.detail,\n })\n if (!geometry) return null\n\n const width = this.layoutBounds.width\n const height = this.layoutBounds.height\n const cached = this._drawnCache\n if (cached && cached.geometry === geometry && cached.width === width && cached.height === height) {\n return cached\n }\n const scale = Math.min(width / geometry.width, height / geometry.height)\n const drawn: Drawn = {\n geometry,\n width,\n height,\n fills: chunk(geometry.fills, geometry.fillLength, scale),\n lines: chunk(geometry.lines, geometry.lineLength, scale),\n }\n this._drawnCache = drawn\n return drawn\n }\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type GeoFeature } from "./format.js";
|
|
2
|
+
import type { GeoFrame } from "./selection.js";
|
|
3
|
+
export type GeoProjectionKind = "conic" | "mercator" | "equirectangular" | "orthographic";
|
|
4
|
+
export type GeoBorders = "all" | "outline";
|
|
5
|
+
export interface GeoContour {
|
|
6
|
+
/** Interleaved x/y in unit space: the longer side spans 1, centred on the origin, y up. */
|
|
7
|
+
points: Float32Array;
|
|
8
|
+
closed: boolean;
|
|
9
|
+
length: number;
|
|
10
|
+
}
|
|
11
|
+
export interface GeoGeometry {
|
|
12
|
+
/** The drawing's extent in unit space; the longer of the two is 1. */
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
fills: GeoContour[];
|
|
16
|
+
lines: GeoContour[];
|
|
17
|
+
fillLength: number;
|
|
18
|
+
lineLength: number;
|
|
19
|
+
bytes: number;
|
|
20
|
+
}
|
|
21
|
+
/** The highest weight bucket a point may carry and still be drawn. */
|
|
22
|
+
export declare function pointBucketLimit(detail: number, area: number): number;
|
|
23
|
+
/** Rings smaller than this (steradians) are dropped, bar each region's largest. */
|
|
24
|
+
export declare function polygonAreaLimit(detail: number, area: number): number;
|
|
25
|
+
export interface GeoGeometryRequest {
|
|
26
|
+
/** Identifies `features` and `frame`: equal keys must mean equal selections. */
|
|
27
|
+
selectionKey: string;
|
|
28
|
+
features: readonly GeoFeature[];
|
|
29
|
+
frame: GeoFrame;
|
|
30
|
+
projection: GeoProjectionKind;
|
|
31
|
+
borders: GeoBorders;
|
|
32
|
+
detail: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The drawing for a selection, cached. The projection is fitted to the
|
|
36
|
+
* selection at full detail, so a `detail` tween never moves or rescales it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function geoGeometry(request: GeoGeometryRequest): GeoGeometry | null;
|
|
39
|
+
export declare function clearGeoGeometry(): void;
|
|
40
|
+
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/border/geometry.ts"],"names":[],"mappings":"AAaA,OAAO,EAAgC,KAAK,UAAU,EAAoC,MAAM,UAAU,CAAA;AAC1G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,cAAc,CAAA;AACzF,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,CAAA;AAE1C,MAAM,WAAW,UAAU;IACvB,2FAA2F;IAC3F,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,WAAW;IACxB,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CAChB;AA6BD,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAIrE;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGrE;AA+VD,MAAM,WAAW,kBAAkB;IAC/B,gFAAgF;IAChF,YA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