layerchart icon indicating copy to clipboard operation
layerchart copied to clipboard

Move some components to sub directories/packages to reduce bundle size

Open techniq opened this issue 5 months ago • 0 comments

Some components such as force, hierarchy, graph, and geo components have external dependencies (such as dagrejs, d3-force, and d3-geo) and are not as commonly used. These could be removed from top-level exports and exposed as sub paths to reduce bundle sizes in many cases.

import { ForceSimulation } from 'layerchart/force';
import { Dagre, Sankey } from 'layerchart/graph';
import { Pack, Partition, Tree, Treemap } from 'layerchart/hierarchy';
import { GeoPath, GeoPoint, GeoTile } from 'layerchart/geo';

GeoContext is integrated into Chart so d3-geo wouldn't be excluded, but d3-tile and a few other packages could be.

techniq avatar Jul 23 '25 21:07 techniq