@vis-tree/core
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

@vis-tree/core

download npm types license

@vis-tree/core contains the main logic of tree data visualization, the layout strategy follows the idea of A Node-Positioning Algorithm for General Trees.

Features

  • Support users to use custom components to render nodes and connecting lines
  • Support multiple layout methods
  • Support dynamic insertion/removal of nodes
  • Support virtual rendering, saving performance overhead
  • Support animation, virtual rendering will also be used during animation

Related NPM library

For React, you can use @vis-tree/react.

For Vue, you can use @vis-tree/vue.

Write your own component

@vis-tree/core is written in pure typescript, based on it, you can encapsulate a tree-data visualization component with any fontend framework. But you should maintain the following DOM structure:

<div class="tree-canvas">
  <div class="tree-anchor">
    <div class="tree-node-wrapper">
      <div class="tree-node-content" />
      <div class="tree-node-head-line" />
      <div class="tree-node-tail-line" />
    </div>

    <div class="tree-junction-line" />

    <div class="tree-custom-line" />
  </div>
</div>
.tree-canvas {
  position: relative;
  overflow: hidden;
  cursor: move;
}

.tree-anchor {
  position: absolute;
  top: 0;
  left: 0;
}

.tree-node-wrapper {
  position: absolute;
  cursor: auto;
}

.tree-node-content {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}

.tree-node-head-line,
.tree-node-tail-line,
.tree-junction-line,
.tree-custom-line {
  position: absolute;
  cursor: auto;
}

Package Sidebar

Install

npm i @vis-tree/core

Weekly Downloads

0

Version

0.1.7

License

MIT

Unpacked Size

117 kB

Total Files

6

Last publish

Collaborators

  • aadonkeyz
  • bytednpm