@kteneyck/cesium-timeline-core 0.4.0 → 0.6.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/README.md +145 -2
- package/dist/cesium-timeline-core.js +195 -170
- package/dist/cesium-timeline-core.umd.cjs +1 -1
- package/dist/index.d.ts +85 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ Angular components use standalone imports — no NgModule required. Selectors: `
|
|
|
123
123
|
- **Auto-scroll during playback** — visible window pans automatically when the needle reaches 10% from either edge.
|
|
124
124
|
- **Infinite scrolling window** — timeline is not clamped to `startTime`/`endTime`; the window can pan anywhere.
|
|
125
125
|
- **Adaptive tick labels** — label granularity adapts to zoom level: milliseconds → seconds → HH:MM:SS → HH:MM → Month Day → Month Year → Year. Tick dates are shown only when the visible window spans more than 24 hours.
|
|
126
|
-
- **
|
|
126
|
+
- **Configurable timezone** — tick labels and the datetime display can show any IANA timezone (e.g. `"UTC"`, `"America/New_York"`) or the browser's local time. A short abbreviation (e.g. `UTC`, `EST`, `PDT`) is displayed to the right of the date line whenever a non-local timezone is active.
|
|
127
127
|
- **Netflix/Hulu-style controls** — transport buttons (⏮ ◀◀ ▶/⏸ ▶▶ ⏭) always stay centered; speed badge and LIVE button in the left column never cause layout shift.
|
|
128
128
|
- **Conditional start/end buttons** — ⏮ and ⏭ are only rendered when `startTime` and `endTime` props are explicitly provided.
|
|
129
129
|
- **Speed cycling** — FF cycles through `ffSpeeds` (default `2×→4×→8×→16×→32×→1×`); RW cycles through `rwSpeeds` (default `−1×→−2×→−4×→−8×→−16×→−32×`). Both arrays are fully configurable.
|
|
@@ -135,6 +135,7 @@ Angular components use standalone imports — no NgModule required. Selectors: `
|
|
|
135
135
|
- **Max tick limit** — `maxTicks` prop prevents the canvas from becoming overloaded at wide zoom levels by coarsening the tick scale automatically.
|
|
136
136
|
- **Swim lanes** — display time intervals and instants as horizontal rows inside the canvas. Supports customizable styling, click/hover/double-click event hooks, drag-to-reorder, and vertical scrolling when lanes overflow.
|
|
137
137
|
- **Fully themeable** — 16 theme properties cover every color, size, and font setting, including swim lane item border defaults.
|
|
138
|
+
- **Localizable labels** — every control-bar label and tooltip is overridable via the `labels` prop; dynamic tooltips accept a `(multiplier: number) => string` callback. See [Labels & i18n](#labels--i18n).
|
|
138
139
|
- **Responsive** — fills container width; `ResizeObserver` redraws on resize.
|
|
139
140
|
|
|
140
141
|
---
|
|
@@ -159,6 +160,7 @@ Angular components use standalone imports — no NgModule required. Selectors: `
|
|
|
159
160
|
| `ffSpeeds` | `number[]` | `[2,4,8,16,32,1]` | Speed steps cycled by the ▶▶ button. Last entry wraps back to first. |
|
|
160
161
|
| `rwSpeeds` | `number[]` | `[1,2,4,8,16,32]` | Absolute-value speed steps cycled by the ◀◀ button (negated internally). |
|
|
161
162
|
| `dateTimeFormat` | `string` | `'MMM DD YYYY HH:mm:ss'` | Token-based format string for the controls datetime display |
|
|
163
|
+
| `timezone` | `string` | browser local | IANA timezone name (e.g. `'UTC'`, `'America/New_York'`) or `'local'` for the browser's timezone. Controls both tick labels and the datetime display. When set, a short abbreviation (e.g. `UTC`, `EST`) appears to the right of the date. |
|
|
162
164
|
| `onDateTimeClick` | `() => void` | — | Called when the user clicks the datetime display. Use to open your own date picker. |
|
|
163
165
|
| `jumpToTime` | `JulianDate \| Date` | — | Set to programmatically jump the timeline to a moment (pans canvas + sets time). |
|
|
164
166
|
| `theme` | `Partial<TimelineTheme>` | `defaultTheme` | Theme overrides (merged with defaults) |
|
|
@@ -172,6 +174,7 @@ Angular components use standalone imports — no NgModule required. Selectors: `
|
|
|
172
174
|
| `onSwimLaneItemHover` | `(info: SwimLaneEventInfo \| null) => void` | — | Fires when mouse enters/leaves a swim lane item |
|
|
173
175
|
| `onSwimLaneItemDoubleClick` | `(info: SwimLaneEventInfo) => void` | — | Fires when a swim lane item is double-clicked |
|
|
174
176
|
| `onSwimLaneReorder` | `(orderedIds: string[]) => void` | — | Fires when swim lanes are reordered via drag. Receives the new lane id order. |
|
|
177
|
+
| `labels` | `Partial<TimelineLabels>` | English defaults | Override any control-bar label or tooltip string. See [Labels & i18n](#labels--i18n). |
|
|
175
178
|
|
|
176
179
|
---
|
|
177
180
|
|
|
@@ -229,6 +232,60 @@ const theme = useMemo(() => {
|
|
|
229
232
|
|
|
230
233
|
---
|
|
231
234
|
|
|
235
|
+
## Timezone
|
|
236
|
+
|
|
237
|
+
By default the timeline displays all times in the **browser's local timezone**. Pass the `timezone` prop to use UTC or any [IANA timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) instead.
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
// UTC
|
|
241
|
+
<Timeline clock={viewer.clock} timezone="UTC" ... />
|
|
242
|
+
|
|
243
|
+
// A named IANA zone
|
|
244
|
+
<Timeline clock={viewer.clock} timezone="America/New_York" ... />
|
|
245
|
+
|
|
246
|
+
// Back to local (or simply omit the prop)
|
|
247
|
+
<Timeline clock={viewer.clock} timezone="local" ... />
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Both the **canvas tick labels** and the **control bar datetime display** update to reflect the chosen timezone. When a non-local timezone is active a short abbreviation (e.g. `UTC`, `EST`, `PDT`) is shown to the right of the date line. The abbreviation is DST-aware — it automatically switches between `EST` and `EDT`, `PST` and `PDT`, etc.
|
|
251
|
+
|
|
252
|
+
### `Timezones` constants
|
|
253
|
+
|
|
254
|
+
```tsx
|
|
255
|
+
import { Timezones } from '@kteneyck/cesium-timeline-react';
|
|
256
|
+
|
|
257
|
+
<Timeline timezone={Timezones.UTC} ... /> // "UTC"
|
|
258
|
+
<Timeline timezone={Timezones.LOCAL} ... /> // "local" (default behavior)
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### `getTimezoneAbbr` utility
|
|
262
|
+
|
|
263
|
+
Returns the short abbreviation for a given date and timezone, or `null` for local.
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
import { getTimezoneAbbr } from '@kteneyck/cesium-timeline-react';
|
|
267
|
+
|
|
268
|
+
getTimezoneAbbr(new Date(), 'UTC'); // → "UTC"
|
|
269
|
+
getTimezoneAbbr(new Date(), 'America/Chicago'); // → "CDT" or "CST"
|
|
270
|
+
getTimezoneAbbr(new Date()); // → null (local)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### `formatDateTime` with timezone
|
|
274
|
+
|
|
275
|
+
The `formatDateTime` utility accepts an optional third argument:
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import { formatDateTime, DateTimeFormats } from '@kteneyck/cesium-timeline-react';
|
|
279
|
+
|
|
280
|
+
formatDateTime(new Date(), DateTimeFormats.ISO, 'UTC');
|
|
281
|
+
// → "2026-02-24 14:04:07" (always in UTC regardless of local browser timezone)
|
|
282
|
+
|
|
283
|
+
formatDateTime(new Date(), DateTimeFormats.DEFAULT, 'America/Los_Angeles');
|
|
284
|
+
// → "Feb 24 2026 06:04:07"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
232
289
|
## DateTime Format
|
|
233
290
|
|
|
234
291
|
The `dateTimeFormat` prop controls the two-line datetime display in the control bar. It accepts a token-based format string.
|
|
@@ -357,6 +414,88 @@ const [pickerOpen, setPickerOpen] = useState(false);
|
|
|
357
414
|
|
|
358
415
|
---
|
|
359
416
|
|
|
417
|
+
## Labels & i18n
|
|
418
|
+
|
|
419
|
+
Every label and tooltip in the control bar is overridable via the `labels` prop. Pass a `Partial<TimelineLabels>` object — only the keys you provide are changed; everything else falls back to the English defaults.
|
|
420
|
+
|
|
421
|
+
### `TimelineLabels` reference
|
|
422
|
+
|
|
423
|
+
| Key | Default (English) | Notes |
|
|
424
|
+
|-----|-------------------|-------|
|
|
425
|
+
| `dateTimeClickTooltip` | `"Click to jump to a date/time"` | Tooltip on the datetime display when `onDateTimeClick` is wired up |
|
|
426
|
+
| `liveLabel` | `"LIVE"` | LIVE button text when not at live time |
|
|
427
|
+
| `liveActiveLabel` | `"● LIVE"` | LIVE button text when at live time |
|
|
428
|
+
| `liveTooltip` | `"Jump to live (now)"` | LIVE button tooltip when not at live time |
|
|
429
|
+
| `liveActiveTooltip` | `"Currently live"` | LIVE button tooltip when at live time |
|
|
430
|
+
| `resetSpeedTooltip` | `"Reset to 1× speed"` | Tooltip on the speed-reset badge |
|
|
431
|
+
| `jumpToStartTooltip` | `"Jump to start"` | ⏮ button tooltip when a start time is set |
|
|
432
|
+
| `noStartTimeTooltip` | `"No start time set"` | ⏮ button tooltip when no start time is set |
|
|
433
|
+
| `jumpToEndTooltip` | `"Jump to end"` | ⏭ button tooltip when an end time is set |
|
|
434
|
+
| `noEndTimeTooltip` | `"No end time set"` | ⏭ button tooltip when no end time is set |
|
|
435
|
+
| `rewindTooltip` | `"Rewind"` | ◀◀ button tooltip at normal speed |
|
|
436
|
+
| `rewindActiveTooltip` | `(n) => "Reverse N× — click to speed up…"` | ◀◀ button tooltip while rewinding — receives the current multiplier |
|
|
437
|
+
| `playTooltip` | `"Play"` | ▶ button tooltip when stopped |
|
|
438
|
+
| `playFromRewindTooltip` | `"Play (reset to 1×)"` | ▶ button tooltip when coming out of rewind |
|
|
439
|
+
| `pauseTooltip` | `"Pause"` | ▶ button tooltip when playing |
|
|
440
|
+
| `fastForwardTooltip` | `"Fast forward"` | ▶▶ button tooltip at normal speed |
|
|
441
|
+
| `fastForwardActiveTooltip` | `(n) => "N× speed — click to increase…"` | ▶▶ button tooltip while fast-forwarding — receives the current multiplier |
|
|
442
|
+
| `collapseSwimLanesTooltip` | `"Collapse swim lanes"` | Chevron button tooltip when lanes are visible |
|
|
443
|
+
| `expandSwimLanesTooltip` | `"Expand swim lanes"` | Chevron button tooltip when lanes are hidden |
|
|
444
|
+
|
|
445
|
+
Dynamic fields (`rewindActiveTooltip`, `fastForwardActiveTooltip`) accept either a **static string** or a **function** `(multiplier: number) => string`. Use a function when you want to embed the speed value in your translated string.
|
|
446
|
+
|
|
447
|
+
### React example
|
|
448
|
+
|
|
449
|
+
```tsx
|
|
450
|
+
import { Timeline } from '@kteneyck/cesium-timeline-react';
|
|
451
|
+
import type { TimelineLabels } from '@kteneyck/cesium-timeline-core';
|
|
452
|
+
|
|
453
|
+
const frLabels: Partial<TimelineLabels> = {
|
|
454
|
+
playTooltip: 'Lecture',
|
|
455
|
+
pauseTooltip: 'Pause',
|
|
456
|
+
liveLabel: 'EN DIRECT',
|
|
457
|
+
liveActiveLabel: '● EN DIRECT',
|
|
458
|
+
liveTooltip: 'Aller en direct',
|
|
459
|
+
liveActiveTooltip: 'Vous êtes en direct',
|
|
460
|
+
rewindTooltip: 'Retour rapide',
|
|
461
|
+
rewindActiveTooltip: (n) => `Retour ${n}× — cliquer pour accélérer`,
|
|
462
|
+
fastForwardTooltip: 'Avance rapide',
|
|
463
|
+
fastForwardActiveTooltip: (n) => `${n}× — cliquer pour augmenter la vitesse`,
|
|
464
|
+
collapseSwimLanesTooltip: 'Réduire les pistes',
|
|
465
|
+
expandSwimLanesTooltip: 'Développer les pistes',
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
<Timeline clock={viewer.clock} labels={frLabels} height={120} />
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### Angular example
|
|
472
|
+
|
|
473
|
+
```typescript
|
|
474
|
+
// component.ts
|
|
475
|
+
import type { TimelineLabels } from '@kteneyck/cesium-timeline-core';
|
|
476
|
+
|
|
477
|
+
@Component({ ... })
|
|
478
|
+
export class AppComponent {
|
|
479
|
+
frLabels: Partial<TimelineLabels> = {
|
|
480
|
+
playTooltip: 'Lecture',
|
|
481
|
+
pauseTooltip: 'Pause',
|
|
482
|
+
liveLabel: 'EN DIRECT',
|
|
483
|
+
liveActiveLabel: '● EN DIRECT',
|
|
484
|
+
liveTooltip: 'Aller en direct',
|
|
485
|
+
liveActiveTooltip: 'Vous êtes en direct',
|
|
486
|
+
rewindActiveTooltip: (n) => `Retour ${n}× — cliquer pour accélérer`,
|
|
487
|
+
fastForwardActiveTooltip: (n) => `${n}× — cliquer pour augmenter la vitesse`,
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
```html
|
|
493
|
+
<!-- component.html -->
|
|
494
|
+
<ct-timeline [clock]="clock" [labels]="frLabels" [height]="120" />
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
360
499
|
## Exports
|
|
361
500
|
|
|
362
501
|
### React
|
|
@@ -385,7 +524,10 @@ import {
|
|
|
385
524
|
```tsx
|
|
386
525
|
import {
|
|
387
526
|
DateTimeFormats, // Format string presets
|
|
388
|
-
|
|
527
|
+
Timezones, // { LOCAL: 'local', UTC: 'UTC' } convenience constants
|
|
528
|
+
DEFAULT_LABELS, // Default English label/tooltip strings
|
|
529
|
+
formatDateTime, // Token-based date formatter (date, format, timezone?)
|
|
530
|
+
getTimezoneAbbr, // Short timezone abbreviation for a date (date, timezone?)
|
|
389
531
|
splitForDisplay, // Split format string into time/date parts
|
|
390
532
|
toJulianDate, // Convert Date | JulianDate → JulianDate
|
|
391
533
|
toDate, // Convert Date | JulianDate → Date
|
|
@@ -401,6 +543,7 @@ import {
|
|
|
401
543
|
// TypeScript types
|
|
402
544
|
import type {
|
|
403
545
|
TimelineTheme,
|
|
546
|
+
TimelineLabels,
|
|
404
547
|
SwimLane,
|
|
405
548
|
SwimLaneItem,
|
|
406
549
|
SwimLaneItemStyle,
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
1
|
+
import * as H from "cesium";
|
|
2
|
+
function ke(e, t) {
|
|
3
|
+
return typeof e == "function" ? e(t) : e;
|
|
4
|
+
}
|
|
5
|
+
const He = {
|
|
6
|
+
dateTimeClickTooltip: "Click to jump to a date/time",
|
|
7
|
+
liveLabel: "LIVE",
|
|
8
|
+
liveActiveLabel: "● LIVE",
|
|
9
|
+
liveTooltip: "Jump to live (now)",
|
|
10
|
+
liveActiveTooltip: "Currently live",
|
|
11
|
+
resetSpeedTooltip: "Reset to 1× speed",
|
|
12
|
+
jumpToStartTooltip: "Jump to start",
|
|
13
|
+
noStartTimeTooltip: "No start time set",
|
|
14
|
+
jumpToEndTooltip: "Jump to end",
|
|
15
|
+
noEndTimeTooltip: "No end time set",
|
|
16
|
+
rewindTooltip: "Rewind",
|
|
17
|
+
rewindActiveTooltip: (e) => `Reverse ${e}× — click to speed up, press play to stop`,
|
|
18
|
+
playTooltip: "Play",
|
|
19
|
+
playFromRewindTooltip: "Play (reset to 1×)",
|
|
20
|
+
pauseTooltip: "Pause",
|
|
21
|
+
fastForwardTooltip: "Fast forward",
|
|
22
|
+
fastForwardActiveTooltip: (e) => `${e}× speed — click to increase, click again at max to reset`,
|
|
23
|
+
collapseSwimLanesTooltip: "Collapse swim lanes",
|
|
24
|
+
expandSwimLanesTooltip: "Expand swim lanes"
|
|
25
|
+
}, Ce = {
|
|
3
26
|
backgroundColor: "#1a1a1a",
|
|
4
27
|
tickColor: "#666666",
|
|
5
28
|
majorTickColor: "#999999",
|
|
@@ -18,7 +41,7 @@ const ke = {
|
|
|
18
41
|
swimLaneItemBorderWidth: 0
|
|
19
42
|
};
|
|
20
43
|
var ce = /* @__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))(ce || {});
|
|
21
|
-
const
|
|
44
|
+
const _ = {
|
|
22
45
|
color: "#4da6ff",
|
|
23
46
|
borderColor: "#2980b9",
|
|
24
47
|
borderWidth: 1,
|
|
@@ -27,23 +50,23 @@ const $ = {
|
|
|
27
50
|
markerSize: 10,
|
|
28
51
|
labelColor: "#cccccc",
|
|
29
52
|
backgroundColor: "transparent"
|
|
30
|
-
},
|
|
31
|
-
function
|
|
32
|
-
return e instanceof
|
|
53
|
+
}, $ = 24;
|
|
54
|
+
function Ae(e) {
|
|
55
|
+
return e instanceof H.JulianDate ? H.JulianDate.clone(e) : H.JulianDate.fromDate(e);
|
|
33
56
|
}
|
|
34
57
|
function te(e) {
|
|
35
|
-
return e instanceof
|
|
58
|
+
return e instanceof H.JulianDate ? H.JulianDate.toDate(e) : e;
|
|
36
59
|
}
|
|
37
|
-
function
|
|
60
|
+
function F(e) {
|
|
38
61
|
return te(e).getTime();
|
|
39
62
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
63
|
+
function Ye(e) {
|
|
64
|
+
return H.JulianDate.fromDate(new Date(e));
|
|
42
65
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
66
|
+
function pe(e, t) {
|
|
67
|
+
return F(t) - F(e);
|
|
45
68
|
}
|
|
46
|
-
const
|
|
69
|
+
const Me = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], de = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], fe = {
|
|
47
70
|
/** e.g. "Feb 24 2026 14:04:07" — default */
|
|
48
71
|
DEFAULT: "MMM DD YYYY HH:mm:ss",
|
|
49
72
|
/** e.g. "Feb 24 2026 02:04:07 PM" */
|
|
@@ -58,7 +81,7 @@ const ge = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"
|
|
|
58
81
|
TIME_ONLY: "HH:mm:ss",
|
|
59
82
|
/** e.g. "02:04:07 PM" */
|
|
60
83
|
TIME_12: "hh:mm:ss A"
|
|
61
|
-
},
|
|
84
|
+
}, we = {
|
|
62
85
|
/** Use the browser's local timezone (default behavior). */
|
|
63
86
|
LOCAL: "local",
|
|
64
87
|
/** Coordinated Universal Time. */
|
|
@@ -66,8 +89,8 @@ const ge = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"
|
|
|
66
89
|
};
|
|
67
90
|
function oe(e, t) {
|
|
68
91
|
if (!t || t === "local") {
|
|
69
|
-
const
|
|
70
|
-
return { yr:
|
|
92
|
+
const M = e.getFullYear(), f = e.getMonth(), u = e.getDate(), D = e.getHours(), L = D % 12 || 12, d = e.getMinutes(), w = e.getSeconds(), E = e.getMilliseconds();
|
|
93
|
+
return { yr: M, mo: f, day: u, hr24: D, hr12: L, min: d, sec: w, ms: E, ampm: D < 12 ? "AM" : "PM" };
|
|
71
94
|
}
|
|
72
95
|
const o = new Intl.DateTimeFormat("en-US", {
|
|
73
96
|
timeZone: t,
|
|
@@ -79,15 +102,15 @@ function oe(e, t) {
|
|
|
79
102
|
second: "2-digit",
|
|
80
103
|
hour12: !1
|
|
81
104
|
}), l = {};
|
|
82
|
-
for (const
|
|
83
|
-
|
|
105
|
+
for (const M of o.formatToParts(e))
|
|
106
|
+
M.type !== "literal" && (l[M.type] = M.value);
|
|
84
107
|
const r = parseInt(l.year), s = parseInt(l.month) - 1, a = parseInt(l.day);
|
|
85
108
|
let n = parseInt(l.hour);
|
|
86
109
|
n === 24 && (n = 0);
|
|
87
|
-
const m = n % 12 || 12, c = parseInt(l.minute), h = parseInt(l.second),
|
|
88
|
-
return { yr: r, mo: s, day: a, hr24: n, hr12: m, min: c, sec: h, ms:
|
|
110
|
+
const m = n % 12 || 12, c = parseInt(l.minute), h = parseInt(l.second), p = e.getMilliseconds();
|
|
111
|
+
return { yr: r, mo: s, day: a, hr24: n, hr12: m, min: c, sec: h, ms: p, ampm: n < 12 ? "AM" : "PM" };
|
|
89
112
|
}
|
|
90
|
-
function
|
|
113
|
+
function Ee(e, t) {
|
|
91
114
|
var r;
|
|
92
115
|
if (!t || t === "local") return null;
|
|
93
116
|
const o = te(e);
|
|
@@ -96,12 +119,12 @@ function Ye(e, t) {
|
|
|
96
119
|
timeZoneName: "short"
|
|
97
120
|
}).formatToParts(o).find((s) => s.type === "timeZoneName")) == null ? void 0 : r.value) ?? null;
|
|
98
121
|
}
|
|
99
|
-
function
|
|
100
|
-
const l = te(e), { yr: r, mo: s, day: a, hr24: n, hr12: m, min: c, sec: h, ms:
|
|
122
|
+
function ge(e, t = fe.DEFAULT, o) {
|
|
123
|
+
const l = te(e), { yr: r, mo: s, day: a, hr24: n, hr12: m, min: c, sec: h, ms: p, ampm: M } = oe(l, o), f = (L) => String(L).padStart(2, "0"), u = (L) => String(L).padStart(3, "0"), D = {
|
|
101
124
|
YYYY: String(r),
|
|
102
125
|
YY: String(r).slice(-2),
|
|
103
126
|
MMMM: de[s],
|
|
104
|
-
MMM:
|
|
127
|
+
MMM: Me[s],
|
|
105
128
|
MM: f(s + 1),
|
|
106
129
|
M: String(s + 1),
|
|
107
130
|
DD: f(a),
|
|
@@ -112,16 +135,16 @@ function Te(e, t = fe.DEFAULT, o) {
|
|
|
112
135
|
h: String(m),
|
|
113
136
|
mm: f(c),
|
|
114
137
|
ss: f(h),
|
|
115
|
-
SSS: u(
|
|
116
|
-
A:
|
|
117
|
-
a:
|
|
138
|
+
SSS: u(p),
|
|
139
|
+
A: M,
|
|
140
|
+
a: M.toLowerCase()
|
|
118
141
|
};
|
|
119
142
|
return t.replace(
|
|
120
143
|
/YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,
|
|
121
|
-
(
|
|
144
|
+
(L) => D[L] ?? L
|
|
122
145
|
);
|
|
123
146
|
}
|
|
124
|
-
function
|
|
147
|
+
function Ie(e = fe.DEFAULT) {
|
|
125
148
|
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();
|
|
126
149
|
let r = e;
|
|
127
150
|
for (const a of t) r = r.replace(a, "");
|
|
@@ -129,46 +152,46 @@ function Ee(e = fe.DEFAULT) {
|
|
|
129
152
|
for (const a of o) s = s.replace(a, "");
|
|
130
153
|
return { timeFormat: l(r), dateFormat: l(s) };
|
|
131
154
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
155
|
+
function Pe(e, t = !1) {
|
|
156
|
+
return ge(e, t ? "HH:mm:ss" : "HH:mm");
|
|
134
157
|
}
|
|
135
|
-
function
|
|
136
|
-
const r =
|
|
158
|
+
function Te(e, t, o, l) {
|
|
159
|
+
const r = F(e), s = F(t), a = F(o);
|
|
137
160
|
if (a === s) return 0;
|
|
138
161
|
const n = (r - s) / (a - s);
|
|
139
162
|
return Math.max(0, Math.min(1, n)) * l;
|
|
140
163
|
}
|
|
141
|
-
function
|
|
142
|
-
const r = Math.max(0, Math.min(1, e / l)), s =
|
|
143
|
-
return
|
|
164
|
+
function Re(e, t, o, l) {
|
|
165
|
+
const r = Math.max(0, Math.min(1, e / l)), s = F(t), a = F(o), n = s + r * (a - s);
|
|
166
|
+
return H.JulianDate.fromDate(new Date(n));
|
|
144
167
|
}
|
|
145
168
|
function _e(e, t, o, l) {
|
|
146
|
-
const r = [], s =
|
|
169
|
+
const r = [], s = pe(e, t), a = F(e);
|
|
147
170
|
let n;
|
|
148
171
|
typeof o == "number" && o in ce || typeof o == "number" ? n = o * 60 * 1e3 : n = 3600 * 1e3;
|
|
149
172
|
const m = n * 4;
|
|
150
173
|
let c = a, h = 0;
|
|
151
174
|
for (; c <= a + s; ) {
|
|
152
|
-
const
|
|
175
|
+
const p = h * n % m === 0, M = Te(
|
|
153
176
|
new Date(c),
|
|
154
177
|
e,
|
|
155
178
|
t,
|
|
156
179
|
l
|
|
157
180
|
);
|
|
158
181
|
let f;
|
|
159
|
-
if (
|
|
160
|
-
const u = new Date(c),
|
|
161
|
-
f = `${
|
|
182
|
+
if (p) {
|
|
183
|
+
const u = new Date(c), D = u.getHours().toString().padStart(2, "0"), L = u.getMinutes().toString().padStart(2, "0");
|
|
184
|
+
f = `${D}:${L}`;
|
|
162
185
|
}
|
|
163
186
|
r.push({
|
|
164
|
-
position:
|
|
165
|
-
isMajor:
|
|
187
|
+
position: M,
|
|
188
|
+
isMajor: p,
|
|
166
189
|
label: f
|
|
167
190
|
}), c += n, h++;
|
|
168
191
|
}
|
|
169
192
|
return r;
|
|
170
193
|
}
|
|
171
|
-
function
|
|
194
|
+
function $e(e, t, o = 10) {
|
|
172
195
|
let l = t[0], r = Math.abs(l.position - e);
|
|
173
196
|
for (const s of t) {
|
|
174
197
|
const a = Math.abs(s.position - e);
|
|
@@ -176,7 +199,7 @@ function Pe(e, t, o = 10) {
|
|
|
176
199
|
}
|
|
177
200
|
return r <= o ? l.position : e;
|
|
178
201
|
}
|
|
179
|
-
const Se = 1e3,
|
|
202
|
+
const Se = 1e3, ye = 31536e9, S = [
|
|
180
203
|
1e-3,
|
|
181
204
|
2e-3,
|
|
182
205
|
5e-3,
|
|
@@ -225,7 +248,7 @@ const Se = 1e3, be = 31536e9, S = [
|
|
|
225
248
|
126144e5,
|
|
226
249
|
15768e6,
|
|
227
250
|
31536e6
|
|
228
|
-
],
|
|
251
|
+
], z = 36, W = 1, be = 6, Q = 6, Fe = 0.3, x = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
229
252
|
function Y(e) {
|
|
230
253
|
return e < 10 ? `0${e}` : `${e}`;
|
|
231
254
|
}
|
|
@@ -237,10 +260,10 @@ function me(e, t, o) {
|
|
|
237
260
|
if (t > 86400) return `${x[s]} ${a} ${Y(n)}:${Y(m)}`;
|
|
238
261
|
if (t > 3600) return `${Y(n)}:${Y(m)}`;
|
|
239
262
|
if (t > 60) return `${Y(n)}:${Y(m)}:${Y(c)}`;
|
|
240
|
-
const
|
|
241
|
-
return `${Y(n)}:${Y(m)}:${Y(c)}${
|
|
263
|
+
const p = h > 0 ? `.${String(h).padStart(3, "0")}` : "";
|
|
264
|
+
return `${Y(n)}:${Y(m)}:${Y(c)}${p}`;
|
|
242
265
|
}
|
|
243
|
-
function
|
|
266
|
+
function De(e, t, o) {
|
|
244
267
|
const l = new Date(e);
|
|
245
268
|
if (!o || o === "local") {
|
|
246
269
|
const m = l.getFullYear(), c = l.getMonth(), h = l.getDate();
|
|
@@ -253,21 +276,21 @@ function ee(e, t) {
|
|
|
253
276
|
return Math.ceil(e / t + 0.5) * t;
|
|
254
277
|
}
|
|
255
278
|
function ue(e, t, o) {
|
|
256
|
-
var l, r, s, a, n, m, c, h,
|
|
279
|
+
var l, r, s, a, n, m, c, h, p, M, f, u;
|
|
257
280
|
return {
|
|
258
|
-
color: ((l = t.style) == null ? void 0 : l.color) ?? ((r = e.style) == null ? void 0 : r.color) ??
|
|
259
|
-
borderColor: ((s = t.style) == null ? void 0 : s.borderColor) ?? ((a = e.style) == null ? void 0 : a.borderColor) ?? (o == null ? void 0 : o.swimLaneItemBorderColor) ??
|
|
260
|
-
borderWidth: ((n = t.style) == null ? void 0 : n.borderWidth) ?? ((m = e.style) == null ? void 0 : m.borderWidth) ?? (o == null ? void 0 : o.swimLaneItemBorderWidth) ??
|
|
261
|
-
opacity: ((c = t.style) == null ? void 0 : c.opacity) ?? ((h = e.style) == null ? void 0 : h.opacity) ??
|
|
262
|
-
markerShape: ((
|
|
263
|
-
markerSize: ((f = t.style) == null ? void 0 : f.markerSize) ?? ((u = e.style) == null ? void 0 : u.markerSize) ??
|
|
281
|
+
color: ((l = t.style) == null ? void 0 : l.color) ?? ((r = e.style) == null ? void 0 : r.color) ?? _.color,
|
|
282
|
+
borderColor: ((s = t.style) == null ? void 0 : s.borderColor) ?? ((a = e.style) == null ? void 0 : a.borderColor) ?? (o == null ? void 0 : o.swimLaneItemBorderColor) ?? _.borderColor,
|
|
283
|
+
borderWidth: ((n = t.style) == null ? void 0 : n.borderWidth) ?? ((m = e.style) == null ? void 0 : m.borderWidth) ?? (o == null ? void 0 : o.swimLaneItemBorderWidth) ?? _.borderWidth,
|
|
284
|
+
opacity: ((c = t.style) == null ? void 0 : c.opacity) ?? ((h = e.style) == null ? void 0 : h.opacity) ?? _.opacity,
|
|
285
|
+
markerShape: ((p = t.style) == null ? void 0 : p.markerShape) ?? ((M = e.style) == null ? void 0 : M.markerShape) ?? _.markerShape,
|
|
286
|
+
markerSize: ((f = t.style) == null ? void 0 : f.markerSize) ?? ((u = e.style) == null ? void 0 : u.markerSize) ?? _.markerSize
|
|
264
287
|
};
|
|
265
288
|
}
|
|
266
|
-
function
|
|
267
|
-
return Math.max(Se, Math.min(
|
|
289
|
+
function Le(e) {
|
|
290
|
+
return Math.max(Se, Math.min(ye, e));
|
|
268
291
|
}
|
|
269
|
-
function
|
|
270
|
-
const l = t - e, r = (e + t) / 2, s =
|
|
292
|
+
function Je(e, t, o) {
|
|
293
|
+
const l = t - e, r = (e + t) / 2, s = Le(l * o);
|
|
271
294
|
return {
|
|
272
295
|
startMs: r - s / 2,
|
|
273
296
|
endMs: r + s / 2
|
|
@@ -275,27 +298,27 @@ function Re(e, t, o) {
|
|
|
275
298
|
}
|
|
276
299
|
function Ne(e) {
|
|
277
300
|
let t = 0;
|
|
278
|
-
for (const o of e) t += (o.height ??
|
|
301
|
+
for (const o of e) t += (o.height ?? $) + W;
|
|
279
302
|
return t;
|
|
280
303
|
}
|
|
281
304
|
function We(e, t, o, l, r) {
|
|
282
305
|
const { swimLanes: s, showSwimLanes: a, scrollTop: n, startMs: m, endMs: c, theme: h } = r;
|
|
283
306
|
if (!a || s.length === 0) return null;
|
|
284
|
-
const
|
|
285
|
-
if (t < 0 || t >=
|
|
286
|
-
let
|
|
307
|
+
const p = Math.max(0, l - z);
|
|
308
|
+
if (t < 0 || t >= p) return null;
|
|
309
|
+
let M = -n;
|
|
287
310
|
for (const f of s) {
|
|
288
|
-
const u = f.height ??
|
|
289
|
-
if (
|
|
311
|
+
const u = f.height ?? $, D = M, L = M + u;
|
|
312
|
+
if (M += u + W, !(t < D || t >= L)) {
|
|
290
313
|
for (const d of f.items) {
|
|
291
314
|
if (d.interval) {
|
|
292
|
-
const
|
|
293
|
-
if (e >= Math.max(0, U) && e <= Math.min(o,
|
|
315
|
+
const w = H.JulianDate.toDate(d.interval.start).getTime(), E = H.JulianDate.toDate(d.interval.stop).getTime(), U = (w - m) / (c - m) * o, G = (E - m) / (c - m) * o;
|
|
316
|
+
if (e >= Math.max(0, U) && e <= Math.min(o, G))
|
|
294
317
|
return { lane: f, item: d };
|
|
295
318
|
}
|
|
296
319
|
if (d.instant) {
|
|
297
|
-
const
|
|
298
|
-
if (Math.abs(e -
|
|
320
|
+
const E = (H.JulianDate.toDate(d.instant).getTime() - m) / (c - m) * o, U = ue(f, d, h);
|
|
321
|
+
if (Math.abs(e - E) <= U.markerSize / 2 + 2)
|
|
299
322
|
return { lane: f, item: d };
|
|
300
323
|
}
|
|
301
324
|
}
|
|
@@ -304,25 +327,25 @@ function We(e, t, o, l, r) {
|
|
|
304
327
|
}
|
|
305
328
|
return null;
|
|
306
329
|
}
|
|
307
|
-
function
|
|
330
|
+
function Oe(e, t, o, l) {
|
|
308
331
|
const { swimLanes: r, showSwimLanes: s, scrollTop: a } = l;
|
|
309
332
|
if (!s || r.length === 0 || e > 80) return null;
|
|
310
|
-
const n = Math.max(0, o -
|
|
333
|
+
const n = Math.max(0, o - z);
|
|
311
334
|
if (t < 0 || t >= n) return null;
|
|
312
335
|
let m = -a;
|
|
313
336
|
for (const c of r) {
|
|
314
|
-
const h = c.height ??
|
|
337
|
+
const h = c.height ?? $;
|
|
315
338
|
if (t >= m && t < m + h) return c;
|
|
316
|
-
m += h +
|
|
339
|
+
m += h + W;
|
|
317
340
|
}
|
|
318
341
|
return null;
|
|
319
342
|
}
|
|
320
|
-
function
|
|
343
|
+
function Ue(e, t, o) {
|
|
321
344
|
if (!o.showSwimLanes || o.swimLanes.length === 0) return !1;
|
|
322
|
-
const l = Math.max(0, t -
|
|
345
|
+
const l = Math.max(0, t - z);
|
|
323
346
|
return e >= 0 && e < l;
|
|
324
347
|
}
|
|
325
|
-
function
|
|
348
|
+
function ve(e, t, o, l) {
|
|
326
349
|
const {
|
|
327
350
|
startMs: r,
|
|
328
351
|
endMs: s,
|
|
@@ -331,163 +354,165 @@ function Oe(e, t, o, l) {
|
|
|
331
354
|
maxTicks: m,
|
|
332
355
|
swimLanes: c,
|
|
333
356
|
showSwimLanes: h,
|
|
334
|
-
reorderState:
|
|
335
|
-
timezone:
|
|
357
|
+
reorderState: p,
|
|
358
|
+
timezone: M
|
|
336
359
|
} = l;
|
|
337
360
|
let { scrollTop: f } = l;
|
|
338
361
|
const u = (s - r) / 1e3;
|
|
339
362
|
if (u <= 0) return f;
|
|
340
363
|
e.fillStyle = n.backgroundColor, e.fillRect(0, 0, t, o);
|
|
341
|
-
const
|
|
342
|
-
let
|
|
343
|
-
if (
|
|
344
|
-
for (const i of c)
|
|
345
|
-
const
|
|
346
|
-
if (f >
|
|
364
|
+
const D = h && c.length > 0, d = D ? Math.max(0, o - z) : 0;
|
|
365
|
+
let w = 0;
|
|
366
|
+
if (D)
|
|
367
|
+
for (const i of c) w += (i.height ?? $) + W;
|
|
368
|
+
const E = Math.max(0, w - d);
|
|
369
|
+
if (f > E && (f = E), f < 0 && (f = 0), D && d > 0) {
|
|
347
370
|
e.save(), e.beginPath(), e.rect(0, 0, t, d), e.clip();
|
|
348
371
|
let i = -f;
|
|
349
|
-
const
|
|
350
|
-
for (const
|
|
351
|
-
const
|
|
372
|
+
const y = (b) => (b - r) / (s - r) * t;
|
|
373
|
+
for (const b of c) {
|
|
374
|
+
const T = b.height ?? $, C = i + T;
|
|
352
375
|
if (C > 0 && i < d) {
|
|
353
|
-
const
|
|
354
|
-
O && O !== "transparent" && (e.fillStyle = O, e.fillRect(0, i, t,
|
|
355
|
-
for (const
|
|
356
|
-
const k = ue(
|
|
357
|
-
if (
|
|
358
|
-
const K =
|
|
376
|
+
const g = b.style, O = (g == null ? void 0 : g.backgroundColor) ?? _.backgroundColor;
|
|
377
|
+
O && O !== "transparent" && (e.fillStyle = O, e.fillRect(0, i, t, T)), e.strokeStyle = n.tickColor + "44", e.lineWidth = 0.5, e.beginPath(), e.moveTo(0, C), e.lineTo(t, C), e.stroke();
|
|
378
|
+
for (const I of b.items) {
|
|
379
|
+
const k = ue(b, I, n);
|
|
380
|
+
if (I.interval) {
|
|
381
|
+
const K = H.JulianDate.toDate(I.interval.start).getTime(), A = H.JulianDate.toDate(I.interval.stop).getTime(), J = y(K), N = y(A), V = Math.max(0, J), q = Math.min(t, N) - V;
|
|
359
382
|
if (q > 0) {
|
|
360
383
|
e.globalAlpha = k.opacity, e.fillStyle = k.color;
|
|
361
|
-
const se = 3, le = i + se, ae =
|
|
384
|
+
const se = 3, le = i + se, ae = T - se * 2;
|
|
362
385
|
e.fillRect(V, le, q, ae), k.borderWidth > 0 && (e.strokeStyle = k.borderColor, e.lineWidth = k.borderWidth, e.strokeRect(V, le, q, ae)), e.globalAlpha = 1;
|
|
363
386
|
}
|
|
364
387
|
}
|
|
365
|
-
if (
|
|
366
|
-
const K =
|
|
388
|
+
if (I.instant) {
|
|
389
|
+
const K = H.JulianDate.toDate(I.instant).getTime(), A = y(K);
|
|
367
390
|
if (A >= -k.markerSize && A <= t + k.markerSize) {
|
|
368
|
-
const
|
|
369
|
-
e.globalAlpha = k.opacity, e.fillStyle = k.color, k.markerShape === "diamond" ? (e.beginPath(), e.moveTo(A,
|
|
391
|
+
const J = i + T / 2, N = k.markerSize;
|
|
392
|
+
e.globalAlpha = k.opacity, e.fillStyle = k.color, k.markerShape === "diamond" ? (e.beginPath(), e.moveTo(A, J - N / 2), e.lineTo(A + N / 2, J), e.lineTo(A, J + N / 2), e.lineTo(A - N / 2, J), e.closePath(), e.fill()) : k.markerShape === "circle" ? (e.beginPath(), e.arc(A, J, N / 2, 0, Math.PI * 2), e.fill()) : (e.strokeStyle = k.color, e.lineWidth = 2, e.beginPath(), e.moveTo(A, i + 2), e.lineTo(A, i + T - 2), e.stroke()), e.globalAlpha = 1;
|
|
370
393
|
}
|
|
371
394
|
}
|
|
372
395
|
}
|
|
373
|
-
e.font = `${Math.min(11,
|
|
396
|
+
e.font = `${Math.min(11, T - 4)}px system-ui, sans-serif`, e.textAlign = "left", e.textBaseline = "middle", e.fillStyle = (g == null ? void 0 : g.labelColor) ?? _.labelColor, e.fillText(b.label, be, i + T / 2);
|
|
374
397
|
}
|
|
375
|
-
if (i +=
|
|
398
|
+
if (i += T + W, i >= d) break;
|
|
376
399
|
}
|
|
377
|
-
if (
|
|
378
|
-
const
|
|
379
|
-
let
|
|
380
|
-
for (let
|
|
381
|
-
|
|
382
|
-
e.strokeStyle = n.indicatorColor, e.lineWidth = 2, e.beginPath(), e.moveTo(0,
|
|
383
|
-
const C = c.find((
|
|
400
|
+
if (p && p.dragging) {
|
|
401
|
+
const b = p.currentY - p.dragStartY;
|
|
402
|
+
let T = -f;
|
|
403
|
+
for (let g = 0; g < c.length && g < p.insertIndex; g++)
|
|
404
|
+
T += (c[g].height ?? $) + W;
|
|
405
|
+
e.strokeStyle = n.indicatorColor, e.lineWidth = 2, e.beginPath(), e.moveTo(0, T), e.lineTo(t, T), e.stroke();
|
|
406
|
+
const C = c.find((g) => g.id === p.dragLaneId);
|
|
384
407
|
if (C) {
|
|
385
|
-
const
|
|
408
|
+
const g = C.height ?? $;
|
|
386
409
|
let O = -f;
|
|
387
|
-
for (const
|
|
388
|
-
if (
|
|
389
|
-
O += (
|
|
410
|
+
for (const I of c) {
|
|
411
|
+
if (I.id === p.dragLaneId) break;
|
|
412
|
+
O += (I.height ?? $) + W;
|
|
390
413
|
}
|
|
391
|
-
e.globalAlpha = 0.4, e.fillStyle = n.indicatorColor, e.fillRect(0, O +
|
|
414
|
+
e.globalAlpha = 0.4, e.fillStyle = n.indicatorColor, e.fillRect(0, O + b, t, g), e.globalAlpha = 1;
|
|
392
415
|
}
|
|
393
416
|
}
|
|
394
|
-
if (
|
|
395
|
-
const
|
|
396
|
-
e.fillStyle = n.tickColor + "22", e.fillRect(
|
|
417
|
+
if (w > d) {
|
|
418
|
+
const b = t - Q - 2, T = d / w, C = Math.max(20, d * T), g = f / E * (d - C);
|
|
419
|
+
e.fillStyle = n.tickColor + "22", e.fillRect(b, 0, Q, d), e.fillStyle = n.tickColor + "88", e.fillRect(b, g, Q, C);
|
|
397
420
|
}
|
|
398
421
|
e.restore();
|
|
399
422
|
}
|
|
400
423
|
e.font = `${n.fontSize}px monospace`;
|
|
401
|
-
const U = me(r + u * 500, u,
|
|
402
|
-
let
|
|
424
|
+
const U = me(r + u * 500, u, M), G = e.measureText(U).width + 24, he = Math.max(G / t * u, u / 1e3);
|
|
425
|
+
let P = S[S.length - 1], v = S.length - 1;
|
|
403
426
|
for (let i = 0; i < S.length; i++)
|
|
404
427
|
if (S[i] > he) {
|
|
405
|
-
|
|
428
|
+
P = S[i], v = i;
|
|
406
429
|
break;
|
|
407
430
|
}
|
|
408
431
|
if (m != null && m > 0)
|
|
409
|
-
for (;
|
|
410
|
-
|
|
411
|
-
let
|
|
412
|
-
for (let i =
|
|
413
|
-
if (
|
|
414
|
-
t * (S[i] / u) >= 3 && (
|
|
432
|
+
for (; v < S.length - 1 && u / P > m; )
|
|
433
|
+
v++, P = S[v];
|
|
434
|
+
let R = 0;
|
|
435
|
+
for (let i = v - 1; i >= 0; i--)
|
|
436
|
+
if (P % S[i] < 1e-4) {
|
|
437
|
+
t * (S[i] / u) >= 3 && (R = S[i]);
|
|
415
438
|
break;
|
|
416
439
|
}
|
|
417
|
-
let
|
|
418
|
-
if (
|
|
419
|
-
for (let i = 0; i < S.length && S[i] <
|
|
420
|
-
if (
|
|
421
|
-
|
|
440
|
+
let B = 0;
|
|
441
|
+
if (R > 0) {
|
|
442
|
+
for (let i = 0; i < S.length && S[i] < R; i++)
|
|
443
|
+
if (R % S[i] < 1e-4 && t * (S[i] / u) >= 3) {
|
|
444
|
+
B = S[i];
|
|
422
445
|
break;
|
|
423
446
|
}
|
|
424
447
|
}
|
|
425
|
-
const ne =
|
|
426
|
-
if (
|
|
448
|
+
const ne = De(r, u, M), j = (r - ne) / 1e3, X = j + u, Z = (i) => t * ((i - j) / u);
|
|
449
|
+
if (B > 0) {
|
|
427
450
|
e.strokeStyle = n.tickColor, e.lineWidth = 1;
|
|
428
|
-
for (let i = Math.floor(j /
|
|
429
|
-
const
|
|
430
|
-
e.beginPath(), e.moveTo(
|
|
451
|
+
for (let i = Math.floor(j / B) * B; i <= X; i = ee(i, B)) {
|
|
452
|
+
const y = Z(i);
|
|
453
|
+
e.beginPath(), e.moveTo(y, o - n.minorTickHeight), e.lineTo(y, o), e.stroke();
|
|
431
454
|
}
|
|
432
455
|
}
|
|
433
|
-
if (
|
|
456
|
+
if (R > 0) {
|
|
434
457
|
e.strokeStyle = n.tickColor, e.lineWidth = 1;
|
|
435
|
-
for (let i = Math.floor(j /
|
|
436
|
-
const
|
|
437
|
-
e.beginPath(), e.moveTo(
|
|
458
|
+
for (let i = Math.floor(j / R) * R; i <= X; i = ee(i, R)) {
|
|
459
|
+
const y = Z(i);
|
|
460
|
+
e.beginPath(), e.moveTo(y, o - n.minorTickHeight), e.lineTo(y, o), e.stroke();
|
|
438
461
|
}
|
|
439
462
|
}
|
|
440
463
|
e.textAlign = "center", e.textBaseline = "bottom";
|
|
441
464
|
let re = -1 / 0;
|
|
442
|
-
for (let i = Math.floor(j /
|
|
443
|
-
const
|
|
444
|
-
e.strokeStyle = n.majorTickColor, e.lineWidth = 1, e.beginPath(), e.moveTo(
|
|
445
|
-
const
|
|
446
|
-
|
|
465
|
+
for (let i = Math.floor(j / P) * P; i <= X + P; i = ee(i, P)) {
|
|
466
|
+
const y = Z(i), b = ne + i * 1e3;
|
|
467
|
+
e.strokeStyle = n.majorTickColor, e.lineWidth = 1, e.beginPath(), e.moveTo(y, o - n.majorTickHeight), e.lineTo(y, o), e.stroke();
|
|
468
|
+
const T = me(b, u, M), C = e.measureText(T).width, g = y - C / 2;
|
|
469
|
+
g > re && (e.fillStyle = n.labelColor, e.fillText(T, y, o - n.majorTickHeight - 4), re = g + C + 5);
|
|
447
470
|
}
|
|
448
471
|
const ie = (a - r) / (s - r) * t;
|
|
449
472
|
return e.strokeStyle = n.indicatorColor, e.lineWidth = n.indicatorLineWidth, e.beginPath(), e.moveTo(ie, 0), e.lineTo(ie, o), e.stroke(), f;
|
|
450
473
|
}
|
|
451
474
|
export {
|
|
452
|
-
|
|
475
|
+
He as DEFAULT_LABELS,
|
|
476
|
+
$ as DEFAULT_LANE_HEIGHT,
|
|
453
477
|
fe as DateTimeFormats,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
478
|
+
be as LABEL_PAD_LEFT,
|
|
479
|
+
W as LANE_GAP,
|
|
480
|
+
ye as MAX_SPAN_MS,
|
|
457
481
|
Se as MIN_SPAN_MS,
|
|
458
482
|
x as MONTHS,
|
|
459
483
|
Q as SCROLLBAR_WIDTH,
|
|
460
|
-
|
|
461
|
-
|
|
484
|
+
Fe as SWIM_LANE_SCROLL_SPEED,
|
|
485
|
+
z as TICK_AREA_HEIGHT,
|
|
462
486
|
S as TIC_SCALES,
|
|
463
487
|
ce as TickInterval,
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
488
|
+
we as Timezones,
|
|
489
|
+
De as calcEpochMs,
|
|
490
|
+
Le as clampSpan,
|
|
491
|
+
_ as defaultSwimLaneStyle,
|
|
492
|
+
Ce as defaultTheme,
|
|
493
|
+
ve as drawTimeline,
|
|
494
|
+
ge as formatDateTime,
|
|
495
|
+
Pe as formatTime,
|
|
496
|
+
Ye as fromMilliseconds,
|
|
473
497
|
_e as generateTicks,
|
|
474
498
|
oe as getDateParts,
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
499
|
+
pe as getDurationMs,
|
|
500
|
+
Ee as getTimezoneAbbr,
|
|
501
|
+
Oe as hitTestLaneLabel,
|
|
478
502
|
We as hitTestSwimLane,
|
|
479
|
-
|
|
503
|
+
Ue as isInSwimLaneRegion,
|
|
480
504
|
me as makeLabel,
|
|
481
505
|
ee as nextTic,
|
|
482
|
-
|
|
506
|
+
Re as positionToTime,
|
|
483
507
|
ue as resolveItemStyle,
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
508
|
+
ke as resolveLabel,
|
|
509
|
+
$e as snapToTick,
|
|
510
|
+
Ie as splitForDisplay,
|
|
511
|
+
Te as timeToPosition,
|
|
487
512
|
te as toDate,
|
|
488
|
-
|
|
489
|
-
|
|
513
|
+
Ae as toJulianDate,
|
|
514
|
+
F as toMilliseconds,
|
|
490
515
|
Ne as totalSwimLaneHeight,
|
|
491
516
|
Y as twoD,
|
|
492
|
-
|
|
517
|
+
Je as zoomRange
|
|
493
518
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],B):(a=typeof globalThis<"u"?globalThis:a||self,B(a.CesiumTimelineCore={},a.Cesium))})(this,(function(a,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 l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const L=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 x=(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))(x||{});const E={color:"#4da6ff",borderColor:"#2980b9",borderWidth:1,opacity:.8,markerShape:"diamond",markerSize:10,labelColor:"#cccccc",backgroundColor:"transparent"},I=24;function ke(e){return e instanceof L.JulianDate?L.JulianDate.clone(e):L.JulianDate.fromDate(e)}function K(e){return e instanceof L.JulianDate?L.JulianDate.toDate(e):e}function P(e){return K(e).getTime()}function Ae(e){return L.JulianDate.fromDate(new Date(e))}function me(e,t){return P(t)-P(e)}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_e=["January","February","March","April","May","June","July","August","September","October","November","December"],ee={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"},Ye={LOCAL:"local",UTC:"UTC"};function Z(e,t){if(!t||t==="local"){const T=e.getFullYear(),u=e.getMonth(),h=e.getDate(),H=e.getHours(),k=H%12||12,d=e.getMinutes(),w=e.getSeconds(),N=e.getMilliseconds();return{yr:T,mo:u,day:h,hr24:H,hr12:k,min:d,sec:w,ms:N,ampm:H<12?"AM":"PM"}}const o=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),l={};for(const T of o.formatToParts(e))T.type!=="literal"&&(l[T.type]=T.value);const i=parseInt(l.year),s=parseInt(l.month)-1,m=parseInt(l.day);let n=parseInt(l.hour);n===24&&(n=0);const c=n%12||12,f=parseInt(l.minute),M=parseInt(l.second),g=e.getMilliseconds();return{yr:i,mo:s,day:m,hr24:n,hr12:c,min:f,sec:M,ms:g,ampm:n<12?"AM":"PM"}}function Ee(e,t){var i;if(!t||t==="local")return null;const o=K(e);return((i=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"short"}).formatToParts(o).find(s=>s.type==="timeZoneName"))==null?void 0:i.value)??null}function ce(e,t=ee.DEFAULT,o){const l=K(e),{yr:i,mo:s,day:m,hr24:n,hr12:c,min:f,sec:M,ms:g,ampm:T}=Z(l,o),u=k=>String(k).padStart(2,"0"),h=k=>String(k).padStart(3,"0"),H={YYYY:String(i),YY:String(i).slice(-2),MMMM:_e[s],MMM:Ce[s],MM:u(s+1),M:String(s+1),DD:u(m),D:String(m),HH:u(n),H:String(n),hh:u(c),h:String(c),mm:u(f),ss:u(M),SSS:h(g),A:T,a:T.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,k=>H[k]??k)}function Ie(e=ee.DEFAULT){const t=["YYYY","YY","MMMM","MMM","MM","M","DD","D"],o=["HH","H","hh","h","mm","ss","SSS","A","a"],l=m=>m.replace(/\s{2,}/g," ").trim().replace(/^[\s\W]+|[\s\W]+$/g,"").trim();let i=e;for(const m of t)i=i.replace(m,"");let s=e;for(const m of o)s=s.replace(m,"");return{timeFormat:l(i),dateFormat:l(s)}}function Pe(e,t=!1){return ce(e,t?"HH:mm:ss":"HH:mm")}function fe(e,t,o,l){const i=P(e),s=P(t),m=P(o);if(m===s)return 0;const n=(i-s)/(m-s);return Math.max(0,Math.min(1,n))*l}function we(e,t,o,l){const i=Math.max(0,Math.min(1,e/l)),s=P(t),m=P(o),n=s+i*(m-s);return L.JulianDate.fromDate(new Date(n))}function Ne(e,t,o,l){const i=[],s=me(e,t),m=P(e);let n;typeof o=="number"&&o in x||typeof o=="number"?n=o*60*1e3:n=3600*1e3;const c=n*4;let f=m,M=0;for(;f<=m+s;){const g=M*n%c===0,T=fe(new Date(f),e,t,l);let u;if(g){const h=new Date(f),H=h.getHours().toString().padStart(2,"0"),k=h.getMinutes().toString().padStart(2,"0");u=`${H}:${k}`}i.push({position:T,isMajor:g,label:u}),f+=n,M++}return i}function Re(e,t,o=10){let l=t[0],i=Math.abs(l.position-e);for(const s of t){const m=Math.abs(s.position-e);m<i&&(i=m,l=s)}return i<=o?l.position:e}const ue=1e3,he=31536e9,b=[.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,O=1,Me=6,q=6,Oe=.3,V=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(e){return e<10?`0${e}`:`${e}`}function te(e,t,o){const l=new Date(e),{yr:i,mo:s,day:m,hr24:n,min:c,sec:f,ms:M}=Z(l,o);if(t>31536e4)return`${i}`;if(t>31536e3)return`${V[s]} ${i}`;if(t>604800)return`${V[s]} ${m}`;if(t>86400)return`${V[s]} ${m} ${_(n)}:${_(c)}`;if(t>3600)return`${_(n)}:${_(c)}`;if(t>60)return`${_(n)}:${_(c)}:${_(f)}`;const g=M>0?`.${String(M).padStart(3,"0")}`:"";return`${_(n)}:${_(c)}:${_(f)}${g}`}function ge(e,t,o){const l=new Date(e);if(!o||o==="local"){const c=l.getFullYear(),f=l.getMonth(),M=l.getDate();return t>31536e4?new Date(Math.floor(c/100)*100,0).getTime():t>31536e3?new Date(Math.floor(c/10)*10,0).getTime():t>86400?new Date(c,0).getTime():new Date(c,f,M).getTime()}const{yr:i,hr24:s,min:m,sec:n}=Z(l,o);return t>31536e4?Date.UTC(Math.floor(i/100)*100,0,1):t>31536e3?Date.UTC(Math.floor(i/10)*10,0,1):t>86400?Date.UTC(i,0,1):e-(s*3600+m*60+n)*1e3}function Q(e,t){return Math.ceil(e/t+.5)*t}function oe(e,t,o){var l,i,s,m,n,c,f,M,g,T,u,h;return{color:((l=t.style)==null?void 0:l.color)??((i=e.style)==null?void 0:i.color)??E.color,borderColor:((s=t.style)==null?void 0:s.borderColor)??((m=e.style)==null?void 0:m.borderColor)??(o==null?void 0:o.swimLaneItemBorderColor)??E.borderColor,borderWidth:((n=t.style)==null?void 0:n.borderWidth)??((c=e.style)==null?void 0:c.borderWidth)??(o==null?void 0:o.swimLaneItemBorderWidth)??E.borderWidth,opacity:((f=t.style)==null?void 0:f.opacity)??((M=e.style)==null?void 0:M.opacity)??E.opacity,markerShape:((g=t.style)==null?void 0:g.markerShape)??((T=e.style)==null?void 0:T.markerShape)??E.markerShape,markerSize:((u=t.style)==null?void 0:u.markerSize)??((h=e.style)==null?void 0:h.markerSize)??E.markerSize}}function Te(e){return Math.max(ue,Math.min(he,e))}function Fe(e,t,o){const l=t-e,i=(e+t)/2,s=Te(l*o);return{startMs:i-s/2,endMs:i+s/2}}function We(e){let t=0;for(const o of e)t+=(o.height??I)+O;return t}function $e(e,t,o,l,i){const{swimLanes:s,showSwimLanes:m,scrollTop:n,startMs:c,endMs:f,theme:M}=i;if(!m||s.length===0)return null;const g=Math.max(0,l-z);if(t<0||t>=g)return null;let T=-n;for(const u of s){const h=u.height??I,H=T,k=T+h;if(T+=h+O,!(t<H||t>=k)){for(const d of u.items){if(d.interval){const w=L.JulianDate.toDate(d.interval.start).getTime(),N=L.JulianDate.toDate(d.interval.stop).getTime(),j=(w-c)/(f-c)*o,ne=(N-c)/(f-c)*o;if(e>=Math.max(0,j)&&e<=Math.min(o,ne))return{lane:u,item:d}}if(d.instant){const N=(L.JulianDate.toDate(d.instant).getTime()-c)/(f-c)*o,j=oe(u,d,M);if(Math.abs(e-N)<=j.markerSize/2+2)return{lane:u,item:d}}}return null}}return null}function Je(e,t,o,l){const{swimLanes:i,showSwimLanes:s,scrollTop:m}=l;if(!s||i.length===0||e>80)return null;const n=Math.max(0,o-z);if(t<0||t>=n)return null;let c=-m;for(const f of i){const M=f.height??I;if(t>=c&&t<c+M)return f;c+=M+O}return null}function Ue(e,t,o){if(!o.showSwimLanes||o.swimLanes.length===0)return!1;const l=Math.max(0,t-z);return e>=0&&e<l}function Be(e,t,o,l){const{startMs:i,endMs:s,currentMs:m,theme:n,maxTicks:c,swimLanes:f,showSwimLanes:M,reorderState:g,timezone:T}=l;let{scrollTop:u}=l;const h=(s-i)/1e3;if(h<=0)return u;e.fillStyle=n.backgroundColor,e.fillRect(0,0,t,o);const H=M&&f.length>0,d=H?Math.max(0,o-z):0;let w=0;if(H)for(const r of f)w+=(r.height??I)+O;const N=Math.max(0,w-d);if(u>N&&(u=N),u<0&&(u=0),H&&d>0){e.save(),e.beginPath(),e.rect(0,0,t,d),e.clip();let r=-u;const y=p=>(p-i)/(s-i)*t;for(const p of f){const D=p.height??I,C=r+D;if(C>0&&r<d){const S=p.style,U=(S==null?void 0:S.backgroundColor)??E.backgroundColor;U&&U!=="transparent"&&(e.fillStyle=U,e.fillRect(0,r,t,D)),e.strokeStyle=n.tickColor+"44",e.lineWidth=.5,e.beginPath(),e.moveTo(0,C),e.lineTo(t,C),e.stroke();for(const R of p.items){const A=oe(p,R,n);if(R.interval){const ae=L.JulianDate.toDate(R.interval.start).getTime(),Y=L.JulianDate.toDate(R.interval.stop).getTime(),$=y(ae),J=y(Y),le=Math.max(0,$),se=Math.min(t,J)-le;if(se>0){e.globalAlpha=A.opacity,e.fillStyle=A.color;const De=3,ye=r+De,pe=D-De*2;e.fillRect(le,ye,se,pe),A.borderWidth>0&&(e.strokeStyle=A.borderColor,e.lineWidth=A.borderWidth,e.strokeRect(le,ye,se,pe)),e.globalAlpha=1}}if(R.instant){const ae=L.JulianDate.toDate(R.instant).getTime(),Y=y(ae);if(Y>=-A.markerSize&&Y<=t+A.markerSize){const $=r+D/2,J=A.markerSize;e.globalAlpha=A.opacity,e.fillStyle=A.color,A.markerShape==="diamond"?(e.beginPath(),e.moveTo(Y,$-J/2),e.lineTo(Y+J/2,$),e.lineTo(Y,$+J/2),e.lineTo(Y-J/2,$),e.closePath(),e.fill()):A.markerShape==="circle"?(e.beginPath(),e.arc(Y,$,J/2,0,Math.PI*2),e.fill()):(e.strokeStyle=A.color,e.lineWidth=2,e.beginPath(),e.moveTo(Y,r+2),e.lineTo(Y,r+D-2),e.stroke()),e.globalAlpha=1}}}e.font=`${Math.min(11,D-4)}px system-ui, sans-serif`,e.textAlign="left",e.textBaseline="middle",e.fillStyle=(S==null?void 0:S.labelColor)??E.labelColor,e.fillText(p.label,Me,r+D/2)}if(r+=D+O,r>=d)break}if(g&&g.dragging){const p=g.currentY-g.dragStartY;let D=-u;for(let S=0;S<f.length&&S<g.insertIndex;S++)D+=(f[S].height??I)+O;e.strokeStyle=n.indicatorColor,e.lineWidth=2,e.beginPath(),e.moveTo(0,D),e.lineTo(t,D),e.stroke();const C=f.find(S=>S.id===g.dragLaneId);if(C){const S=C.height??I;let U=-u;for(const R of f){if(R.id===g.dragLaneId)break;U+=(R.height??I)+O}e.globalAlpha=.4,e.fillStyle=n.indicatorColor,e.fillRect(0,U+p,t,S),e.globalAlpha=1}}if(w>d){const p=t-q-2,D=d/w,C=Math.max(20,d*D),S=u/N*(d-C);e.fillStyle=n.tickColor+"22",e.fillRect(p,0,q,d),e.fillStyle=n.tickColor+"88",e.fillRect(p,S,q,C)}e.restore()}e.font=`${n.fontSize}px monospace`;const j=te(i+h*500,h,T),ne=e.measureText(j).width+24,ze=Math.max(ne/t*h,h/1e3);let F=b[b.length-1],v=b.length-1;for(let r=0;r<b.length;r++)if(b[r]>ze){F=b[r],v=r;break}if(c!=null&&c>0)for(;v<b.length-1&&h/F>c;)v++,F=b[v];let W=0;for(let r=v-1;r>=0;r--)if(F%b[r]<1e-4){t*(b[r]/h)>=3&&(W=b[r]);break}let G=0;if(W>0){for(let r=0;r<b.length&&b[r]<W;r++)if(W%b[r]<1e-4&&t*(b[r]/h)>=3){G=b[r];break}}const de=ge(i,h,T),X=(i-de)/1e3,ie=X+h,re=r=>t*((r-X)/h);if(G>0){e.strokeStyle=n.tickColor,e.lineWidth=1;for(let r=Math.floor(X/G)*G;r<=ie;r=Q(r,G)){const y=re(r);e.beginPath(),e.moveTo(y,o-n.minorTickHeight),e.lineTo(y,o),e.stroke()}}if(W>0){e.strokeStyle=n.tickColor,e.lineWidth=1;for(let r=Math.floor(X/W)*W;r<=ie;r=Q(r,W)){const y=re(r);e.beginPath(),e.moveTo(y,o-n.minorTickHeight),e.lineTo(y,o),e.stroke()}}e.textAlign="center",e.textBaseline="bottom";let Se=-1/0;for(let r=Math.floor(X/F)*F;r<=ie+F;r=Q(r,F)){const y=re(r),p=de+r*1e3;e.strokeStyle=n.majorTickColor,e.lineWidth=1,e.beginPath(),e.moveTo(y,o-n.majorTickHeight),e.lineTo(y,o),e.stroke();const D=te(p,h,T),C=e.measureText(D).width,S=y-C/2;S>Se&&(e.fillStyle=n.labelColor,e.fillText(D,y,o-n.majorTickHeight-4),Se=S+C+5)}const be=(m-i)/(s-i)*t;return e.strokeStyle=n.indicatorColor,e.lineWidth=n.indicatorLineWidth,e.beginPath(),e.moveTo(be,0),e.lineTo(be,o),e.stroke(),u}a.DEFAULT_LANE_HEIGHT=I,a.DateTimeFormats=ee,a.LABEL_PAD_LEFT=Me,a.LANE_GAP=O,a.MAX_SPAN_MS=he,a.MIN_SPAN_MS=ue,a.MONTHS=V,a.SCROLLBAR_WIDTH=q,a.SWIM_LANE_SCROLL_SPEED=Oe,a.TICK_AREA_HEIGHT=z,a.TIC_SCALES=b,a.TickInterval=x,a.Timezones=Ye,a.calcEpochMs=ge,a.clampSpan=Te,a.defaultSwimLaneStyle=E,a.defaultTheme=He,a.drawTimeline=Be,a.formatDateTime=ce,a.formatTime=Pe,a.fromMilliseconds=Ae,a.generateTicks=Ne,a.getDateParts=Z,a.getDurationMs=me,a.getTimezoneAbbr=Ee,a.hitTestLaneLabel=Je,a.hitTestSwimLane=$e,a.isInSwimLaneRegion=Ue,a.makeLabel=te,a.nextTic=Q,a.positionToTime=we,a.resolveItemStyle=oe,a.snapToTick=Re,a.splitForDisplay=Ie,a.timeToPosition=fe,a.toDate=K,a.toJulianDate=ke,a.toMilliseconds=P,a.totalSwimLaneHeight=We,a.twoD=_,a.zoomRange=Fe,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(i,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(i.CesiumTimelineCore={},i.Cesium))})(this,(function(i,U){"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 l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const L=Le(U);function Ae(e,t){return typeof e=="function"?e(t):e}const He={dateTimeClickTooltip:"Click to jump to a date/time",liveLabel:"LIVE",liveActiveLabel:"● LIVE",liveTooltip:"Jump to live (now)",liveActiveTooltip:"Currently live",resetSpeedTooltip:"Reset to 1× speed",jumpToStartTooltip:"Jump to start",noStartTimeTooltip:"No start time set",jumpToEndTooltip:"Jump to end",noEndTimeTooltip:"No end time set",rewindTooltip:"Rewind",rewindActiveTooltip:e=>`Reverse ${e}× — click to speed up, press play to stop`,playTooltip:"Play",playFromRewindTooltip:"Play (reset to 1×)",pauseTooltip:"Pause",fastForwardTooltip:"Fast forward",fastForwardActiveTooltip:e=>`${e}× speed — click to increase, click again at max to reset`,collapseSwimLanesTooltip:"Collapse swim lanes",expandSwimLanesTooltip:"Expand swim lanes"},ke={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 x=(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))(x||{});const w={color:"#4da6ff",borderColor:"#2980b9",borderWidth:1,opacity:.8,markerShape:"diamond",markerSize:10,labelColor:"#cccccc",backgroundColor:"transparent"},Y=24;function Ce(e){return e instanceof L.JulianDate?L.JulianDate.clone(e):L.JulianDate.fromDate(e)}function K(e){return e instanceof L.JulianDate?L.JulianDate.toDate(e):e}function I(e){return K(e).getTime()}function Ee(e){return L.JulianDate.fromDate(new Date(e))}function me(e,t){return I(t)-I(e)}const _e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],we=["January","February","March","April","May","June","July","August","September","October","November","December"],ee={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"},Ye={LOCAL:"local",UTC:"UTC"};function Z(e,t){if(!t||t==="local"){const M=e.getFullYear(),u=e.getMonth(),h=e.getDate(),A=e.getHours(),H=A%12||12,g=e.getMinutes(),P=e.getSeconds(),R=e.getMilliseconds();return{yr:M,mo:u,day:h,hr24:A,hr12:H,min:g,sec:P,ms:R,ampm:A<12?"AM":"PM"}}const o=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),l={};for(const M of o.formatToParts(e))M.type!=="literal"&&(l[M.type]=M.value);const r=parseInt(l.year),s=parseInt(l.month)-1,m=parseInt(l.day);let n=parseInt(l.hour);n===24&&(n=0);const c=n%12||12,f=parseInt(l.minute),T=parseInt(l.second),d=e.getMilliseconds();return{yr:r,mo:s,day:m,hr24:n,hr12:c,min:f,sec:T,ms:d,ampm:n<12?"AM":"PM"}}function Ie(e,t){var r;if(!t||t==="local")return null;const o=K(e);return((r=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"short"}).formatToParts(o).find(s=>s.type==="timeZoneName"))==null?void 0:r.value)??null}function ce(e,t=ee.DEFAULT,o){const l=K(e),{yr:r,mo:s,day:m,hr24:n,hr12:c,min:f,sec:T,ms:d,ampm:M}=Z(l,o),u=H=>String(H).padStart(2,"0"),h=H=>String(H).padStart(3,"0"),A={YYYY:String(r),YY:String(r).slice(-2),MMMM:we[s],MMM:_e[s],MM:u(s+1),M:String(s+1),DD:u(m),D:String(m),HH:u(n),H:String(n),hh:u(c),h:String(c),mm:u(f),ss:u(T),SSS:h(d),A:M,a:M.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,H=>A[H]??H)}function Pe(e=ee.DEFAULT){const t=["YYYY","YY","MMMM","MMM","MM","M","DD","D"],o=["HH","H","hh","h","mm","ss","SSS","A","a"],l=m=>m.replace(/\s{2,}/g," ").trim().replace(/^[\s\W]+|[\s\W]+$/g,"").trim();let r=e;for(const m of t)r=r.replace(m,"");let s=e;for(const m of o)s=s.replace(m,"");return{timeFormat:l(r),dateFormat:l(s)}}function Re(e,t=!1){return ce(e,t?"HH:mm:ss":"HH:mm")}function fe(e,t,o,l){const r=I(e),s=I(t),m=I(o);if(m===s)return 0;const n=(r-s)/(m-s);return Math.max(0,Math.min(1,n))*l}function Ne(e,t,o,l){const r=Math.max(0,Math.min(1,e/l)),s=I(t),m=I(o),n=s+r*(m-s);return L.JulianDate.fromDate(new Date(n))}function Fe(e,t,o,l){const r=[],s=me(e,t),m=I(e);let n;typeof o=="number"&&o in x||typeof o=="number"?n=o*60*1e3:n=3600*1e3;const c=n*4;let f=m,T=0;for(;f<=m+s;){const d=T*n%c===0,M=fe(new Date(f),e,t,l);let u;if(d){const h=new Date(f),A=h.getHours().toString().padStart(2,"0"),H=h.getMinutes().toString().padStart(2,"0");u=`${A}:${H}`}r.push({position:M,isMajor:d,label:u}),f+=n,T++}return r}function Oe(e,t,o=10){let l=t[0],r=Math.abs(l.position-e);for(const s of t){const m=Math.abs(s.position-e);m<r&&(r=m,l=s)}return r<=o?l.position:e}const ue=1e3,he=31536e9,p=[.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],B=36,F=1,Te=6,V=6,$e=.3,q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e){return e<10?`0${e}`:`${e}`}function te(e,t,o){const l=new Date(e),{yr:r,mo:s,day:m,hr24:n,min:c,sec:f,ms:T}=Z(l,o);if(t>31536e4)return`${r}`;if(t>31536e3)return`${q[s]} ${r}`;if(t>604800)return`${q[s]} ${m}`;if(t>86400)return`${q[s]} ${m} ${E(n)}:${E(c)}`;if(t>3600)return`${E(n)}:${E(c)}`;if(t>60)return`${E(n)}:${E(c)}:${E(f)}`;const d=T>0?`.${String(T).padStart(3,"0")}`:"";return`${E(n)}:${E(c)}:${E(f)}${d}`}function de(e,t,o){const l=new Date(e);if(!o||o==="local"){const c=l.getFullYear(),f=l.getMonth(),T=l.getDate();return t>31536e4?new Date(Math.floor(c/100)*100,0).getTime():t>31536e3?new Date(Math.floor(c/10)*10,0).getTime():t>86400?new Date(c,0).getTime():new Date(c,f,T).getTime()}const{yr:r,hr24:s,min:m,sec:n}=Z(l,o);return t>31536e4?Date.UTC(Math.floor(r/100)*100,0,1):t>31536e3?Date.UTC(Math.floor(r/10)*10,0,1):t>86400?Date.UTC(r,0,1):e-(s*3600+m*60+n)*1e3}function Q(e,t){return Math.ceil(e/t+.5)*t}function oe(e,t,o){var l,r,s,m,n,c,f,T,d,M,u,h;return{color:((l=t.style)==null?void 0:l.color)??((r=e.style)==null?void 0:r.color)??w.color,borderColor:((s=t.style)==null?void 0:s.borderColor)??((m=e.style)==null?void 0:m.borderColor)??(o==null?void 0:o.swimLaneItemBorderColor)??w.borderColor,borderWidth:((n=t.style)==null?void 0:n.borderWidth)??((c=e.style)==null?void 0:c.borderWidth)??(o==null?void 0:o.swimLaneItemBorderWidth)??w.borderWidth,opacity:((f=t.style)==null?void 0:f.opacity)??((T=e.style)==null?void 0:T.opacity)??w.opacity,markerShape:((d=t.style)==null?void 0:d.markerShape)??((M=e.style)==null?void 0:M.markerShape)??w.markerShape,markerSize:((u=t.style)==null?void 0:u.markerSize)??((h=e.style)==null?void 0:h.markerSize)??w.markerSize}}function Me(e){return Math.max(ue,Math.min(he,e))}function Je(e,t,o){const l=t-e,r=(e+t)/2,s=Me(l*o);return{startMs:r-s/2,endMs:r+s/2}}function We(e){let t=0;for(const o of e)t+=(o.height??Y)+F;return t}function ve(e,t,o,l,r){const{swimLanes:s,showSwimLanes:m,scrollTop:n,startMs:c,endMs:f,theme:T}=r;if(!m||s.length===0)return null;const d=Math.max(0,l-B);if(t<0||t>=d)return null;let M=-n;for(const u of s){const h=u.height??Y,A=M,H=M+h;if(M+=h+F,!(t<A||t>=H)){for(const g of u.items){if(g.interval){const P=L.JulianDate.toDate(g.interval.start).getTime(),R=L.JulianDate.toDate(g.interval.stop).getTime(),j=(P-c)/(f-c)*o,ne=(R-c)/(f-c)*o;if(e>=Math.max(0,j)&&e<=Math.min(o,ne))return{lane:u,item:g}}if(g.instant){const R=(L.JulianDate.toDate(g.instant).getTime()-c)/(f-c)*o,j=oe(u,g,T);if(Math.abs(e-R)<=j.markerSize/2+2)return{lane:u,item:g}}}return null}}return null}function Ue(e,t,o,l){const{swimLanes:r,showSwimLanes:s,scrollTop:m}=l;if(!s||r.length===0||e>80)return null;const n=Math.max(0,o-B);if(t<0||t>=n)return null;let c=-m;for(const f of r){const T=f.height??Y;if(t>=c&&t<c+T)return f;c+=T+F}return null}function Be(e,t,o){if(!o.showSwimLanes||o.swimLanes.length===0)return!1;const l=Math.max(0,t-B);return e>=0&&e<l}function je(e,t,o,l){const{startMs:r,endMs:s,currentMs:m,theme:n,maxTicks:c,swimLanes:f,showSwimLanes:T,reorderState:d,timezone:M}=l;let{scrollTop:u}=l;const h=(s-r)/1e3;if(h<=0)return u;e.fillStyle=n.backgroundColor,e.fillRect(0,0,t,o);const A=T&&f.length>0,g=A?Math.max(0,o-B):0;let P=0;if(A)for(const a of f)P+=(a.height??Y)+F;const R=Math.max(0,P-g);if(u>R&&(u=R),u<0&&(u=0),A&&g>0){e.save(),e.beginPath(),e.rect(0,0,t,g),e.clip();let a=-u;const y=D=>(D-r)/(s-r)*t;for(const D of f){const b=D.height??Y,C=a+b;if(C>0&&a<g){const S=D.style,v=(S==null?void 0:S.backgroundColor)??w.backgroundColor;v&&v!=="transparent"&&(e.fillStyle=v,e.fillRect(0,a,t,b)),e.strokeStyle=n.tickColor+"44",e.lineWidth=.5,e.beginPath(),e.moveTo(0,C),e.lineTo(t,C),e.stroke();for(const N of D.items){const k=oe(D,N,n);if(N.interval){const ae=L.JulianDate.toDate(N.interval.start).getTime(),_=L.JulianDate.toDate(N.interval.stop).getTime(),J=y(ae),W=y(_),le=Math.max(0,J),se=Math.min(t,W)-le;if(se>0){e.globalAlpha=k.opacity,e.fillStyle=k.color;const be=3,ye=a+be,De=b-be*2;e.fillRect(le,ye,se,De),k.borderWidth>0&&(e.strokeStyle=k.borderColor,e.lineWidth=k.borderWidth,e.strokeRect(le,ye,se,De)),e.globalAlpha=1}}if(N.instant){const ae=L.JulianDate.toDate(N.instant).getTime(),_=y(ae);if(_>=-k.markerSize&&_<=t+k.markerSize){const J=a+b/2,W=k.markerSize;e.globalAlpha=k.opacity,e.fillStyle=k.color,k.markerShape==="diamond"?(e.beginPath(),e.moveTo(_,J-W/2),e.lineTo(_+W/2,J),e.lineTo(_,J+W/2),e.lineTo(_-W/2,J),e.closePath(),e.fill()):k.markerShape==="circle"?(e.beginPath(),e.arc(_,J,W/2,0,Math.PI*2),e.fill()):(e.strokeStyle=k.color,e.lineWidth=2,e.beginPath(),e.moveTo(_,a+2),e.lineTo(_,a+b-2),e.stroke()),e.globalAlpha=1}}}e.font=`${Math.min(11,b-4)}px system-ui, sans-serif`,e.textAlign="left",e.textBaseline="middle",e.fillStyle=(S==null?void 0:S.labelColor)??w.labelColor,e.fillText(D.label,Te,a+b/2)}if(a+=b+F,a>=g)break}if(d&&d.dragging){const D=d.currentY-d.dragStartY;let b=-u;for(let S=0;S<f.length&&S<d.insertIndex;S++)b+=(f[S].height??Y)+F;e.strokeStyle=n.indicatorColor,e.lineWidth=2,e.beginPath(),e.moveTo(0,b),e.lineTo(t,b),e.stroke();const C=f.find(S=>S.id===d.dragLaneId);if(C){const S=C.height??Y;let v=-u;for(const N of f){if(N.id===d.dragLaneId)break;v+=(N.height??Y)+F}e.globalAlpha=.4,e.fillStyle=n.indicatorColor,e.fillRect(0,v+D,t,S),e.globalAlpha=1}}if(P>g){const D=t-V-2,b=g/P,C=Math.max(20,g*b),S=u/R*(g-C);e.fillStyle=n.tickColor+"22",e.fillRect(D,0,V,g),e.fillStyle=n.tickColor+"88",e.fillRect(D,S,V,C)}e.restore()}e.font=`${n.fontSize}px monospace`;const j=te(r+h*500,h,M),ne=e.measureText(j).width+24,ze=Math.max(ne/t*h,h/1e3);let O=p[p.length-1],z=p.length-1;for(let a=0;a<p.length;a++)if(p[a]>ze){O=p[a],z=a;break}if(c!=null&&c>0)for(;z<p.length-1&&h/O>c;)z++,O=p[z];let $=0;for(let a=z-1;a>=0;a--)if(O%p[a]<1e-4){t*(p[a]/h)>=3&&($=p[a]);break}let G=0;if($>0){for(let a=0;a<p.length&&p[a]<$;a++)if($%p[a]<1e-4&&t*(p[a]/h)>=3){G=p[a];break}}const ge=de(r,h,M),X=(r-ge)/1e3,ie=X+h,re=a=>t*((a-X)/h);if(G>0){e.strokeStyle=n.tickColor,e.lineWidth=1;for(let a=Math.floor(X/G)*G;a<=ie;a=Q(a,G)){const y=re(a);e.beginPath(),e.moveTo(y,o-n.minorTickHeight),e.lineTo(y,o),e.stroke()}}if($>0){e.strokeStyle=n.tickColor,e.lineWidth=1;for(let a=Math.floor(X/$)*$;a<=ie;a=Q(a,$)){const y=re(a);e.beginPath(),e.moveTo(y,o-n.minorTickHeight),e.lineTo(y,o),e.stroke()}}e.textAlign="center",e.textBaseline="bottom";let Se=-1/0;for(let a=Math.floor(X/O)*O;a<=ie+O;a=Q(a,O)){const y=re(a),D=ge+a*1e3;e.strokeStyle=n.majorTickColor,e.lineWidth=1,e.beginPath(),e.moveTo(y,o-n.majorTickHeight),e.lineTo(y,o),e.stroke();const b=te(D,h,M),C=e.measureText(b).width,S=y-C/2;S>Se&&(e.fillStyle=n.labelColor,e.fillText(b,y,o-n.majorTickHeight-4),Se=S+C+5)}const pe=(m-r)/(s-r)*t;return e.strokeStyle=n.indicatorColor,e.lineWidth=n.indicatorLineWidth,e.beginPath(),e.moveTo(pe,0),e.lineTo(pe,o),e.stroke(),u}i.DEFAULT_LABELS=He,i.DEFAULT_LANE_HEIGHT=Y,i.DateTimeFormats=ee,i.LABEL_PAD_LEFT=Te,i.LANE_GAP=F,i.MAX_SPAN_MS=he,i.MIN_SPAN_MS=ue,i.MONTHS=q,i.SCROLLBAR_WIDTH=V,i.SWIM_LANE_SCROLL_SPEED=$e,i.TICK_AREA_HEIGHT=B,i.TIC_SCALES=p,i.TickInterval=x,i.Timezones=Ye,i.calcEpochMs=de,i.clampSpan=Me,i.defaultSwimLaneStyle=w,i.defaultTheme=ke,i.drawTimeline=je,i.formatDateTime=ce,i.formatTime=Re,i.fromMilliseconds=Ee,i.generateTicks=Fe,i.getDateParts=Z,i.getDurationMs=me,i.getTimezoneAbbr=Ie,i.hitTestLaneLabel=Ue,i.hitTestSwimLane=ve,i.isInSwimLaneRegion=Be,i.makeLabel=te,i.nextTic=Q,i.positionToTime=Ne,i.resolveItemStyle=oe,i.resolveLabel=Ae,i.snapToTick=Oe,i.splitForDisplay=Pe,i.timeToPosition=fe,i.toDate=K,i.toJulianDate=Ce,i.toMilliseconds=I,i.totalSwimLaneHeight=We,i.twoD=E,i.zoomRange=Je,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,11 @@ export declare interface ControlsBaseProps {
|
|
|
52
52
|
swimLanesVisible?: boolean;
|
|
53
53
|
/** Toggle callback for the swim-lane chevron button. */
|
|
54
54
|
onToggleSwimLanes?: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Overrides for control-bar labels and tooltips.
|
|
57
|
+
* @see TimelineBaseProps.labels
|
|
58
|
+
*/
|
|
59
|
+
labels?: Partial<TimelineLabels>;
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
/** Decomposed date/time fields extracted in a specific timezone. `mo` is 0-indexed. */
|
|
@@ -85,6 +90,9 @@ export declare const DateTimeFormats: {
|
|
|
85
90
|
readonly TIME_12: "hh:mm:ss A";
|
|
86
91
|
};
|
|
87
92
|
|
|
93
|
+
/** English default labels — used as the fallback for any field not overridden. */
|
|
94
|
+
export declare const DEFAULT_LABELS: Required<TimelineLabels>;
|
|
95
|
+
|
|
88
96
|
export declare const DEFAULT_LANE_HEIGHT = 24;
|
|
89
97
|
|
|
90
98
|
export declare const defaultSwimLaneStyle: SwimLaneStyle;
|
|
@@ -197,6 +205,9 @@ export declare interface ReorderState {
|
|
|
197
205
|
/** Resolve the effective style for a swim lane item (item → lane → theme → defaults). */
|
|
198
206
|
export declare function resolveItemStyle(lane: SwimLane, item: SwimLaneItem, theme?: TimelineTheme): SwimLaneItemStyle;
|
|
199
207
|
|
|
208
|
+
/** Resolves a label field that may be a static string or a multiplier callback. */
|
|
209
|
+
export declare function resolveLabel(label: string | ((multiplier: number) => string), multiplier: number): string;
|
|
210
|
+
|
|
200
211
|
/** Width in pixels for the thin scrollbar track. */
|
|
201
212
|
export declare const SCROLLBAR_WIDTH = 6;
|
|
202
213
|
|
|
@@ -409,6 +420,80 @@ export declare interface TimelineBaseProps {
|
|
|
409
420
|
onSwimLaneItemContextMenu?: (info: SwimLaneEventInfo) => void;
|
|
410
421
|
/** Fired when swim lanes are reordered via drag. Returns the new ordered lane IDs. */
|
|
411
422
|
onSwimLaneReorder?: (orderedLaneIds: string[]) => void;
|
|
423
|
+
/**
|
|
424
|
+
* Overrides for control-bar labels and tooltips.
|
|
425
|
+
* Useful for localisation or custom verbiage — provide only the strings you
|
|
426
|
+
* want to change; everything else falls back to the English defaults.
|
|
427
|
+
*/
|
|
428
|
+
labels?: Partial<TimelineLabels>;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* All user-facing labels and tooltip strings rendered by the timeline control bar.
|
|
433
|
+
* Every field is optional — provide only the strings you want to override.
|
|
434
|
+
* Unspecified fields fall back to the English defaults in {@link DEFAULT_LABELS}.
|
|
435
|
+
*
|
|
436
|
+
* Dynamic tooltip fields accept either a static string **or** a function that
|
|
437
|
+
* receives the current speed multiplier and returns a string, letting you embed
|
|
438
|
+
* the value in whatever format your language requires.
|
|
439
|
+
*
|
|
440
|
+
* @example
|
|
441
|
+
* ```ts
|
|
442
|
+
* // Minimal French override
|
|
443
|
+
* const frLabels: Partial<TimelineLabels> = {
|
|
444
|
+
* playTooltip: 'Lecture',
|
|
445
|
+
* pauseTooltip: 'Pause',
|
|
446
|
+
* liveTooltip: 'Aller en direct',
|
|
447
|
+
* liveActiveTooltip: 'En direct',
|
|
448
|
+
* };
|
|
449
|
+
* <Timeline labels={frLabels} />
|
|
450
|
+
* ```
|
|
451
|
+
*/
|
|
452
|
+
export declare interface TimelineLabels {
|
|
453
|
+
/** Tooltip shown on the datetime display when `onDateTimeClick` is wired up. */
|
|
454
|
+
dateTimeClickTooltip: string;
|
|
455
|
+
/** Visible text on the LIVE button when the needle is NOT at live time. */
|
|
456
|
+
liveLabel: string;
|
|
457
|
+
/** Visible text on the LIVE button when the needle IS at live time. */
|
|
458
|
+
liveActiveLabel: string;
|
|
459
|
+
/** Tooltip when the needle is NOT at live time. */
|
|
460
|
+
liveTooltip: string;
|
|
461
|
+
/** Tooltip when the needle IS at live time. */
|
|
462
|
+
liveActiveTooltip: string;
|
|
463
|
+
/** Tooltip on the speed-reset badge (shown when playback is not 1×). */
|
|
464
|
+
resetSpeedTooltip: string;
|
|
465
|
+
/** Tooltip on the ⏮ jump-to-start button when a start time is set. */
|
|
466
|
+
jumpToStartTooltip: string;
|
|
467
|
+
/** Tooltip on the ⏮ jump-to-start button when no start time is set. */
|
|
468
|
+
noStartTimeTooltip: string;
|
|
469
|
+
/** Tooltip on the ⏭ jump-to-end button when an end time is set. */
|
|
470
|
+
jumpToEndTooltip: string;
|
|
471
|
+
/** Tooltip on the ⏭ jump-to-end button when no end time is set. */
|
|
472
|
+
noEndTimeTooltip: string;
|
|
473
|
+
/** Tooltip on the ◀◀ rewind button when not currently rewinding. */
|
|
474
|
+
rewindTooltip: string;
|
|
475
|
+
/**
|
|
476
|
+
* Tooltip on the ◀◀ rewind button while actively rewinding.
|
|
477
|
+
* Receives the current absolute multiplier (e.g. `2`, `4`, `8`).
|
|
478
|
+
*/
|
|
479
|
+
rewindActiveTooltip: string | ((multiplier: number) => string);
|
|
480
|
+
/** Tooltip on the play button when stopped and not rewinding. */
|
|
481
|
+
playTooltip: string;
|
|
482
|
+
/** Tooltip on the play button when rewinding (clicking will reset to 1× forward). */
|
|
483
|
+
playFromRewindTooltip: string;
|
|
484
|
+
/** Tooltip on the play button when currently playing (will pause on click). */
|
|
485
|
+
pauseTooltip: string;
|
|
486
|
+
/** Tooltip on the ▶▶ fast-forward button when at normal speed. */
|
|
487
|
+
fastForwardTooltip: string;
|
|
488
|
+
/**
|
|
489
|
+
* Tooltip on the ▶▶ fast-forward button while fast-forwarding.
|
|
490
|
+
* Receives the current absolute multiplier (e.g. `2`, `4`, `8`).
|
|
491
|
+
*/
|
|
492
|
+
fastForwardActiveTooltip: string | ((multiplier: number) => string);
|
|
493
|
+
/** Tooltip on the chevron button when swim lanes are currently visible (click will collapse). */
|
|
494
|
+
collapseSwimLanesTooltip: string;
|
|
495
|
+
/** Tooltip on the chevron button when swim lanes are currently hidden (click will expand). */
|
|
496
|
+
expandSwimLanesTooltip: string;
|
|
412
497
|
}
|
|
413
498
|
|
|
414
499
|
/** Mutable state the engine reads during a draw call. */
|