From 296b50f05bdb26281858eabe0a8700df63671bac Mon Sep 17 00:00:00 2001 From: hustcc Date: Mon, 9 Oct 2023 00:15:05 +0800 Subject: [PATCH] chore: upgrade gui to component (#5615) --- package.json | 2 +- site/docs/manual/extra-topics/bundle.zh.md | 2 +- src/component/axis.ts | 2 +- src/component/legendCategory.ts | 2 +- src/component/legendContinuous.ts | 2 +- src/component/scrollbar.ts | 2 +- src/component/slider.ts | 2 +- src/component/utils.ts | 2 +- src/interaction/tooltip.ts | 2 +- src/shape/connector/connector.ts | 2 +- src/shape/text/advance.ts | 2 +- src/shape/text/badge.ts | 2 +- src/spec/interaction.ts | 2 +- vite.config.js | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index a731947b4b..476a063b76 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@antv/g-canvas": "^1.11.5", "@antv/g-plugin-3d": "^1.9.14", "@antv/g-plugin-dragndrop": "^1.8.3", - "@antv/gui": "^0.5.0", + "@antv/component": "^1.0.0-beta.1", "@antv/path-util": "^3.0.1", "@antv/scale": "^0.4.7", "@antv/util": "^3.3.2", diff --git a/site/docs/manual/extra-topics/bundle.zh.md b/site/docs/manual/extra-topics/bundle.zh.md index c7668d0dae..0ca6620723 100644 --- a/site/docs/manual/extra-topics/bundle.zh.md +++ b/site/docs/manual/extra-topics/bundle.zh.md @@ -273,7 +273,7 @@ chart.point3D(); 目前是推出了按需打包的能力,但是可以发现效果不是很明显,只减少了 10% 左右的大小。通过分析如下 G2 5.0.18 使用 [G2.stdlib](#g2corelib) 依赖图可以有以下几个可以进一步优化思路: - 减少 Runtime 的体积:把一些能力放在 library 里面可以按需使用。 -- 依赖治理:去掉一些重复依赖,比如 `@antv/util`;减少一些依赖的大小 `@antv/gui`。 +- 依赖治理:去掉一些重复依赖,比如 `@antv/util`;减少一些依赖的大小 `@antv/component`。 - 提供比 corelib 更小的 library:可以实现 Mark 级别的按需打包。 dep diff --git a/src/component/axis.ts b/src/component/axis.ts index d87d58aa55..95c2524c6a 100644 --- a/src/component/axis.ts +++ b/src/component/axis.ts @@ -1,6 +1,6 @@ import { Coordinate } from '@antv/coord'; import type { DisplayObject } from '@antv/g'; -import { Axis as AxisComponent } from '@antv/gui'; +import { Axis as AxisComponent } from '@antv/component'; import { Linear as LinearScale } from '@antv/scale'; import { deepMix, omit, upperFirst } from '@antv/util'; import { extent } from 'd3-array'; diff --git a/src/component/legendCategory.ts b/src/component/legendCategory.ts index ef8a97ef90..c8885dba8a 100644 --- a/src/component/legendCategory.ts +++ b/src/component/legendCategory.ts @@ -1,5 +1,5 @@ import type { DisplayObject } from '@antv/g'; -import { Category } from '@antv/gui'; +import { Category } from '@antv/component'; import { last } from '@antv/util'; import { format } from 'd3-format'; import { Identity } from '@antv/scale'; diff --git a/src/component/legendContinuous.ts b/src/component/legendContinuous.ts index a88d913f9a..6a7fcb0d3b 100644 --- a/src/component/legendContinuous.ts +++ b/src/component/legendContinuous.ts @@ -1,5 +1,5 @@ import { DisplayObject, parseColor } from '@antv/g'; -import { Continuous } from '@antv/gui'; +import { Continuous } from '@antv/component'; import { Constant, Quantile, Quantize, Threshold } from '@antv/scale'; import { format } from 'd3-format'; import type { diff --git a/src/component/scrollbar.ts b/src/component/scrollbar.ts index b642646583..cef73cfbb3 100644 --- a/src/component/scrollbar.ts +++ b/src/component/scrollbar.ts @@ -1,4 +1,4 @@ -import { Scrollbar as ScrollbarComponent } from '@antv/gui'; +import { Scrollbar as ScrollbarComponent } from '@antv/component'; import { DisplayObject } from '@antv/g'; import { GuideComponentComponent as GCC } from '../runtime'; diff --git a/src/component/slider.ts b/src/component/slider.ts index dc30c3d1de..2f4ad07ac5 100644 --- a/src/component/slider.ts +++ b/src/component/slider.ts @@ -1,4 +1,4 @@ -import { Slider as SliderComponent } from '@antv/gui'; +import { Slider as SliderComponent } from '@antv/component'; import { format } from 'd3-format'; import { DisplayObject } from '@antv/g'; import { isTranspose } from '../utils/coordinate'; diff --git a/src/component/utils.ts b/src/component/utils.ts index da521b21cb..84d79999d6 100644 --- a/src/component/utils.ts +++ b/src/component/utils.ts @@ -1,5 +1,5 @@ import { CustomElement, DisplayObjectConfig, Group } from '@antv/g'; -import { Layout } from '@antv/gui'; +import { Layout } from '@antv/component'; import { deepMix, upperFirst } from '@antv/util'; import { FlexLayout, diff --git a/src/interaction/tooltip.ts b/src/interaction/tooltip.ts index 2bd781529f..a00154f8d9 100644 --- a/src/interaction/tooltip.ts +++ b/src/interaction/tooltip.ts @@ -1,7 +1,7 @@ import { Circle, DisplayObject, IElement, Line } from '@antv/g'; import { sort, group, mean, bisector, minIndex } from 'd3-array'; import { deepMix, lowerFirst, throttle } from '@antv/util'; -import { Tooltip as TooltipComponent } from '@antv/gui'; +import { Tooltip as TooltipComponent } from '@antv/component'; import { Constant, Band } from '@antv/scale'; import { defined, subObject } from '../utils/helper'; import { isTranspose, isPolar } from '../utils/coordinate'; diff --git a/src/shape/connector/connector.ts b/src/shape/connector/connector.ts index 8ed1e0ae46..05e9ffc2d3 100644 --- a/src/shape/connector/connector.ts +++ b/src/shape/connector/connector.ts @@ -1,7 +1,7 @@ import { Coordinate } from '@antv/coord'; import type { PathArray } from '@antv/util'; import { PathStyleProps, Path } from '@antv/g'; -import { Marker } from '@antv/gui'; +import { Marker } from '@antv/component'; import { line as d3line } from 'd3-shape'; import { ShapeComponent as SC, Vector2, WithPrefix } from '../../runtime'; import { isTranspose } from '../../utils/coordinate'; diff --git a/src/shape/text/advance.ts b/src/shape/text/advance.ts index 57ea496064..8b33a0b38d 100644 --- a/src/shape/text/advance.ts +++ b/src/shape/text/advance.ts @@ -8,7 +8,7 @@ import { PathStyleProps, } from '@antv/g'; import { isNumber } from '@antv/util'; -import { Marker } from '@antv/gui'; +import { Marker } from '@antv/component'; import { line } from 'd3-shape'; import { WithPrefix } from '../../runtime'; import { createElement } from '../../utils/createElement'; diff --git a/src/shape/text/badge.ts b/src/shape/text/badge.ts index 74c0573e33..d6270e6945 100644 --- a/src/shape/text/badge.ts +++ b/src/shape/text/badge.ts @@ -1,5 +1,5 @@ import { TextStyleProps, DisplayObject } from '@antv/g'; -import { Marker } from '@antv/gui'; +import { Marker } from '@antv/component'; import { ShapeComponent as SC, WithPrefix } from '../../runtime'; import { createElement } from '../../utils/createElement'; import { subObject } from '../../utils/helper'; diff --git a/src/spec/interaction.ts b/src/spec/interaction.ts index e2d9b71435..f73991c4b6 100644 --- a/src/spec/interaction.ts +++ b/src/spec/interaction.ts @@ -1,4 +1,4 @@ -import type { TooltipStyleProps } from '@antv/gui'; +import type { TooltipStyleProps } from '@antv/component'; import { BBox, InteractionComponent } from '../runtime'; import { FisheyeCoordinate } from './coordinateTransform'; import { TooltipItemValue } from './component'; diff --git a/vite.config.js b/vite.config.js index 12b6f17867..2fafb2e228 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,7 +5,7 @@ const { LINK, MODULE } = process.env; if (LINK === '1' && !MODULE) { throw new Error( - `Please specify MODULE, for example: $ MODULE=@antv/gui npm run dev:link.`, + `Please specify MODULE, for example: $ MODULE=@antv/component npm run dev:link.`, ); }