API index

Everything @umriss-ui/schedule exports, with its signature. A component's props stand on its own page.

Hooks

useSchedule

Declares a schedule: hands back Schedule and the parts declared inside it - Lane, LaneGroup, Subtasks, Dependencies, BlockedTimes, Milestones -, its view and the setters setView, setDomain, toggleGroup, foldAll and unfoldAll. A ref on Schedule still gives the ScheduleHandle.

function useSchedule(options?: ScheduleOptions): ScheduleParts;

Used on Scenarios, Installation, First schedule, Lanes, Lane groups, Subtasks, Bar labels, Appearances, Overlap, Dependencies, Routes, Time axis and calendar, Blocked time, Milestones, Now line, Pan and zoom, Selection, Interactions, Tooltip, View, Linked schedules, The handle, Findings as data, Move and lane, Stretch, lead-in, lead-out, Snapping, Placing from outside, Where a subtask may go, Ripple and Benchmark.

Functions

applyIntent

The subtask as the intent asks for it. An intent for another subtask leaves it as it is.

function applyIntent<S extends Subtask>(subtask: S, intent: Intent): S;

Used on Scenarios, Lane groups, Time axis and calendar, Blocked time, Interactions, Move and lane, Stretch, lead-in, lead-out, Snapping, Placing from outside, Where a subtask may go and Ripple.

arrival

When a dependency has to have arrived at its subtask, by its anchor.

function arrival(dependency: Dependency, to: Subtask): number;

Used on Scenarios, Now line and Findings as data.

departure

When a dependency leaves its subtask, by its anchor.

function departure(dependency: Dependency, from: Subtask): number;

Used on Findings as data.

findings

Every finding at once. Without blocked time there is none in it.

function findings(subtasks: readonly Subtask[], dependencies: readonly Dependency[], blocked?: readonly BlockedTime[]): Findings;

Used on Scenarios, First schedule, Lane groups, Blocked time, Tooltip and Findings as data.

inBlockedTime

Every subtask that covers blocked time on its lane, lead-in and lead-out included - once per blocked interval it covers, in the order of the subtasks. Touching at a shared edge is not covering.

function inBlockedTime(subtasks: readonly Subtask[], blocked: readonly BlockedTime[]): InBlockedTime[];

Used on Scenarios, Blocked time and Findings as data.

occupied

The interval a subtask occupies on its lane: lead-in and lead-out included.

function occupied(subtask: Subtask): {
    from: number;
    to: number;
};

overlaps

Every pair of subtasks that cover each other on a lane. Touching at a shared edge is not covering, and a subtask that covers no time covers nothing.

function overlaps(subtasks: readonly Subtask[]): Overlap[];

Used on Scenarios, Lane groups, Findings as data and Move and lane.

resolveAppearance

Settles a subtask's appearances into what is drawn. provisional and fixed contradict each other; the later one in the list wins.

  • appearance – The subtask's appearance, in the order it was given.
  • Returns Which of the four channels are on.
function resolveAppearance(appearance: readonly SubtaskAppearance[] | undefined): ResolvedAppearance;

Used on Appearances.

ripple

The moves that push every successor whose dependency no longer fits after intent - transitively, in the order they were first pushed. The subtask the intent is about is never moved, and a cycle among the successors ends after a bounded number of pushes instead of running on.

function ripple(subtasks: readonly Subtask[], dependencies: readonly Dependency[], intent: Intent): MoveIntent[];

Used on Scenarios, Dependencies and Ripple.

shiftTask

The moves that carry a whole task in time - every subtask of it by the same amount, so that its lengths and the distances between its stops stay as they were. The schedule never runs it: apply the moves like any other intent, or run ripple over them first.

  • subtasks – All subtasks; only those of task are moved.
  • task – The id of the task, as its subtasks name it in task.
  • by – How far, in milliseconds; negative is earlier.
  • Returns One move intent per subtask of the task - none where by is zero or not finite.
function shiftTask(subtasks: readonly Subtask[], task: string, by: number): MoveIntent[];

Used on Scenarios and Ripple.

snapTime

time onto the nearest line of the raster in local time - a step alone starts at local midnight. A step of zero or less is no raster: the time stays as it is.

function snapTime(time: number, raster: number | SnapRaster): number;

Used on Snapping.

subtaskFromPlace

The subtask a place intent asks for, under an id the caller chooses.

function subtaskFromPlace(intent: PlaceIntent, id: string): Subtask;

Used on Placing from outside and Where a subtask may go.

violatedDependencies

Every dependency whose successor is to be reached before the predecessor's departure plus the dependency's lag. A dependency naming a subtask that is not in the data is passed over: there is nothing to judge.

function violatedDependencies(subtasks: readonly Subtask[], dependencies: readonly Dependency[]): ViolatedDependency[];

Used on Scenarios, Lane groups, Tooltip and Findings as data.

Types

BlockedTime

Its table stands on Blocked time.

Used on Scenarios, Blocked time, Tooltip, Findings as data and Where a subtask may go.

BlockedTimesProps

Its table stands on Blocked time.

DependenciesProps

Its table stands on Dependencies.

DependencyAttachment

