Skip to content

feat(layout): bundle only force-directed layouts and support custom l… - #74

Merged
pearlwang1106 merged 7 commits into
refactor-layoutfrom
perf/builtin-layouts
Nov 27, 2026
Merged

pearlwang1106 merged 7 commits into
refactor-layoutfrom
perf/builtin-layouts

Conversation

@hustcc

@hustcc hustcc commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

改动

  • 内置布局仅保留 force、force-atlas2、d3-force、fruchterman。
  • 其他布局统一从 @antv/layout 导入布局类传入,无需注册。
  • 删除 G6Lite 全部布局封装和 @antv/g6-lite/layouts/* 子入口。
  • 升级 @antv/layout 到 2.1.0-beta.1。

使用方式

内置布局:

layout: { type: 'force' }

外置布局:

import { DagreLayout } from '@antv/layout';
layout: { type: DagreLayout, rankdir: 'LR' }

包大小

  • UMD:171.7 KB → 118.5 KB gzip(-31%)

…ayout classes

- Bundle only force, force-atlas2, d3-force, and fruchterman by default
- Allow passing @antv/layout classes directly as layout.type
- Run custom layout classes on the main thread; keep Worker for built-in names
- Update docs, demos, and tests to use the new layout API
- Reduce UMD gzip size from 171.7 KB to 118.6 KB
- Allow string | number node ids and optional forEachNode index
- Remove unnecessary type assertions for built-in layouts
- Use built-in force layout in README examples
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://antvis-G6Lite-preview-pr-74.surge.sh
📝 Commitcb249e6
⏱️ Build time0.008s
📦 Size202.4 MB (-25.7 KB ⬇️) · 4929 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ cb249e6 · antvis-G6Lite-preview-pr-74.surge.sh (open ↗) · 2026-11-27 15:31:20 UTC

🤖 Powered by surge-preview

…v/layout

- Upgrade @antv/layout to 2.1.0-beta.1
- Remove all custom layout implementations and optional subpath entries
- Import layout classes directly from @antv/layout in docs and demos
- Remove g6-lite-layouts.min.js build and registration requirements
- Delete obsolete tests for removed layout functions
- Remove hardcoded byte counts from README badge descriptions
- Update performance docs with current UMD and ESM sizes
@hustcc
hustcc changed the base branch from master to refactor-layout November 27, 2026 15:30
@pearlwang1106
pearlwang1106 merged commit d4c9a7b into refactor-layout Nov 27, 2026
3 checks passed
@pearlwang1106
pearlwang1106 deleted the perf/builtin-layouts branch November 27, 2026 15:34
hustcc added a commit that referenced this pull request Nov 30, 2026
* feat(layout): bundle only force-directed layouts and support custom l… (#74)

* feat(layout): bundle only force-directed layouts and support custom layout classes

- Bundle only force, force-atlas2, d3-force, and fruchterman by default
- Allow passing @antv/layout classes directly as layout.type
- Run custom layout classes on the main thread; keep Worker for built-in names
- Update docs, demos, and tests to use the new layout API
- Reduce UMD gzip size from 171.7 KB to 118.6 KB

* fix(layout): align LayoutInstance with @antv/layout node types

- Allow string | number node ids and optional forEachNode index
- Remove unnecessary type assertions for built-in layouts
- Use built-in force layout in README examples

* refactor(layout): remove layout wrappers and import classes from @antv/layout

- Upgrade @antv/layout to 2.1.0-beta.1
- Remove all custom layout implementations and optional subpath entries
- Import layout classes directly from @antv/layout in docs and demos
- Remove g6-lite-layouts.min.js build and registration requirements
- Delete obsolete tests for removed layout functions

* docs: update package size measurements after layout cleanup

- Remove hardcoded byte counts from README badge descriptions
- Update performance docs with current UMD and ESM sizes

* docs: use versionless CDN URLs for automatic latest version resolution

* docs: simplify package size section to UMD minified and gzip sizes

* docs: update homepage UMD size measurement to 118.2 kB

* docs: remove minzip badge from README

* docs: add UMD size comparison with G6, ECharts, and Sigma.js

* chore: update antv layout version with 2.1.0

* fix(site): align layout examples with the layout refactor

* docs(site): finish layout refactor documentation (#76)

---------

Co-authored-by: gengsheng.wp <gengsheng.wp@antgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants