# KptRoadmap (kpt-roadmap) A roadmap - rows of tasks on a horizontal timeline (a Gantt-style view). The label column and the axis header stay stuck while scrolling, the bars are positioned as percentages, and dependencies are drawn by an SVG layer. The computation core lives in `@konce-pt/roadmap` - plain TypeScript, tested, shared with the React port. Import: `import { KptRoadmap } from '@konce-pt/angular/roadmap';` ## Selector `kpt-roadmap` - standalone, OnPush, zoneless. The generic `KptRoadmap` types the `meta` field. ## Inputs - `config`: KptRoadmapConfig (required) - the data and every option - `scrollHeight`: string | null - a fixed height, e.g. '420px'; enables the sticky header - `labelWidth`: string - the width of the label column (default '14rem') - `cellWidthPx`: number | null - the width of an axis column; without it the value depends on the zoom - `showToday`: boolean - the "today" marker (default true) - `virtual`: boolean - renders only the visible rows; worth it from roughly 100 rows up ## Model / events - `collapsedGroups`: model - the two-way ids of collapsed groups - `itemClick`: output - `rangeChange`: output - the computed axis range ## KptRoadmapConfig - `items`: KptRoadmapItem[] (required) - `groups?`: KptRoadmapGroup[] - `links?`: KptRoadmapLink[] - dependencies given as a graph - `zoom?`: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' (default 'week') - `range?`: { start?: number; end?: number } - a missing end is computed from the data - `locale?`: string; `today?`: Date | number | string - `timeline?`, `rows?`, `dependencies?`, `interaction?` - the detailed options ### KptRoadmapItem - `id`: string, `label`: string (required) - `start`: Date | number | string; `end?`: the same - no `end` means a milestone - `sublabel?`, `icon?`, `disabled?` - `variant?`: 'neutral' | 'primary' | 'success' | 'danger' | 'warning' | 'info' - `color?`: string - any CSS color, overriding `variant` - `progress?`: number 0..1 - the fill inside the bar - `groupId?`: string; `dependsOn?`: (string | KptRoadmapLink)[] - a bare string means an 'FS' dependency - `milestone?`: boolean - forces a diamond - `meta?`: TItem - The `draggable`, `resizable`, `locked` and `constraints` fields are reserved for editing and are ignored today. ### KptRoadmapGroup - `id`, `label` (required); `sublabel?`, `parentId?`, `collapsed?`, `variant?`, `color?` - `summary?`: 'auto' | 'none' - 'auto' draws a rolled-up bar from min(start) to max(end) of the children ### KptTimelineOptions (`config.timeline`) - `weekendDays?`: number[] (default [0, 6]); `weekPrefix?`: string (from i18n by default) - `workHours?`: { from, to, mode?: 'skip' | 'dim', skipWeekends? } - only with `zoom: 'hour'`; 'skip' cuts the nights out of the axis, 'dim' leaves the columns greyed out - `positionMode?`: 'uniform' (default) | 'linear' - `bandUnit?`: the unit of the header's top level; `maxCells?`: number (default 4000) ### KptRoadmapRowOptions (`config.rows`) - `mode?`: 'row-per-item' (default) | 'pack' - 'pack' lays non-overlapping tasks out in a single row - `itemHeight?`, `groupHeight?`, `laneHeight?`, `packMinGapMs?` - `showUngroupedHeader?`, `ungroupedLabel?` ## Example roadmap: KptRoadmapConfig = { zoom: 'week', groups: [{ id: 'app', label: 'Application' }], items: [ { id: 'auth', label: 'Sign-in', start: '2026-08-24', end: '2026-08-31', groupId: 'app', variant: 'success', progress: 1 }, { id: 'ship', label: 'Release', start: '2026-09-14', groupId: 'app', variant: 'warning', dependsOn: ['auth'] }, ], }; ## Behavior - The axis is computed in local time; week numbering follows ISO 8601 (week 1 contains the year's first Thursday). - The 'uniform' mode gives columns of equal width despite DST changes and months of different lengths; inside a column the position is interpolated linearly, so a task can start in the middle of a day. - A year change: a stronger vertical line and a black marker with the year on that year's first band. At week zoom the boundary is computed by the ISO week year, so W53 does not fall into the next year. - An item extending past the axis range is cut off on the side where it is clipped. - Tooltips use the `kptTooltip` directive (not the native `title`): the bubble appears immediately, is styled with tokens and works with keyboard focus too. - The rule: a tooltip shows what cannot be seen. Bars, row labels and header bands carry it with `kptTooltipOnlyWhenTruncated`, so a tooltip only pops up for text cut off with an ellipsis - checked on hover, so it reacts to changes in width and zoom. Milestones and header cells carry a tooltip unconditionally: a diamond shows no text at all, and a cell fills in the year that "W35 / 24.08-30.08" does not show. - Dependencies: 'FS' (the default), 'SS', 'FF', 'SF'; violated ones are drawn as a dashed line in the danger color. - Entries with an invalid date or a duplicate `id` are skipped, with a warning in development mode. ## i18n The `roadmap.*` keys: `empty`, `week`, `today`, `milestone`, `expandGroup`, `collapseGroup`, `progress` (`{percent}`). Month and weekday names come from `Intl` per `config.locale` or the locale from `KptI18n`, so they follow each language's orthography (lowercase in Polish, capitalized in English). In the header the first character is capitalized through `::first-letter`, so that the axis looks the same regardless of language; the text itself is untouched, so tooltips and screen reader output get the original form. ## Accessibility Bars and milestones are `role="button"` with an accessible name built from the label, sublabel, date range and progress (`Design, 3-14 Mar 2026, 40% complete`) - the end is exclusive, so the last occupied day is announced. The whole bar grid is one Tab stop (roving tabindex): Left/Right move within a row, Up/Down go to the bar with the nearest start in the neighbouring row, Home/End jump to the row's edge, Ctrl+Home/End to the first/last bar; Enter and Space act like a click. With `virtual` on, moving to a row outside the window scrolls it in first. Disabled items get `aria-disabled`. A group toggle is named by the group label and carries `aria-expanded`; "Expand/Collapse group" is only its tooltip. The background grid and the dependency layer are `aria-hidden`. ## Tokens Surfaces `--kpt-color-surface{,-variant,-sunken,-hover}`, outlines `--kpt-color-border{,-strong}`, bars per variant `--kpt-color-{primary,success,danger,warning,info,muted}`. A bar's label takes its variant's content token: `--kpt-color-{success,danger,warning,info}-contrast`, `--kpt-color-on-muted` for `neutral` and `--kpt-color-text-inverse` for `primary`. A group's rolled-up bar in the `neutral` variant is drawn in `--kpt-color-on-surface-muted` - `--kpt-color-muted` would be indistinguishable from the row background. Further: the year marker is inverted, `--kpt-color-on-surface` / `--kpt-color-surface`. Sizes: `--kpt-roadmap-label-w`, `--kpt-roadmap-cell-w` (both can be overridden from outside). ## To do (roadmap) Dragging and resizing bars, drawing dependencies with the mouse, adding rows - the types (`KptRoadmapChange`, `constraints`, `interaction`) are already part of the API.