@eightkk/vue-weave 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +525 -0
- package/CONTRIBUTING.md +116 -0
- package/LICENSE +21 -0
- package/README.ja.md +278 -0
- package/README.md +275 -2
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/dist/core-LWK21xl4.js +13672 -0
- package/dist/core.js +1 -0
- package/dist/index.js +8505 -0
- package/dist/style.css +2 -0
- package/dist/types/components/GanttChart.vue.d.ts +353 -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 +76 -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/sheetEditing.d.ts +36 -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 +805 -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 +2009 -0
- package/docs/architecture.md +112 -0
- package/docs/code-of-conduct.md +24 -0
- package/docs/integration.md +964 -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,805 @@
|
|
|
1
|
+
import type { GraphBox, GraphEdge, GraphLayout, GraphPoint, IdentifiedNode } from './graph.js';
|
|
2
|
+
import type { GraphGroup } from './graph.js';
|
|
3
|
+
import type { EditMode, TimeRange } from './timeline.js';
|
|
4
|
+
import type { TimelineFieldSpec, TimelineFieldEdit } from './fieldEditing.js';
|
|
5
|
+
import type { SvgExportThemeInput } from './exportSvg.js';
|
|
6
|
+
import type { GraphRect } from './graphView.js';
|
|
7
|
+
import type { GraphEdgeBand } from './graphFlow.js';
|
|
8
|
+
export type ChartTone = 'teal' | 'blue' | 'amber' | 'violet';
|
|
9
|
+
/**
|
|
10
|
+
* A node of NetworkGraph. `D` types the optional `data` payload; it defaults to `unknown`, so `NetworkNode` without a type
|
|
11
|
+
* argument is unchanged.
|
|
12
|
+
*/
|
|
13
|
+
export interface NetworkNode<D = unknown> extends IdentifiedNode {
|
|
14
|
+
label: string;
|
|
15
|
+
detail?: string;
|
|
16
|
+
tone?: ChartTone;
|
|
17
|
+
draggable?: boolean;
|
|
18
|
+
/** False keeps the node out of NetworkGraph deletion proposals (`deletable`). */
|
|
19
|
+
deletable?: boolean;
|
|
20
|
+
/** Outline drawn by the default renderer and `renderGraphSvg`. Default `'box'`. */
|
|
21
|
+
shape?: NetworkNodeShape;
|
|
22
|
+
/** False hides the NetworkGraph resize handles of this node (`resizable`). */
|
|
23
|
+
resizable?: boolean;
|
|
24
|
+
/** Application data. The components pass it through untouched. */
|
|
25
|
+
data?: D;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The outline of a node in its layout box. `box` (the default) and `rounded` are rectangles with small and large corner
|
|
29
|
+
* radii; `diamond`, `ellipse` and `hexagon` are drawn inside the box and centre the label and detail text.
|
|
30
|
+
*/
|
|
31
|
+
export type NetworkNodeShape = 'box' | 'rounded' | 'diamond' | 'ellipse' | 'hexagon';
|
|
32
|
+
/**
|
|
33
|
+
* A custom NetworkGraph layout. `N` and `E` type the nodes and edges it receives; with collapsed groups they include
|
|
34
|
+
* proxy nodes and re-attached edges (see `GraphShownNode` and `GraphShownEdge`).
|
|
35
|
+
*/
|
|
36
|
+
export type GraphLayoutFunction<N extends NetworkNode = NetworkNode, E extends GraphEdge = GraphEdge> = (nodes: readonly N[], edges: readonly E[]) => GraphLayout;
|
|
37
|
+
export interface GraphViewport {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
scale: number;
|
|
41
|
+
}
|
|
42
|
+
/** A GanttChart row. `D` types the optional `data` payload; it defaults to `unknown`. */
|
|
43
|
+
export interface TimelineRow<D = unknown> {
|
|
44
|
+
id: string;
|
|
45
|
+
parentId?: string;
|
|
46
|
+
label: string;
|
|
47
|
+
detail?: string;
|
|
48
|
+
/** Application data. The components pass it through untouched. */
|
|
49
|
+
data?: D;
|
|
50
|
+
}
|
|
51
|
+
/** A GanttChart bar. `D` types the optional `data` payload; it defaults to `unknown`. */
|
|
52
|
+
export interface TimelineBar<D = unknown> extends TimeRange {
|
|
53
|
+
id: string;
|
|
54
|
+
rowId: string;
|
|
55
|
+
label: string;
|
|
56
|
+
lane?: number;
|
|
57
|
+
tone?: ChartTone;
|
|
58
|
+
appearance?: 'outline' | 'solid';
|
|
59
|
+
editable?: boolean;
|
|
60
|
+
progress?: number;
|
|
61
|
+
/**
|
|
62
|
+
* The single unnamed baseline, drawn below the bar. It takes part in baseline selection as the set
|
|
63
|
+
* `timelineBaselineId` (`'$baseline'`).
|
|
64
|
+
*/
|
|
65
|
+
baseline?: TimeRange;
|
|
66
|
+
/**
|
|
67
|
+
* Named baselines, at most one per set ID (for example `plan` or `rev1`). Each is a finite interval with `end >= start`;
|
|
68
|
+
* the set ID `timelineBaselineId` is reserved for `baseline`. GanttChart `baselineIds` chooses the sets that are drawn.
|
|
69
|
+
*/
|
|
70
|
+
baselines?: readonly TimelineBaseline[];
|
|
71
|
+
/** Application data. The components pass it through untouched. */
|
|
72
|
+
data?: D;
|
|
73
|
+
/** Draws the bar with the critical outline (`--vw-critical`) and adds `GanttLabels.critical` to its description. */
|
|
74
|
+
critical?: boolean;
|
|
75
|
+
/** Latest finish that keeps the plan; a float line is drawn from `end` to it. Finite and not before `end`. */
|
|
76
|
+
latestEnd?: number;
|
|
77
|
+
/** A due time, drawn as an indicator in the bar's lane. A bar whose `end` is after it is marked late. */
|
|
78
|
+
deadline?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Extra text about the bar for assistive technology and the native tooltip, for example "Manually scheduled". GanttChart
|
|
81
|
+
* puts it first in the bar's accessible description, before the critical, float, deadline, constraint and baseline
|
|
82
|
+
* facts, and after the dates in its `title`; `renderTimelineSvg` adds it to the bar's `<title>`. The accessible name is
|
|
83
|
+
* unchanged. Must be a string; blank text is ignored.
|
|
84
|
+
*/
|
|
85
|
+
description?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Worked pieces of a split bar: sorted, non-overlapping, positive-length intervals inside [start, end]. The gaps are
|
|
88
|
+
* drawn as a thin connector. Not allowed on milestones.
|
|
89
|
+
*/
|
|
90
|
+
segments?: readonly TimeRange[];
|
|
91
|
+
/**
|
|
92
|
+
* Whether Delete or Backspace may propose removing the bar when the chart's `deletable` prop is set.
|
|
93
|
+
* Defaults to `editable`.
|
|
94
|
+
*/
|
|
95
|
+
deletable?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Scheduling constraints, drawn as markers in the bar's lane and added to its description. The fields are named as in
|
|
98
|
+
* `ScheduleTask`, so they spread into a task unchanged. Each is a finite time in the chart's units. The chart does not
|
|
99
|
+
* move the bar to meet them; a constraint that the bar's dates break is drawn as violated.
|
|
100
|
+
*/
|
|
101
|
+
constraints?: TimelineConstraints;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The scheduling constraints of a bar, named as in `ScheduleTask`. Times are in the chart's units. Logically conflicting
|
|
105
|
+
* combinations are allowed; whether they can be met is decided by the scheduler.
|
|
106
|
+
*/
|
|
107
|
+
export interface TimelineConstraints {
|
|
108
|
+
/** The bar may not start before this time. */
|
|
109
|
+
startNoEarlierThan?: number;
|
|
110
|
+
/** The bar may not start after this time. */
|
|
111
|
+
startNoLaterThan?: number;
|
|
112
|
+
/** The bar may not finish before this time. */
|
|
113
|
+
finishNoEarlierThan?: number;
|
|
114
|
+
/** The bar may not finish after this time. */
|
|
115
|
+
finishNoLaterThan?: number;
|
|
116
|
+
/**
|
|
117
|
+
* The bar must start at this time. It is independent of the bar's own `start`: a bar that starts at another time is
|
|
118
|
+
* drawn with the constraint violated, as the scheduler would report it.
|
|
119
|
+
*/
|
|
120
|
+
fixedStart?: number;
|
|
121
|
+
}
|
|
122
|
+
/** The name of one scheduling constraint. See `timelineConstraintKinds`. */
|
|
123
|
+
export type TimelineConstraintKind = keyof TimelineConstraints;
|
|
124
|
+
/**
|
|
125
|
+
* A constraint proposal from GanttChart (`constraintsEditable`). Apply it with `applyTimelineConstraintEdit`, or set
|
|
126
|
+
* the bar's `constraints[kind]` to `after` (remove it when `after` is undefined).
|
|
127
|
+
*/
|
|
128
|
+
export interface TimelineConstraintEdit {
|
|
129
|
+
/** The bar ID. */
|
|
130
|
+
id: string;
|
|
131
|
+
kind: TimelineConstraintKind;
|
|
132
|
+
/** The constraint's time before the edit, or undefined when the bar did not have it. */
|
|
133
|
+
before: number | undefined;
|
|
134
|
+
/** The proposed time, snapped and kept inside `editBounds`, or undefined to remove the constraint. */
|
|
135
|
+
after: number | undefined;
|
|
136
|
+
source: 'pointer' | 'keyboard';
|
|
137
|
+
}
|
|
138
|
+
/** Synchronous check of a `constraint-edit` proposal. Accept with true or undefined; reject with false or a reason. */
|
|
139
|
+
export type ConstraintEditValidator = (change: TimelineConstraintEdit) => boolean | string | void;
|
|
140
|
+
/** A recorded interval of a bar in the baseline set `id`, for example `plan` or `rev1`. */
|
|
141
|
+
export interface TimelineBaseline extends TimeRange {
|
|
142
|
+
/** Nonempty ID of the baseline set, unique per bar. */
|
|
143
|
+
id: string;
|
|
144
|
+
}
|
|
145
|
+
/** A bar's interval minus a baseline: positive values are later or longer than the baseline. See `baselineVariance`. */
|
|
146
|
+
export interface TimelineBaselineVariance {
|
|
147
|
+
/** `bar.start - baseline.start`. */
|
|
148
|
+
start: number;
|
|
149
|
+
/** `bar.end - baseline.end`. */
|
|
150
|
+
end: number;
|
|
151
|
+
/** `(bar.end - bar.start) - (baseline.end - baseline.start)`. */
|
|
152
|
+
duration: number;
|
|
153
|
+
}
|
|
154
|
+
export interface TimelineSummary extends TimeRange {
|
|
155
|
+
count: number;
|
|
156
|
+
progress?: number;
|
|
157
|
+
}
|
|
158
|
+
/** An extra GanttChart column. `R` types the rows its callbacks receive. */
|
|
159
|
+
export interface TimelineColumn<R extends TimelineRow = TimelineRow> {
|
|
160
|
+
id: string;
|
|
161
|
+
label: string;
|
|
162
|
+
width: number;
|
|
163
|
+
value: (row: R, summary?: TimelineSummary) => string | number;
|
|
164
|
+
editable?: boolean | ((row: R) => boolean);
|
|
165
|
+
/** Optional typed field definition. Leave it unset to keep the plain text cell behaviour. */
|
|
166
|
+
field?: TimelineFieldSpec<R>;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* One GanttChart spreadsheet operation (`sheet-edit`), proposed as a whole: apply both lists as a single transaction,
|
|
170
|
+
* for example with `applyTimelineSheetEdit`.
|
|
171
|
+
*/
|
|
172
|
+
export interface TimelineSheetEdit<R extends TimelineRow = TimelineRow> {
|
|
173
|
+
/** `paste` (clipboard), `fill` (Ctrl/Cmd+D or the fill handle) or `clear` (Delete, Backspace or cut). */
|
|
174
|
+
action: 'paste' | 'fill' | 'clear';
|
|
175
|
+
/** Edits of typed columns (`column.field`), in row then column order. */
|
|
176
|
+
fieldEdits: TimelineFieldEdit<R>[];
|
|
177
|
+
/** Edits of plain editable columns, in row then column order. */
|
|
178
|
+
cellEdits: TimelineCellEdit[];
|
|
179
|
+
}
|
|
180
|
+
export interface TimelineCellEdit {
|
|
181
|
+
rowId: string;
|
|
182
|
+
columnId: string;
|
|
183
|
+
before: string | number;
|
|
184
|
+
after: string;
|
|
185
|
+
}
|
|
186
|
+
/** Why GanttChart cancelled an in-flight edit (`edit-cancel`). */
|
|
187
|
+
export type TimelineEditCancelReason = 'escape' | 'source-changed' | 'api' | 'pointer-cancel' | 'hidden';
|
|
188
|
+
/**
|
|
189
|
+
* Payload of the GanttChart `edit-cancel` event. It is emitted only when an edit was in flight: a pointer gesture
|
|
190
|
+
* (move, resize, progress, constraint, connection, create, row or column drag), an armed connection or an open
|
|
191
|
+
* `cell-editor`. `barIds` lists the bars of the gesture (empty for a create, row, column or cell edit); `cell` names
|
|
192
|
+
* the cell of a cancelled `cell-editor`.
|
|
193
|
+
*/
|
|
194
|
+
export interface TimelineEditCancel {
|
|
195
|
+
reason: TimelineEditCancelReason;
|
|
196
|
+
barIds: readonly string[];
|
|
197
|
+
cell?: {
|
|
198
|
+
rowId: string;
|
|
199
|
+
columnId: string;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export interface TimelineBand extends TimeRange {
|
|
203
|
+
label: string;
|
|
204
|
+
}
|
|
205
|
+
export interface TimelineMarker {
|
|
206
|
+
id: string;
|
|
207
|
+
time: number;
|
|
208
|
+
label: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* A highlighted half-open time range `[start, end)` (GanttChart `markerRanges`): a shaded band across the chart body
|
|
212
|
+
* with its label in the header. `end` must be greater than `start`; use a `TimelineMarker` for a single point in time.
|
|
213
|
+
*/
|
|
214
|
+
export interface TimelineMarkerRange extends TimeRange {
|
|
215
|
+
/** Unique among the marker ranges of a chart. */
|
|
216
|
+
id: string;
|
|
217
|
+
label: string;
|
|
218
|
+
/** Colour of the band and its label. Defaults to the `--vw-range-*` colours. */
|
|
219
|
+
tone?: ChartTone;
|
|
220
|
+
/** Shade only these rows. Every ID must name a row. Defaults to the full height, including load rows. */
|
|
221
|
+
rowIds?: readonly string[];
|
|
222
|
+
}
|
|
223
|
+
export interface TimelineDependency {
|
|
224
|
+
id: string;
|
|
225
|
+
from: string;
|
|
226
|
+
to: string;
|
|
227
|
+
type?: 'FS' | 'SS' | 'FF' | 'SF';
|
|
228
|
+
/**
|
|
229
|
+
* Lag in the chart's time units (milliseconds by default): the elapsed time between the linked bar ends. A negative
|
|
230
|
+
* value is a lead. GanttChart draws a non-zero lag as a label on the connector and in the dependency's description;
|
|
231
|
+
* omitted or 0 draws nothing extra. `ScheduleLink` extends this type, so the lag reaches `scheduleTasks`.
|
|
232
|
+
*/
|
|
233
|
+
lag?: number;
|
|
234
|
+
}
|
|
235
|
+
export interface TimelineEdit {
|
|
236
|
+
id: string;
|
|
237
|
+
before: TimeRange;
|
|
238
|
+
after: TimeRange;
|
|
239
|
+
mode: EditMode;
|
|
240
|
+
source: 'pointer' | 'keyboard';
|
|
241
|
+
/** Present only when the proposal moves the bar to another row (`rowDraggable`). */
|
|
242
|
+
row?: {
|
|
243
|
+
before: string;
|
|
244
|
+
after: string;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
export type EditValidator = (change: TimelineEdit) => boolean | string | void;
|
|
248
|
+
export interface GraphLabels {
|
|
249
|
+
region: string;
|
|
250
|
+
empty: string;
|
|
251
|
+
zoom: string;
|
|
252
|
+
zoomIn: string;
|
|
253
|
+
zoomOut: string;
|
|
254
|
+
fit: string;
|
|
255
|
+
minimap?: string;
|
|
256
|
+
connectFrom?: string;
|
|
257
|
+
connectTo?: string;
|
|
258
|
+
reconnectSource?: string;
|
|
259
|
+
reconnectTarget?: string;
|
|
260
|
+
moveGroup?: string;
|
|
261
|
+
rejected?: string;
|
|
262
|
+
selectEdge?: string;
|
|
263
|
+
groupWithin?: string;
|
|
264
|
+
/** Announced when `validateDelete` returns false. */
|
|
265
|
+
deleteRejected?: string;
|
|
266
|
+
/** Name prefix of the toggle that collapses a group, followed by the group label. Default "Collapse group". */
|
|
267
|
+
collapseGroup?: string;
|
|
268
|
+
/** Name prefix of the toggle that expands a collapsed group, followed by the group label. Default "Expand group". */
|
|
269
|
+
expandGroup?: string;
|
|
270
|
+
/** Proxy detail after a member count of one. Default "node". */
|
|
271
|
+
collapsedNode?: string;
|
|
272
|
+
/** Proxy detail after any other member count. Default "nodes". */
|
|
273
|
+
collapsedNodes?: string;
|
|
274
|
+
/** Name prefix of a waypoint handle, followed by its number and the edge label or ID. Default "Move waypoint". */
|
|
275
|
+
moveWaypoint?: string;
|
|
276
|
+
/** Name prefix of a handle that inserts a waypoint, followed by its number and the edge label or ID. Default "Add waypoint". */
|
|
277
|
+
addWaypoint?: string;
|
|
278
|
+
/** Announced when `validateEdgeReshape` returns false. Default "This edge change was rejected." */
|
|
279
|
+
reshapeRejected?: string;
|
|
280
|
+
/** Name prefix of a resize handle, followed by the node label and the corner. Default "Resize". */
|
|
281
|
+
resizeNode?: string;
|
|
282
|
+
/** Corner names of the resize handles. Defaults "top left", "top right", "bottom left" and "bottom right". */
|
|
283
|
+
topLeft?: string;
|
|
284
|
+
topRight?: string;
|
|
285
|
+
bottomLeft?: string;
|
|
286
|
+
bottomRight?: string;
|
|
287
|
+
/** Announced when `validateNodeResize` returns false. Default "This resize was rejected." */
|
|
288
|
+
resizeRejected?: string;
|
|
289
|
+
/** Name prefix of the inline label editor (`editableLabels`), followed by the node label or the edge label or ID. Default "Edit label of". */
|
|
290
|
+
editLabel?: string;
|
|
291
|
+
/** Announced when `validateLabelEdit` returns false. Default "This label change was rejected." */
|
|
292
|
+
labelRejected?: string;
|
|
293
|
+
/** Name prefix of the `node-toolbar` slot's group, followed by the node label. Default "Node actions". */
|
|
294
|
+
nodeToolbar?: string;
|
|
295
|
+
/** Name prefix of the `edge-toolbar` slot's group, followed by the edge label or ID. Default "Edge actions". */
|
|
296
|
+
edgeToolbar?: string;
|
|
297
|
+
}
|
|
298
|
+
export interface GanttLabels {
|
|
299
|
+
region: string;
|
|
300
|
+
rows: string;
|
|
301
|
+
empty: string;
|
|
302
|
+
zoom: string;
|
|
303
|
+
zoomIn: string;
|
|
304
|
+
zoomOut: string;
|
|
305
|
+
editHint: string;
|
|
306
|
+
rejected: string;
|
|
307
|
+
expandRow?: string;
|
|
308
|
+
collapseRow?: string;
|
|
309
|
+
/** Label of the unnamed baseline (`TimelineBar.baseline`) in titles and descriptions. Default "Baseline". */
|
|
310
|
+
baseline?: string;
|
|
311
|
+
/** Word before the start variance in baseline titles and descriptions. Default "start". */
|
|
312
|
+
baselineStart?: string;
|
|
313
|
+
/** Word before the finish variance in baseline titles and descriptions. Default "finish". */
|
|
314
|
+
baselineFinish?: string;
|
|
315
|
+
/** Word before the duration variance in baseline titles and descriptions. Default "duration". */
|
|
316
|
+
baselineDuration?: string;
|
|
317
|
+
connectFrom?: string;
|
|
318
|
+
connectTo?: string;
|
|
319
|
+
startOf?: string;
|
|
320
|
+
finishOf?: string;
|
|
321
|
+
selectDependency?: string;
|
|
322
|
+
reconnectSource?: string;
|
|
323
|
+
reconnectTarget?: string;
|
|
324
|
+
connectionRejected?: string;
|
|
325
|
+
zoomPresets?: string;
|
|
326
|
+
now?: string;
|
|
327
|
+
loadRegion?: string;
|
|
328
|
+
load?: string;
|
|
329
|
+
capacity?: string;
|
|
330
|
+
overload?: string;
|
|
331
|
+
moveRowHint?: string;
|
|
332
|
+
/** Bar description for `TimelineBar.critical`. Default "Critical". */
|
|
333
|
+
critical?: string;
|
|
334
|
+
/** Bar description prefix before the formatted `latestEnd`. Default "Float until". */
|
|
335
|
+
float?: string;
|
|
336
|
+
/** Bar description prefix before the formatted `deadline`. Default "Deadline". */
|
|
337
|
+
deadline?: string;
|
|
338
|
+
/** Bar description for a bar that ends after its deadline. Default "Late". */
|
|
339
|
+
late?: string;
|
|
340
|
+
/** Accessible name prefix of the progress slider, followed by the bar label. Default "Progress of". */
|
|
341
|
+
progressOf?: string;
|
|
342
|
+
/** Description of a deletable bar. Default "Delete or Backspace removes the bar." */
|
|
343
|
+
deleteHint?: string;
|
|
344
|
+
/** Accessible name prefix of the add-bar button of a creatable row, followed by the row label. Default "Add bar to". */
|
|
345
|
+
createIn?: string;
|
|
346
|
+
/** Announced when `validateCreate` returns false. Default "This new bar was rejected." */
|
|
347
|
+
createRejected?: string;
|
|
348
|
+
/** Accessible name prefix of a row's move handle (`rowsReorderable`), followed by the row label. Default "Move row". */
|
|
349
|
+
moveRow?: string;
|
|
350
|
+
/** Description of the row move handles. Default lists the Alt key shortcuts. */
|
|
351
|
+
moveRowKeysHint?: string;
|
|
352
|
+
/** Description of spreadsheet cells (`spreadsheet`). Default lists the selection and editing keys. */
|
|
353
|
+
sheetHint?: string;
|
|
354
|
+
/** Reason of a spreadsheet operation that would change a read-only cell. Default "Read-only cell." */
|
|
355
|
+
sheetReadOnly?: string;
|
|
356
|
+
/** Reason of a paste whose records have different numbers of cells. Default "The pasted rows must have the same number of cells." */
|
|
357
|
+
sheetRagged?: string;
|
|
358
|
+
/** Reason of a paste that extends past the last row or column. Default "The pasted cells extend past the table." */
|
|
359
|
+
sheetOutside?: string;
|
|
360
|
+
/** Announced when `validateSheetEdit` returns false. Default "This sheet change was rejected." */
|
|
361
|
+
sheetRejected?: string;
|
|
362
|
+
/** Announced when `validateRowMove` returns false. Default "This row move was rejected." */
|
|
363
|
+
rowMoveRejected?: string;
|
|
364
|
+
/** Label of the status-date line (`statusDate`). Default "Status date". */
|
|
365
|
+
statusDate?: string;
|
|
366
|
+
/** Accessible name prefix of a column resize handle (`columnsResizable`), followed by the column label. Default "Resize column". */
|
|
367
|
+
resizeColumn?: string;
|
|
368
|
+
/** Announced when `validateColumnResize` returns false. Default "This column resize was rejected." */
|
|
369
|
+
columnResizeRejected?: string;
|
|
370
|
+
/** Description prefix of a dependency with a non-zero `lag`, before the formatted lag. Default "Lag". */
|
|
371
|
+
lag?: string;
|
|
372
|
+
/** Text of a `startNoEarlierThan` constraint in descriptions and handle names. Default "Start no earlier than". */
|
|
373
|
+
startNoEarlierThan?: string;
|
|
374
|
+
/** Text of a `startNoLaterThan` constraint. Default "Start no later than". */
|
|
375
|
+
startNoLaterThan?: string;
|
|
376
|
+
/** Text of a `finishNoEarlierThan` constraint. Default "Finish no earlier than". */
|
|
377
|
+
finishNoEarlierThan?: string;
|
|
378
|
+
/** Text of a `finishNoLaterThan` constraint. Default "Finish no later than". */
|
|
379
|
+
finishNoLaterThan?: string;
|
|
380
|
+
/** Text of a `fixedStart` constraint. Default "Must start on". */
|
|
381
|
+
fixedStart?: string;
|
|
382
|
+
/** Added after a constraint that the bar's dates break, in descriptions and handle values. Default "violated". */
|
|
383
|
+
constraintViolated?: string;
|
|
384
|
+
/** Description of the constraint handles (`constraintsEditable`). Default lists the keys. */
|
|
385
|
+
constraintHint?: string;
|
|
386
|
+
/** Announced when `validateConstraintEdit` returns false. Default "This constraint change was rejected." */
|
|
387
|
+
constraintRejected?: string;
|
|
388
|
+
}
|
|
389
|
+
/** Second argument of the GanttChart `select` event. */
|
|
390
|
+
export interface TimelineSelectDetail {
|
|
391
|
+
/** True when the click ended a pointer drag of the bar, which proposed a move or resize through `edit`. */
|
|
392
|
+
dragged: boolean;
|
|
393
|
+
}
|
|
394
|
+
/** Props of the NetworkGraph `node` slot. `N` types the node. */
|
|
395
|
+
export interface NetworkNodeSlot<N extends NetworkNode = NetworkNode> {
|
|
396
|
+
node: N;
|
|
397
|
+
box: GraphBox;
|
|
398
|
+
selected: boolean;
|
|
399
|
+
dimmed?: boolean;
|
|
400
|
+
/** True when the node is in `relatedIds`. */
|
|
401
|
+
related: boolean;
|
|
402
|
+
/** True when the node is in `highlightedNodeIds`. */
|
|
403
|
+
highlighted: boolean;
|
|
404
|
+
/** The current camera scale, for level-of-detail rendering in custom node slots. */
|
|
405
|
+
scale: number;
|
|
406
|
+
}
|
|
407
|
+
/** Props of the NetworkGraph `edge` slot. `E` types the edge. */
|
|
408
|
+
export interface NetworkEdgeSlot<E extends GraphEdge = GraphEdge> {
|
|
409
|
+
edge: E;
|
|
410
|
+
/** The routed SVG path in chart coordinates. */
|
|
411
|
+
path: string;
|
|
412
|
+
/** True when the edge is selected through `selectedEdgeIds` (only with `edgesSelectable`). Before 0.4.0 this was the related state. */
|
|
413
|
+
selected: boolean;
|
|
414
|
+
/** True when both ends of the edge are in `relatedIds`. */
|
|
415
|
+
related: boolean;
|
|
416
|
+
/** True when the edge is in `highlightedEdgeIds`. */
|
|
417
|
+
highlighted: boolean;
|
|
418
|
+
dimmed?: boolean;
|
|
419
|
+
/** The current camera scale, for level-of-detail rendering in custom edge slots. */
|
|
420
|
+
scale: number;
|
|
421
|
+
/** The band drawing of the edge from the `edgeBands` prop; absent for an edge without a band. */
|
|
422
|
+
band?: GraphEdgeBand;
|
|
423
|
+
}
|
|
424
|
+
/** Props of the NetworkGraph `node-toolbar` slot, shown for the only selected node. `N` types the node. */
|
|
425
|
+
export interface NetworkNodeToolbarSlot<N extends NetworkNode = NetworkNode> {
|
|
426
|
+
node: N;
|
|
427
|
+
/** The node box in chart coordinates. */
|
|
428
|
+
box: GraphBox;
|
|
429
|
+
/** The current camera scale. */
|
|
430
|
+
scale: number;
|
|
431
|
+
}
|
|
432
|
+
/** Props of the NetworkGraph `edge-toolbar` slot, shown for the selected edge. `E` types the edge. */
|
|
433
|
+
export interface NetworkEdgeToolbarSlot<E extends GraphEdge = GraphEdge> {
|
|
434
|
+
edge: E;
|
|
435
|
+
/** The anchor in chart coordinates: the edge label position, else the middle between the path ends. */
|
|
436
|
+
point: GraphPoint;
|
|
437
|
+
/** The current camera scale. */
|
|
438
|
+
scale: number;
|
|
439
|
+
}
|
|
440
|
+
/** Props of the NetworkGraph `group` slot, which draws a group frame and label in chart coordinates. `G` types the group. */
|
|
441
|
+
export interface NetworkGroupSlot<G extends NetworkGroup = NetworkGroup> {
|
|
442
|
+
group: G;
|
|
443
|
+
/** The frame in chart coordinates, including the label strip at its top. */
|
|
444
|
+
box: GraphRect;
|
|
445
|
+
/** Nesting depth: 0 for a group without `parentId`. */
|
|
446
|
+
depth: number;
|
|
447
|
+
}
|
|
448
|
+
/** Props of the NetworkGraph `minimap-node` slot, which draws one node in the minimap in chart coordinates. */
|
|
449
|
+
export interface NetworkMinimapNodeSlot<N extends NetworkNode = NetworkNode> {
|
|
450
|
+
node: N;
|
|
451
|
+
box: GraphBox;
|
|
452
|
+
selected: boolean;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* A label proposal from NetworkGraph (`editableLabels`). `before` is the current label (empty for an edge without one)
|
|
456
|
+
* and `after` the text typed, unchanged. Set the node's or edge's `label` to accept it.
|
|
457
|
+
*/
|
|
458
|
+
export interface GraphLabelEdit {
|
|
459
|
+
kind: 'node' | 'edge';
|
|
460
|
+
id: string;
|
|
461
|
+
before: string;
|
|
462
|
+
after: string;
|
|
463
|
+
}
|
|
464
|
+
/** How a NetworkGraph `boxSelect` drag selects: a rectangle (`box`) or a free-form outline (`lasso`). */
|
|
465
|
+
export type GraphSelectionMode = 'box' | 'lasso';
|
|
466
|
+
/** A waypoint proposal from NetworkGraph (`editableEdges`). Set the edge's `points` to `after` to accept it. */
|
|
467
|
+
export interface GraphEdgeReshape {
|
|
468
|
+
id: string;
|
|
469
|
+
/** The edge's waypoints before the change; empty when it had none. */
|
|
470
|
+
before: GraphPoint[];
|
|
471
|
+
/** The proposed waypoints; empty when the last one was removed. */
|
|
472
|
+
after: GraphPoint[];
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* A resize proposal from NetworkGraph (`resizable`). Set the node's size to `after.width` and `after.height` (the `sizes`
|
|
476
|
+
* prop) and, when `after.x` or `after.y` changed, its position (the `positions` prop).
|
|
477
|
+
*/
|
|
478
|
+
export interface GraphNodeResize {
|
|
479
|
+
id: string;
|
|
480
|
+
before: GraphRect;
|
|
481
|
+
after: GraphRect;
|
|
482
|
+
}
|
|
483
|
+
/** A visual group. `parentId` nests it inside another group; `nodeIds` lists only its direct members. */
|
|
484
|
+
export interface NetworkGroup extends GraphGroup {
|
|
485
|
+
parentId?: string;
|
|
486
|
+
}
|
|
487
|
+
export interface NetworkFocusOptions {
|
|
488
|
+
/** Camera scale after centering, between 0.1 and 3. Defaults to the current scale. */
|
|
489
|
+
scale?: number;
|
|
490
|
+
}
|
|
491
|
+
/** Options of the NetworkGraph `fit` method. Without options, `fit()` shows the whole graph. */
|
|
492
|
+
export interface GraphFitOptions {
|
|
493
|
+
/** Node IDs whose combined boxes are fitted. An empty list leaves the camera unchanged. */
|
|
494
|
+
ids?: Iterable<string>;
|
|
495
|
+
/** Nonnegative margin in screen pixels kept around the fitted content. Default 0. */
|
|
496
|
+
padding?: number;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* A NetworkGraph gesture that a new layout or other source change would cancel: a node drag (`node-drag` for one
|
|
500
|
+
* node, `nodes-drag` for several, including a group label drag), a resize handle drag (`node-resize`), a waypoint
|
|
501
|
+
* drag (`edge-reshape`), a connection or reconnection from arming to completion (`connect`, `reconnect`), a box
|
|
502
|
+
* selection (`box-select`), a background pan (`pan`) and a two-finger pinch (`pinch`).
|
|
503
|
+
*/
|
|
504
|
+
export type GraphGestureKind = 'node-drag' | 'nodes-drag' | 'node-resize' | 'edge-reshape' | 'connect' | 'reconnect' | 'box-select' | 'pan' | 'pinch';
|
|
505
|
+
/** Payload of the NetworkGraph `gesture-start` event. */
|
|
506
|
+
export interface GraphGesture {
|
|
507
|
+
kind: GraphGestureKind;
|
|
508
|
+
/** 'keyboard' only for a connection or reconnection armed with Enter or Space. */
|
|
509
|
+
source: 'pointer' | 'keyboard';
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Payload of the NetworkGraph `gesture-end` event. `outcome` is 'committed' when the user finished the gesture
|
|
513
|
+
* (released the pointer, or completed or dropped a connection); any proposal or `*-rejected` event it produced was
|
|
514
|
+
* emitted before. It is 'cancelled' when the gesture ended without a proposal: Escape, pointer cancellation or lost
|
|
515
|
+
* capture, a context menu, a second touch, a camera method, unmounting, or a change of source data, layout or
|
|
516
|
+
* coordinates.
|
|
517
|
+
*/
|
|
518
|
+
export interface GraphGestureEnd extends GraphGesture {
|
|
519
|
+
outcome: 'committed' | 'cancelled';
|
|
520
|
+
}
|
|
521
|
+
/** The element a NetworkGraph `context-menu` event refers to. */
|
|
522
|
+
export type GraphContextMenuTarget = {
|
|
523
|
+
kind: 'node';
|
|
524
|
+
id: string;
|
|
525
|
+
} | {
|
|
526
|
+
kind: 'edge';
|
|
527
|
+
id: string;
|
|
528
|
+
} | {
|
|
529
|
+
kind: 'group';
|
|
530
|
+
id: string;
|
|
531
|
+
} | {
|
|
532
|
+
kind: 'canvas';
|
|
533
|
+
};
|
|
534
|
+
/** Payload of the NetworkGraph `context-menu` event. The component renders no menu itself. */
|
|
535
|
+
export interface GraphContextMenu {
|
|
536
|
+
target: GraphContextMenuTarget;
|
|
537
|
+
/** The pointer position, or the centre of the focused element, in chart (world) coordinates. */
|
|
538
|
+
point: GraphPoint;
|
|
539
|
+
/** Viewport coordinates for positioning a menu, for example with `position: fixed`. */
|
|
540
|
+
clientX: number;
|
|
541
|
+
clientY: number;
|
|
542
|
+
source: 'pointer' | 'keyboard';
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Payload of the NetworkGraph `copy-selection` and `duplicate-selection` events: node and edge IDs in input order, including every edge
|
|
546
|
+
* between two listed nodes, and the current top-left position of each listed node in chart coordinates.
|
|
547
|
+
*/
|
|
548
|
+
export interface GraphClipboardSelection {
|
|
549
|
+
nodeIds: string[];
|
|
550
|
+
edgeIds: string[];
|
|
551
|
+
positions: Map<string, GraphPoint>;
|
|
552
|
+
}
|
|
553
|
+
/** Payload of the NetworkGraph `paste-request` event: where to place the pasted content, in chart coordinates. */
|
|
554
|
+
export interface GraphPaste {
|
|
555
|
+
point: GraphPoint;
|
|
556
|
+
}
|
|
557
|
+
/** Props of the NetworkGraph `tooltip` slot. `N` and `E` type the node or edge under the pointer. */
|
|
558
|
+
export interface NetworkTooltipSlot<N extends NetworkNode = NetworkNode, E extends GraphEdge = GraphEdge> {
|
|
559
|
+
target: {
|
|
560
|
+
kind: 'node';
|
|
561
|
+
node: N;
|
|
562
|
+
} | {
|
|
563
|
+
kind: 'edge';
|
|
564
|
+
edge: E;
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
/** The bar end a dependency handle belongs to. `start` maps to S and `finish` to F in a dependency type. */
|
|
568
|
+
export type TimelineBarEnd = 'start' | 'finish';
|
|
569
|
+
export type TimelineDependencyType = 'FS' | 'SS' | 'FF' | 'SF';
|
|
570
|
+
/** A dependency proposal from GanttChart. The parent assigns an ID and updates `dependencies`. */
|
|
571
|
+
export interface TimelineConnection {
|
|
572
|
+
from: string;
|
|
573
|
+
to: string;
|
|
574
|
+
type: TimelineDependencyType;
|
|
575
|
+
/**
|
|
576
|
+
* The dependency's lag. Present only in `reconnect` proposals (`before` and `after`) of a dependency with a non-zero
|
|
577
|
+
* lag, which a reconnection keeps. New `connect` proposals never carry one.
|
|
578
|
+
*/
|
|
579
|
+
lag?: number;
|
|
580
|
+
}
|
|
581
|
+
export interface TimelineReconnect {
|
|
582
|
+
id: string;
|
|
583
|
+
before: TimelineConnection;
|
|
584
|
+
after: TimelineConnection;
|
|
585
|
+
}
|
|
586
|
+
export type TimelineConnectionValidator = (connection: TimelineConnection, replacingDependencyId?: string) => boolean | string | void;
|
|
587
|
+
export type BatchEditValidator = (changes: readonly TimelineEdit[]) => boolean | string | void;
|
|
588
|
+
/** A progress proposal from GanttChart (`progressEditable`). The parent sets the bar's `progress` to `after`. */
|
|
589
|
+
export interface TimelineProgressEdit {
|
|
590
|
+
id: string;
|
|
591
|
+
/** The bar's progress before the edit, or undefined when the bar had none (drawn as 0). */
|
|
592
|
+
before: number | undefined;
|
|
593
|
+
/** Proposed progress from 0 to 1, snapped to `progressStep`; Home and End propose exactly 0 and 1. */
|
|
594
|
+
after: number;
|
|
595
|
+
source: 'pointer' | 'keyboard';
|
|
596
|
+
}
|
|
597
|
+
export type ProgressEditValidator = (change: TimelineProgressEdit) => boolean | string | void;
|
|
598
|
+
/** Synchronous check of a `bars-delete` proposal. Accept with true or undefined; reject with false or a reason. */
|
|
599
|
+
export type BarsDeleteValidator = (ids: readonly string[]) => boolean | string | void;
|
|
600
|
+
/**
|
|
601
|
+
* A new bar proposed by GanttChart (`creatable`): a drag or click on an empty part of a row, or the row's add button.
|
|
602
|
+
* The parent assigns an ID and a label and adds the bar to accept it.
|
|
603
|
+
*/
|
|
604
|
+
export interface TimelineCreate {
|
|
605
|
+
rowId: string;
|
|
606
|
+
/** Zero-based lane: the lane under the pointer, or the lowest free lane for the add button. */
|
|
607
|
+
lane: number;
|
|
608
|
+
start: number;
|
|
609
|
+
end: number;
|
|
610
|
+
/** `keyboard` when the add button was activated with Enter or Space. */
|
|
611
|
+
source: 'pointer' | 'keyboard';
|
|
612
|
+
}
|
|
613
|
+
/** A place in a row hierarchy: the parent row (absent for a root row) and the zero-based index among its children. */
|
|
614
|
+
export interface TimelineRowPosition {
|
|
615
|
+
parentId?: string;
|
|
616
|
+
index: number;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* A row hierarchy proposal from GanttChart (`rowsReorderable`). Apply it with
|
|
620
|
+
* `moveTimelineRow(rows, change.id, change.after)`. `after.index` counts the new siblings without the moved row.
|
|
621
|
+
*/
|
|
622
|
+
export interface TimelineRowMove {
|
|
623
|
+
id: string;
|
|
624
|
+
before: TimelineRowPosition;
|
|
625
|
+
after: TimelineRowPosition;
|
|
626
|
+
source: 'pointer' | 'keyboard';
|
|
627
|
+
}
|
|
628
|
+
/** Synchronous check of a `row-move` proposal. Accept with true or undefined; reject with false or a reason. */
|
|
629
|
+
export type RowMoveValidator = (change: TimelineRowMove) => boolean | string | void;
|
|
630
|
+
/**
|
|
631
|
+
* A column width proposal from GanttChart (`columnsResizable`). `id` is the `TimelineColumn.id`, or
|
|
632
|
+
* `timelineLabelColumnId` for the row label column; set that column's `width` (or the `labelWidth` prop) to `after`
|
|
633
|
+
* to accept it. Widths are in CSS pixels.
|
|
634
|
+
*/
|
|
635
|
+
export interface TimelineColumnResize {
|
|
636
|
+
id: string;
|
|
637
|
+
before: number;
|
|
638
|
+
after: number;
|
|
639
|
+
source: 'pointer' | 'keyboard';
|
|
640
|
+
}
|
|
641
|
+
/** Synchronous check of a `column-resize` proposal. Accept with true or undefined; reject with false or a reason. */
|
|
642
|
+
export type ColumnResizeValidator = (change: TimelineColumnResize) => boolean | string | void;
|
|
643
|
+
/** Synchronous check of a `create` proposal. Accept with true or undefined; reject with false or a reason. */
|
|
644
|
+
export type CreateValidator = (proposal: TimelineCreate) => boolean | string | void;
|
|
645
|
+
/**
|
|
646
|
+
* Auto-scheduling hook of GanttChart (`cascade`): the follow-on changes of other bars for one proposed move or resize.
|
|
647
|
+
* It must be synchronous and free of side effects, because it also runs for every snapped step of a drag preview.
|
|
648
|
+
*/
|
|
649
|
+
export type TimelineCascade = (change: TimelineEdit) => readonly TimelineEdit[];
|
|
650
|
+
/** What a GanttChart `context-menu` event was opened on. */
|
|
651
|
+
export type TimelineContextTarget = {
|
|
652
|
+
kind: 'bar';
|
|
653
|
+
id: string;
|
|
654
|
+
} | {
|
|
655
|
+
kind: 'dependency';
|
|
656
|
+
id: string;
|
|
657
|
+
} | {
|
|
658
|
+
kind: 'row';
|
|
659
|
+
id: string;
|
|
660
|
+
} | {
|
|
661
|
+
kind: 'chart';
|
|
662
|
+
};
|
|
663
|
+
/** Payload of the GanttChart `context-menu` event. The component renders no menu itself. */
|
|
664
|
+
export interface TimelineContextMenu {
|
|
665
|
+
target: TimelineContextTarget;
|
|
666
|
+
/** Time under the pointer when it is over the time area. Absent for the keyboard. */
|
|
667
|
+
time?: number;
|
|
668
|
+
/** Displayed task row under the pointer, or the row of a bar opened from the keyboard. */
|
|
669
|
+
rowId?: string;
|
|
670
|
+
/** Viewport coordinates of the pointer, or of the focused element's centre for the keyboard. */
|
|
671
|
+
clientX: number;
|
|
672
|
+
clientY: number;
|
|
673
|
+
source: 'pointer' | 'keyboard';
|
|
674
|
+
}
|
|
675
|
+
/** Options of the GanttChart `fitToBars` method. */
|
|
676
|
+
export interface TimelineFitOptions {
|
|
677
|
+
/** Space in screen pixels kept on each side of the fitted bars. Default 24. */
|
|
678
|
+
padding?: number;
|
|
679
|
+
}
|
|
680
|
+
export interface TimelineZoomPreset {
|
|
681
|
+
id: string;
|
|
682
|
+
label: string;
|
|
683
|
+
pixelsPerUnit: number;
|
|
684
|
+
tickSteps?: readonly number[];
|
|
685
|
+
headerBands?: readonly (readonly TimelineBand[])[];
|
|
686
|
+
snap?: number;
|
|
687
|
+
}
|
|
688
|
+
export interface TimelineZoomState {
|
|
689
|
+
zoom: number;
|
|
690
|
+
preset?: string;
|
|
691
|
+
}
|
|
692
|
+
export interface TimelineLoadRow {
|
|
693
|
+
id: string;
|
|
694
|
+
label: string;
|
|
695
|
+
detail?: string;
|
|
696
|
+
}
|
|
697
|
+
/** Structurally compatible with `ResourceLoadSegment` from `calculateResourceLoad`. */
|
|
698
|
+
export interface TimelineLoadSegment extends TimeRange {
|
|
699
|
+
resourceId: string;
|
|
700
|
+
load: number;
|
|
701
|
+
capacity: number;
|
|
702
|
+
overload?: number;
|
|
703
|
+
taskIds?: readonly string[];
|
|
704
|
+
}
|
|
705
|
+
export type CalendarBandUnit = 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
706
|
+
/** Local wall-clock fields of a band start, in the `timeZone` or fixed offset of `calendarBands`. */
|
|
707
|
+
export interface CalendarBandLocalTime {
|
|
708
|
+
/** Astronomical year: 0 is 1 BC. */
|
|
709
|
+
year: number;
|
|
710
|
+
/** 1 to 12. */
|
|
711
|
+
month: number;
|
|
712
|
+
day: number;
|
|
713
|
+
hour: number;
|
|
714
|
+
minute: number;
|
|
715
|
+
/** 0 = Sunday to 6 = Saturday. */
|
|
716
|
+
weekday: number;
|
|
717
|
+
/** Local time minus UTC at the band start, in minutes. Can be fractional for historical local mean time. */
|
|
718
|
+
utcOffsetMinutes: number;
|
|
719
|
+
/** The `timeZone` option, or undefined for a fixed offset. */
|
|
720
|
+
timeZone?: string;
|
|
721
|
+
}
|
|
722
|
+
export interface CalendarBandOptions {
|
|
723
|
+
/** Fixed offset from UTC in minutes. Daylight-saving transitions are not applied. Cannot be combined with `timeZone`. */
|
|
724
|
+
utcOffsetMinutes?: number;
|
|
725
|
+
/**
|
|
726
|
+
* IANA time zone such as `Europe/Berlin`. Bands then follow local dates and hours with daylight-saving rules, so a
|
|
727
|
+
* day band can last 23 or 25 hours. Cannot be combined with `utcOffsetMinutes`.
|
|
728
|
+
*/
|
|
729
|
+
timeZone?: string;
|
|
730
|
+
/** Number of units per band. Defaults to 1. */
|
|
731
|
+
step?: number;
|
|
732
|
+
/** First day of a week, 0 = Sunday to 6 = Saturday. Defaults to 1 (Monday). */
|
|
733
|
+
weekStartsOn?: number;
|
|
734
|
+
/** Label for an unclipped band. Times are epoch milliseconds; `local` holds the local fields of `start`. Wins over `locale`. */
|
|
735
|
+
label?: (start: number, end: number, local: CalendarBandLocalTime) => string;
|
|
736
|
+
/**
|
|
737
|
+
* BCP 47 locale (or list) for labels formatted with `Intl.DateTimeFormat` from the local date and time of each band
|
|
738
|
+
* start. Without `locale` and `labelFormat`, labels are ISO-like (`2026-03-29`, `2026-03`, `09:00`). With only
|
|
739
|
+
* `labelFormat`, the locale is `en-US`; the runtime's default locale is never used, so labels match on server and client.
|
|
740
|
+
*/
|
|
741
|
+
locale?: string | readonly string[];
|
|
742
|
+
/**
|
|
743
|
+
* `Intl.DateTimeFormat` options for locale-aware labels. Its `timeZone` is ignored: the band's own local time is
|
|
744
|
+
* formatted. Defaults by unit: hour `{ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }`, day and week
|
|
745
|
+
* `{ year: 'numeric', month: 'short', day: 'numeric' }`, month `{ year: 'numeric', month: 'long' }`, year `{ year: 'numeric' }`.
|
|
746
|
+
*/
|
|
747
|
+
labelFormat?: Intl.DateTimeFormatOptions;
|
|
748
|
+
}
|
|
749
|
+
/** Text direction of a component. `auto` follows the inherited CSS direction after mounting. */
|
|
750
|
+
export type ChartDirection = 'ltr' | 'rtl' | 'auto';
|
|
751
|
+
/** Options of the `exportSvg` method on GanttChart. Current props, collapsed rows and zoom supply everything else. */
|
|
752
|
+
/** `R` and `B` type the rows and bars that `rowLabel` and `barLabel` receive. */
|
|
753
|
+
export interface GanttExportOptions<R extends TimelineRow = TimelineRow, B extends TimelineBar = TimelineBar> {
|
|
754
|
+
/** Export only this time window. Defaults to the whole `range`. */
|
|
755
|
+
timeRange?: TimeRange;
|
|
756
|
+
/** Export displayed rows `start` (inclusive) to `end` (exclusive), counted after collapsing. Defaults to all. */
|
|
757
|
+
rowRange?: {
|
|
758
|
+
start: number;
|
|
759
|
+
end: number;
|
|
760
|
+
};
|
|
761
|
+
/** Include load histogram rows. Default true. */
|
|
762
|
+
includeLoad?: boolean;
|
|
763
|
+
/** Paint an opaque background. Default true. */
|
|
764
|
+
background?: boolean;
|
|
765
|
+
title?: string;
|
|
766
|
+
/** Heading of the row column. Defaults to `labels.rows`; the `row-heading` slot is not exported. */
|
|
767
|
+
rowHeading?: string;
|
|
768
|
+
/** Prefix for marker and clip-path IDs. Defaults to an ID unique to the component instance. */
|
|
769
|
+
idPrefix?: string;
|
|
770
|
+
/** Colours that replace the values read from the `--vw-*` custom properties. */
|
|
771
|
+
theme?: SvgExportThemeInput;
|
|
772
|
+
barLabel?: (bar: B) => string;
|
|
773
|
+
rowLabel?: (row: R) => string;
|
|
774
|
+
/** Include the `statusDate` line and, with `showProgressLine`, the progress line. Default true. */
|
|
775
|
+
includeStatusDate?: boolean;
|
|
776
|
+
}
|
|
777
|
+
/** Options of the `exportSvg` method on NetworkGraph. */
|
|
778
|
+
/** `N` and `E` type the nodes and edges that the label callbacks receive. */
|
|
779
|
+
export interface GraphExportOptions<N extends NetworkNode = NetworkNode, E extends GraphEdge = GraphEdge> {
|
|
780
|
+
/** Margin around the content in pixels. Default 16. */
|
|
781
|
+
padding?: number;
|
|
782
|
+
/** Paint an opaque background. Default true. */
|
|
783
|
+
background?: boolean;
|
|
784
|
+
title?: string;
|
|
785
|
+
/** Prefix for marker IDs. Defaults to an ID unique to the component instance. */
|
|
786
|
+
idPrefix?: string;
|
|
787
|
+
/** Colours that replace the values read from the `--vw-*` custom properties. */
|
|
788
|
+
theme?: SvgExportThemeInput;
|
|
789
|
+
/** Draw selected nodes in the selected style. Default true. */
|
|
790
|
+
includeSelection?: boolean;
|
|
791
|
+
/** Draw the nodes and edges of `highlightedNodeIds` and `highlightedEdgeIds` in the highlighted style. Default true. */
|
|
792
|
+
includeHighlight?: boolean;
|
|
793
|
+
nodeLabel?: (node: N) => string;
|
|
794
|
+
nodeDetail?: (node: N) => string | undefined;
|
|
795
|
+
edgeLabel?: (edge: E) => string | undefined;
|
|
796
|
+
}
|
|
797
|
+
/** Raster options shared by the `exportPng` methods. */
|
|
798
|
+
export interface PngExportOptions {
|
|
799
|
+
/** Device pixels per CSS pixel, greater than 0 and at most 8. Default 1. */
|
|
800
|
+
scale?: number;
|
|
801
|
+
}
|
|
802
|
+
export interface GanttPngExportOptions<R extends TimelineRow = TimelineRow, B extends TimelineBar = TimelineBar> extends GanttExportOptions<R, B>, PngExportOptions {
|
|
803
|
+
}
|
|
804
|
+
export interface GraphPngExportOptions<N extends NetworkNode = NetworkNode, E extends GraphEdge = GraphEdge> extends GraphExportOptions<N, E>, PngExportOptions {
|
|
805
|
+
}
|