npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gantryjs/core

v2.0.0

Published

Framework-free core of Gantry: Gantt chart types, timeline math, tree data helpers and critical-path computation.

Readme

@gantryjs/core

Framework-free core of the Gantry Gantt chart: domain types, timeline math, tree helpers and critical-path computation. No DOM, no framework — runs in browsers, Node, workers and SSR. No runtime dependencies.

You usually don't install this directly: it powers @gantryjs/angular (Angular) and @gantryjs/vanilla (Web Component, used by the React, Vue and Svelte bindings), and every binding re-exports it. Use it on its own to compute schedules server-side or to build your own renderer.

Install

npm i @gantryjs/core

What's inside

| Area | Exports | | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Types | GanttTask, GanttDependency, GanttOptions, GanttTheme, ColumnDef, GanttAnnotation, TaskDragEvent, TaskResizeEvent, RetryEvent, … and ViewMode, TaskType, DependencyType (as const objects with same-name types: ViewMode.Week works as a value and as a type) | | Timeline math | dateToPixel, pixelToDate, calendarDays, addDays, formatDate, durationLabel | | Render model | resolveConfig (every option default), buildTimeline, computeRowGeometries, computeBarVisual / hitTestBar, computeArrowVisual, computeMarkerLane, DragSession, formatDragReadout, wheelZoom / fitZoomLevel / anchoredScrollLeft, LightTheme / DarkTheme, themeToCss | | Interaction | resolveKey (the key map), navigateGrid / navigateTimeline, tabStopIndex, KeyboardEditSession, the pointer gesture machine (startGesture, DRAG_THRESHOLD_PX, LONG_PRESS_MS), autoScrollDelta, createAnnouncer, taskAccessibleName | | State models | buildToolbar, resolveChartState / skeletonRows, buildLegend / legendPlacement, buildTooltipModel / reduceTooltip / placeTooltip, selection and saved state | | Tree data | flattenTree, filterVisible, reindexVisible, sortRoots, columnComparator, findRowById, collectDescendants, buildDefaultColumns | | Editing | GanttChange and the pipeline (taskChange / dragChange / progressChange / linkChange, applyChange, invertChange, prepareChange), GanttHistory, validateChange / editRules / cellEditable, resolveCellEditor / commitCellValue, parsePredecessors / parseDuration, ProgressSession / LinkSession, resolveEditing | | Export | createExportSource (a chart snapshot without a binding), exportChartSvg, exportChartCsv, exportChartPages (print pages), buildExportModel / renderExportSvg, paginateChart, planRaster, exportFileName / exportFileText, resolveExportCall, sanitizeSvgMarkup (the custom-bar markup rules) | | Scheduling | computeCriticalPath(tasks, resolveConfig(options)) (CPM with FS/SS/FF/SF dependencies and lag, in working time with a calendar), longestChain | | Working calendar | createWorkingCalendar (WorkingCalendar: addWorking, snapStart / snapEnd, workingDuration…), formatDuration / formatFloat, taskDuration / spanDuration / measureBetween / addDuration, snapTaskStart / snapTaskEnd / followTaskEnd, editCalendar, dateReadingOf / sameDateReading, DEFAULT_WORKING_HOURS | | Resources | GanttResource / GanttTask.resources, indexResources, parseAssignments / formatAssignments, computeResourceUtilization (the daily load, loadAt, contributorsAt), projectResourceRows / resourceViewTasks (the synthetic rows of rows: 'resources'), computeLoadVisuals / hitTestLoad, buildResourceTooltip, resourceInfoOf, toggleRowsMode, LOAD_STYLE | | i18n | DEFAULT_LABELS, DEFAULT_FORMATS |

Every Gantry binding paints these models, which is why an option behaves the same everywhere; the options themselves are documented in the main README's Configuration.

import { computeCriticalPath, DependencyType } from '@gantryjs/core';

const { criticalIds } = computeCriticalPath([
  { id: 'a', name: 'Design', start: new Date('2026-01-05'), end: new Date('2026-01-20') },
  {
    id: 'b',
    name: 'Build',
    start: new Date('2026-01-21'),
    end: new Date('2026-02-28'),
    dependency: { taskId: 'a', type: DependencyType.FS },
  },
]);

Exports run here too, with no DOM: the same chart gives the same SVG and CSV as the bindings' exportSvg() / exportCsv(), so you can render a plan on a server or in a worker (Export and print):

import { createExportSource, exportChartCsv, exportChartPages, exportChartSvg, exportFileText } from '@gantryjs/core';

const source = createExportSource({ tasks, options: { viewMode: 'Week' }, now: new Date(2026, 0, 15) });
const svg = exportFileText('svg', exportChartSvg(source, { theme: 'light' })); // an .svg file's text
const csv = exportChartCsv(source, { columns: 'all', delimiter: ';' }); // RFC 4180, formulas neutralised
const { pages } = exportChartPages(source, { paper: 'a4' }); // one SVG per printed page

@gantryjs/core is published one file per module, so a bundler leaves out what an app never imports (the export code, for instance, until a chart exports).

Sample data for demos and docs lives in a separate entry point, @gantryjs/core/demo:

import { createDemoData, anchorToToday, DEMO_TASKS } from '@gantryjs/core/demo';

const { tasks, annotations } = createDemoData(); // today ≈ 40% into the plan
const later = createDemoData({ now: new Date(2027, 0, 4), at: 0.8 });
const mine = anchorToToday(myTemplate, { at: 0.5 }).tasks; // any template, whole-week shift

DEMO_TASKS / DEMO_ANNOTATIONS are the fixed 2026 reference plan.

License

MIT