@salmonui/gantt 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +43 -2
- package/dist/gantt/Gantt.d.ts +5 -0
- package/dist/gantt/Gantt.d.ts.map +1 -0
- package/dist/gantt/Gantt.js +516 -0
- package/dist/gantt/Gantt.js.map +1 -0
- package/dist/gantt/adaptive.d.ts +8 -0
- package/dist/gantt/adaptive.d.ts.map +1 -0
- package/dist/gantt/adaptive.js +38 -0
- package/dist/gantt/adaptive.js.map +1 -0
- package/dist/gantt/api.d.ts +9 -0
- package/dist/gantt/api.d.ts.map +1 -0
- package/dist/gantt/api.js +181 -0
- package/dist/gantt/api.js.map +1 -0
- package/dist/gantt/chart.d.ts +70 -0
- package/dist/gantt/chart.d.ts.map +1 -0
- package/dist/gantt/chart.js +580 -0
- package/dist/gantt/chart.js.map +1 -0
- package/dist/gantt/columns.d.ts +9 -0
- package/dist/gantt/columns.d.ts.map +1 -0
- package/dist/gantt/columns.js +139 -0
- package/dist/gantt/columns.js.map +1 -0
- package/dist/gantt/export.d.ts +53 -0
- package/dist/gantt/export.d.ts.map +1 -0
- package/dist/gantt/export.js +241 -0
- package/dist/gantt/export.js.map +1 -0
- package/dist/gantt/fields.d.ts +42 -0
- package/dist/gantt/fields.d.ts.map +1 -0
- package/dist/gantt/fields.js +235 -0
- package/dist/gantt/fields.js.map +1 -0
- package/dist/gantt/instance.d.ts +214 -0
- package/dist/gantt/instance.d.ts.map +1 -0
- package/dist/gantt/instance.js +1029 -0
- package/dist/gantt/instance.js.map +1 -0
- package/dist/gantt/interact.d.ts +7 -0
- package/dist/gantt/interact.d.ts.map +1 -0
- package/dist/gantt/interact.js +315 -0
- package/dist/gantt/interact.js.map +1 -0
- package/dist/gantt/loading.d.ts +21 -0
- package/dist/gantt/loading.d.ts.map +1 -0
- package/dist/gantt/loading.js +81 -0
- package/dist/gantt/loading.js.map +1 -0
- package/dist/gantt/locale.d.ts +161 -0
- package/dist/gantt/locale.d.ts.map +1 -0
- package/dist/gantt/locale.js +145 -0
- package/dist/gantt/locale.js.map +1 -0
- package/dist/gantt/menu-items.d.ts +8 -0
- package/dist/gantt/menu-items.d.ts.map +1 -0
- package/dist/gantt/menu-items.js +16 -0
- package/dist/gantt/menu-items.js.map +1 -0
- package/dist/gantt/menu-run.d.ts +5 -0
- package/dist/gantt/menu-run.d.ts.map +1 -0
- package/dist/gantt/menu-run.js +69 -0
- package/dist/gantt/menu-run.js.map +1 -0
- package/dist/gantt/modules.d.ts +19 -0
- package/dist/gantt/modules.d.ts.map +1 -0
- package/dist/gantt/modules.js +8 -0
- package/dist/gantt/modules.js.map +1 -0
- package/dist/gantt/popups.d.ts +23 -0
- package/dist/gantt/popups.d.ts.map +1 -0
- package/dist/gantt/popups.js +158 -0
- package/dist/gantt/popups.js.map +1 -0
- package/dist/gantt/registry-lazy.d.ts +4 -0
- package/dist/gantt/registry-lazy.d.ts.map +1 -0
- package/dist/gantt/registry-lazy.js +54 -0
- package/dist/gantt/registry-lazy.js.map +1 -0
- package/dist/gantt/registry-static.d.ts +4 -0
- package/dist/gantt/registry-static.d.ts.map +1 -0
- package/dist/gantt/registry-static.js +13 -0
- package/dist/gantt/registry-static.js.map +1 -0
- package/dist/gantt/remote.d.ts +16 -0
- package/dist/gantt/remote.d.ts.map +1 -0
- package/dist/gantt/remote.js +178 -0
- package/dist/gantt/remote.js.map +1 -0
- package/dist/gantt/resource-view.d.ts +57 -0
- package/dist/gantt/resource-view.d.ts.map +1 -0
- package/dist/gantt/resource-view.js +123 -0
- package/dist/gantt/resource-view.js.map +1 -0
- package/dist/gantt/toolbar.d.ts +11 -0
- package/dist/gantt/toolbar.d.ts.map +1 -0
- package/dist/gantt/toolbar.js +166 -0
- package/dist/gantt/toolbar.js.map +1 -0
- package/dist/gantt/tooltip.d.ts +7 -0
- package/dist/gantt/tooltip.d.ts.map +1 -0
- package/dist/gantt/tooltip.js +180 -0
- package/dist/gantt/tooltip.js.map +1 -0
- package/dist/gantt/types.d.ts +625 -0
- package/dist/gantt/types.d.ts.map +1 -0
- package/dist/gantt/types.js +7 -0
- package/dist/gantt/types.js.map +1 -0
- package/dist/gantt.css +5593 -0
- package/dist/gantt.d.ts +6 -0
- package/dist/gantt.d.ts.map +1 -0
- package/dist/gantt.js +13 -0
- package/dist/gantt.js.map +1 -0
- package/dist/internal/timeline/project/calendar.d.ts +50 -0
- package/dist/internal/timeline/project/calendar.d.ts.map +1 -0
- package/dist/internal/timeline/project/calendar.js +312 -0
- package/dist/internal/timeline/project/calendar.js.map +1 -0
- package/dist/internal/timeline/project/critical.d.ts +34 -0
- package/dist/internal/timeline/project/critical.d.ts.map +1 -0
- package/dist/internal/timeline/project/critical.js +135 -0
- package/dist/internal/timeline/project/critical.js.map +1 -0
- package/dist/internal/timeline/project/dependencies.d.ts +16 -0
- package/dist/internal/timeline/project/dependencies.d.ts.map +1 -0
- package/dist/internal/timeline/project/dependencies.js +87 -0
- package/dist/internal/timeline/project/dependencies.js.map +1 -0
- package/dist/internal/timeline/project/engine.d.ts +118 -0
- package/dist/internal/timeline/project/engine.d.ts.map +1 -0
- package/dist/internal/timeline/project/engine.js +1907 -0
- package/dist/internal/timeline/project/engine.js.map +1 -0
- package/dist/internal/timeline/project/format.d.ts +22 -0
- package/dist/internal/timeline/project/format.d.ts.map +1 -0
- package/dist/internal/timeline/project/format.js +41 -0
- package/dist/internal/timeline/project/format.js.map +1 -0
- package/dist/internal/timeline/project/history.d.ts +27 -0
- package/dist/internal/timeline/project/history.d.ts.map +1 -0
- package/dist/internal/timeline/project/history.js +74 -0
- package/dist/internal/timeline/project/history.js.map +1 -0
- package/dist/internal/timeline/project/resources.d.ts +26 -0
- package/dist/internal/timeline/project/resources.d.ts.map +1 -0
- package/dist/internal/timeline/project/resources.js +109 -0
- package/dist/internal/timeline/project/resources.js.map +1 -0
- package/dist/internal/timeline/project/types.d.ts +99 -0
- package/dist/internal/timeline/project/types.d.ts.map +1 -0
- package/dist/internal/timeline/project/types.js +6 -0
- package/dist/internal/timeline/project/types.js.map +1 -0
- package/dist/internal/timeline/scale.d.ts +60 -0
- package/dist/internal/timeline/scale.d.ts.map +1 -0
- package/dist/internal/timeline/scale.js +156 -0
- package/dist/internal/timeline/scale.js.map +1 -0
- package/package.json +55 -4
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export type TaskId = string;
|
|
2
|
+
export type DurationUnit = 'minute' | 'hour' | 'day';
|
|
3
|
+
export type WorkUnit = 'minute' | 'hour' | 'day';
|
|
4
|
+
export type DependencyType = 'fs' | 'ss' | 'ff' | 'sf';
|
|
5
|
+
export type TaskMode = 'auto' | 'manual' | 'custom';
|
|
6
|
+
export type TaskType = 'fixedUnit' | 'fixedWork' | 'fixedDuration';
|
|
7
|
+
export type ConstraintType = 'asSoonAsPossible' | 'asLateAsPossible' | 'startNoEarlierThan' | 'startNoLaterThan' | 'finishNoEarlierThan' | 'finishNoLaterThan' | 'mustStartOn' | 'mustFinishOn';
|
|
8
|
+
/** A link from a predecessor (`id`) to the task that owns it; `lag` in `lagUnit` of working time (negative = lead). */
|
|
9
|
+
export interface Dependency {
|
|
10
|
+
readonly id: TaskId;
|
|
11
|
+
readonly type: DependencyType;
|
|
12
|
+
readonly lag: number;
|
|
13
|
+
readonly lagUnit: DurationUnit;
|
|
14
|
+
}
|
|
15
|
+
/** A resource assigned to a task; `unit` is a percentage (default 100). */
|
|
16
|
+
export interface ResourceAssignment {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly unit: number;
|
|
19
|
+
}
|
|
20
|
+
/** One segment of a split task (wall ms); `end` or `duration` (in the task's duration unit). */
|
|
21
|
+
export interface SegmentInput {
|
|
22
|
+
readonly start?: number | null;
|
|
23
|
+
readonly end?: number | null;
|
|
24
|
+
readonly duration?: number | null;
|
|
25
|
+
}
|
|
26
|
+
export interface ProjectTaskInput {
|
|
27
|
+
readonly id: TaskId;
|
|
28
|
+
readonly parentId: TaskId | null;
|
|
29
|
+
readonly start?: number | null;
|
|
30
|
+
readonly end?: number | null;
|
|
31
|
+
readonly duration?: number | null;
|
|
32
|
+
readonly durationUnit?: DurationUnit;
|
|
33
|
+
/** 0..100. */
|
|
34
|
+
readonly progress?: number;
|
|
35
|
+
readonly milestone?: boolean;
|
|
36
|
+
readonly manual?: boolean;
|
|
37
|
+
readonly taskType?: TaskType;
|
|
38
|
+
readonly work?: number | null;
|
|
39
|
+
readonly predecessors?: readonly Dependency[];
|
|
40
|
+
readonly resources?: readonly ResourceAssignment[];
|
|
41
|
+
readonly constraintType?: ConstraintType;
|
|
42
|
+
readonly constraintDate?: number | null;
|
|
43
|
+
readonly calendar?: string | null;
|
|
44
|
+
readonly segments?: readonly SegmentInput[] | null;
|
|
45
|
+
readonly baselineStart?: number | null;
|
|
46
|
+
readonly baselineEnd?: number | null;
|
|
47
|
+
}
|
|
48
|
+
/** A dependency or constraint the schedule could not honour (or a cycle-closing link that was ignored). */
|
|
49
|
+
export interface ScheduleConflict {
|
|
50
|
+
readonly kind: 'dependency' | 'constraint';
|
|
51
|
+
readonly taskId: TaskId;
|
|
52
|
+
readonly predecessorId: TaskId | null;
|
|
53
|
+
readonly type: DependencyType | null;
|
|
54
|
+
/** The earliest start the dependencies allow (wall ms). */
|
|
55
|
+
readonly earliestStart: number;
|
|
56
|
+
}
|
|
57
|
+
export interface ScheduleSegment {
|
|
58
|
+
readonly start: number;
|
|
59
|
+
readonly end: number;
|
|
60
|
+
}
|
|
61
|
+
/** The computed schedule of one task: frozen, replaced by a new object only when a field changes. */
|
|
62
|
+
export interface TaskSchedule {
|
|
63
|
+
readonly id: TaskId;
|
|
64
|
+
readonly parentId: TaskId | null;
|
|
65
|
+
readonly level: number;
|
|
66
|
+
/** Position in tree order. */
|
|
67
|
+
readonly index: number;
|
|
68
|
+
/** null = unscheduled. */
|
|
69
|
+
readonly start: number | null;
|
|
70
|
+
readonly end: number | null;
|
|
71
|
+
/** In `durationUnit` (segment gaps excluded). */
|
|
72
|
+
readonly duration: number;
|
|
73
|
+
readonly durationUnit: DurationUnit;
|
|
74
|
+
/** Working ms of the duration. */
|
|
75
|
+
readonly workMs: number;
|
|
76
|
+
readonly progress: number;
|
|
77
|
+
readonly milestone: boolean;
|
|
78
|
+
readonly parent: boolean;
|
|
79
|
+
readonly manual: boolean;
|
|
80
|
+
readonly unscheduled: boolean;
|
|
81
|
+
/** In the engine `workUnit`. */
|
|
82
|
+
readonly work: number;
|
|
83
|
+
readonly taskType: TaskType;
|
|
84
|
+
readonly segments: readonly ScheduleSegment[] | null;
|
|
85
|
+
/** Parents: the range of their scheduled children (for manual parents it differs from start/end). */
|
|
86
|
+
readonly rollupStart: number | null;
|
|
87
|
+
readonly rollupEnd: number | null;
|
|
88
|
+
readonly wbs: string;
|
|
89
|
+
/** Valid after `computeCriticalPath()`; floats in working ms. */
|
|
90
|
+
readonly critical: boolean;
|
|
91
|
+
readonly totalFloat: number;
|
|
92
|
+
readonly freeFloat: number;
|
|
93
|
+
readonly conflicts: readonly ScheduleConflict[];
|
|
94
|
+
}
|
|
95
|
+
export interface UpdateResult {
|
|
96
|
+
readonly changed: ReadonlySet<TaskId>;
|
|
97
|
+
readonly conflicts: readonly ScheduleConflict[];
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/internal/timeline/project/types.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AACrD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AACjD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACvD,MAAM,MAAM,QAAQ,GAAG,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gB,EAAE,CAAC;CACjD;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACjD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Project engine types (project
|
|
2
|
+
// subsystem of `internal/timeline`): task inputs as the React layer normalizes them
|
|
3
|
+
// (ids stringified, dates as floating wall-clock ms), dependencies, and the
|
|
4
|
+
// frozen per-task schedule the engine computes. Pure types, no runtime.
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/internal/timeline/project/types.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,oFAAoF;AACpF,4EAA4E;AAC5E,wEAAwE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type ScaleUnit = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute';
|
|
2
|
+
/** One header tier: cells of `count` units. */
|
|
3
|
+
export interface TierSpec {
|
|
4
|
+
readonly unit: ScaleUnit;
|
|
5
|
+
readonly count: number;
|
|
6
|
+
}
|
|
7
|
+
/** A zoom level: two tiers and the width of one bottom-tier cell. */
|
|
8
|
+
export interface ZoomLevel {
|
|
9
|
+
readonly level: number;
|
|
10
|
+
readonly top: TierSpec | null;
|
|
11
|
+
readonly bottom: TierSpec;
|
|
12
|
+
readonly unitWidth: number;
|
|
13
|
+
}
|
|
14
|
+
/** Built-in zoom levels, coarse to fine. Level 7 is `timeline.mode: 'week'` at 33 px. */
|
|
15
|
+
export declare const ZOOM_LEVELS: readonly ZoomLevel[];
|
|
16
|
+
/** `timeline.mode` presets. */
|
|
17
|
+
export declare const VIEW_MODES: Readonly<Record<'hour' | 'day' | 'week' | 'month' | 'year', ZoomLevel>>;
|
|
18
|
+
/** Mean length of one unit in ms (month and year are mean Gregorian lengths). */
|
|
19
|
+
export declare function unitLength(unit: ScaleUnit): number;
|
|
20
|
+
/** Start of the unit (of `count` units, aligned from the epoch, or from January / the hour for month and minute counts) that contains `wall`. */
|
|
21
|
+
export declare function startOfUnit(wall: number, unit: ScaleUnit, count?: number, weekStart?: number): number;
|
|
22
|
+
/** `wall` plus `n` units (calendar arithmetic for month and year). */
|
|
23
|
+
export declare function addUnits(wall: number, unit: ScaleUnit, n: number): number;
|
|
24
|
+
/** A linear scale over [start, end) of wall ms at `pxPerMs`. */
|
|
25
|
+
export interface TimeScale {
|
|
26
|
+
readonly start: number;
|
|
27
|
+
readonly end: number;
|
|
28
|
+
readonly pxPerMs: number;
|
|
29
|
+
/** Total width in px. */
|
|
30
|
+
readonly width: number;
|
|
31
|
+
readonly level: ZoomLevel;
|
|
32
|
+
readonly weekStart: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The scale of a zoom level over a date range: the range is widened to whole
|
|
36
|
+
* top-tier units (whole bottom units without a top tier), plus `padUnits`
|
|
37
|
+
* bottom-tier cells on each side.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createScale(rangeStart: number, rangeEnd: number, level: ZoomLevel, weekStart?: number, padUnits?: number): TimeScale;
|
|
40
|
+
/** px position of a wall time. */
|
|
41
|
+
export declare const xOf: (scale: TimeScale, wall: number) => number;
|
|
42
|
+
/** Wall time at a px position. */
|
|
43
|
+
export declare const timeAt: (scale: TimeScale, x: number) => number;
|
|
44
|
+
/** A header cell: [start, end) wall ms at [x, x + width) px. */
|
|
45
|
+
export interface ScaleCell {
|
|
46
|
+
readonly start: number;
|
|
47
|
+
readonly end: number;
|
|
48
|
+
readonly x: number;
|
|
49
|
+
readonly width: number;
|
|
50
|
+
}
|
|
51
|
+
/** Cells of one tier that intersect the px window [from, to) (horizontal virtualization). */
|
|
52
|
+
export declare function tierCells(scale: TimeScale, tier: TierSpec, from: number, to: number): ScaleCell[];
|
|
53
|
+
/** The zoom level index nearest to a level (for `zoomIn` / `zoomOut` from a custom or preset level). */
|
|
54
|
+
export declare function nearestLevel(level: ZoomLevel, levels?: readonly ZoomLevel[]): number;
|
|
55
|
+
/**
|
|
56
|
+
* Zoom to fit: the finest level whose scale shows [start, end) in
|
|
57
|
+
* `width` px, with its unit width stretched so the range fills the width.
|
|
58
|
+
*/
|
|
59
|
+
export declare function fitLevel(start: number, end: number, width: number, levels?: readonly ZoomLevel[]): ZoomLevel;
|
|
60
|
+
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/internal/timeline/scale.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9E,+CAA+C;AAC/C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,qEAAqE;AACrE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAKD,yFAAyF;AACzF,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAiB3C,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,SAAS,CAAC,CAM9F,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAelD;AAED,iJAAiJ;AACjJ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AAE,EAAE,MAAM,GAAG,SAAS,EAAE,CAcjG;AAED,wGAAwG;AACxG,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,GAAE,SAAS,SAAS,EAAgB,GAAG,MAAM,CAajG;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,SAAS,SAAS,EAAgB,GAAG,SAAS,CAazH"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// Linear time scale of the Gantt chart (layer `timeline`): calendar units
|
|
2
|
+
// (year .. minute), tier presets and zoom levels, the px position of a wall
|
|
3
|
+
// time, and the header cells of one tier inside a px window (horizontal
|
|
4
|
+
// virtualization). Times are floating wall-clock ms like `axis.ts`; the
|
|
5
|
+
// scale is linear in calendar time (non-working days keep their width).
|
|
6
|
+
// Pure: no React, no DOM, zero dependencies.
|
|
7
|
+
import { DAY, HOUR, MINUTE } from '@salmonui/core/internal/timeline/axis';
|
|
8
|
+
const t = (unit, count = 1) => ({ unit, count });
|
|
9
|
+
const z = (level, top, bottom, unitWidth) => ({ level, top, bottom, unitWidth });
|
|
10
|
+
/** Built-in zoom levels, coarse to fine. Level 7 is `timeline.mode: 'week'` at 33 px. */
|
|
11
|
+
export const ZOOM_LEVELS = [
|
|
12
|
+
z(0, t('year'), t('month', 6), 66),
|
|
13
|
+
z(1, t('year'), t('month', 3), 66),
|
|
14
|
+
z(2, t('year'), t('month'), 33),
|
|
15
|
+
z(3, t('year'), t('month'), 66),
|
|
16
|
+
z(4, t('month'), t('week'), 33),
|
|
17
|
+
z(5, t('month'), t('week'), 66),
|
|
18
|
+
z(6, t('week'), t('day'), 20),
|
|
19
|
+
z(7, t('week'), t('day'), 33),
|
|
20
|
+
z(8, t('week'), t('day'), 66),
|
|
21
|
+
z(9, t('day'), t('hour', 12), 66),
|
|
22
|
+
z(10, t('day'), t('hour', 6), 66),
|
|
23
|
+
z(11, t('day'), t('hour', 2), 66),
|
|
24
|
+
z(12, t('day'), t('hour'), 66),
|
|
25
|
+
z(13, t('hour'), t('minute', 30), 66),
|
|
26
|
+
z(14, t('hour'), t('minute', 15), 66),
|
|
27
|
+
z(15, t('hour'), t('minute', 5), 66),
|
|
28
|
+
];
|
|
29
|
+
/** `timeline.mode` presets. */
|
|
30
|
+
export const VIEW_MODES = {
|
|
31
|
+
hour: z(-1, t('hour'), t('minute', 30), 66),
|
|
32
|
+
day: z(-1, t('day'), t('hour'), 33),
|
|
33
|
+
week: ZOOM_LEVELS[7],
|
|
34
|
+
month: z(-1, t('month'), t('week'), 66),
|
|
35
|
+
year: z(-1, t('year'), t('month'), 66),
|
|
36
|
+
};
|
|
37
|
+
/** Mean length of one unit in ms (month and year are mean Gregorian lengths). */
|
|
38
|
+
export function unitLength(unit) {
|
|
39
|
+
switch (unit) {
|
|
40
|
+
case 'minute':
|
|
41
|
+
return MINUTE;
|
|
42
|
+
case 'hour':
|
|
43
|
+
return HOUR;
|
|
44
|
+
case 'day':
|
|
45
|
+
return DAY;
|
|
46
|
+
case 'week':
|
|
47
|
+
return 7 * DAY;
|
|
48
|
+
case 'month':
|
|
49
|
+
return 30.436875 * DAY;
|
|
50
|
+
default:
|
|
51
|
+
return 365.2425 * DAY;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** Start of the unit (of `count` units, aligned from the epoch, or from January / the hour for month and minute counts) that contains `wall`. */
|
|
55
|
+
export function startOfUnit(wall, unit, count = 1, weekStart = 0) {
|
|
56
|
+
const n = Math.max(1, count | 0);
|
|
57
|
+
if (unit === 'minute') {
|
|
58
|
+
const hour = Math.floor(wall / HOUR) * HOUR;
|
|
59
|
+
return hour + Math.floor((wall - hour) / (n * MINUTE)) * n * MINUTE;
|
|
60
|
+
}
|
|
61
|
+
if (unit === 'hour') {
|
|
62
|
+
const day = Math.floor(wall / DAY) * DAY;
|
|
63
|
+
return day + Math.floor((wall - day) / (n * HOUR)) * n * HOUR;
|
|
64
|
+
}
|
|
65
|
+
const day = Math.floor(wall / DAY);
|
|
66
|
+
if (unit === 'day')
|
|
67
|
+
return day * DAY;
|
|
68
|
+
// Day 0 (1970-01-01) is a Thursday (weekday 4).
|
|
69
|
+
if (unit === 'week')
|
|
70
|
+
return (day - ((((day + 4 - weekStart) % 7) + 7) % 7)) * DAY;
|
|
71
|
+
const d = new Date(day * DAY);
|
|
72
|
+
const year = d.getUTCFullYear();
|
|
73
|
+
if (unit === 'year')
|
|
74
|
+
return Date.UTC(year - (((year % n) + n) % n), 0, 1);
|
|
75
|
+
const month = d.getUTCMonth();
|
|
76
|
+
return Date.UTC(year, month - (month % n), 1);
|
|
77
|
+
}
|
|
78
|
+
/** `wall` plus `n` units (calendar arithmetic for month and year). */
|
|
79
|
+
export function addUnits(wall, unit, n) {
|
|
80
|
+
if (unit === 'month' || unit === 'year') {
|
|
81
|
+
const d = new Date(wall);
|
|
82
|
+
const months = unit === 'year' ? n * 12 : n;
|
|
83
|
+
return Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + months, d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
|
|
84
|
+
}
|
|
85
|
+
return wall + n * unitLength(unit);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The scale of a zoom level over a date range: the range is widened to whole
|
|
89
|
+
* top-tier units (whole bottom units without a top tier), plus `padUnits`
|
|
90
|
+
* bottom-tier cells on each side.
|
|
91
|
+
*/
|
|
92
|
+
export function createScale(rangeStart, rangeEnd, level, weekStart = 0, padUnits = 2) {
|
|
93
|
+
const outer = level.top ?? level.bottom;
|
|
94
|
+
const b = level.bottom;
|
|
95
|
+
const s = startOfUnit(addUnits(rangeStart, b.unit, -padUnits * b.count), outer.unit, outer.count, weekStart);
|
|
96
|
+
const lastStart = startOfUnit(addUnits(Math.max(rangeEnd, rangeStart + 1), b.unit, padUnits * b.count), outer.unit, outer.count, weekStart);
|
|
97
|
+
const e = addUnits(lastStart, outer.unit, outer.count);
|
|
98
|
+
const pxPerMs = level.unitWidth / (unitLength(b.unit) * b.count);
|
|
99
|
+
return { start: s, end: e, pxPerMs, width: Math.round((e - s) * pxPerMs), level, weekStart };
|
|
100
|
+
}
|
|
101
|
+
/** px position of a wall time. */
|
|
102
|
+
export const xOf = (scale, wall) => (wall - scale.start) * scale.pxPerMs;
|
|
103
|
+
/** Wall time at a px position. */
|
|
104
|
+
export const timeAt = (scale, x) => scale.start + x / scale.pxPerMs;
|
|
105
|
+
/** Cells of one tier that intersect the px window [from, to) (horizontal virtualization). */
|
|
106
|
+
export function tierCells(scale, tier, from, to) {
|
|
107
|
+
const out = [];
|
|
108
|
+
const lo = Math.max(scale.start, timeAt(scale, Math.max(0, from)));
|
|
109
|
+
const hi = Math.min(scale.end, timeAt(scale, Math.min(scale.width, to)));
|
|
110
|
+
let s = Math.max(scale.start, startOfUnit(lo, tier.unit, tier.count, scale.weekStart));
|
|
111
|
+
// Cells are capped so a pathological window can never loop forever.
|
|
112
|
+
for (let i = 0; s < hi && i < 10_000; i++) {
|
|
113
|
+
const next = Math.min(scale.end, addUnits(startOfUnit(s, tier.unit, tier.count, scale.weekStart), tier.unit, tier.count));
|
|
114
|
+
if (next <= s)
|
|
115
|
+
break;
|
|
116
|
+
const x = xOf(scale, s);
|
|
117
|
+
out.push({ start: s, end: next, x, width: xOf(scale, next) - x });
|
|
118
|
+
s = next;
|
|
119
|
+
}
|
|
120
|
+
return out;
|
|
121
|
+
}
|
|
122
|
+
/** The zoom level index nearest to a level (for `zoomIn` / `zoomOut` from a custom or preset level). */
|
|
123
|
+
export function nearestLevel(level, levels = ZOOM_LEVELS) {
|
|
124
|
+
if (level.level >= 0 && level.level < levels.length && levels[level.level] === level)
|
|
125
|
+
return level.level;
|
|
126
|
+
const target = (unitLength(level.bottom.unit) * level.bottom.count) / level.unitWidth;
|
|
127
|
+
let best = 0;
|
|
128
|
+
let bestDiff = Number.POSITIVE_INFINITY;
|
|
129
|
+
levels.forEach((l, i) => {
|
|
130
|
+
const diff = Math.abs(Math.log((unitLength(l.bottom.unit) * l.bottom.count) / l.unitWidth / target));
|
|
131
|
+
if (diff < bestDiff) {
|
|
132
|
+
bestDiff = diff;
|
|
133
|
+
best = i;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return best;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Zoom to fit: the finest level whose scale shows [start, end) in
|
|
140
|
+
* `width` px, with its unit width stretched so the range fills the width.
|
|
141
|
+
*/
|
|
142
|
+
export function fitLevel(start, end, width, levels = ZOOM_LEVELS) {
|
|
143
|
+
const span = Math.max(HOUR, end - start);
|
|
144
|
+
const usable = Math.max(100, width);
|
|
145
|
+
for (let i = levels.length - 1; i >= 0; i--) {
|
|
146
|
+
const l = levels[i];
|
|
147
|
+
const unitMs = unitLength(l.bottom.unit) * l.bottom.count;
|
|
148
|
+
// Room for the 2 padding cells on each side.
|
|
149
|
+
if ((span / unitMs + 4) * l.unitWidth <= usable) {
|
|
150
|
+
const unitWidth = Math.max(l.unitWidth, Math.floor(usable / (span / unitMs + 4)));
|
|
151
|
+
return { level: l.level, top: l.top, bottom: l.bottom, unitWidth };
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return levels[0];
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=scale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.js","sourceRoot":"","sources":["../../../src/internal/timeline/scale.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,6CAA6C;AAE7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAkB1E,MAAM,CAAC,GAAG,CAAC,IAAe,EAAE,KAAK,GAAG,CAAC,EAAY,EAAE,CAAC,CAAC,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AAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAClF,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC;QACrE,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,CAAC,CAAc,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salmonui/gantt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Gantt chart for Salmon UI on the Data Grid: dependencies, critical path, baselines, resources and undo history.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/hy-ong/salmonui.git",
|
|
9
|
+
"directory": "packages/gantt"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://salmonui.dev",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/hy-ong/salmonui/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/gantt.d.ts",
|
|
22
|
+
"import": "./dist/gantt.js"
|
|
23
|
+
},
|
|
24
|
+
"./styles.css": "./dist/gantt.css",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"imports": {
|
|
28
|
+
"#gantt-modules": {
|
|
29
|
+
"types": "./dist/gantt/registry-static.d.ts",
|
|
30
|
+
"workerd": "./dist/gantt/registry-static.js",
|
|
31
|
+
"worker": "./dist/gantt/registry-static.js",
|
|
32
|
+
"edge-light": "./dist/gantt/registry-static.js",
|
|
33
|
+
"browser": "./dist/gantt/registry-lazy.js",
|
|
34
|
+
"default": "./dist/gantt/registry-static.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@salmonui/core": "0.3.0",
|
|
44
|
+
"@salmonui/data-grid": "0.3.0",
|
|
45
|
+
"@salmonui/calendars": "0.3.0",
|
|
46
|
+
"@salmonui/overlays": "0.3.0",
|
|
47
|
+
"@salmonui/buttons": "0.3.0",
|
|
48
|
+
"@salmonui/layout": "0.3.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": ">=19",
|
|
52
|
+
"react-dom": ">=19"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=22"
|
|
56
|
+
}
|
|
57
|
+
}
|