Where on its bars a dependency's line attaches: the middle of both, or the edge that faces the other stop - which is the shortest line between them. Deliberately not called an anchor: a dependency already HAS two anchors (leaves, arrives), and those decide what it connects and therefore whether it is violated. This decides where the line touches, and nothing else. The tree has an Anchor of its own as well (CONTEXT.md).

type DependencyAttachment = "centre" | "nearest";

Used on Dependencies.

DependencyEnds

Whether a dependency's two ends carry a dot. The dot says where the line is anchored, which is worth saying while a plan is being read and is noise in a plan full of short moves - so it is the caller's choice.

type DependencyEnds = "dot" | "none";

Used on Dependencies.

DependencyRoute

How a dependency is drawn between its two ends: a curve that leaves and arrives forwards, a straight line, or axis-parallel segments.

type DependencyRoute = "curve" | "straight" | "orthogonal";

InBlockedTime

Its table stands on Findings as data.

Intent

What the schedule reports when an interaction asks for a change. Every intent carries the values it asks for, not a difference: two intents of one drop - a move and a lane - give the same data in either order.

type Intent = MoveIntent | StretchIntent | LeadInIntent | LeadOutIntent | LaneIntent | PlaceIntent;

Used on Scenarios, Blocked time, Move and lane, Placing from outside, Where a subtask may go and Ripple.

IntentKind

The names of the intents - the editing API of the schedule.

type IntentKind = Intent["kind"];

LaneGroupProps

Its table stands on Lane groups.

LaneIntent

Put the subtask on another lane.

LaneProps

Its table stands on Lanes.

LeadInIntent

Change the lead-in on its own.

LeadOutIntent

Change the lead-out on its own.

Milestone

Its table stands on Milestones.

Used on Milestones.

MilestonesProps

Its table stands on Milestones.

MoveIntent

Move the subtask in time: the main time keeps its length.

Used on Ripple.

Overlap

Its table stands on Findings as data.

PlaceIntent

Put work on the plan that was not on it: the answer to a drag from outside the schedule. It carries no subtask id - there is no subtask yet; the caller creates one, with its own identity, from subtaskFromPlace.

NameTypeDefaultDescription
kindrequired"place"—

Shown in: Read a folded group (Lane groups), Plan work around someone's leave (Blocked time), Refuse a move that double-books someone (Move and lane) and 7 more

itemrequiredstring—The caller's key for the dragged item, as it declared it while dragging.

Shown in: Drag work in from the backlog (Placing from outside), Apply the same rule to work dragged in (Where a subtask may go), Replan the day on the line (Scenarios)

taskrequiredstring—The task the work belongs to.
lanerequiredstring—The lane it was dropped on.

Shown in: Drag work in from the backlog (Placing from outside), Apply the same rule to work dragged in (Where a subtask may go)

fromrequirednumber—Where its main time would start.
torequirednumber—Where its main time would end.
leadInnumber—The lead-in it was declared with.
leadOutnumber—The lead-out it was declared with.

PlacingItem

What the application says it is dragging in, while it drags it: the browser hands over the dragged data only on the drop, so the ghost before the drop can only come from the caller.

NameTypeDefaultDescription
itemrequiredstring—The caller's key for the dragged item; it comes back in the intent.

Shown in: Drag work in from the backlog (Placing from outside), Apply the same rule to work dragged in (Where a subtask may go)

taskrequiredstring—The task the work belongs to.

Shown in: Drag work in from the backlog (Placing from outside), Apply the same rule to work dragged in (Where a subtask may go)

durationrequirednumber—How long its main time is.

Shown in: Drag work in from the backlog (Placing from outside), Apply the same rule to work dragged in (Where a subtask may go)

leadInnumber—The lead-in it brings.
leadOutnumber—The lead-out it brings.

Used on Placing from outside and Where a subtask may go.

ResolvedAppearance

What the drawing needs to know, with the contradiction already settled. Two of the field names (dashed, hatched) are older than the drawing; the channel each one owns stands beside it.

NameTypeDefaultDescription
dashedrequiredboolean—provisional: the FILL - none at all, so the surface shows through, with a dashed outline in the task colour. Planned, not released.
hatchedrequiredboolean—fixed: the ENDS - a cap at each end of the main time. Not a hatch: a hatch says "not available" of a refused lane. The field keeps the name hatched.
mutedrequiredboolean—muted: the SATURATION - the task colour mixed half into the surface, opaque and at full height. Another team's, another crew's.
openrequiredboolean—open: the FADE, where the bar passes the edge of the view. It goes on past what is drawn.

ScheduleHandle

What a schedule offers a caller imperatively: the arithmetic between a point on the screen and a time on a lane. Everything else is props.

NameTypeDefaultDescription
positionAtrequired(clientX: number, clientY: number) => { time: number; lane: string | null } | null—The time and the lane at a client point, or null outside the plot.

Shown in: Place a mark of your own (The handle)

clientPointOfrequired(time: number, lane?: string) => { x: number; y: number } | null—The client point of a time - on the middle of a lane where one is named - or null while the schedule is not on screen.

Shown in: Place a mark of your own (The handle)

