npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@echarts-extension/layout-core

v0.1.0

Published

Language: English | [中文](./README_CN.md)

Readme

@echarts-extension/layout-core

Language: English | 中文

Shared layout and rendering helpers for the ECharts extension packages in this monorepo. Most chart users do not import this package directly; use it when you are building a new extension or testing the local graph layouts.

Layout Core chart

Install

npm install @echarts-extension/layout-core

If you are rendering through ECharts, install echarts in the host application as well.

Compute a Layout

import { computeGraphLayout } from '@echarts-extension/layout-core';

const result = computeGraphLayout('radial', {
  nodes: [
    { id: 'root', value: 10 },
    { id: 'a', value: 4 },
    { id: 'b', value: 3 }
  ],
  edges: [
    { source: 'root', target: 'a' },
    { source: 'root', target: 'b' }
  ]
}, {
  center: [300, 220],
  unitRadius: 90,
  nodeSize: 18
});

console.log(result.nodes);

computeGraphLayout(type, input, options) supports arc, concentric, grid, mds, and radial.

Register a Graph Series

import * as echarts from 'echarts/lib/echarts';
import { installGraphLayout } from '@echarts-extension/layout-core';

installGraphLayout(echarts, {
  chartType: 'customRadial',
  layoutType: 'radial'
});

The registered series accepts ECharts graph-style data/links or nodes/edges input and renders nodes, labels, and links with the shared graph view.

Main Exports

  • normalizeGraphData: normalizes graph-style input into nodes and edges.
  • computeGraphLayout: dispatches to a named graph layout.
  • computeArcLayout, computeConcentricLayout, computeGridLayout, computeMDSLayout, computeRadialLayout: layout-specific APIs.
  • installGraphLayout: registers a graph-style ECharts series.
  • installFisheyeController, resolveFisheyeOptions, fisheyeTransform: reusable fisheye magnifier primitives for chart packages.
  • installElementHover, renderAlive, clearAliveRender, setAliveRenderKey: shared rendering helpers used by custom chart packages.

Options

This table is generated by scripts/sync-options-from-readmes.mjs --write-readmes. Update the English README option table, then run npm run docs:sync-options to refresh the docs page.

| Option | Description | Values | | --- | --- | --- | | type | Selects which graph layout algorithm to run. | 'radial' \| 'concentric' \| 'grid' \| 'mds' \| 'arc' | | input | Groups graph input data and link options. | Object | | input.data | Graph nodes to place. Same effect as input.nodes. | Array<object \| unknown[]> | | input.data.id | Record id. | string \| number | | input.data.name | Display name. | string | | input.data.value | Numeric value. | number | | input.data.itemStyle | Per-record item style. | Object | | input.data.itemStyle.color | Fill color. | string | | input.data.itemStyle.fill | Alias for fill color. | string | | input.data.itemStyle.opacity | Fill opacity. | number | | input.data.itemStyle.borderColor | Border color. | string | | input.data.itemStyle.borderWidth | Border width. | number | | input.data.itemStyle.borderRadius | Corner radius. | number | | input.data.itemStyle.shadowBlur | Shadow blur radius. | number | | input.data.itemStyle.shadowColor | Shadow color. | string | | input.data.itemStyle.lineWidth | Stroke width used by icon or shape styles. | number | | input.data.label | Per-record label style. | Object | | input.data.label.show | Shows labels when true. | boolean | | input.data.label.color | Label text color. | string | | input.data.label.fontSize | Label text size. | number | | input.data.label.fontWeight | Label font weight. | string \| number | | input.data.label.formatter | Formats label text. | string \| function | | input.data.x | X coordinate or category. | number | | input.data.y | Y coordinate or category. | number | | input.data.size | Per-record size. | number | | input.nodes | Same effect as input.data. Graph nodes to place. | Array<object \| unknown[]> | | input.nodes.id | Record id. | string \| number | | input.nodes.name | Display name. | string | | input.nodes.value | Numeric value. | number | | input.nodes.itemStyle | Per-record item style. | Object | | input.nodes.itemStyle.color | Fill color. | string | | input.nodes.itemStyle.fill | Alias for fill color. | string | | input.nodes.itemStyle.opacity | Fill opacity. | number | | input.nodes.itemStyle.borderColor | Border color. | string | | input.nodes.itemStyle.borderWidth | Border width. | number | | input.nodes.itemStyle.borderRadius | Corner radius. | number | | input.nodes.itemStyle.shadowBlur | Shadow blur radius. | number | | input.nodes.itemStyle.shadowColor | Shadow color. | string | | input.nodes.itemStyle.lineWidth | Stroke width used by icon or shape styles. | number | | input.nodes.label | Per-record label style. | Object | | input.nodes.label.show | Shows labels when true. | boolean | | input.nodes.label.color | Label text color. | string | | input.nodes.label.fontSize | Label text size. | number | | input.nodes.label.fontWeight | Label font weight. | string \| number | | input.nodes.label.formatter | Formats label text. | string \| function | | input.nodes.x | X coordinate or category. | number | | input.nodes.y | Y coordinate or category. | number | | input.nodes.size | Per-record size. | number | | input.links | Graph edges that connect source and target nodes. Same effect as input.edges. | Array<object> | | input.links.source | Source node id or name. | string \| number | | input.links.target | Target node id or name. | string \| number | | input.edges | Same effect as input.links. Graph edges that connect source and target nodes. | Array<object> | | input.edges.source | Source node id or name. | string \| number | | input.edges.target | Target node id or name. | string \| number | | width | Layout viewport width. | number | | height | Layout viewport height. | number | | center | Layout center point inside the viewport. | [number \| string, number \| string] | | nodeSize | Node diameter used by layout spacing and overlap prevention. | number \| number[] \| function | | nodeSpacing | Extra spacing around each node. | number \| function | | preventOverlap | Separates nodes when a layout can otherwise place them too close. | boolean | | preventOverlapPadding | Extra gap used during overlap prevention. | number | | sortBy | Sorts nodes before layouts that use ordering. | string \| function | | linkDistance | Target distance between connected nodes. | number | | focusNode | Node id or name used as the radial center. | string \| number | | unitRadius | Distance between radial graph levels. | number | | strictRadial | Keeps radial nodes on strict level rings. | boolean | | maxIteration | Maximum layout iterations for radial refinement. | number | | maxPreventOverlapIteration | Maximum iterations used by overlap prevention. | number | | sortStrength | Weight applied when sorted radial nodes share a ring. | number | | maxLevelDiff | Maximum score difference before concentric nodes move to a new level. | number | | sweep | Angular span used by radial or concentric placement. | number (radians) | | equidistant | Forces concentric levels to use equal ring spacing. | boolean | | startAngle | Starting angle for circular layouts. | number (radians) | | clockwise | Places circular nodes clockwise when true. | boolean | | rows | Requested row count for grid layout. | number | | cols | Requested column count for grid layout. | number | | begin | Top-left starting point for grid layout. | [number \| string, number \| string] | | condense | Lets grid cells shrink to the minimum size needed by nodes. | boolean | | position | Pins grid nodes to explicit row and column cells. | function(node) => { row, col } | | nodeSep | Horizontal gap between nodes in arc layout. | number |