@eightkk/vue-weave 0.0.0-stage → 1.0.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/CHANGELOG.md +517 -0
- package/CONTRIBUTING.md +123 -0
- package/LICENSE +21 -0
- package/README.ja.md +275 -0
- package/README.md +272 -2
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/dist/core-BH5rTsKp.js +13606 -0
- package/dist/core.js +1 -0
- package/dist/index.js +8022 -0
- package/dist/style.css +2 -0
- package/dist/types/components/GanttChart.vue.d.ts +339 -0
- package/dist/types/components/NetworkGraph.vue.d.ts +252 -0
- package/dist/types/components/types.d.ts +27 -0
- package/dist/types/composables/useAsyncGraphLayout.d.ts +163 -0
- package/dist/types/composables/useEditHistory.d.ts +13 -0
- package/dist/types/composables/useEditTransaction.d.ts +46 -0
- package/dist/types/composables/useLinkedSelection.d.ts +118 -0
- package/dist/types/composables/useTimelineView.d.ts +24 -0
- package/dist/types/composables/useWindowedData.d.ts +83 -0
- package/dist/types/core/actuals.d.ts +170 -0
- package/dist/types/core/calendarFormat.d.ts +65 -0
- package/dist/types/core/editTransaction.d.ts +96 -0
- package/dist/types/core/exportSvg.d.ts +236 -0
- package/dist/types/core/fieldEditing.d.ts +114 -0
- package/dist/types/core/graph.d.ts +196 -0
- package/dist/types/core/graphAlgorithms.d.ts +51 -0
- package/dist/types/core/graphAnalysis.d.ts +96 -0
- package/dist/types/core/graphCollapse.d.ts +62 -0
- package/dist/types/core/graphCrossings.d.ts +25 -0
- package/dist/types/core/graphEditing.d.ts +52 -0
- package/dist/types/core/graphExpansion.d.ts +71 -0
- package/dist/types/core/graphFlow.d.ts +184 -0
- package/dist/types/core/graphForce.d.ts +29 -0
- package/dist/types/core/graphGeometry.d.ts +31 -0
- package/dist/types/core/graphIncremental.d.ts +93 -0
- package/dist/types/core/graphLasso.d.ts +15 -0
- package/dist/types/core/graphLayoutRequests.d.ts +218 -0
- package/dist/types/core/graphLayouts.d.ts +81 -0
- package/dist/types/core/graphObstacleRouting.d.ts +68 -0
- package/dist/types/core/graphPortRules.d.ts +111 -0
- package/dist/types/core/graphRouting.d.ts +84 -0
- package/dist/types/core/graphSnapping.d.ts +34 -0
- package/dist/types/core/graphSpatial.d.ts +49 -0
- package/dist/types/core/graphSwimlanes.d.ts +77 -0
- package/dist/types/core/graphTraversal.d.ts +51 -0
- package/dist/types/core/graphView.d.ts +73 -0
- package/dist/types/core/index.d.ts +75 -0
- package/dist/types/core/interchange.d.ts +6 -0
- package/dist/types/core/interchangeCsv.d.ts +75 -0
- package/dist/types/core/interchangeICalendar.d.ts +111 -0
- package/dist/types/core/interchangeMsProject.d.ts +339 -0
- package/dist/types/core/leveling.d.ts +57 -0
- package/dist/types/core/pert.d.ts +62 -0
- package/dist/types/core/placement.d.ts +100 -0
- package/dist/types/core/planComparison.d.ts +275 -0
- package/dist/types/core/resourceLoad.d.ts +65 -0
- package/dist/types/core/resourceTimeline.d.ts +179 -0
- package/dist/types/core/rowHierarchy.d.ts +25 -0
- package/dist/types/core/scheduleDiagnostics.d.ts +37 -0
- package/dist/types/core/scheduleModel.d.ts +187 -0
- package/dist/types/core/scheduleTrace.d.ts +118 -0
- package/dist/types/core/scheduling.d.ts +194 -0
- package/dist/types/core/snapshot.d.ts +388 -0
- package/dist/types/core/statusDate.d.ts +36 -0
- package/dist/types/core/timeRangeTargets.d.ts +67 -0
- package/dist/types/core/timeline.d.ts +194 -0
- package/dist/types/core/timelineView.d.ts +101 -0
- package/dist/types/core/types.d.ts +783 -0
- package/dist/types/core/viewBindings.d.ts +112 -0
- package/dist/types/core/windowedData.d.ts +255 -0
- package/dist/types/core/workCalendar.d.ts +41 -0
- package/dist/types/core/workingTimeScale.d.ts +33 -0
- package/dist/types/index.d.ts +52 -0
- package/docs/api.md +1989 -0
- package/docs/architecture.md +112 -0
- package/docs/code-of-conduct.md +24 -0
- package/docs/integration.md +931 -0
- package/docs/scheduling.md +586 -0
- package/docs/security.md +26 -0
- package/docs/third-party-licenses.md +33 -0
- package/package.json +79 -4
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { CalendarBandOptions, CalendarBandUnit, TimelineBand, TimelineBar, TimelineBarEnd, TimelineDependency, TimelineDependencyType, TimelineLoadSegment, TimelineRow, TimelineSummary } from './types.js';
|
|
2
|
+
import type { TimelineBaselineVariance } from './types.js';
|
|
3
|
+
import type { TimelineConstraintEdit, TimelineConstraintKind, TimelineConstraints } from './types.js';
|
|
4
|
+
export interface TimeRange {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
}
|
|
8
|
+
export type EditMode = 'move' | 'start' | 'end';
|
|
9
|
+
/**
|
|
10
|
+
* The `TimelineColumnResize.id` of the row label column, which has no `TimelineColumn` of its own. Do not use it as
|
|
11
|
+
* the ID of a `TimelineColumn` in a chart with `columnsResizable`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const timelineLabelColumnId = "$label";
|
|
14
|
+
/**
|
|
15
|
+
* The baseline set ID of the single unnamed `TimelineBar.baseline`, for `baselineIds` and `baselineLabel`. A
|
|
16
|
+
* `TimelineBar.baselines` entry may not use it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const timelineBaselineId = "$baseline";
|
|
19
|
+
/** The most baseline sets GanttChart and `renderTimelineSvg` draw at once. */
|
|
20
|
+
export declare const timelineBaselineLimit = 3;
|
|
21
|
+
/** Every `TimelineConstraintKind`, in the order GanttChart describes and draws them. */
|
|
22
|
+
export declare const timelineConstraintKinds: readonly TimelineConstraintKind[];
|
|
23
|
+
/**
|
|
24
|
+
* Whether the interval breaks the constraint `kind` at `time`: a start before `startNoEarlierThan` or after
|
|
25
|
+
* `startNoLaterThan`, a finish (`end`) before `finishNoEarlierThan` or after `finishNoLaterThan`, or a start other than
|
|
26
|
+
* `fixedStart`. GanttChart and `renderTimelineSvg` draw such a constraint as violated.
|
|
27
|
+
*/
|
|
28
|
+
export declare function timelineConstraintViolated(range: TimeRange, kind: TimelineConstraintKind, time: number): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The constraint fields of any object, for example a `ScheduleTask`, as a new `TimelineConstraints` with only the
|
|
31
|
+
* kinds that are set, or undefined when none is. Use it to build `TimelineBar.constraints` from scheduler tasks; the
|
|
32
|
+
* other direction needs no helper, because `{ ...task, ...bar.constraints }` is a valid `ScheduleTask`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function timelineConstraints(source: Readonly<TimelineConstraints> | undefined): TimelineConstraints | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Apply a GanttChart `constraint-edit` proposal: returns a new array in which the bar `change.id` is a copy with
|
|
37
|
+
* `constraints[change.kind]` set to `change.after`, or without it when `after` is undefined (the `constraints` field is
|
|
38
|
+
* left out once it is empty). Other bars are the same objects. The input is not modified. Throws an Error for an unknown
|
|
39
|
+
* bar or kind and a RangeError for an `after` that is not a finite time. `before` is not compared with the bar.
|
|
40
|
+
*/
|
|
41
|
+
export declare function applyTimelineConstraintEdit<B extends TimelineBar>(bars: readonly B[], change: TimelineConstraintEdit): B[];
|
|
42
|
+
/** A bar's interval in baseline set `id`: `bar.baseline` for `timelineBaselineId`, otherwise the matching `bar.baselines` entry. */
|
|
43
|
+
export declare function timelineBaseline(bar: Pick<TimelineBar, 'baseline' | 'baselines'>, id: string): TimeRange | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Every baseline set ID that occurs in `bars`: `timelineBaselineId` first when any bar has a `baseline`, then the
|
|
46
|
+
* `baselines` IDs in order of first appearance. GanttChart draws the first `timelineBaselineLimit` of them when
|
|
47
|
+
* `baselineIds` is omitted.
|
|
48
|
+
*/
|
|
49
|
+
export declare function timelineBaselineIds(bars: readonly Pick<TimelineBar, 'baseline' | 'baselines'>[]): string[];
|
|
50
|
+
/**
|
|
51
|
+
* The variance of a bar against a baseline, in the units of the bar: `start` and `end` are the bar's dates minus the
|
|
52
|
+
* baseline's and `duration` is the bar's length minus the baseline's, so positive values mean later or longer. Throws a
|
|
53
|
+
* RangeError for non-finite times.
|
|
54
|
+
*/
|
|
55
|
+
export declare function baselineVariance(bar: TimeRange, baseline: TimeRange): TimelineBaselineVariance;
|
|
56
|
+
/** A monotonic, continuous mapping. All components use the same coordinate space. */
|
|
57
|
+
export interface TimeScale {
|
|
58
|
+
width: number;
|
|
59
|
+
toX(time: number): number;
|
|
60
|
+
toTime(x: number): number;
|
|
61
|
+
}
|
|
62
|
+
export declare function createTimeScale(range: TimeRange, pixelsPerUnit: number): TimeScale;
|
|
63
|
+
/**
|
|
64
|
+
* Mirror a scale for a right-to-left axis: the range start maps to `width` and the range end to 0. Both mappings
|
|
65
|
+
* stay inverse; round trips are exact whenever they are exact for `scale` and `width - x` is exactly representable
|
|
66
|
+
* (for example integer pixel positions). GanttChart does not need it, because it positions elements from the inline
|
|
67
|
+
* start edge; it is used to export right-to-left SVG and is available for custom renderers.
|
|
68
|
+
*/
|
|
69
|
+
export declare function mirrorTimeScale(scale: TimeScale): TimeScale;
|
|
70
|
+
/**
|
|
71
|
+
* Ticks at `anchor + k × step` inside the closed window. With a fractional step, tick values are computed in exact
|
|
72
|
+
* decimal arithmetic when the step and anchor have at most 15 decimal places, so ticks of 0.1 are 0.1, 0.2, 0.3 and
|
|
73
|
+
* not 0.30000000000000004. Integer steps use plain arithmetic.
|
|
74
|
+
*/
|
|
75
|
+
export declare function timeTicks(window: TimeRange, step: number, anchor?: number): number[];
|
|
76
|
+
export declare function visibleRows(scrollTop: number, bodyHeight: number, rowHeight: number, count: number, overscan?: number): {
|
|
77
|
+
first: number;
|
|
78
|
+
afterLast: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Whether an interval overlaps a window. Intervals are half-open, so one that ends at `window.start` or starts at
|
|
82
|
+
* `window.end` does not overlap; a zero-duration interval (milestone) overlaps when it lies inside the closed window,
|
|
83
|
+
* so a milestone at either window edge counts.
|
|
84
|
+
*/
|
|
85
|
+
export declare function intersectsWindow(bar: TimeRange, window: TimeRange): boolean;
|
|
86
|
+
/** Snap displacement relative to the original interval, preserving off-grid starts. */
|
|
87
|
+
export declare function editTimeRange(range: TimeRange, mode: EditMode, delta: number, step: number, bounds: TimeRange, minDuration?: number): TimeRange;
|
|
88
|
+
/** Shape of a dependency connector: right angles (default), right angles with rounded corners, or a smooth curve. */
|
|
89
|
+
export type DependencyPathStyle = 'orthogonal' | 'rounded' | 'curve';
|
|
90
|
+
/**
|
|
91
|
+
* SVG path of a dependency connector from (x1, y1) to (x2, y2). It leaves the source and enters the target horizontally,
|
|
92
|
+
* and loops around through the middle when the target starts left of the source. Any other style throws RangeError.
|
|
93
|
+
*/
|
|
94
|
+
export declare function dependencyPath(x1: number, y1: number, x2: number, y2: number, style?: DependencyPathStyle): string;
|
|
95
|
+
export declare function dependencyTimes(source: TimeRange, target: TimeRange, type?: TimelineDependency['type']): {
|
|
96
|
+
from: number;
|
|
97
|
+
to: number;
|
|
98
|
+
};
|
|
99
|
+
/** Options of `validateTimelineData`. */
|
|
100
|
+
export interface TimelineDataOptions {
|
|
101
|
+
/**
|
|
102
|
+
* Accept a dependency end that names a summary row (a row other rows have as `parentId`) when no bar has that ID, as
|
|
103
|
+
* GanttChart `summaryDependencies` and `renderTimelineSvg` `summaryDependencies` draw them. Default false: every
|
|
104
|
+
* dependency end must be a bar ID.
|
|
105
|
+
*/
|
|
106
|
+
summaryDependencies?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Validate once per input change. IDs must be unique within each collection (rows, bars, dependencies); a row and a
|
|
110
|
+
* bar may share an ID. Throws an Error for a dependency from a bar to itself, naming the dependency and the bar.
|
|
111
|
+
* (`scheduleTasks`, which takes its own links, reports such a link as a cycle instead.) Throws a RangeError for a
|
|
112
|
+
* dependency `lag` that is not a finite number. With `options.summaryDependencies`, a dependency end may also be the ID
|
|
113
|
+
* of a summary row; an ID that is both a bar ID and a row ID always means the bar. As in `scheduleTasks`, a dependency
|
|
114
|
+
* between a summary row and a bar or summary row below it throws an Error.
|
|
115
|
+
*/
|
|
116
|
+
export declare function validateTimelineData(rows: readonly TimelineRow[], bars: readonly TimelineBar[], dependencies?: readonly TimelineDependency[], laneCount?: number, options?: TimelineDataOptions): void;
|
|
117
|
+
/**
|
|
118
|
+
* Default text of a dependency lag in GanttChart (`formatLag`) and `renderTimelineSvg`: a signed number of hours of a
|
|
119
|
+
* millisecond lag, rounded to two decimals, such as `+2 h`, `+0.5 h` or `−1.25 h` (a lead, with U+2212 MINUS SIGN).
|
|
120
|
+
* Charts in other time units should pass their own formatter. Throws a RangeError for a non-finite lag.
|
|
121
|
+
*/
|
|
122
|
+
export declare function formatDependencyLag(lag: number): string;
|
|
123
|
+
/** Build a stable preorder and validate that every row reaches a root. */
|
|
124
|
+
export declare function createTimelineRowTree<R extends TimelineRow>(rows: readonly R[]): {
|
|
125
|
+
row: R;
|
|
126
|
+
depth: number;
|
|
127
|
+
hasChildren: boolean;
|
|
128
|
+
afterSubtree: number;
|
|
129
|
+
}[];
|
|
130
|
+
/** Roll up descendant leaf bars. Explicit parent bars remain separate. */
|
|
131
|
+
export declare function summarizeTimelineRows(tree: ReturnType<typeof createTimelineRowTree>, bars: readonly TimelineBar[]): Map<string, TimelineSummary>;
|
|
132
|
+
/** Derive the dependency type joining a source bar end to a target bar end. */
|
|
133
|
+
export declare function dependencyTypeForEnds(from: TimelineBarEnd, to: TimelineBarEnd): TimelineDependencyType;
|
|
134
|
+
/** The bar ends a dependency type joins. FS joins the source finish to the target start. */
|
|
135
|
+
export declare function dependencyEndsForType(type?: TimelineDependency['type']): {
|
|
136
|
+
from: TimelineBarEnd;
|
|
137
|
+
to: TimelineBarEnd;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Move several intervals by one snapped displacement. The displacement is clamped so every interval stays inside
|
|
141
|
+
* bounds, which preserves the relative offsets of the group.
|
|
142
|
+
*/
|
|
143
|
+
export declare function moveTimeRanges(ranges: readonly TimeRange[], delta: number, step: number, bounds: TimeRange): TimeRange[];
|
|
144
|
+
/**
|
|
145
|
+
* Remove bars and every dependency that starts or ends at one of them, for example to accept a GanttChart
|
|
146
|
+
* `bars-delete` proposal. Returns new arrays and leaves the inputs unchanged. Every ID must name a bar in `bars`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function removeTimelineBars<B extends TimelineBar, D extends TimelineDependency>(bars: readonly B[], dependencies: readonly D[], ids: Iterable<string>): {
|
|
149
|
+
bars: B[];
|
|
150
|
+
dependencies: D[];
|
|
151
|
+
};
|
|
152
|
+
export interface AssignLanesOptions {
|
|
153
|
+
/**
|
|
154
|
+
* Keep each bar's current `lane` (default 0) unless it conflicts with a bar placed before it in input order; only
|
|
155
|
+
* conflicting bars move, to the lowest free lane. Without it, lanes are assigned first-fit in start order.
|
|
156
|
+
*/
|
|
157
|
+
keepLanes?: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface AssignLanesResult<B extends TimelineBar = TimelineBar> {
|
|
160
|
+
/** New bar objects in input order, each with `lane` set. */
|
|
161
|
+
bars: B[];
|
|
162
|
+
/** The largest lane count of any row, at least 1. Pass it as GanttChart `laneCount`. */
|
|
163
|
+
laneCount: number;
|
|
164
|
+
/** Lanes used by each row that has bars: the highest lane plus one. */
|
|
165
|
+
rowLaneCounts: Map<string, number>;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Assign lanes so that the bars of one row never overlap within a lane. The default first-fit pass in start order
|
|
169
|
+
* (ties keep input order) uses the fewest lanes possible. `keepLanes` keeps stable lanes for interactive edits.
|
|
170
|
+
* Returns new bar objects and leaves the input unchanged.
|
|
171
|
+
*/
|
|
172
|
+
export declare function assignLanes<B extends TimelineBar>(bars: readonly B[], options?: AssignLanesOptions): AssignLanesResult<B>;
|
|
173
|
+
/**
|
|
174
|
+
* Build one header band level from calendar units in epoch milliseconds. Bands are aligned to a fixed UTC offset or
|
|
175
|
+
* to local time in an IANA `timeZone`, clipped to the range and labelled from their unclipped boundaries: ISO-like by
|
|
176
|
+
* default, with `Intl.DateTimeFormat` when `locale` or `labelFormat` is set, or by a custom `label` function.
|
|
177
|
+
*
|
|
178
|
+
* With `timeZone`, day, week, month and year bands start at the first instant of their local date: local midnight,
|
|
179
|
+
* or the end of a daylight-saving gap that skips midnight. A local date that the zone skips entirely has no band.
|
|
180
|
+
* Hour bands start where local time reaches a multiple of `step` hours counted from local midnight, so a 23-hour day
|
|
181
|
+
* has 23 one-hour bands and a 25-hour day 25, with the repeated hour twice. A grid hour inside a gap starts its band at
|
|
182
|
+
* the end of the gap, so its band is shorter (and absent when the gap ends on the next grid hour).
|
|
183
|
+
*/
|
|
184
|
+
export declare function calendarBands(range: TimeRange, unit: CalendarBandUnit, options?: CalendarBandOptions): TimelineBand[];
|
|
185
|
+
export interface ResourceLoadHistogram {
|
|
186
|
+
segments: TimelineLoadSegment[];
|
|
187
|
+
/** Largest load or capacity among the resource's segments; zero when every segment is empty. */
|
|
188
|
+
peak: number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Group load segments by resource for a histogram band. Segments are sorted by start and must not overlap within a
|
|
192
|
+
* resource. When `resourceIds` is supplied, every segment must reference one of them and each ID gets an entry.
|
|
193
|
+
*/
|
|
194
|
+
export declare function resourceLoadHistogram(segments: readonly TimelineLoadSegment[], resourceIds?: Iterable<string>): Map<string, ResourceLoadHistogram>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { TimeRange } from './timeline.js';
|
|
2
|
+
import type { TimelineBar, TimelineColumn, TimelineDependency, TimelineRow } from './types.js';
|
|
3
|
+
export interface TimelineViewColumn {
|
|
4
|
+
id: string;
|
|
5
|
+
visible: boolean;
|
|
6
|
+
/** Overrides `TimelineColumn.width` when set. */
|
|
7
|
+
width?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface TimelineViewSearch {
|
|
10
|
+
text: string;
|
|
11
|
+
/** Columns whose text is searched. Omit to search every column; with no columns, row labels and details. */
|
|
12
|
+
columnIds?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface TimelineViewSort {
|
|
15
|
+
/** ID of a registered compare rule, or a column ID to compare by that column's value. */
|
|
16
|
+
ruleId: string;
|
|
17
|
+
direction: 'asc' | 'desc';
|
|
18
|
+
}
|
|
19
|
+
/** Declarative, JSON-safe view state. It holds no functions, DOM state, hover state or edit drafts. */
|
|
20
|
+
export interface TimelineViewState {
|
|
21
|
+
version: 1;
|
|
22
|
+
/** Column order and visibility. */
|
|
23
|
+
columns: TimelineViewColumn[];
|
|
24
|
+
search: TimelineViewSearch;
|
|
25
|
+
sort: TimelineViewSort[];
|
|
26
|
+
/** Collapsed row IDs. The projection passes them through; the chart applies them. */
|
|
27
|
+
collapsedIds: string[];
|
|
28
|
+
/** Visible time window. */
|
|
29
|
+
window?: TimeRange;
|
|
30
|
+
/** ID of an application-defined zoom preset. */
|
|
31
|
+
zoom?: string;
|
|
32
|
+
}
|
|
33
|
+
export type TimelineViewDiagnosticCode = 'unknown-column' | 'new-column' | 'duplicate-column' | 'invalid-width' | 'unknown-sort-rule' | 'unknown-row';
|
|
34
|
+
export interface TimelineViewDiagnostic {
|
|
35
|
+
code: TimelineViewDiagnosticCode;
|
|
36
|
+
id: string;
|
|
37
|
+
message: string;
|
|
38
|
+
}
|
|
39
|
+
/** Compare two rows for one sort rule. Negative: `a` first. Ties keep the original order. */
|
|
40
|
+
export type TimelineRowCompare<R extends TimelineRow = TimelineRow> = (a: R, b: R) => number;
|
|
41
|
+
export interface TimelineViewInput<R extends TimelineRow = TimelineRow, B extends TimelineBar = TimelineBar, D extends TimelineDependency = TimelineDependency> {
|
|
42
|
+
rows: readonly R[];
|
|
43
|
+
bars: readonly B[];
|
|
44
|
+
dependencies?: readonly D[];
|
|
45
|
+
/** Needed to resolve column IDs in the state. */
|
|
46
|
+
columns?: readonly TimelineColumn<R>[];
|
|
47
|
+
/** Registered compare rules by ID. */
|
|
48
|
+
sortRules?: Readonly<Record<string, TimelineRowCompare<R>>>;
|
|
49
|
+
/** Same meaning as the `laneCount` prop. Default: the lanes the bars use. */
|
|
50
|
+
laneCount?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface TimelineHiddenTarget {
|
|
53
|
+
barId: string;
|
|
54
|
+
rowId: string;
|
|
55
|
+
/** Removed dependencies that connected this hidden bar to a visible one. */
|
|
56
|
+
dependencyIds: string[];
|
|
57
|
+
/** The visible bars on the other end of those dependencies. */
|
|
58
|
+
visibleBarIds: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface TimelineViewProjection<R extends TimelineRow = TimelineRow, B extends TimelineBar = TimelineBar, D extends TimelineDependency = TimelineDependency> {
|
|
61
|
+
rows: R[];
|
|
62
|
+
bars: B[];
|
|
63
|
+
dependencies: D[];
|
|
64
|
+
/** IDs of the rows that matched the search (without the ancestors that were kept for them). Empty without a search. */
|
|
65
|
+
matchedRowIds: string[];
|
|
66
|
+
/** Dependencies dropped because an endpoint bar is not shown. */
|
|
67
|
+
removedDependencyIds: string[];
|
|
68
|
+
removedDependencyCount: number;
|
|
69
|
+
/** Hidden bars a visible bar still depends on or feeds, for "show hidden" navigation. */
|
|
70
|
+
hiddenTargets: TimelineHiddenTarget[];
|
|
71
|
+
/** WBS codes computed from the original row array, never from the display order. */
|
|
72
|
+
wbs: Map<string, string>;
|
|
73
|
+
collapsedIds: string[];
|
|
74
|
+
window?: TimeRange;
|
|
75
|
+
zoom?: string;
|
|
76
|
+
diagnostics: TimelineViewDiagnostic[];
|
|
77
|
+
}
|
|
78
|
+
/** A view that shows every column in declared order with no search, sort or collapsed rows. */
|
|
79
|
+
export declare function createTimelineViewState(columns?: readonly Pick<TimelineColumn, 'id'>[], patch?: Partial<Omit<TimelineViewState, 'version'>>): TimelineViewState;
|
|
80
|
+
/** Validate untrusted JSON (for example a stored view) and return a plain, normalised state. Throws on a bad shape. */
|
|
81
|
+
export declare function parseTimelineViewState(value: unknown): TimelineViewState;
|
|
82
|
+
/**
|
|
83
|
+
* Reconcile a (possibly old) state with the current columns. Unknown column IDs are dropped and reported;
|
|
84
|
+
* columns the state has not seen are appended after the known ones, visible, in their declared order.
|
|
85
|
+
* Bad widths are dropped and reported. Does not change `state`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function reconcileTimelineViewColumns(state: TimelineViewState, columns: readonly Pick<TimelineColumn, 'id'>[]): {
|
|
88
|
+
columns: TimelineViewColumn[];
|
|
89
|
+
diagnostics: TimelineViewDiagnostic[];
|
|
90
|
+
};
|
|
91
|
+
/** The columns to render: ordered, hidden ones removed, saved widths applied. Returns new column objects. */
|
|
92
|
+
export declare function resolveTimelineColumns<C extends Pick<TimelineColumn, 'id' | 'width'>>(state: TimelineViewState, columns: readonly C[]): {
|
|
93
|
+
columns: C[];
|
|
94
|
+
diagnostics: TimelineViewDiagnostic[];
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Project the data for display. Rows that match the search stay with their ancestors, siblings are sorted
|
|
98
|
+
* stably, and dependencies to hidden bars are removed and reported. The result passes
|
|
99
|
+
* `validateTimelineData`. Inputs are not changed, and WBS codes come from the original rows.
|
|
100
|
+
*/
|
|
101
|
+
export declare function projectTimelineView<R extends TimelineRow, B extends TimelineBar, D extends TimelineDependency = TimelineDependency>(input: TimelineViewInput<R, B, D>, state: TimelineViewState): TimelineViewProjection<R, B, D>;
|