@shawerestart/layout
TypeScript icon, indicating that this package has built-in type declarations

0.1.42 • Public • Published

About

Layout algorithms for AntV

Installation

# npm
$ npm install @antv/layout --save

# yarn
$ yarn add @antv/layout

Usage

import { GridLayout } from '@antv/layout'

const model = {
  nodes: [
    {
      id: 'node1',
      x: 0,
      y: 0,
    }, {
      id: 'node2',
      x: 20,
      y: 20,
    },
  ],
  edges: [
    {
      source: 'node1',
      target: 'node2',
    },
  ],
}

const gridLayout = new GridLayout({
  type: 'grid',
  width: 600,
  height: 400,
  rows: 4,
  cols: 4,
})

const newModel = gridLayout.layout(model)

Documentation

License

The scripts and documentation in this project are released under the MIT License.

Package Sidebar

Install

npm i @shawerestart/layout

Weekly Downloads

1

Version

0.1.42

License

MIT

Unpacked Size

5.16 MB

Total Files

240

Last publish

Collaborators

  • shawerestart