@kteneyck/cesium-timeline-core 0.1.0
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/cesium-timeline-core.js +447 -0
- package/dist/cesium-timeline-core.umd.cjs +1 -0
- package/dist/index.d.ts +429 -0
- package/package.json +48 -0
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import * as k from "cesium";
|
|
2
|
+
const ye = {
|
|
3
|
+
backgroundColor: "#1a1a1a",
|
|
4
|
+
tickColor: "#666666",
|
|
5
|
+
majorTickColor: "#999999",
|
|
6
|
+
labelColor: "#cccccc",
|
|
7
|
+
indicatorColor: "#d69826",
|
|
8
|
+
indicatorLineWidth: 5,
|
|
9
|
+
majorTickHeight: 10,
|
|
10
|
+
minorTickHeight: 5,
|
|
11
|
+
fontSize: 12,
|
|
12
|
+
controlBarBackground: "#242424",
|
|
13
|
+
controlBarBorder: "#333333",
|
|
14
|
+
buttonColor: "#666666",
|
|
15
|
+
buttonHoverColor: "#888888",
|
|
16
|
+
buttonActiveColor: "#d69826",
|
|
17
|
+
swimLaneItemBorderColor: "#666666",
|
|
18
|
+
swimLaneItemBorderWidth: 0
|
|
19
|
+
};
|
|
20
|
+
var ae = /* @__PURE__ */ ((e) => (e[e.FIFTEEN_MIN = 15] = "FIFTEEN_MIN", e[e.THIRTY_MIN = 30] = "THIRTY_MIN", e[e.HOURLY = 60] = "HOURLY", e[e.CUSTOM = -1] = "CUSTOM", e))(ae || {});
|
|
21
|
+
const w = {
|
|
22
|
+
color: "#4da6ff",
|
|
23
|
+
borderColor: "#2980b9",
|
|
24
|
+
borderWidth: 1,
|
|
25
|
+
opacity: 0.8,
|
|
26
|
+
markerShape: "diamond",
|
|
27
|
+
markerSize: 10,
|
|
28
|
+
labelColor: "#cccccc",
|
|
29
|
+
backgroundColor: "transparent"
|
|
30
|
+
}, R = 24;
|
|
31
|
+
function He(e) {
|
|
32
|
+
return e instanceof k.JulianDate ? k.JulianDate.clone(e) : k.JulianDate.fromDate(e);
|
|
33
|
+
}
|
|
34
|
+
function ce(e) {
|
|
35
|
+
return e instanceof k.JulianDate ? k.JulianDate.toDate(e) : e;
|
|
36
|
+
}
|
|
37
|
+
function W(e) {
|
|
38
|
+
return ce(e).getTime();
|
|
39
|
+
}
|
|
40
|
+
function ke(e) {
|
|
41
|
+
return k.JulianDate.fromDate(new Date(e));
|
|
42
|
+
}
|
|
43
|
+
function ue(e, t) {
|
|
44
|
+
return W(t) - W(e);
|
|
45
|
+
}
|
|
46
|
+
const he = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], Me = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], me = {
|
|
47
|
+
/** e.g. "Feb 24 2026 14:04:07" — default */
|
|
48
|
+
DEFAULT: "MMM DD YYYY HH:mm:ss",
|
|
49
|
+
/** e.g. "Feb 24 2026 02:04:07 PM" */
|
|
50
|
+
TWELVE_HR: "MMM DD YYYY hh:mm:ss A",
|
|
51
|
+
/** e.g. "2026-02-24 14:04:07" */
|
|
52
|
+
ISO: "YYYY-MM-DD HH:mm:ss",
|
|
53
|
+
/** e.g. "02/24/2026 14:04" */
|
|
54
|
+
US: "MM/DD/YYYY HH:mm",
|
|
55
|
+
/** e.g. "24/02/2026 14:04" */
|
|
56
|
+
EU: "DD/MM/YYYY HH:mm",
|
|
57
|
+
/** e.g. "14:04:07" */
|
|
58
|
+
TIME_ONLY: "HH:mm:ss",
|
|
59
|
+
/** e.g. "02:04:07 PM" */
|
|
60
|
+
TIME_12: "hh:mm:ss A"
|
|
61
|
+
};
|
|
62
|
+
function ge(e, t = me.DEFAULT) {
|
|
63
|
+
const o = ce(e), l = o.getFullYear(), r = o.getMonth(), s = o.getDate(), a = o.getHours(), i = a % 12 || 12, u = o.getMinutes(), c = o.getSeconds(), d = o.getMilliseconds(), M = a < 12 ? "AM" : "PM", m = (Y) => String(Y).padStart(2, "0"), f = (Y) => String(Y).padStart(3, "0"), T = {
|
|
64
|
+
YYYY: String(l),
|
|
65
|
+
YY: String(l).slice(-2),
|
|
66
|
+
MMMM: Me[r],
|
|
67
|
+
MMM: he[r],
|
|
68
|
+
MM: m(r + 1),
|
|
69
|
+
M: String(r + 1),
|
|
70
|
+
DD: m(s),
|
|
71
|
+
D: String(s),
|
|
72
|
+
HH: m(a),
|
|
73
|
+
H: String(a),
|
|
74
|
+
hh: m(i),
|
|
75
|
+
h: String(i),
|
|
76
|
+
mm: m(u),
|
|
77
|
+
ss: m(c),
|
|
78
|
+
SSS: f(d),
|
|
79
|
+
A: M,
|
|
80
|
+
a: M.toLowerCase()
|
|
81
|
+
};
|
|
82
|
+
return t.replace(
|
|
83
|
+
/YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,
|
|
84
|
+
(Y) => T[Y] ?? Y
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
function Le(e = me.DEFAULT) {
|
|
88
|
+
const t = ["YYYY", "YY", "MMMM", "MMM", "MM", "M", "DD", "D"], o = ["HH", "H", "hh", "h", "mm", "ss", "SSS", "A", "a"], l = (a) => a.replace(/\s{2,}/g, " ").trim().replace(/^[\s\W]+|[\s\W]+$/g, "").trim();
|
|
89
|
+
let r = e;
|
|
90
|
+
for (const a of t) r = r.replace(a, "");
|
|
91
|
+
let s = e;
|
|
92
|
+
for (const a of o) s = s.replace(a, "");
|
|
93
|
+
return { timeFormat: l(r), dateFormat: l(s) };
|
|
94
|
+
}
|
|
95
|
+
function Ye(e, t = !1) {
|
|
96
|
+
return ge(e, t ? "HH:mm:ss" : "HH:mm");
|
|
97
|
+
}
|
|
98
|
+
function de(e, t, o, l) {
|
|
99
|
+
const r = W(e), s = W(t), a = W(o);
|
|
100
|
+
if (a === s) return 0;
|
|
101
|
+
const i = (r - s) / (a - s);
|
|
102
|
+
return Math.max(0, Math.min(1, i)) * l;
|
|
103
|
+
}
|
|
104
|
+
function Ce(e, t, o, l) {
|
|
105
|
+
const r = Math.max(0, Math.min(1, e / l)), s = W(t), a = W(o), i = s + r * (a - s);
|
|
106
|
+
return k.JulianDate.fromDate(new Date(i));
|
|
107
|
+
}
|
|
108
|
+
function Ae(e, t, o, l) {
|
|
109
|
+
const r = [], s = ue(e, t), a = W(e);
|
|
110
|
+
let i;
|
|
111
|
+
typeof o == "number" && o in ae || typeof o == "number" ? i = o * 60 * 1e3 : i = 3600 * 1e3;
|
|
112
|
+
const u = i * 4;
|
|
113
|
+
let c = a, d = 0;
|
|
114
|
+
for (; c <= a + s; ) {
|
|
115
|
+
const M = d * i % u === 0, m = de(
|
|
116
|
+
new Date(c),
|
|
117
|
+
e,
|
|
118
|
+
t,
|
|
119
|
+
l
|
|
120
|
+
);
|
|
121
|
+
let f;
|
|
122
|
+
if (M) {
|
|
123
|
+
const T = new Date(c), Y = T.getHours().toString().padStart(2, "0"), b = T.getMinutes().toString().padStart(2, "0");
|
|
124
|
+
f = `${Y}:${b}`;
|
|
125
|
+
}
|
|
126
|
+
r.push({
|
|
127
|
+
position: m,
|
|
128
|
+
isMajor: M,
|
|
129
|
+
label: f
|
|
130
|
+
}), c += i, d++;
|
|
131
|
+
}
|
|
132
|
+
return r;
|
|
133
|
+
}
|
|
134
|
+
function Ee(e, t, o = 10) {
|
|
135
|
+
let l = t[0], r = Math.abs(l.position - e);
|
|
136
|
+
for (const s of t) {
|
|
137
|
+
const a = Math.abs(s.position - e);
|
|
138
|
+
a < r && (r = a, l = s);
|
|
139
|
+
}
|
|
140
|
+
return r <= o ? l.position : e;
|
|
141
|
+
}
|
|
142
|
+
const Se = 1e3, Te = 31536e9, S = [
|
|
143
|
+
1e-3,
|
|
144
|
+
2e-3,
|
|
145
|
+
5e-3,
|
|
146
|
+
0.01,
|
|
147
|
+
0.02,
|
|
148
|
+
0.05,
|
|
149
|
+
0.1,
|
|
150
|
+
0.25,
|
|
151
|
+
0.5,
|
|
152
|
+
1,
|
|
153
|
+
2,
|
|
154
|
+
5,
|
|
155
|
+
10,
|
|
156
|
+
15,
|
|
157
|
+
30,
|
|
158
|
+
60,
|
|
159
|
+
120,
|
|
160
|
+
300,
|
|
161
|
+
600,
|
|
162
|
+
900,
|
|
163
|
+
1800,
|
|
164
|
+
3600,
|
|
165
|
+
7200,
|
|
166
|
+
14400,
|
|
167
|
+
21600,
|
|
168
|
+
43200,
|
|
169
|
+
86400,
|
|
170
|
+
172800,
|
|
171
|
+
345600,
|
|
172
|
+
604800,
|
|
173
|
+
1296e3,
|
|
174
|
+
2592e3,
|
|
175
|
+
5184e3,
|
|
176
|
+
7776e3,
|
|
177
|
+
15552e3,
|
|
178
|
+
31536e3,
|
|
179
|
+
63072e3,
|
|
180
|
+
126144e3,
|
|
181
|
+
15768e4,
|
|
182
|
+
31536e4,
|
|
183
|
+
63072e4,
|
|
184
|
+
126144e4,
|
|
185
|
+
15768e5,
|
|
186
|
+
31536e5,
|
|
187
|
+
63072e5,
|
|
188
|
+
126144e5,
|
|
189
|
+
15768e6,
|
|
190
|
+
31536e6
|
|
191
|
+
], G = 36, P = 1, be = 6, Z = 6, _e = 0.3, x = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
192
|
+
function A(e) {
|
|
193
|
+
return e < 10 ? `0${e}` : `${e}`;
|
|
194
|
+
}
|
|
195
|
+
function le(e, t) {
|
|
196
|
+
const o = new Date(e), l = o.getFullYear(), r = o.getMonth(), s = o.getDate(), a = o.getHours(), i = o.getMinutes(), u = o.getSeconds(), c = o.getMilliseconds();
|
|
197
|
+
if (t > 31536e4) return `${l}`;
|
|
198
|
+
if (t > 31536e3) return `${x[r]} ${l}`;
|
|
199
|
+
if (t > 604800) return `${x[r]} ${s}`;
|
|
200
|
+
if (t > 86400) return `${x[r]} ${s} ${A(a)}:${A(i)}`;
|
|
201
|
+
if (t > 3600) return `${A(a)}:${A(i)}`;
|
|
202
|
+
if (t > 60) return `${A(a)}:${A(i)}:${A(u)}`;
|
|
203
|
+
const d = c > 0 ? `.${String(c).padStart(3, "0")}` : "";
|
|
204
|
+
return `${A(a)}:${A(i)}:${A(u)}${d}`;
|
|
205
|
+
}
|
|
206
|
+
function pe(e, t) {
|
|
207
|
+
const o = new Date(e), l = o.getFullYear(), r = o.getMonth(), s = o.getDate();
|
|
208
|
+
return t > 31536e4 ? new Date(Math.floor(l / 100) * 100, 0).getTime() : t > 31536e3 ? new Date(Math.floor(l / 10) * 10, 0).getTime() : t > 86400 ? new Date(l, 0).getTime() : new Date(l, r, s).getTime();
|
|
209
|
+
}
|
|
210
|
+
function ee(e, t) {
|
|
211
|
+
return Math.ceil(e / t + 0.5) * t;
|
|
212
|
+
}
|
|
213
|
+
function fe(e, t, o) {
|
|
214
|
+
var l, r, s, a, i, u, c, d, M, m, f, T;
|
|
215
|
+
return {
|
|
216
|
+
color: ((l = t.style) == null ? void 0 : l.color) ?? ((r = e.style) == null ? void 0 : r.color) ?? w.color,
|
|
217
|
+
borderColor: ((s = t.style) == null ? void 0 : s.borderColor) ?? ((a = e.style) == null ? void 0 : a.borderColor) ?? (o == null ? void 0 : o.swimLaneItemBorderColor) ?? w.borderColor,
|
|
218
|
+
borderWidth: ((i = t.style) == null ? void 0 : i.borderWidth) ?? ((u = e.style) == null ? void 0 : u.borderWidth) ?? (o == null ? void 0 : o.swimLaneItemBorderWidth) ?? w.borderWidth,
|
|
219
|
+
opacity: ((c = t.style) == null ? void 0 : c.opacity) ?? ((d = e.style) == null ? void 0 : d.opacity) ?? w.opacity,
|
|
220
|
+
markerShape: ((M = t.style) == null ? void 0 : M.markerShape) ?? ((m = e.style) == null ? void 0 : m.markerShape) ?? w.markerShape,
|
|
221
|
+
markerSize: ((f = t.style) == null ? void 0 : f.markerSize) ?? ((T = e.style) == null ? void 0 : T.markerSize) ?? w.markerSize
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function De(e) {
|
|
225
|
+
return Math.max(Se, Math.min(Te, e));
|
|
226
|
+
}
|
|
227
|
+
function $e(e, t, o) {
|
|
228
|
+
const l = t - e, r = (e + t) / 2, s = De(l * o);
|
|
229
|
+
return {
|
|
230
|
+
startMs: r - s / 2,
|
|
231
|
+
endMs: r + s / 2
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function we(e) {
|
|
235
|
+
let t = 0;
|
|
236
|
+
for (const o of e) t += (o.height ?? R) + P;
|
|
237
|
+
return t;
|
|
238
|
+
}
|
|
239
|
+
function Re(e, t, o, l, r) {
|
|
240
|
+
const { swimLanes: s, showSwimLanes: a, scrollTop: i, startMs: u, endMs: c, theme: d } = r;
|
|
241
|
+
if (!a || s.length === 0) return null;
|
|
242
|
+
const M = Math.max(0, l - G);
|
|
243
|
+
if (t < 0 || t >= M) return null;
|
|
244
|
+
let m = -i;
|
|
245
|
+
for (const f of s) {
|
|
246
|
+
const T = f.height ?? R, Y = m, b = m + T;
|
|
247
|
+
if (m += T + P, !(t < Y || t >= b)) {
|
|
248
|
+
for (const y of f.items) {
|
|
249
|
+
if (y.interval) {
|
|
250
|
+
const F = k.JulianDate.toDate(y.interval.start).getTime(), O = k.JulianDate.toDate(y.interval.stop).getTime(), B = (F - u) / (c - u) * o, X = (O - u) / (c - u) * o;
|
|
251
|
+
if (e >= Math.max(0, B) && e <= Math.min(o, X))
|
|
252
|
+
return { lane: f, item: y };
|
|
253
|
+
}
|
|
254
|
+
if (y.instant) {
|
|
255
|
+
const O = (k.JulianDate.toDate(y.instant).getTime() - u) / (c - u) * o, B = fe(f, y, d);
|
|
256
|
+
if (Math.abs(e - O) <= B.markerSize / 2 + 2)
|
|
257
|
+
return { lane: f, item: y };
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
function We(e, t, o, l) {
|
|
266
|
+
const { swimLanes: r, showSwimLanes: s, scrollTop: a } = l;
|
|
267
|
+
if (!s || r.length === 0 || e > 80) return null;
|
|
268
|
+
const i = Math.max(0, o - G);
|
|
269
|
+
if (t < 0 || t >= i) return null;
|
|
270
|
+
let u = -a;
|
|
271
|
+
for (const c of r) {
|
|
272
|
+
const d = c.height ?? R;
|
|
273
|
+
if (t >= u && t < u + d) return c;
|
|
274
|
+
u += d + P;
|
|
275
|
+
}
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
function Je(e, t, o) {
|
|
279
|
+
if (!o.showSwimLanes || o.swimLanes.length === 0) return !1;
|
|
280
|
+
const l = Math.max(0, t - G);
|
|
281
|
+
return e >= 0 && e < l;
|
|
282
|
+
}
|
|
283
|
+
function Ne(e, t, o, l) {
|
|
284
|
+
const {
|
|
285
|
+
startMs: r,
|
|
286
|
+
endMs: s,
|
|
287
|
+
currentMs: a,
|
|
288
|
+
theme: i,
|
|
289
|
+
maxTicks: u,
|
|
290
|
+
swimLanes: c,
|
|
291
|
+
showSwimLanes: d,
|
|
292
|
+
reorderState: M
|
|
293
|
+
} = l;
|
|
294
|
+
let { scrollTop: m } = l;
|
|
295
|
+
const f = (s - r) / 1e3;
|
|
296
|
+
if (f <= 0) return m;
|
|
297
|
+
e.fillStyle = i.backgroundColor, e.fillRect(0, 0, t, o);
|
|
298
|
+
const T = d && c.length > 0, b = T ? Math.max(0, o - G) : 0;
|
|
299
|
+
let y = 0;
|
|
300
|
+
if (T)
|
|
301
|
+
for (const n of c) y += (n.height ?? R) + P;
|
|
302
|
+
const F = Math.max(0, y - b);
|
|
303
|
+
if (m > F && (m = F), m < 0 && (m = 0), T && b > 0) {
|
|
304
|
+
e.save(), e.beginPath(), e.rect(0, 0, t, b), e.clip();
|
|
305
|
+
let n = -m;
|
|
306
|
+
const p = (D) => (D - r) / (s - r) * t;
|
|
307
|
+
for (const D of c) {
|
|
308
|
+
const g = D.height ?? R, L = n + g;
|
|
309
|
+
if (L > 0 && n < b) {
|
|
310
|
+
const h = D.style, I = (h == null ? void 0 : h.backgroundColor) ?? w.backgroundColor;
|
|
311
|
+
I && I !== "transparent" && (e.fillStyle = I, e.fillRect(0, n, t, g)), e.strokeStyle = i.tickColor + "44", e.lineWidth = 0.5, e.beginPath(), e.moveTo(0, L), e.lineTo(t, L), e.stroke();
|
|
312
|
+
for (const E of D.items) {
|
|
313
|
+
const H = fe(D, E, i);
|
|
314
|
+
if (E.interval) {
|
|
315
|
+
const V = k.JulianDate.toDate(E.interval.start).getTime(), C = k.JulianDate.toDate(E.interval.stop).getTime(), J = p(V), N = p(C), q = Math.max(0, J), Q = Math.min(t, N) - q;
|
|
316
|
+
if (Q > 0) {
|
|
317
|
+
e.globalAlpha = H.opacity, e.fillStyle = H.color;
|
|
318
|
+
const re = 3, ie = n + re, se = g - re * 2;
|
|
319
|
+
e.fillRect(q, ie, Q, se), H.borderWidth > 0 && (e.strokeStyle = H.borderColor, e.lineWidth = H.borderWidth, e.strokeRect(q, ie, Q, se)), e.globalAlpha = 1;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (E.instant) {
|
|
323
|
+
const V = k.JulianDate.toDate(E.instant).getTime(), C = p(V);
|
|
324
|
+
if (C >= -H.markerSize && C <= t + H.markerSize) {
|
|
325
|
+
const J = n + g / 2, N = H.markerSize;
|
|
326
|
+
e.globalAlpha = H.opacity, e.fillStyle = H.color, H.markerShape === "diamond" ? (e.beginPath(), e.moveTo(C, J - N / 2), e.lineTo(C + N / 2, J), e.lineTo(C, J + N / 2), e.lineTo(C - N / 2, J), e.closePath(), e.fill()) : H.markerShape === "circle" ? (e.beginPath(), e.arc(C, J, N / 2, 0, Math.PI * 2), e.fill()) : (e.strokeStyle = H.color, e.lineWidth = 2, e.beginPath(), e.moveTo(C, n + 2), e.lineTo(C, n + g - 2), e.stroke()), e.globalAlpha = 1;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
e.font = `${Math.min(11, g - 4)}px system-ui, sans-serif`, e.textAlign = "left", e.textBaseline = "middle", e.fillStyle = (h == null ? void 0 : h.labelColor) ?? w.labelColor, e.fillText(D.label, be, n + g / 2);
|
|
331
|
+
}
|
|
332
|
+
if (n += g + P, n >= b) break;
|
|
333
|
+
}
|
|
334
|
+
if (M && M.dragging) {
|
|
335
|
+
const D = M.currentY - M.dragStartY;
|
|
336
|
+
let g = -m;
|
|
337
|
+
for (let h = 0; h < c.length && h < M.insertIndex; h++)
|
|
338
|
+
g += (c[h].height ?? R) + P;
|
|
339
|
+
e.strokeStyle = i.indicatorColor, e.lineWidth = 2, e.beginPath(), e.moveTo(0, g), e.lineTo(t, g), e.stroke();
|
|
340
|
+
const L = c.find((h) => h.id === M.dragLaneId);
|
|
341
|
+
if (L) {
|
|
342
|
+
const h = L.height ?? R;
|
|
343
|
+
let I = -m;
|
|
344
|
+
for (const E of c) {
|
|
345
|
+
if (E.id === M.dragLaneId) break;
|
|
346
|
+
I += (E.height ?? R) + P;
|
|
347
|
+
}
|
|
348
|
+
e.globalAlpha = 0.4, e.fillStyle = i.indicatorColor, e.fillRect(0, I + D, t, h), e.globalAlpha = 1;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (y > b) {
|
|
352
|
+
const D = t - Z - 2, g = b / y, L = Math.max(20, b * g), h = m / F * (b - L);
|
|
353
|
+
e.fillStyle = i.tickColor + "22", e.fillRect(D, 0, Z, b), e.fillStyle = i.tickColor + "88", e.fillRect(D, h, Z, L);
|
|
354
|
+
}
|
|
355
|
+
e.restore();
|
|
356
|
+
}
|
|
357
|
+
e.font = `${i.fontSize}px monospace`;
|
|
358
|
+
const O = le(r + f * 500, f), B = e.measureText(O).width + 24, X = Math.max(B / t * f, f / 1e3);
|
|
359
|
+
let _ = S[S.length - 1], z = S.length - 1;
|
|
360
|
+
for (let n = 0; n < S.length; n++)
|
|
361
|
+
if (S[n] > X) {
|
|
362
|
+
_ = S[n], z = n;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
if (u != null && u > 0)
|
|
366
|
+
for (; z < S.length - 1 && f / _ > u; )
|
|
367
|
+
z++, _ = S[z];
|
|
368
|
+
let $ = 0;
|
|
369
|
+
for (let n = z - 1; n >= 0; n--)
|
|
370
|
+
if (_ % S[n] < 1e-4) {
|
|
371
|
+
t * (S[n] / f) >= 3 && ($ = S[n]);
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
let U = 0;
|
|
375
|
+
if ($ > 0) {
|
|
376
|
+
for (let n = 0; n < S.length && S[n] < $; n++)
|
|
377
|
+
if ($ % S[n] < 1e-4 && t * (S[n] / f) >= 3) {
|
|
378
|
+
U = S[n];
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const te = pe(r, f), j = (r - te) / 1e3, K = j + f, v = (n) => t * ((n - j) / f);
|
|
383
|
+
if (U > 0) {
|
|
384
|
+
e.strokeStyle = i.tickColor, e.lineWidth = 1;
|
|
385
|
+
for (let n = Math.floor(j / U) * U; n <= K; n = ee(n, U)) {
|
|
386
|
+
const p = v(n);
|
|
387
|
+
e.beginPath(), e.moveTo(p, o - i.minorTickHeight), e.lineTo(p, o), e.stroke();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if ($ > 0) {
|
|
391
|
+
e.strokeStyle = i.tickColor, e.lineWidth = 1;
|
|
392
|
+
for (let n = Math.floor(j / $) * $; n <= K; n = ee(n, $)) {
|
|
393
|
+
const p = v(n);
|
|
394
|
+
e.beginPath(), e.moveTo(p, o - i.minorTickHeight), e.lineTo(p, o), e.stroke();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
e.textAlign = "center", e.textBaseline = "bottom";
|
|
398
|
+
let oe = -1 / 0;
|
|
399
|
+
for (let n = Math.floor(j / _) * _; n <= K + _; n = ee(n, _)) {
|
|
400
|
+
const p = v(n), D = te + n * 1e3;
|
|
401
|
+
e.strokeStyle = i.majorTickColor, e.lineWidth = 1, e.beginPath(), e.moveTo(p, o - i.majorTickHeight), e.lineTo(p, o), e.stroke();
|
|
402
|
+
const g = le(D, f), L = e.measureText(g).width, h = p - L / 2;
|
|
403
|
+
h > oe && (e.fillStyle = i.labelColor, e.fillText(g, p, o - i.majorTickHeight - 4), oe = h + L + 5);
|
|
404
|
+
}
|
|
405
|
+
const ne = (a - r) / (s - r) * t;
|
|
406
|
+
return e.strokeStyle = i.indicatorColor, e.lineWidth = i.indicatorLineWidth, e.beginPath(), e.moveTo(ne, 0), e.lineTo(ne, o), e.stroke(), m;
|
|
407
|
+
}
|
|
408
|
+
export {
|
|
409
|
+
R as DEFAULT_LANE_HEIGHT,
|
|
410
|
+
me as DateTimeFormats,
|
|
411
|
+
be as LABEL_PAD_LEFT,
|
|
412
|
+
P as LANE_GAP,
|
|
413
|
+
Te as MAX_SPAN_MS,
|
|
414
|
+
Se as MIN_SPAN_MS,
|
|
415
|
+
x as MONTHS,
|
|
416
|
+
Z as SCROLLBAR_WIDTH,
|
|
417
|
+
_e as SWIM_LANE_SCROLL_SPEED,
|
|
418
|
+
G as TICK_AREA_HEIGHT,
|
|
419
|
+
S as TIC_SCALES,
|
|
420
|
+
ae as TickInterval,
|
|
421
|
+
pe as calcEpochMs,
|
|
422
|
+
De as clampSpan,
|
|
423
|
+
w as defaultSwimLaneStyle,
|
|
424
|
+
ye as defaultTheme,
|
|
425
|
+
Ne as drawTimeline,
|
|
426
|
+
ge as formatDateTime,
|
|
427
|
+
Ye as formatTime,
|
|
428
|
+
ke as fromMilliseconds,
|
|
429
|
+
Ae as generateTicks,
|
|
430
|
+
ue as getDurationMs,
|
|
431
|
+
We as hitTestLaneLabel,
|
|
432
|
+
Re as hitTestSwimLane,
|
|
433
|
+
Je as isInSwimLaneRegion,
|
|
434
|
+
le as makeLabel,
|
|
435
|
+
ee as nextTic,
|
|
436
|
+
Ce as positionToTime,
|
|
437
|
+
fe as resolveItemStyle,
|
|
438
|
+
Ee as snapToTick,
|
|
439
|
+
Le as splitForDisplay,
|
|
440
|
+
de as timeToPosition,
|
|
441
|
+
ce as toDate,
|
|
442
|
+
He as toJulianDate,
|
|
443
|
+
W as toMilliseconds,
|
|
444
|
+
we as totalSwimLaneHeight,
|
|
445
|
+
A as twoD,
|
|
446
|
+
$e as zoomRange
|
|
447
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(r,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],B):(r=typeof globalThis<"u"?globalThis:r||self,B(r.CesiumTimelineCore={},r.Cesium))})(this,(function(r,B){"use strict";function Le(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const H=Le(B),He={backgroundColor:"#1a1a1a",tickColor:"#666666",majorTickColor:"#999999",labelColor:"#cccccc",indicatorColor:"#d69826",indicatorLineWidth:5,majorTickHeight:10,minorTickHeight:5,fontSize:12,controlBarBackground:"#242424",controlBarBorder:"#333333",buttonColor:"#666666",buttonHoverColor:"#888888",buttonActiveColor:"#d69826",swimLaneItemBorderColor:"#666666",swimLaneItemBorderWidth:0};var Q=(e=>(e[e.FIFTEEN_MIN=15]="FIFTEEN_MIN",e[e.THIRTY_MIN=30]="THIRTY_MIN",e[e.HOURLY=60]="HOURLY",e[e.CUSTOM=-1]="CUSTOM",e))(Q||{});const E={color:"#4da6ff",borderColor:"#2980b9",borderWidth:1,opacity:.8,markerShape:"diamond",markerSize:10,labelColor:"#cccccc",backgroundColor:"transparent"},w=24;function ke(e){return e instanceof H.JulianDate?H.JulianDate.clone(e):H.JulianDate.fromDate(e)}function Z(e){return e instanceof H.JulianDate?H.JulianDate.toDate(e):e}function I(e){return Z(e).getTime()}function pe(e){return H.JulianDate.fromDate(new Date(e))}function se(e,t){return I(t)-I(e)}const Ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ce=["January","February","March","April","May","June","July","August","September","October","November","December"],x={DEFAULT:"MMM DD YYYY HH:mm:ss",TWELVE_HR:"MMM DD YYYY hh:mm:ss A",ISO:"YYYY-MM-DD HH:mm:ss",US:"MM/DD/YYYY HH:mm",EU:"DD/MM/YYYY HH:mm",TIME_ONLY:"HH:mm:ss",TIME_12:"hh:mm:ss A"};function ce(e,t=x.DEFAULT){const o=Z(e),a=o.getFullYear(),i=o.getMonth(),s=o.getDate(),c=o.getHours(),l=c%12||12,M=o.getMinutes(),m=o.getSeconds(),T=o.getMilliseconds(),g=c<12?"AM":"PM",f=_=>String(_).padStart(2,"0"),u=_=>String(_).padStart(3,"0"),b={YYYY:String(a),YY:String(a).slice(-2),MMMM:Ce[i],MMM:Ae[i],MM:f(i+1),M:String(i+1),DD:f(s),D:String(s),HH:f(c),H:String(c),hh:f(l),h:String(l),mm:f(M),ss:f(m),SSS:u(T),A:g,a:g.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,_=>b[_]??_)}function _e(e=x.DEFAULT){const t=["YYYY","YY","MMMM","MMM","MM","M","DD","D"],o=["HH","H","hh","h","mm","ss","SSS","A","a"],a=c=>c.replace(/\s{2,}/g," ").trim().replace(/^[\s\W]+|[\s\W]+$/g,"").trim();let i=e;for(const c of t)i=i.replace(c,"");let s=e;for(const c of o)s=s.replace(c,"");return{timeFormat:a(i),dateFormat:a(s)}}function Ye(e,t=!1){return ce(e,t?"HH:mm:ss":"HH:mm")}function me(e,t,o,a){const i=I(e),s=I(t),c=I(o);if(c===s)return 0;const l=(i-s)/(c-s);return Math.max(0,Math.min(1,l))*a}function Ee(e,t,o,a){const i=Math.max(0,Math.min(1,e/a)),s=I(t),c=I(o),l=s+i*(c-s);return H.JulianDate.fromDate(new Date(l))}function we(e,t,o,a){const i=[],s=se(e,t),c=I(e);let l;typeof o=="number"&&o in Q||typeof o=="number"?l=o*60*1e3:l=3600*1e3;const M=l*4;let m=c,T=0;for(;m<=c+s;){const g=T*l%M===0,f=me(new Date(m),e,t,a);let u;if(g){const b=new Date(m),_=b.getHours().toString().padStart(2,"0"),D=b.getMinutes().toString().padStart(2,"0");u=`${_}:${D}`}i.push({position:f,isMajor:g,label:u}),m+=l,T++}return i}function Ie(e,t,o=10){let a=t[0],i=Math.abs(a.position-e);for(const s of t){const c=Math.abs(s.position-e);c<i&&(i=c,a=s)}return i<=o?a.position:e}const fe=1e3,ue=31536e9,d=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],z=36,R=1,Me=6,K=6,Pe=.3,q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(e){return e<10?`0${e}`:`${e}`}function ee(e,t){const o=new Date(e),a=o.getFullYear(),i=o.getMonth(),s=o.getDate(),c=o.getHours(),l=o.getMinutes(),M=o.getSeconds(),m=o.getMilliseconds();if(t>31536e4)return`${a}`;if(t>31536e3)return`${q[i]} ${a}`;if(t>604800)return`${q[i]} ${s}`;if(t>86400)return`${q[i]} ${s} ${C(c)}:${C(l)}`;if(t>3600)return`${C(c)}:${C(l)}`;if(t>60)return`${C(c)}:${C(l)}:${C(M)}`;const T=m>0?`.${String(m).padStart(3,"0")}`:"";return`${C(c)}:${C(l)}:${C(M)}${T}`}function he(e,t){const o=new Date(e),a=o.getFullYear(),i=o.getMonth(),s=o.getDate();return t>31536e4?new Date(Math.floor(a/100)*100,0).getTime():t>31536e3?new Date(Math.floor(a/10)*10,0).getTime():t>86400?new Date(a,0).getTime():new Date(a,i,s).getTime()}function V(e,t){return Math.ceil(e/t+.5)*t}function te(e,t,o){var a,i,s,c,l,M,m,T,g,f,u,b;return{color:((a=t.style)==null?void 0:a.color)??((i=e.style)==null?void 0:i.color)??E.color,borderColor:((s=t.style)==null?void 0:s.borderColor)??((c=e.style)==null?void 0:c.borderColor)??(o==null?void 0:o.swimLaneItemBorderColor)??E.borderColor,borderWidth:((l=t.style)==null?void 0:l.borderWidth)??((M=e.style)==null?void 0:M.borderWidth)??(o==null?void 0:o.swimLaneItemBorderWidth)??E.borderWidth,opacity:((m=t.style)==null?void 0:m.opacity)??((T=e.style)==null?void 0:T.opacity)??E.opacity,markerShape:((g=t.style)==null?void 0:g.markerShape)??((f=e.style)==null?void 0:f.markerShape)??E.markerShape,markerSize:((u=t.style)==null?void 0:u.markerSize)??((b=e.style)==null?void 0:b.markerSize)??E.markerSize}}function ge(e){return Math.max(fe,Math.min(ue,e))}function Re(e,t,o){const a=t-e,i=(e+t)/2,s=ge(a*o);return{startMs:i-s/2,endMs:i+s/2}}function Ne(e){let t=0;for(const o of e)t+=(o.height??w)+R;return t}function Oe(e,t,o,a,i){const{swimLanes:s,showSwimLanes:c,scrollTop:l,startMs:M,endMs:m,theme:T}=i;if(!c||s.length===0)return null;const g=Math.max(0,a-z);if(t<0||t>=g)return null;let f=-l;for(const u of s){const b=u.height??w,_=f,D=f+b;if(f+=b+R,!(t<_||t>=D)){for(const k of u.items){if(k.interval){const F=H.JulianDate.toDate(k.interval.start).getTime(),j=H.JulianDate.toDate(k.interval.stop).getTime(),U=(F-M)/(m-M)*o,oe=(j-M)/(m-M)*o;if(e>=Math.max(0,U)&&e<=Math.min(o,oe))return{lane:u,item:k}}if(k.instant){const j=(H.JulianDate.toDate(k.instant).getTime()-M)/(m-M)*o,U=te(u,k,T);if(Math.abs(e-j)<=U.markerSize/2+2)return{lane:u,item:k}}}return null}}return null}function We(e,t,o,a){const{swimLanes:i,showSwimLanes:s,scrollTop:c}=a;if(!s||i.length===0||e>80)return null;const l=Math.max(0,o-z);if(t<0||t>=l)return null;let M=-c;for(const m of i){const T=m.height??w;if(t>=M&&t<M+T)return m;M+=T+R}return null}function $e(e,t,o){if(!o.showSwimLanes||o.swimLanes.length===0)return!1;const a=Math.max(0,t-z);return e>=0&&e<a}function Fe(e,t,o,a){const{startMs:i,endMs:s,currentMs:c,theme:l,maxTicks:M,swimLanes:m,showSwimLanes:T,reorderState:g}=a;let{scrollTop:f}=a;const u=(s-i)/1e3;if(u<=0)return f;e.fillStyle=l.backgroundColor,e.fillRect(0,0,t,o);const b=T&&m.length>0,D=b?Math.max(0,o-z):0;let k=0;if(b)for(const n of m)k+=(n.height??w)+R;const F=Math.max(0,k-D);if(f>F&&(f=F),f<0&&(f=0),b&&D>0){e.save(),e.beginPath(),e.rect(0,0,t,D),e.clip();let n=-f;const y=L=>(L-i)/(s-i)*t;for(const L of m){const S=L.height??w,A=n+S;if(A>0&&n<D){const h=L.style,J=(h==null?void 0:h.backgroundColor)??E.backgroundColor;J&&J!=="transparent"&&(e.fillStyle=J,e.fillRect(0,n,t,S)),e.strokeStyle=l.tickColor+"44",e.lineWidth=.5,e.beginPath(),e.moveTo(0,A),e.lineTo(t,A),e.stroke();for(const P of L.items){const p=te(L,P,l);if(P.interval){const re=H.JulianDate.toDate(P.interval.start).getTime(),Y=H.JulianDate.toDate(P.interval.stop).getTime(),W=y(re),$=y(Y),le=Math.max(0,W),ae=Math.min(t,$)-le;if(ae>0){e.globalAlpha=p.opacity,e.fillStyle=p.color;const be=3,De=n+be,ye=S-be*2;e.fillRect(le,De,ae,ye),p.borderWidth>0&&(e.strokeStyle=p.borderColor,e.lineWidth=p.borderWidth,e.strokeRect(le,De,ae,ye)),e.globalAlpha=1}}if(P.instant){const re=H.JulianDate.toDate(P.instant).getTime(),Y=y(re);if(Y>=-p.markerSize&&Y<=t+p.markerSize){const W=n+S/2,$=p.markerSize;e.globalAlpha=p.opacity,e.fillStyle=p.color,p.markerShape==="diamond"?(e.beginPath(),e.moveTo(Y,W-$/2),e.lineTo(Y+$/2,W),e.lineTo(Y,W+$/2),e.lineTo(Y-$/2,W),e.closePath(),e.fill()):p.markerShape==="circle"?(e.beginPath(),e.arc(Y,W,$/2,0,Math.PI*2),e.fill()):(e.strokeStyle=p.color,e.lineWidth=2,e.beginPath(),e.moveTo(Y,n+2),e.lineTo(Y,n+S-2),e.stroke()),e.globalAlpha=1}}}e.font=`${Math.min(11,S-4)}px system-ui, sans-serif`,e.textAlign="left",e.textBaseline="middle",e.fillStyle=(h==null?void 0:h.labelColor)??E.labelColor,e.fillText(L.label,Me,n+S/2)}if(n+=S+R,n>=D)break}if(g&&g.dragging){const L=g.currentY-g.dragStartY;let S=-f;for(let h=0;h<m.length&&h<g.insertIndex;h++)S+=(m[h].height??w)+R;e.strokeStyle=l.indicatorColor,e.lineWidth=2,e.beginPath(),e.moveTo(0,S),e.lineTo(t,S),e.stroke();const A=m.find(h=>h.id===g.dragLaneId);if(A){const h=A.height??w;let J=-f;for(const P of m){if(P.id===g.dragLaneId)break;J+=(P.height??w)+R}e.globalAlpha=.4,e.fillStyle=l.indicatorColor,e.fillRect(0,J+L,t,h),e.globalAlpha=1}}if(k>D){const L=t-K-2,S=D/k,A=Math.max(20,D*S),h=f/F*(D-A);e.fillStyle=l.tickColor+"22",e.fillRect(L,0,K,D),e.fillStyle=l.tickColor+"88",e.fillRect(L,h,K,A)}e.restore()}e.font=`${l.fontSize}px monospace`;const j=ee(i+u*500,u),U=e.measureText(j).width+24,oe=Math.max(U/t*u,u/1e3);let N=d[d.length-1],G=d.length-1;for(let n=0;n<d.length;n++)if(d[n]>oe){N=d[n],G=n;break}if(M!=null&&M>0)for(;G<d.length-1&&u/N>M;)G++,N=d[G];let O=0;for(let n=G-1;n>=0;n--)if(N%d[n]<1e-4){t*(d[n]/u)>=3&&(O=d[n]);break}let v=0;if(O>0){for(let n=0;n<d.length&&d[n]<O;n++)if(O%d[n]<1e-4&&t*(d[n]/u)>=3){v=d[n];break}}const de=he(i,u),X=(i-de)/1e3,ne=X+u,ie=n=>t*((n-X)/u);if(v>0){e.strokeStyle=l.tickColor,e.lineWidth=1;for(let n=Math.floor(X/v)*v;n<=ne;n=V(n,v)){const y=ie(n);e.beginPath(),e.moveTo(y,o-l.minorTickHeight),e.lineTo(y,o),e.stroke()}}if(O>0){e.strokeStyle=l.tickColor,e.lineWidth=1;for(let n=Math.floor(X/O)*O;n<=ne;n=V(n,O)){const y=ie(n);e.beginPath(),e.moveTo(y,o-l.minorTickHeight),e.lineTo(y,o),e.stroke()}}e.textAlign="center",e.textBaseline="bottom";let Se=-1/0;for(let n=Math.floor(X/N)*N;n<=ne+N;n=V(n,N)){const y=ie(n),L=de+n*1e3;e.strokeStyle=l.majorTickColor,e.lineWidth=1,e.beginPath(),e.moveTo(y,o-l.majorTickHeight),e.lineTo(y,o),e.stroke();const S=ee(L,u),A=e.measureText(S).width,h=y-A/2;h>Se&&(e.fillStyle=l.labelColor,e.fillText(S,y,o-l.majorTickHeight-4),Se=h+A+5)}const Te=(c-i)/(s-i)*t;return e.strokeStyle=l.indicatorColor,e.lineWidth=l.indicatorLineWidth,e.beginPath(),e.moveTo(Te,0),e.lineTo(Te,o),e.stroke(),f}r.DEFAULT_LANE_HEIGHT=w,r.DateTimeFormats=x,r.LABEL_PAD_LEFT=Me,r.LANE_GAP=R,r.MAX_SPAN_MS=ue,r.MIN_SPAN_MS=fe,r.MONTHS=q,r.SCROLLBAR_WIDTH=K,r.SWIM_LANE_SCROLL_SPEED=Pe,r.TICK_AREA_HEIGHT=z,r.TIC_SCALES=d,r.TickInterval=Q,r.calcEpochMs=he,r.clampSpan=ge,r.defaultSwimLaneStyle=E,r.defaultTheme=He,r.drawTimeline=Fe,r.formatDateTime=ce,r.formatTime=Ye,r.fromMilliseconds=pe,r.generateTicks=we,r.getDurationMs=se,r.hitTestLaneLabel=We,r.hitTestSwimLane=Oe,r.isInSwimLaneRegion=$e,r.makeLabel=ee,r.nextTic=V,r.positionToTime=Ee,r.resolveItemStyle=te,r.snapToTick=Ie,r.splitForDisplay=_e,r.timeToPosition=me,r.toDate=Z,r.toJulianDate=ke,r.toMilliseconds=I,r.totalSwimLaneHeight=Ne,r.twoD=C,r.zoomRange=Re,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
|
|
3
|
+
/** Pick a round epoch near startMs so tick offsets are clean integers (mirrors Cesium). */
|
|
4
|
+
export declare function calcEpochMs(startMs: number, durationSec: number): number;
|
|
5
|
+
|
|
6
|
+
/** Clamp a time span to the allowed zoom range. */
|
|
7
|
+
export declare function clampSpan(span: number): number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Framework-agnostic base props for the transport controls.
|
|
11
|
+
*/
|
|
12
|
+
export declare interface ControlsBaseProps {
|
|
13
|
+
/** The current time displayed in the control bar (ms since epoch). */
|
|
14
|
+
currentTimeMs: number;
|
|
15
|
+
/** Whether playback is currently active. */
|
|
16
|
+
isPlaying: boolean;
|
|
17
|
+
/** Current playback speed multiplier (negative = rewind). */
|
|
18
|
+
multiplier: number;
|
|
19
|
+
/** @see TimelineBaseProps.dateTimeFormat */
|
|
20
|
+
dateTimeFormat?: string;
|
|
21
|
+
/** @see TimelineBaseProps.onDateTimeClick */
|
|
22
|
+
onDateTimeClick?: () => void;
|
|
23
|
+
/** Toggle play / pause. */
|
|
24
|
+
onPlayPause: (isPlaying: boolean) => void;
|
|
25
|
+
/** Jump to the start of the timeline range. */
|
|
26
|
+
onJumpToStart: () => void;
|
|
27
|
+
/** Step to the next rewind speed. */
|
|
28
|
+
onRewind: () => void;
|
|
29
|
+
/** Step to the next fast-forward speed. */
|
|
30
|
+
onFastForward: () => void;
|
|
31
|
+
/** Jump to the end of the timeline range. */
|
|
32
|
+
onJumpToEnd: () => void;
|
|
33
|
+
/** Jump to the current wall-clock time and resume 1× playback. */
|
|
34
|
+
onJumpToLive: () => void;
|
|
35
|
+
/** Reset the playback speed to 1×. */
|
|
36
|
+
onResetSpeed: () => void;
|
|
37
|
+
/** Whether the needle is near the current wall-clock time (within 10 s). */
|
|
38
|
+
isLive: boolean;
|
|
39
|
+
/** Whether to show the ⏮ jump-to-start button (true when startTime prop was provided). */
|
|
40
|
+
hasStartTime: boolean;
|
|
41
|
+
/** Whether to show the ⏭ jump-to-end button (true when endTime prop was provided). */
|
|
42
|
+
hasEndTime: boolean;
|
|
43
|
+
/** Resolved theme object applied to control bar elements. */
|
|
44
|
+
theme: TimelineTheme;
|
|
45
|
+
/** Whether swim lanes are currently visible. When defined, the chevron toggle is rendered. */
|
|
46
|
+
swimLanesVisible?: boolean;
|
|
47
|
+
/** Toggle callback for the swim-lane chevron button. */
|
|
48
|
+
onToggleSwimLanes?: () => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Built-in format presets. Pass one of these (or any custom string) as `dateTimeFormat`. */
|
|
52
|
+
export declare const DateTimeFormats: {
|
|
53
|
+
/** e.g. "Feb 24 2026 14:04:07" — default */
|
|
54
|
+
readonly DEFAULT: "MMM DD YYYY HH:mm:ss";
|
|
55
|
+
/** e.g. "Feb 24 2026 02:04:07 PM" */
|
|
56
|
+
readonly TWELVE_HR: "MMM DD YYYY hh:mm:ss A";
|
|
57
|
+
/** e.g. "2026-02-24 14:04:07" */
|
|
58
|
+
readonly ISO: "YYYY-MM-DD HH:mm:ss";
|
|
59
|
+
/** e.g. "02/24/2026 14:04" */
|
|
60
|
+
readonly US: "MM/DD/YYYY HH:mm";
|
|
61
|
+
/** e.g. "24/02/2026 14:04" */
|
|
62
|
+
readonly EU: "DD/MM/YYYY HH:mm";
|
|
63
|
+
/** e.g. "14:04:07" */
|
|
64
|
+
readonly TIME_ONLY: "HH:mm:ss";
|
|
65
|
+
/** e.g. "02:04:07 PM" */
|
|
66
|
+
readonly TIME_12: "hh:mm:ss A";
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export declare const DEFAULT_LANE_HEIGHT = 24;
|
|
70
|
+
|
|
71
|
+
export declare const defaultSwimLaneStyle: SwimLaneStyle;
|
|
72
|
+
|
|
73
|
+
export declare const defaultTheme: TimelineTheme;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Render the entire timeline onto a 2D canvas context.
|
|
77
|
+
*
|
|
78
|
+
* This is a pure rendering function — it reads from `state` and writes pixels
|
|
79
|
+
* to `ctx`. It does NOT modify `state` (except returning clamped scrollTop
|
|
80
|
+
* if the caller wants to update it).
|
|
81
|
+
*
|
|
82
|
+
* @param ctx The 2D rendering context (already DPR-scaled by the caller).
|
|
83
|
+
* @param w CSS-pixel width of the canvas.
|
|
84
|
+
* @param h CSS-pixel height of the canvas.
|
|
85
|
+
* @param state The current render state.
|
|
86
|
+
* @returns The clamped scrollTop value (caller should update their state if different).
|
|
87
|
+
*/
|
|
88
|
+
export declare function drawTimeline(ctx: CanvasRenderingContext2D, w: number, h: number, state: TimelineRenderState): number;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Format a date using a token-based format string.
|
|
92
|
+
*
|
|
93
|
+
* Supported tokens (longest-first to avoid partial matches):
|
|
94
|
+
* YYYY – 4-digit year e.g. 2026
|
|
95
|
+
* YY – 2-digit year e.g. 26
|
|
96
|
+
* MMMM – full month name e.g. February
|
|
97
|
+
* MMM – abbreviated month name e.g. Feb
|
|
98
|
+
* MM – zero-padded month number e.g. 02
|
|
99
|
+
* M – month number e.g. 2
|
|
100
|
+
* DD – zero-padded day e.g. 05
|
|
101
|
+
* D – day e.g. 5
|
|
102
|
+
* HH – 24-hour, zero-padded e.g. 14
|
|
103
|
+
* H – 24-hour e.g. 14
|
|
104
|
+
* hh – 12-hour, zero-padded e.g. 02
|
|
105
|
+
* h – 12-hour e.g. 2
|
|
106
|
+
* mm – minutes, zero-padded e.g. 04
|
|
107
|
+
* ss – seconds, zero-padded e.g. 07
|
|
108
|
+
* SSS – milliseconds, zero-padded e.g. 042
|
|
109
|
+
* A – AM / PM uppercase
|
|
110
|
+
* a – am / pm lowercase
|
|
111
|
+
*/
|
|
112
|
+
export declare function formatDateTime(date: Cesium.JulianDate | Date, format?: string): string;
|
|
113
|
+
|
|
114
|
+
/** @deprecated Use formatDateTime instead */
|
|
115
|
+
export declare function formatTime(date: Cesium.JulianDate | Date, includeSeconds?: boolean): string;
|
|
116
|
+
|
|
117
|
+
export declare function fromMilliseconds(ms: number): Cesium.JulianDate;
|
|
118
|
+
|
|
119
|
+
export declare function generateTicks(startTime: Cesium.JulianDate | Date, endTime: Cesium.JulianDate | Date, tickInterval: TickInterval | number, width: number): Tick[];
|
|
120
|
+
|
|
121
|
+
export declare function getDurationMs(startTime: Cesium.JulianDate | Date, endTime: Cesium.JulianDate | Date): number;
|
|
122
|
+
|
|
123
|
+
/** Check if a Y coordinate is in the swim lane label area (leftmost ~80px). */
|
|
124
|
+
export declare function hitTestLaneLabel(canvasX: number, canvasY: number, canvasH: number, state: Pick<TimelineRenderState, 'swimLanes' | 'showSwimLanes' | 'scrollTop'>): SwimLane | null;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Given canvas-local coordinates, find which swim lane item (if any) is under the point.
|
|
128
|
+
*/
|
|
129
|
+
export declare function hitTestSwimLane(canvasX: number, canvasY: number, canvasW: number, canvasH: number, state: Pick<TimelineRenderState, 'swimLanes' | 'showSwimLanes' | 'scrollTop' | 'startMs' | 'endMs' | 'theme'>): SwimLaneHitResult | null;
|
|
130
|
+
|
|
131
|
+
/** Check if Y is in the swim lane region (above tick area). */
|
|
132
|
+
export declare function isInSwimLaneRegion(canvasY: number, canvasH: number, state: Pick<TimelineRenderState, 'swimLanes' | 'showSwimLanes'>): boolean;
|
|
133
|
+
|
|
134
|
+
/** Left padding in pixels for lane labels. */
|
|
135
|
+
export declare const LABEL_PAD_LEFT = 6;
|
|
136
|
+
|
|
137
|
+
/** Gap in pixels between swim lane rows. */
|
|
138
|
+
export declare const LANE_GAP = 1;
|
|
139
|
+
|
|
140
|
+
export declare function makeLabel(ms: number, durationSec: number): string;
|
|
141
|
+
|
|
142
|
+
/** Maximum visible span: ~1 000 years — stays within TIC_SCALES range. */
|
|
143
|
+
export declare const MAX_SPAN_MS = 31536000000000;
|
|
144
|
+
|
|
145
|
+
/** Minimum visible span: 1 second — prevents sub-ms span / blank canvas. */
|
|
146
|
+
export declare const MIN_SPAN_MS = 1000;
|
|
147
|
+
|
|
148
|
+
/** Abbreviated month names used for tick labels. */
|
|
149
|
+
export declare const MONTHS: string[];
|
|
150
|
+
|
|
151
|
+
/** Advance to next tick boundary (identical to Cesium's getNextTic). */
|
|
152
|
+
export declare function nextTic(t: number, scale: number): number;
|
|
153
|
+
|
|
154
|
+
export declare function positionToTime(x: number, startTime: Cesium.JulianDate | Date, endTime: Cesium.JulianDate | Date, width: number): Cesium.JulianDate;
|
|
155
|
+
|
|
156
|
+
/** Drag-to-reorder visual state. */
|
|
157
|
+
export declare interface ReorderState {
|
|
158
|
+
dragging: boolean;
|
|
159
|
+
dragLaneId: string;
|
|
160
|
+
dragStartY: number;
|
|
161
|
+
currentY: number;
|
|
162
|
+
insertIndex: number;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Resolve the effective style for a swim lane item (item → lane → theme → defaults). */
|
|
166
|
+
export declare function resolveItemStyle(lane: SwimLane, item: SwimLaneItem, theme?: TimelineTheme): SwimLaneItemStyle;
|
|
167
|
+
|
|
168
|
+
/** Width in pixels for the thin scrollbar track. */
|
|
169
|
+
export declare const SCROLLBAR_WIDTH = 6;
|
|
170
|
+
|
|
171
|
+
export declare function snapToTick(x: number, ticks: Tick[], snapDistance?: number): number;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Split a format string into separate time and date parts for two-line display.
|
|
175
|
+
* Strips date tokens to derive the time format, and time tokens to derive the date format.
|
|
176
|
+
* Returns empty string for either part if no relevant tokens exist in the format.
|
|
177
|
+
*/
|
|
178
|
+
export declare function splitForDisplay(format?: string): {
|
|
179
|
+
timeFormat: string;
|
|
180
|
+
dateFormat: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/** Multiplier applied to wheel deltaY for swim lane vertical scrolling.
|
|
184
|
+
* Keeps scrolling smooth when the overflow range is small. */
|
|
185
|
+
export declare const SWIM_LANE_SCROLL_SPEED = 0.3;
|
|
186
|
+
|
|
187
|
+
export declare interface SwimLane {
|
|
188
|
+
id: string;
|
|
189
|
+
label: string;
|
|
190
|
+
items: SwimLaneItem[];
|
|
191
|
+
/** Lane-level default style applied to all items unless overridden per-item. */
|
|
192
|
+
style?: Partial<SwimLaneStyle>;
|
|
193
|
+
/** Height of this lane row in pixels. @default 24 */
|
|
194
|
+
height?: number;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export declare interface SwimLaneEventInfo {
|
|
198
|
+
laneId: string;
|
|
199
|
+
item: SwimLaneItem;
|
|
200
|
+
originalEvent: MouseEvent;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** Hit-test result for swim lane items. */
|
|
204
|
+
export declare interface SwimLaneHitResult {
|
|
205
|
+
lane: SwimLane;
|
|
206
|
+
item: SwimLaneItem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export declare interface SwimLaneItem {
|
|
210
|
+
id: string;
|
|
211
|
+
/** Provide a TimeInterval for a range (bar). */
|
|
212
|
+
interval?: Cesium.TimeInterval;
|
|
213
|
+
/** Provide a JulianDate for a point-in-time (marker). */
|
|
214
|
+
instant?: Cesium.JulianDate;
|
|
215
|
+
/** Per-item style overrides. */
|
|
216
|
+
style?: Partial<SwimLaneItemStyle>;
|
|
217
|
+
/** Arbitrary user data attached to this item. */
|
|
218
|
+
data?: unknown;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export declare interface SwimLaneItemStyle {
|
|
222
|
+
/** Fill color for interval bars / instant markers. */
|
|
223
|
+
color: string;
|
|
224
|
+
/** Border color for interval bars. */
|
|
225
|
+
borderColor: string;
|
|
226
|
+
/** Border width in pixels. */
|
|
227
|
+
borderWidth: number;
|
|
228
|
+
/** Opacity (0–1). */
|
|
229
|
+
opacity: number;
|
|
230
|
+
/** Shape used to render instants. */
|
|
231
|
+
markerShape: 'diamond' | 'circle' | 'line';
|
|
232
|
+
/** Size in pixels for instant markers. */
|
|
233
|
+
markerSize: number;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export declare interface SwimLaneStyle extends SwimLaneItemStyle {
|
|
237
|
+
/** Color of the lane label text. */
|
|
238
|
+
labelColor: string;
|
|
239
|
+
/** Background color of the lane row. */
|
|
240
|
+
backgroundColor: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Cesium-derived tick scale table (in seconds).
|
|
245
|
+
* Used to pick appropriate major / sub / tiny tick intervals.
|
|
246
|
+
*/
|
|
247
|
+
export declare const TIC_SCALES: number[];
|
|
248
|
+
|
|
249
|
+
export declare interface Tick {
|
|
250
|
+
position: number;
|
|
251
|
+
isMajor: boolean;
|
|
252
|
+
label?: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Fixed height in pixels for the tick + label area at the bottom of the canvas. */
|
|
256
|
+
export declare const TICK_AREA_HEIGHT = 36;
|
|
257
|
+
|
|
258
|
+
export declare enum TickInterval {
|
|
259
|
+
FIFTEEN_MIN = 15,
|
|
260
|
+
THIRTY_MIN = 30,
|
|
261
|
+
HOURLY = 60,
|
|
262
|
+
CUSTOM = -1
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Framework-agnostic base props for the timeline component.
|
|
267
|
+
* Framework wrappers (React, Angular) extend or adapt this interface.
|
|
268
|
+
*/
|
|
269
|
+
export declare interface TimelineBaseProps {
|
|
270
|
+
/** The start boundary of the timeline range. Defaults to 12 hours before now. */
|
|
271
|
+
startTime?: Cesium.JulianDate | Date;
|
|
272
|
+
/** The end boundary of the timeline range. Defaults to 12 hours after now. */
|
|
273
|
+
endTime?: Cesium.JulianDate | Date;
|
|
274
|
+
/** Initial current-time position of the needle. Defaults to `startTime` or now. */
|
|
275
|
+
currentTime?: Cesium.JulianDate | Date;
|
|
276
|
+
/** Cesium Clock instance to synchronize with. When provided the timeline follows the clock's tick. */
|
|
277
|
+
clock?: Cesium.Clock;
|
|
278
|
+
/** Fired whenever the current time changes (scrub, playback, or programmatic jump). */
|
|
279
|
+
onTimeChange?: (time: Cesium.JulianDate) => void;
|
|
280
|
+
/** Fired when playback is toggled. Receives the new playing state. */
|
|
281
|
+
onPlayPause?: (isPlaying: boolean) => void;
|
|
282
|
+
/** Fired when the playback speed multiplier changes (fast-forward / rewind). */
|
|
283
|
+
onMultiplierChange?: (multiplier: number) => void;
|
|
284
|
+
/**
|
|
285
|
+
* Explicit height in pixels. When omitted the timeline fills its container
|
|
286
|
+
* (the outer div uses `height: 100%`). When provided, a fixed pixel height
|
|
287
|
+
* is applied instead.
|
|
288
|
+
*/
|
|
289
|
+
height?: number;
|
|
290
|
+
/** Tick interval override. When omitted the timeline auto-selects an appropriate scale. */
|
|
291
|
+
tickInterval?: TickInterval | number;
|
|
292
|
+
/** Whether to render tick labels on the time axis. @default true */
|
|
293
|
+
showLabels?: boolean;
|
|
294
|
+
/** Whether to render the transport control bar above the canvas. @default true */
|
|
295
|
+
showControls?: boolean;
|
|
296
|
+
/** When `true`, ticks snap to round time boundaries during scrub. */
|
|
297
|
+
snapToTicks?: boolean;
|
|
298
|
+
/** Whether the user can scrub / drag the timeline. @default true */
|
|
299
|
+
enableDrag?: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Format string for the time display in the control bar.
|
|
302
|
+
* Tokens: YYYY YY MMMM MMM MM M DD D HH H hh h mm ss SSS A a
|
|
303
|
+
* Presets available via the exported `DateTimeFormats` object.
|
|
304
|
+
* @default 'MMM DD YYYY HH:mm:ss'
|
|
305
|
+
*/
|
|
306
|
+
dateTimeFormat?: string;
|
|
307
|
+
/**
|
|
308
|
+
* Called when the user clicks the datetime display in the control bar.
|
|
309
|
+
* Use this to open your own date/time picker.
|
|
310
|
+
*/
|
|
311
|
+
onDateTimeClick?: () => void;
|
|
312
|
+
/**
|
|
313
|
+
* Set this to a new Date or JulianDate to programmatically jump the timeline
|
|
314
|
+
* to that moment (pans the canvas and updates current time).
|
|
315
|
+
*/
|
|
316
|
+
jumpToTime?: Cesium.JulianDate | Date;
|
|
317
|
+
/**
|
|
318
|
+
* Maximum number of major ticks to render on the canvas at one time.
|
|
319
|
+
* When the computed tick count would exceed this value the tick scale is
|
|
320
|
+
* coarsened until it fits. Defaults to unlimited.
|
|
321
|
+
*/
|
|
322
|
+
maxTicks?: number;
|
|
323
|
+
/**
|
|
324
|
+
* Speed steps cycled by the fast-forward button.
|
|
325
|
+
* Each click advances to the next entry; the last entry wraps back to the
|
|
326
|
+
* first. Defaults to [2, 4, 8, 16, 32, 1].
|
|
327
|
+
*/
|
|
328
|
+
ffSpeeds?: number[];
|
|
329
|
+
/**
|
|
330
|
+
* Absolute-value speed steps cycled by the rewind button (negated internally).
|
|
331
|
+
* Defaults to [1, 2, 4, 8, 16, 32].
|
|
332
|
+
*/
|
|
333
|
+
rwSpeeds?: number[];
|
|
334
|
+
/** Partial theme overrides merged with the default theme. */
|
|
335
|
+
theme?: Partial<TimelineTheme>;
|
|
336
|
+
/**
|
|
337
|
+
* Swim lane definitions. Each lane is a labeled row rendered inside the
|
|
338
|
+
* timeline canvas showing time intervals (bars) and/or instants (markers).
|
|
339
|
+
*/
|
|
340
|
+
swimLanes?: SwimLane[];
|
|
341
|
+
/**
|
|
342
|
+
* Whether to show swim lanes. Defaults to `true` when `swimLanes` is provided.
|
|
343
|
+
* When `swimLanes` is provided, a chevron toggle button in the control bar
|
|
344
|
+
* lets the user expand / collapse the lanes at runtime.
|
|
345
|
+
*/
|
|
346
|
+
showSwimLanes?: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Fired when the built-in swim-lane toggle button is clicked.
|
|
349
|
+
* Receives the new visibility value. Use this to keep external state in sync.
|
|
350
|
+
*/
|
|
351
|
+
onShowSwimLanesChange?: (visible: boolean) => void;
|
|
352
|
+
/**
|
|
353
|
+
* Transition used when the timeline expands / collapses swim lanes.
|
|
354
|
+
* `'animated'` applies a smooth CSS transition (default).
|
|
355
|
+
* `'instant'` switches height immediately with no animation.
|
|
356
|
+
*/
|
|
357
|
+
swimLaneTransition?: 'animated' | 'instant';
|
|
358
|
+
/** Fired when the user clicks a swim lane item. */
|
|
359
|
+
onSwimLaneItemClick?: (info: SwimLaneEventInfo) => void;
|
|
360
|
+
/** Fired when the user hovers over (or leaves) a swim lane item. `null` = left. */
|
|
361
|
+
onSwimLaneItemHover?: (info: SwimLaneEventInfo | null) => void;
|
|
362
|
+
/** Fired when the user double-clicks a swim lane item. */
|
|
363
|
+
onSwimLaneItemDoubleClick?: (info: SwimLaneEventInfo) => void;
|
|
364
|
+
/** Fired when the user right-clicks a swim lane item. */
|
|
365
|
+
onSwimLaneItemContextMenu?: (info: SwimLaneEventInfo) => void;
|
|
366
|
+
/** Fired when swim lanes are reordered via drag. Returns the new ordered lane IDs. */
|
|
367
|
+
onSwimLaneReorder?: (orderedLaneIds: string[]) => void;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** Mutable state the engine reads during a draw call. */
|
|
371
|
+
export declare interface TimelineRenderState {
|
|
372
|
+
startMs: number;
|
|
373
|
+
endMs: number;
|
|
374
|
+
currentMs: number;
|
|
375
|
+
theme: TimelineTheme;
|
|
376
|
+
maxTicks?: number;
|
|
377
|
+
swimLanes: SwimLane[];
|
|
378
|
+
showSwimLanes: boolean;
|
|
379
|
+
scrollTop: number;
|
|
380
|
+
reorderState: ReorderState | null;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export declare interface TimelineTheme {
|
|
384
|
+
backgroundColor: string;
|
|
385
|
+
tickColor: string;
|
|
386
|
+
majorTickColor: string;
|
|
387
|
+
labelColor: string;
|
|
388
|
+
indicatorColor: string;
|
|
389
|
+
indicatorLineWidth: number;
|
|
390
|
+
majorTickHeight: number;
|
|
391
|
+
minorTickHeight: number;
|
|
392
|
+
fontSize: number;
|
|
393
|
+
controlBarBackground: string;
|
|
394
|
+
controlBarBorder: string;
|
|
395
|
+
buttonColor: string;
|
|
396
|
+
buttonHoverColor: string;
|
|
397
|
+
/** Highlight color for active FF/RW buttons. Defaults to indicatorColor. */
|
|
398
|
+
buttonActiveColor: string;
|
|
399
|
+
/** Default border color for swim lane items. */
|
|
400
|
+
swimLaneItemBorderColor: string;
|
|
401
|
+
/** Default border width for swim lane items (px). Set to 0 to remove borders. */
|
|
402
|
+
swimLaneItemBorderWidth: number;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export declare interface TimePosition {
|
|
406
|
+
x: number;
|
|
407
|
+
time: Cesium.JulianDate;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export declare function timeToPosition(time: Cesium.JulianDate | Date, startTime: Cesium.JulianDate | Date, endTime: Cesium.JulianDate | Date, width: number): number;
|
|
411
|
+
|
|
412
|
+
export declare function toDate(date: Cesium.JulianDate | Date): Date;
|
|
413
|
+
|
|
414
|
+
export declare function toJulianDate(date: Cesium.JulianDate | Date): Cesium.JulianDate;
|
|
415
|
+
|
|
416
|
+
export declare function toMilliseconds(date: Cesium.JulianDate | Date): number;
|
|
417
|
+
|
|
418
|
+
/** Compute the total content height of all swim lanes. */
|
|
419
|
+
export declare function totalSwimLaneHeight(lanes: SwimLane[]): number;
|
|
420
|
+
|
|
421
|
+
export declare function twoD(n: number): string;
|
|
422
|
+
|
|
423
|
+
/** Compute a new visible range after zooming by `amount` around the center. */
|
|
424
|
+
export declare function zoomRange(startMs: number, endMs: number, amount: number): {
|
|
425
|
+
startMs: number;
|
|
426
|
+
endMs: number;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
export { }
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kteneyck/cesium-timeline-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Framework-agnostic core logic for the Cesium timeline component",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "kteneyck",
|
|
7
|
+
"keywords": ["cesium", "timeline", "cesiumjs", "gis", "3d", "geospatial"],
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Hive-Space/cesium-timeline.git",
|
|
11
|
+
"directory": "packages/core"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/Hive-Space/cesium-timeline#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/Hive-Space/cesium-timeline/issues"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/cesium-timeline-core.umd.cjs",
|
|
22
|
+
"module": "./dist/cesium-timeline-core.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": "./dist/cesium-timeline-core.js",
|
|
27
|
+
"require": "./dist/cesium-timeline-core.umd.cjs",
|
|
28
|
+
"types": "./dist/index.d.ts"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "vite build",
|
|
36
|
+
"test": "vitest"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"cesium": "^1.100.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"cesium": "^1.100.0",
|
|
43
|
+
"typescript": "^5.9.0",
|
|
44
|
+
"vite": "^6.0.0",
|
|
45
|
+
"vite-plugin-dts": "^4.0.0",
|
|
46
|
+
"vitest": "^4.0.0"
|
|
47
|
+
}
|
|
48
|
+
}
|