Repository navigation
v1.7.0
Brings the later components closer to NetworkGraph and GanttChart: TreeGrid gains column resizing, header sorting and header filtering, EventCalendar an agenda view and working touch editing, and TaskBoard, EventCalendar and TreeGrid export to SVG and PNG. levelResources no longer slows down quadratically on long horizons, and a culled NetworkGraph re-routes only the edges a change can affect. The less-covered components get server-rendering, browser and structural accessibility tests.
Added
- TreeGrid: opt-in column resizing, header sorting and header filtering, as in GanttChart.
columnsResizable(withminColumnWidth,maxColumnWidthandvalidateColumnResize) adds a separator to the tree column header and each column header that proposescolumn-resize(TimelineColumnResize;timelineLabelColumnIdnames the tree column, accepted throughtreeColumnWidth) by pointer drag or arrow keys, orcolumn-resize-rejected.sortableColumnsandfilterableColumnsadd sort buttons (aria-sorton the header of the first rule) and filter dialogs that proposeupdate:sortandupdate:filters(v-model:sort,v-model:filters) from the controlledsortandfilters. With these options a grid without lines keeps its header, as GanttChart does, with the empty text as a row under it, so a filter that matches nothing can still be edited or cleared from its open dialog. New optionalTreeGridLabels:resizeColumn,columnResizeRejected,sortBy,sortedAscending,sortedDescending,filterBy,filtered,filterContains,filterValuesandclearFilter. Without the new props the grid renders and behaves as before. - Core:
projectTreeGridRows(input, { sort, filters })applies those proposals while keeping the hierarchy (siblings sorted within their parent, filtered rows with all their ancestors, the sparse cells of the kept rows), andtreeGridCellText(index, rowId, columnId, options?)gives the text the grid shows in a cell. The "Tree grid" example adds a cost breakdown with these header controls. - EventCalendar has an opt-in agenda view:
view: 'agenda', offered in the built-in view switch when the newviewsprop lists it (default['day', 'week', 'month'], so the toolbar is unchanged). It lists the events of the week that containsdate, or of the newagendaDays(1–366) days from it, by day: all-day entries first, then by start; multi-day events on every day they cover; recurring occurrences as passed. Entries are event buttons with the same names, selection, activation,eventslot and Left/Right day moves as the other views, Up, Down, Home and End move the focus, and the list is named by the new optional labelsagendaandagendaEditHint. The new typeEventCalendarViewName(EventCalendarView | 'agenda') names every view;EventCalendarViewstays'day' | 'week' | 'month', so existing TypeScript code compiles unchanged. Theviewandviewsprops,eventCalendarRange,eventCalendarDays,shiftEventCalendarDateand the export takeEventCalendarViewName, and the component infers fromviewandviewswhether it can show the agenda: only then doupdate:view,range-changeand theeventandtoolbarslots carryEventCalendarViewName, otherwiseEventCalendarViewas before.EventCalendarOptionshasagendaDays, whicheventCalendarRange,eventCalendarDaysandshiftEventCalendarDatefollow foragenda. - Core:
layoutCalendarAgenda(events, days)returns, for each day, the events that overlap it clipped to the day, withallDay,continuesBeforeandcontinuesAfter, in agenda order (CalendarAgendaDay,CalendarAgendaItem). - EventCalendar touch input: on empty space of a
creatablecalendar, a touch held still for half a second drags to create (the page does not scroll during that drag), and a touch within 14 px of a resizable edge of an event resizes it, so the few-pixel handles need no exact hit. Mouse input is unchanged. - TaskBoard, EventCalendar and TreeGrid expose
exportSvg(options?)andexportPng(options?)like NetworkGraph and GanttChart (TaskBoardExportOptions,EventCalendarExportOptions,TreeGridExportOptionsand theirPngvariants), with the theme colours and font in effect on the component. The board exports every column, lane and shown card; the calendar the shown day, week, month or agenda view with the whole time grid, or every day of the agenda (over the week oragendaDays, with the empty text when no day has events); the grid every displayed line and column, not only the rendered window. Core:renderTaskBoardSvg,renderEventCalendarSvg(every view,agendaincluded, with theagendaDaysoption and the optionallabels.empty; an unknown view throws aRangeError) andrenderTreeGridSvg(with optionalsortandfiltersapplied byprojectTreeGridRows,rowRangeandcolumnRange) build the same documents without a DOM. Right-to-left exports keep event times in left-to-right order at the inline start of their line, as the component's isolated time span does (the time a separate left-to-right text run, a title on the same line a right-to-left run beside it, so the order does not depend on the renderer's bidi handling), and draw TaskBoard count badges right to left like the component's count. The component methods write colours that need a stylesheet as the computed colour (an eventcolorsuch asvar(--booking-color)computed on the event's button, else on the calendar;currentColorin the board and grid colour properties), so standalone SVG and PNG files paint them as on screen, and pass the callbacks the event, card and row objects themselves; the core builders write such colours as given, likerenderGraphSvgandrenderTimelineSvg. - Core:
createGraphRouteCache()and the opt-incacheoption ofrouteGraphEdges. A call with a cache routes again only the edges whose inputs changed since the previous call with it (withavoidNodes, also those whose obstacle search a changed box can affect) and returns the same layout as a call without one. On a two-dimensional 3,000-node graph withavoidNodes, routing after one node moved took 66 ms instead of 215 ms in the benchmark. - TaskBoard: the
column-headerslot also receivescollapsed,toggle()andtoggleLabel, so a slot that replaces the header, built-in collapse toggle included, can draw its own toggle;toggle()proposesupdate:collapsedColumnIdslike the built-in one. Existing slots are unchanged. - The "Event calendar" example has an Export SVG button, like the "Task board" and "Tree grid" examples.
- Docs: Running core calculations in a Worker shows a Worker for
graphLayoutWorkerAdapterand a plain module Worker for routing,scheduleTasksandlevelResources, with what can be posted and how to drop stale results.
Changed
levelResourcesis much faster on long horizons: placing a task now reads remaining capacity and free working time only as far as that task's placement needs, instead of from its earliest start to the end of the horizon. In the benchmark ofdocs/performance.md, 3,000 tasks went from about 1 s to under 0.2 s and 10,000 tasks from about 13 s to under 1 s. Results are unchanged: the same dates, leveled tasks, delays, overloads, unresolved tasks, traces and errors.- NetworkGraph with
cullOffscreenkeeps a route cache and the culling bounds across saved layouts, so a saved change such as a drop routes and measures again only the edges it can affect. The routes, labels and markers drawn, exports, the minimap andfitare unchanged; layout and routing still cover every node and edge. WithoutcullOffscreennothing changes. - NetworkGraph no longer routes every styled edge a second time when a drag, resize or waypoint preview starts; the extent of each route now comes from the saved routing. With orthogonal edges and
avoidNodesthis removes a pause of about one full routing from the first move of a drag. The previews are unchanged. npm run bench:rendermeasures a culled graph with orthogonal edges andavoidNodes(graph-culled-avoid), andnpm run bench:corerouting after one node moved, with and without a route cache.
Fixed
- NetworkGraph and
renderGraphSvgcentre the text of plain rectangle nodes on the node height, as they already did for outline shapes. Before, the title and detail lines sat at fixed offsets made for the default height of 58, so a shorter node (for examplenodeHeight: 30) drew its text across or below its bottom edge, and a taller node drew it near the top. Output at height 58 is unchanged. - Documentation site examples: the option bars wrap whole controls onto a new line instead of breaking checkbox and button labels word by word, the Japanese linked-views and scenario graphs widen their nodes to fit the longer detail text, and the construction showcase keeps its milestone table and critical-path dates inside the panel on narrow screens.
- EventCalendar: a touch swipe that scrolls a
creatabletime grid or month no longer reportsedit-cancel(pointer-cancel) for a create it never showed, and no longer flashes a create preview; a tap still proposes an event. The click of a tap that proposes an event no longer selects the new event drawn under the finger. While a touch or pen gesture is in flight, a long press no longer opens the browser's context menu or callout. projectTimelineRowsandprojectTimelineView(GanttChart header sorting) look upsortRulesby own key only. Before, a sort on a column whose ID is anObject.prototypemember, such asconstructor,toString,valueOf,hasOwnPropertyor__proto__, took the inherited member for a registered rule wheneversortRuleswas given: the rows stayed unsorted or the call threw aTypeError.projectTreeGridRowsreads them the same way.