PointlineJS is an SVG based JS library for drawing tree diagrams. It relies on Treant-JS, Raphael for handling SVG and animations, JQuery.
- Install PointlineJS:
npm i pointlinejs
- Import PointlineJS:
import { PointlineJS } from "pointlinejs";
- Create DOM-element in html where draw PointlineJS chart:
<div id="tree-simple" style="height: 600px; width: 900px;"></div>
- Describe config chart in typescript file:
const simple_chart_config = {
chart: {
container: "#tree-simple",
},
nodeStructure: {
text: { name: "Parent node" },
children: [
{
text: { name: "First child" },
},
{
text: { name: "Second child" },
},
],
},
};
- Draw chart:
const testTree = new PointlineJS(simple_chart_config);
testTree.getTree();
testTree.draw();
For run demo also see "Quick start" section.
- clone repository with command:
$ git clone https://github.com/egor-progger/pointlinejs-quick-start
- to run this example you need to install some dependencies:
$ cd pointlinejs-quick-start
$ npm install
- start local web-server:
$ npx webpack serve
- open in browser address http://localhost:9001
For Docs, Examples, and everything else see: https://egor-progger.github.io/pointlinejs/documentation/
Node version: minimum 20.18.1
npx webpack --config webpack.config.js
npm run start- open
http://localhost:9000/documentation/in browser