visibleDomainrequired() => readonly [number, number]—The visible span, as two wall-clock instants.

Used on The handle.

ScheduleHit

What a pointer is on.

type ScheduleHit =
  | { readonly kind: "subtask"; readonly subtask: Subtask; readonly part: "leadIn" | "main" | "leadOut" }
  | { readonly kind: "dependency"; readonly dependency: Dependency }
  | { readonly kind: "milestone"; readonly milestone: Milestone }
  | { readonly kind: "lane"; readonly lane: string }
  | { readonly kind: "nothing" };

ScheduleInteraction

Its table stands on Interactions.

Used on Scenarios, Interactions, Tooltip and Benchmark.

ScheduleOptions

Its table stands on View.

ScheduleParts

What useSchedule hands back: the schedule and what is declared inside it, its view and the setters that change it.

NameTypeDefaultDescription
Schedulerequired(props: ScheduleProps) => ReactNode—The schedule. One per useSchedule: a second schedule is a second call.

Shown in: The smallest schedule (Installation), A day of tours (First schedule), Start from an empty plan (First schedule) and 78 more

Lanerequiredtypeof Lane—

Shown in: The smallest schedule (Installation), A day of tours (First schedule), Start from an empty plan (First schedule) and 78 more

LaneGrouprequiredtypeof LaneGroup—

Shown in: Group lanes under a head (Lane groups), Nest groups to any depth (Lane groups), Fold groups from outside (Lane groups) and 5 more

Subtasksrequiredtypeof Subtasks—

Shown in: The smallest schedule (Installation), A day of tours (First schedule), Start from an empty plan (First schedule) and 78 more

Dependenciesrequiredtypeof Dependencies—

Shown in: The smallest schedule (Installation), A day of tours (First schedule), Plan a day in the machine shop (First schedule) and 28 more

BlockedTimesrequiredtypeof BlockedTimes—

Shown in: Block out leave and maintenance (Blocked time), Plan work around someone's leave (Blocked time), Check a sprint against the leave calendar (Blocked time) and 5 more

Milestonesrequiredtypeof Milestones—

Shown in: Mark a handover and a release (Milestones), Say what a milestone is in your own tooltip (Milestones)

viewrequiredScheduleView—How the planner is looking at the plan: the span and the folded groups.

Shown in: Fold groups from outside (Lane groups), Keep and restore a view (View), Keep two schedules in step (Linked schedules) and 1 more

setViewrequired(view: ScheduleView) => void—Goes to a whole view; what it leaves out is shown whole again. Not reported through onViewChange: two schedules kept in step by onViewChange: (v) => other.setView(v) in both directions do not answer each other. A view with the content already shown changes nothing.

Shown in: Keep and restore a view (View), Keep two schedules in step (Linked schedules), Read a rota beside the incidents (Linked schedules)

setDomainrequired(span: readonly [number, number] | null) => void—Puts a span of two wall-clock instants in view; null shows the subtasks' extent.

Shown in: Keep and restore a view (View)

toggleGrouprequired(id: string) => void—Folds or unfolds one Lane group.
foldAllrequired() => void—Folds every group.

Shown in: Fold groups from outside (Lane groups)

unfoldAllrequired() => void—Unfolds every group.

Shown in: Fold groups from outside (Lane groups)

Used on Linked schedules.

ScheduleProps

Its table stands on First schedule.

ScheduleTooltipTarget

Its table stands on Tooltip.

Used on Milestones and Tooltip.

ScheduleView

Its table stands on View.

Used on View.

SnapRaster

A raster: a step, and where it starts after local midnight.

NameTypeDefaultDescription
steprequirednumber—The distance between two lines of the raster, in milliseconds.

Shown in: Snap to handover times (Snapping)

offsetrequirednumber—Where the raster starts after local midnight, in milliseconds: six hours for handovers at 06:00, 14:00 and 22:00.

Shown in: Snap to handover times (Snapping)

Used on Snapping.

StretchIntent

Stretch the main time at one or both of its edges.

NameTypeDefaultDescription
kindrequired"stretch"—

Shown in: Read a folded group (Lane groups), Plan work around someone's leave (Blocked time), Refuse a move that double-books someone (Move and lane) and 7 more

subtaskrequiredstring—The id of the subtask.

Shown in: Read a folded group (Lane groups), Plan work around someone's leave (Blocked time), Refuse a move that double-books someone (Move and lane) and 4 more

fromrequirednumber—The new start of the main time.
torequirednumber—The new end of the main time.

SubtaskAppearance

The appearances a caller may give a subtask.

type SubtaskAppearance = "provisional" | "fixed" | "muted" | "open";

SubtasksProps

Its table stands on Subtasks.

ViolatedDependency

Its table stands on Findings as data.

Used on Dependencies.

ZoomLimits

The narrowest and the widest span zoom may reach.

NameTypeDefaultDescription
minrequirednumber—

Shown in: Move through the plan (Pan and zoom)

maxrequirednumber—

Shown in: Move through the plan (Pan and zoom)

Every page of @umriss-ui/schedule

Getting started

Plan

Time

Reading

Editing

Measuring

API index