Install it in your app
The quickest way is to ask your AI assistant: paste the prompt under
Add it in the README. The assistant installs the
package, puts the chart on one existing page, and runs your build and npx tachlon doctor until both pass.
To do it by hand, put the Tachlon chart in a Vite React app: install the package, let npx tachlon init write the chart
component, and open a schedule file. The video goes through every step; the steps are below it.
The steps
-
Start from a Vite React app, or make one:
npm create vite@latest my-app -- --template react-ts. -
In the app folder, install the package and write the chart file:
npm install tachlon npx tachlon initinitwritessrc/tachlon-chart.tsx, a component with three sample tasks, and prints the line to add to a page. It changes no file you already have. -
In
src/App.tsx, addimport Chart from "./tachlon-chart";and render<Chart />inside a full-widthdiv. -
Run
npm run devand open the page. The three tasks are drawn with dates, durations and zero days of float. Ctrl and the mouse wheel zoom the timeline. -
To open a schedule, keep the file the user picks in state (
useState<File>(), set from theonChangeof an<input type="file">) and, once there is one, render theGanttcomponent fromtachlon/reactwith that file as itsscheduleprop. It reads a P6 XER file or an MS Project XML file. -
With no bundler, a plain HTML page loads the package from jsDelivr: a stylesheet link and an import map, pinned to the package version you chose. The package README, “No bundler”, has the page.
-
If a chart does not draw, run
npx tachlon doctor. It checks that the package is listed and installed once, the engine file, a stylesheet import and the page’s Content-Security-Policy, and asks a Chrome, Edge or Chromium on your machine whether the chart gets WebGPU or WebGL2. It writes nothing in your project and says how to fix each problem. -
To ask the installed package what it offers, run
npx tachlon describe. It answers for the version innode_modules. Before you theme the chart or wire saves, runnpx tachlon describe fit.