Skip to content

egor-progger/pointlinejs

Repository files navigation

PointlineJS

PointlineJS is an SVG based JS library for drawing tree diagrams. It relies on Treant-JS, Raphael for handling SVG and animations, JQuery.

Build status

Node.js Package NPM Downloads NPM Version Static Badge Quick start example

Add to project

  1. Install PointlineJS:

npm i pointlinejs

  1. Import PointlineJS:

import { PointlineJS } from "pointlinejs";

  1. Create DOM-element in html where draw PointlineJS chart:

<div id="tree-simple" style="height: 600px; width: 900px;"></div>

  1. 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" },
      },
    ],
  },
};
  1. Draw chart:
const testTree = new PointlineJS(simple_chart_config);
testTree.getTree();
testTree.draw();

For run demo also see "Quick start" section.

Quick start

  1. clone repository with command:
$ git clone https://github.com/egor-progger/pointlinejs-quick-start
  1. to run this example you need to install some dependencies:
$ cd pointlinejs-quick-start
$ npm install
  1. start local web-server:
$ npx webpack serve
  1. open in browser address http://localhost:9001

For Docs, Examples, and everything else see: https://egor-progger.github.io/pointlinejs/documentation/

Development

Requirements

Node version: minimum 20.18.1

How to compile sources

npx webpack --config webpack.config.js

How to run dev-server for debugging

  1. npm run start
  2. open http://localhost:9000/documentation/ in browser

Packages

 
 
 

Contributors