diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap index c9bab271a5..be7f0a7c5c 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap @@ -2271,12 +2271,12 @@ Array [ "width": 113.6, }, Object { - "actualText": "2367236723611...", + "actualText": "236723672361111", "actualTextHeight": 15, - "actualTextWidth": 96, + "actualTextWidth": 98, "height": 30, "multiLineActualTexts": Array [ - "2367236723611...", + "236723672361111", ], "originalText": 236723672361111, "width": 113.6, @@ -6356,8 +6356,8 @@ Array [ "actualTextWidth": 100, "height": 30, "multiLineActualTexts": Array [ - "236723672361", - "111", + "2367236723611", + "11", ], "originalText": 236723672361111, "width": 102.57, @@ -12254,8 +12254,8 @@ Array [ "actualTextWidth": 100, "height": 30, "multiLineActualTexts": Array [ - "236723672361", - "111", + "2367236723611", + "11", ], "originalText": 236723672361111, "width": 102.57, @@ -15261,8 +15261,8 @@ Array [ "actualTextWidth": 100, "height": 30, "multiLineActualTexts": Array [ - "236723672361", - "111", + "2367236723611", + "11", ], "originalText": 236723672361111, "width": 102.57, diff --git a/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts b/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts index 7980c50b89..2ccf650541 100644 --- a/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts @@ -21,7 +21,7 @@ const s2Options: S2Options = { describe('Compare Layout Tests', () => { const expectTextOverflowing = (s2: SpreadSheet) => { - [...s2.facet.getColCells(), ...s2.facet.getDataCells()].forEach((cell) => { + s2.facet.getCells().forEach((cell) => { expect(cell.getTextShape().isOverflowing()).toBeFalsy(); }); }; @@ -55,9 +55,9 @@ describe('Compare Layout Tests', () => { const colLeafNodes = s2.facet.getColLeafNodes(); - expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(133); + expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(122); expect(Math.floor(colLeafNodes[1].width)).toEqual( - options.showDefaultHeaderActionIcon ? 71 : 66, + options.showDefaultHeaderActionIcon ? 66 : 63, ); expectTextOverflowing(s2); }, @@ -84,15 +84,15 @@ describe('Compare Layout Tests', () => { }); await s2.render(); - const expectWidth = options.showDefaultHeaderActionIcon ? 71 : 66; + const expectWidth = options.showDefaultHeaderActionIcon ? 66 : 63; const isLargeFontSize = options.fontSize === 20; const colLeafNodes = s2.facet.getColLeafNodes(); expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo( - isLargeFontSize ? 209 : 133, + isLargeFontSize ? 191 : 122, ); expect(Math.floor(colLeafNodes[1].width)).toEqual( - isLargeFontSize ? 97 : expectWidth, + isLargeFontSize ? 92 : expectWidth, ); expectTextOverflowing(s2); }); @@ -123,7 +123,7 @@ describe('Compare Layout Tests', () => { const colLeafNodes = s2.facet.getColLeafNodes(); const { dataCellWidthList, colLeafNodeWidthList } = mapWidthList(s2); - const expectWidth = 207; + const expectWidth = 183; expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(expectWidth); expect( @@ -171,13 +171,186 @@ describe('Compare Layout Tests', () => { expect(dataCellWidthList).toEqual( options.showDefaultHeaderActionIcon - ? [227, 227, 227, 227, 115, 115, 115, 115, 93, 93, 93, 93] - : [227, 227, 227, 227, 115, 115, 115, 115, 71, 71, 71, 71], + ? [209, 209, 209, 209, 110, 110, 110, 110, 85, 85, 85, 85] + : [209, 209, 209, 209, 110, 110, 110, 110, 69, 69, 69, 69], ); expect(colLeafNodeWidthList).toEqual( - options.showDefaultHeaderActionIcon ? [227, 115, 93] : [227, 115, 71], + options.showDefaultHeaderActionIcon ? [209, 110, 85] : [209, 110, 69], ); expectTextOverflowing(s2); }, ); + + test.each([{ showIcon: true }, { showIcon: false }])( + 'should get max row width for pivot sheet and format name by %o', + async (options) => { + const s2 = new PivotSheet( + getContainer(), + { + ...mockDataConfig, + meta: [ + { field: 'province', name: '省份666' }, + { field: 'city', name: '城市1234567' }, + ], + }, + { + ...s2Options, + headerActionIcons: options.showIcon + ? [ + { + icons: ['SortDown'], + belongsCell: 'cornerCell', + }, + ] + : [], + }, + ); + + await s2.render(); + + const rowNodes = s2.facet.getRowNodes(); + + expect(Math.floor(rowNodes[0].width)).toBeCloseTo( + options.showIcon ? 80 : 62, + ); + expect(Math.floor(rowNodes[1].width)).toEqual( + options.showIcon ? 106 : 88, + ); + expectTextOverflowing(s2); + }, + ); + + test('should not render overflowing text for table sheet and a difference type text', async () => { + const s2 = new TableSheet(getContainer(), mockDataConfig, s2Options); + + s2.setDataCfg({ + fields: { + columns: [ + 'date', + 'zh', + 'percentage', + 'number', + 'url-number', + 'url-en', + 'url-zh', + ], + }, + meta: [ + { + field: 'date', + formatter: () => '2021-09-08', + }, + { + field: 'zh', + formatter: () => '中文文本测试中文文本', + }, + { + field: 'percentage', + formatter: () => '100.23433333%', + }, + { + field: 'number', + formatter: () => '111111111111', + }, + { + field: 'url-number', + formatter: () => `https://wwww.test.cn?test=${'1'.repeat(10)}`, + }, + { + field: 'url-en', + formatter: () => `https://wwww.test.cn?test=${'t'.repeat(10)}`, + }, + { + field: 'url-zh', + formatter: () => `https://wwww.test.cn?test=${'测'.repeat(10)}`, + }, + ], + }); + + await s2.render(); + + expectTextOverflowing(s2); + }); + + test('should get max col width for pivot sheet conditions', async () => { + const s2 = new PivotSheet(getContainer(), mockDataConfig, { + ...s2Options, + conditions: { + icon: [ + { + field: 'price', + position: 'left', + mapping(fieldValue: number) { + if (!fieldValue) { + return null; + } + + return fieldValue > 0 + ? { + fill: 'red', + icon: 'CellUp', + } + : { + fill: 'green', + icon: 'CellDown', + }; + }, + }, + ], + }, + }); + + s2.setDataCfg({ + meta: [ + { + field: 'price', + formatter: (value) => (value === '111' ? '35333.7%' : value), + }, + ], + }); + + await s2.render(); + + const { dataCellWidthList, colLeafNodeWidthList } = mapWidthList(s2); + + expect(dataCellWidthList).toEqual([ + 140, 140, 140, 140, 81, 81, 81, 81, 92, 92, 92, 92, + ]); + expect(colLeafNodeWidthList).toEqual([140, 81, 92]); + expectTextOverflowing(s2); + }); + + test.each([ + { text: '中文文本测试中文文本测试', width: 145 }, + { text: '中文文本测试中文文本123', width: 142 }, + { text: '中文文本测试中文文本word', width: 150 }, + { text: '11111111111111111', width: 104 }, + { text: '参数:', width: 37 }, + { text: 'word', width: 30 }, + { text: 'word123', width: 50 }, + { text: 'word123...', width: 60 }, + { text: '100.234%', width: 56 }, + { text: '2024-12-24', width: 63 }, + { text: '纸张123456', width: 66 }, + { text: `https://wwww.test.cn?test=${'1'.repeat(10)}`, width: 217 }, + ])('should get correctly text width for %o', async ({ text, width }) => { + const s2 = new PivotSheet(getContainer(), mockDataConfig, { + ...s2Options, + }); + + await s2.render(); + + const result = s2.facet.measureTextWidth(text, { + fontFamily: 'Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif', + fontSize: 12, + fontWeight: 700, + fill: '#000000', + opacity: 1, + textAlign: 'left', + textBaseline: 'middle', + linkTextFill: '#2C60D4', + }); + + expect(result).toEqual(width); + }); }); diff --git a/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts b/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts index 5502548bcd..8dd602b623 100644 --- a/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts @@ -480,7 +480,7 @@ describe('Scroll Tests', () => { s2.changeSheetSize(1000, 150); // 纵向滚动条 await s2.render(false); - expect(Math.floor(s2.facet.vScrollBar.getBBox().x)).toEqual(213); + expect(Math.floor(s2.facet.vScrollBar.getBBox().x)).toEqual(201); s2.setOptions({ interaction: { diff --git a/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts b/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts index 3dc217914d..975dbb3a47 100644 --- a/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts +++ b/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts @@ -138,7 +138,7 @@ describe('Col width Test', () => { const colLeafNodes = s2.facet.getColLeafNodes(); // price 列,列头标签比表身数据更长 - expect(Math.round(colLeafNodes[0].width)).toBe(52); + expect(Math.round(colLeafNodes[0].width)).toBe(47); // cost 列,表身数据比列头更长(格式化) expect(Math.round(colLeafNodes[1].width)).toBe(168); }); diff --git a/packages/s2-core/__tests__/unit/utils/canvas-spec.ts b/packages/s2-core/__tests__/unit/utils/canvas-spec.ts index c4c1161a7a..cb4c38fb7e 100644 --- a/packages/s2-core/__tests__/unit/utils/canvas-spec.ts +++ b/packages/s2-core/__tests__/unit/utils/canvas-spec.ts @@ -2,7 +2,7 @@ import { getOffscreenCanvas, removeOffscreenCanvas } from '@/utils'; import { sleep } from './../../util/helpers'; describe('Canvas Utils Tests', () => { - const ID = 's2-offscreen-canvas'; + const ID = 'antv-s2-offscreen-canvas'; test('should get offscreen canvas', () => { const canvas = getOffscreenCanvas(); diff --git a/packages/s2-core/package.json b/packages/s2-core/package.json index 55c4fb626c..cab1475b21 100644 --- a/packages/s2-core/package.json +++ b/packages/s2-core/package.json @@ -74,9 +74,9 @@ }, "dependencies": { "@antv/event-emitter": "^0.1.3", - "@antv/g": "^6.1.15", - "@antv/g-canvas": "^2.0.33", - "@antv/g-lite": "^2.2.10", + "@antv/g": "^6.1.17", + "@antv/g-canvas": "^2.0.35", + "@antv/g-lite": "^2.2.12", "d3-ease": "^3.0.1", "d3-interpolate": "^1.3.2", "d3-timer": "^1.0.9", diff --git a/packages/s2-core/scripts/test-live.mjs b/packages/s2-core/scripts/test-live.mjs index 5acde67f40..ac491d2ea5 100644 --- a/packages/s2-core/scripts/test-live.mjs +++ b/packages/s2-core/scripts/test-live.mjs @@ -8,7 +8,7 @@ import ora from 'ora'; inquirer.registerPrompt('autocomplete', autoCompletePrompt); function run(path) { - const command = `cross-env DEBUG_MODE=1 npx jest ${path} --passWithNoTests --detectOpenHandles`; + const command = `cross-env DEBUG_MODE=1 npx jest ${path} --passWithNoTests`; const jestSpinner = ora(`[测试运行中]: ${command}`).start(); try { diff --git a/packages/s2-core/src/cell/base-cell.ts b/packages/s2-core/src/cell/base-cell.ts index 8b607b1a12..0d30616d91 100644 --- a/packages/s2-core/src/cell/base-cell.ts +++ b/packages/s2-core/src/cell/base-cell.ts @@ -491,13 +491,14 @@ export abstract class BaseCell extends Group { const maxTextWidth = Math.max(this.getMaxTextWidth(), 0) + EXTRA_PIXEL; const textStyle = this.getTextStyle(); const maxLines = this.getResizedTextMaxLines() || textStyle?.maxLines; + const text = this.getFieldValue()!; // 在坐标计算 (getTextPosition) 之前, 预渲染一次, 提前生成 textShape, 获得文字宽度, 用于计算 icon 绘制坐标 this.renderTextShape({ ...textStyle, x: 0, y: 0, - text: this.getFieldValue()!, + text, wordWrapWidth: maxTextWidth, maxLines, }); diff --git a/packages/s2-core/src/facet/base-facet.ts b/packages/s2-core/src/facet/base-facet.ts index f882447ffb..69959c710d 100644 --- a/packages/s2-core/src/facet/base-facet.ts +++ b/packages/s2-core/src/facet/base-facet.ts @@ -2454,22 +2454,10 @@ export abstract class BaseFacet { * @tip 和 this.spreadsheet.measureTextWidth() 的区别在于: * 1. 额外添加一像素余量,防止 maxLabel 有多个同样长度情况下,一些 label 不能展示完全, 出现省略号 * 2. 测量时, 文本宽度取整, 避免子像素的不一致性 - * 3. TODO: 由于 G 测量文本是一个一个字符进行计算, 在数字/英文等场景会有较大误差, 这里为了防止紧凑模式出现省略号, 暂时保持一样的策略 */ - protected measureTextWidth( - text: SimpleData, - font: unknown, - roughly = true, - ): number { + protected measureTextWidth(text: SimpleData, font: unknown): number { const EXTRA_PIXEL = 1; - if (roughly) { - return ( - Math.ceil(this.spreadsheet.measureTextWidthRoughly(text, font)) + - EXTRA_PIXEL - ); - } - return ( Math.ceil(this.spreadsheet.measureTextWidth(text, font)) + EXTRA_PIXEL ); diff --git a/packages/s2-core/src/facet/pivot-facet.ts b/packages/s2-core/src/facet/pivot-facet.ts index dc423659eb..f118aa4689 100644 --- a/packages/s2-core/src/facet/pivot-facet.ts +++ b/packages/s2-core/src/facet/pivot-facet.ts @@ -803,7 +803,7 @@ export class PivotFacet extends FrozenFacet { * 额外增加 1,当内容和容器宽度恰好相等时会出现换行 */ const maxLabelWidth = - this.measureTextWidth(treeHeaderLabel, cornerCellTextStyle, false) + + this.measureTextWidth(treeHeaderLabel, cornerCellTextStyle) + cornerIconStyle.size * 2 + cornerIconStyle.margin?.left + cornerIconStyle.margin?.right + diff --git a/packages/s2-core/src/facet/table-facet.ts b/packages/s2-core/src/facet/table-facet.ts index 5e26b85d9f..b22e870130 100644 --- a/packages/s2-core/src/facet/table-facet.ts +++ b/packages/s2-core/src/facet/table-facet.ts @@ -134,7 +134,7 @@ export class TableFacet extends FrozenFacet { const iconX = viewportWidth / 2 - icon.width / 2; const iconY = height / 2 + maxY - icon.height / 2 + icon.margin.top; const text = empty?.description ?? i18n('暂无数据'); - const descWidth = this.measureTextWidth(text, description, false); + const descWidth = this.measureTextWidth(text, description); const descX = viewportWidth / 2 - descWidth / 2; const descY = iconY + icon.height + icon.margin.bottom; diff --git a/packages/s2-core/src/sheet-type/spread-sheet.ts b/packages/s2-core/src/sheet-type/spread-sheet.ts index 91723a6e43..b4b7359de6 100644 --- a/packages/s2-core/src/sheet-type/spread-sheet.ts +++ b/packages/s2-core/src/sheet-type/spread-sheet.ts @@ -65,7 +65,7 @@ import { RootInteraction } from '../interaction/root'; import { getTheme } from '../theme'; import { HdAdapter } from '../ui/hd-adapter'; import { BaseTooltip } from '../ui/tooltip'; -import { removeOffscreenCanvas } from '../utils/canvas'; +import { getOffscreenCanvas, removeOffscreenCanvas } from '../utils/canvas'; import { clearValueRangeState } from '../utils/condition/state-controller'; import { hideColumnsByThunkGroup } from '../utils/hide-columns'; import { isMobile } from '../utils/is-mobile'; @@ -784,7 +784,8 @@ export abstract class SpreadSheet extends EE { return null; } - const ctx = this.getCanvasElement()?.getContext('2d')!; + const canvas = getOffscreenCanvas() || this.getCanvasElement(); + const ctx = canvas?.getContext('2d')!; const { fontSize, fontFamily, fontWeight, fontStyle, fontVariant } = font as CSSStyleDeclaration; diff --git a/packages/s2-core/src/utils/canvas.ts b/packages/s2-core/src/utils/canvas.ts index fe96b36f65..aa777e9533 100644 --- a/packages/s2-core/src/utils/canvas.ts +++ b/packages/s2-core/src/utils/canvas.ts @@ -1,4 +1,6 @@ -const OFFSCREEN_CANVAS_DOM_ID = 's2-offscreen-canvas'; +import { S2_PREFIX_CLS } from '../common/constant/classnames'; + +const OFFSCREEN_CANVAS_DOM_ID = `${S2_PREFIX_CLS}-offscreen-canvas`; /** * 获取工具 canvas diff --git a/packages/s2-react/playground/config.tsx b/packages/s2-react/playground/config.tsx index 74be56b948..6fe753173a 100644 --- a/packages/s2-react/playground/config.tsx +++ b/packages/s2-react/playground/config.tsx @@ -103,7 +103,7 @@ export const pivotSheetDataCfgForCompactMode = customMerge( { province: '浙江省', city: '杭州市', - sub_type: '纸张', + sub_type: '纸张123456', type: '办公用品', number: 2, }, @@ -112,7 +112,7 @@ export const pivotSheetDataCfgForCompactMode = customMerge( city: '舟山市', sub_type: '笔', type: '办公用品', - number: 2, + number: '20000.334%', }, { province: '浙江省', @@ -412,7 +412,6 @@ export const s2Options: SheetComponentOptions = { // ], // ], tooltip: S2TooltipOptions, - style: {}, }; export const sliderOptions: SliderSingleProps = { diff --git a/packages/s2-react/scripts/test-live.mjs b/packages/s2-react/scripts/test-live.mjs index 5ce0d08372..72d2d0a299 100644 --- a/packages/s2-react/scripts/test-live.mjs +++ b/packages/s2-react/scripts/test-live.mjs @@ -8,7 +8,7 @@ import ora from 'ora'; inquirer.registerPrompt('autocomplete', autoCompletePrompt); function run(path) { - const command = `cross-env DEBUG_MODE=1 npx jest ${path} --passWithNoTests --detectOpenHandles`; + const command = `cross-env DEBUG_MODE=1 npx jest ${path} --passWithNoTests`; const jestSpinner = ora(`[测试运行中]: ${command}`).start(); try { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7835b24540..51c65771f9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -273,14 +273,14 @@ importers: specifier: ^0.1.3 version: 0.1.3 '@antv/g': - specifier: ^6.1.15 - version: 6.1.15 + specifier: ^6.1.17 + version: 6.1.17 '@antv/g-canvas': - specifier: ^2.0.33 - version: 2.0.33 + specifier: ^2.0.35 + version: 2.0.35 '@antv/g-lite': - specifier: ^2.2.10 - version: 2.2.10 + specifier: ^2.2.12 + version: 2.2.12 d3-ease: specifier: ^3.0.1 version: 3.0.1 @@ -505,17 +505,17 @@ importers: specifier: ^0.5.5 version: 0.5.5(@algolia/client-search@5.18.0)(@babel/core@7.24.7)(@types/react@18.3.3)(dumi@2.4.17(@babel/core@7.24.7)(@swc/helpers@0.5.1)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@8.57.0)(jest@26.6.3)(lightningcss@1.22.1)(postcss-less@6.0.0(postcss@8.4.38))(prettier@3.3.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(stylelint@15.11.0(typescript@5.4.5))(terser@5.31.1)(type-fest@1.4.0)(typescript@5.4.5))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@antv/g': - specifier: ^6.1.15 - version: 6.1.15 + specifier: ^6.1.17 + version: 6.1.17 '@antv/g-canvas': - specifier: ^2.0.33 - version: 2.0.33 + specifier: ^2.0.35 + version: 2.0.35 '@antv/g-plugin-a11y': - specifier: ^1.1.15 - version: 1.1.15 + specifier: ^1.1.17 + version: 1.1.17 '@antv/g-plugin-rough-canvas-renderer': - specifier: ^2.0.33 - version: 2.0.33 + specifier: ^2.0.35 + version: 2.0.35 '@antv/g2': specifier: ^5.1.21 version: 5.1.21 @@ -769,14 +769,17 @@ packages: '@antv/event-emitter@0.1.3': resolution: {integrity: sha512-4ddpsiHN9Pd4UIlWuKVK1C4IiZIdbwQvy9i7DUSI3xNJ89FPUFt8lxDYj8GzzfdllV0NkJTRxnG+FvLk0llidg==} - '@antv/g-camera-api@2.0.29': - resolution: {integrity: sha512-SADx+f+kQ1Jlx+LH9Pp4AXEk++1FCndVl7eZCosDClLUBBbAbLiMxtu4+K05whLiB4aF9rWmWc24VDNRlrC+Dg==} + '@antv/g-camera-api@2.0.31': + resolution: {integrity: sha512-wF8TB4PBxmIcuhovxYjfGnwPwdPAnCRVSLOt7olhnXYX7+Ejwy15tbMlT7itzUaBVI5/xhRK8j9PfziBchd1iw==} '@antv/g-canvas@2.0.33': resolution: {integrity: sha512-bqLqB42biy1ov/pu0iuKe7ErY6ASDuCDoChYQjqE9xWHFVAkXC3/sFRV0g/Br4qSJiDX4ewnRj89JH/hqTLMRA==} - '@antv/g-dom-mutation-observer-api@2.0.26': - resolution: {integrity: sha512-Yc/G/vSZ7Emh9Xb29mhOWp4CxHjyPOl0dK6eQVHFp6iKXEe6DUL5s1VMs66mle+DaQA4sZ2EZRiZjhLVT/A0Xw==} + '@antv/g-canvas@2.0.35': + resolution: {integrity: sha512-3MN6sKsLxgz4cUiq7ixKKkBwXiLhvbZEvwcqEvY93A5fhOEVGS/Lnr1TPf41Y+33wDYN0shlB4z6/6e2iI43Iw==} + + '@antv/g-dom-mutation-observer-api@2.0.28': + resolution: {integrity: sha512-flOPkPuSgMw3AEEhrLodGvQglLD6blgi74EWqwZg5zCWpMEe1fiyc63xj+3cWA2e4oodPAdd3yba908OD20G1Q==} '@antv/g-lite@2.0.5': resolution: {integrity: sha512-IeD7L10MOofNg302Zrru09zjNczCyOAC6mFLjHQlkYCQRtcU04zn32pTxCDy7xRkLHlhAK1mlymBqzeRMkmrRg==} @@ -784,44 +787,71 @@ packages: '@antv/g-lite@2.2.10': resolution: {integrity: sha512-XK2zKM1jx9nBQrxg5wxK4EOy7AvCE5c8iz7r+hfqILZn9/Mhrgj63u/YPDPyXjx0G3KUmy7XTY9231tOOtW+Wg==} + '@antv/g-lite@2.2.12': + resolution: {integrity: sha512-zgAIqByPlmkYW/cG3+5NgfhtWBxdpqHMtJhX/Fmp5hiGTYSvbteoJCG+v/LE5E2k+B1YAiNiXNFG4TR7BoKJdg==} + '@antv/g-math@3.0.0': resolution: {integrity: sha512-AkmiNIEL1vgqTPeGY2wtsMdBBqKFwF7SKSgs+D1iOS/rqYMsXdhp/HvtuQ5tx/HdawE/ZzTiicIYopc520ADZw==} '@antv/g-plugin-a11y@1.1.15': resolution: {integrity: sha512-1Ip9YXOtMT+yu8rLEmmSBHMxsB+hFpGY0EWy3mYOO+O00WSvHOYQxHvjb2/BtJuwcfyr6HzfLO4RJHSRsGfhMA==} + '@antv/g-plugin-a11y@1.1.17': + resolution: {integrity: sha512-qvjWkj5W6eRX32iLQ9he5/ryTB5w+ocUZVhNjL6fnMV0l937z958W8L0cDaFlICe/J5RIB1uCI8AbHFjMIqKxw==} + '@antv/g-plugin-canvas-path-generator@2.1.10': resolution: {integrity: sha512-G+2BSTQ51UpB/E/Jqp0/RoiflFath+hV0BLlKBZQPSGKkIP2Yu01V+2meGLbcFLjsppJL1GiJvLJdhPLEOZAUA==} + '@antv/g-plugin-canvas-path-generator@2.1.12': + resolution: {integrity: sha512-VsVmmLxRBDDsWHjLvTWHAyYoBaipqI3Sia4sirydKMpVvZ3TxtqS0MPRQ3I2q+Km7z5XKVTaRxd5vLAcdC1m9Q==} + '@antv/g-plugin-canvas-picker@2.1.12': resolution: {integrity: sha512-hRoMAeyw32zNhiRDIXYOPJp/IFydOaNkwA6asv4dS5lv/CqfXgeOG9m58YtCBNfIRREVCRh6xuX/L2tiwtzFOg==} + '@antv/g-plugin-canvas-picker@2.1.14': + resolution: {integrity: sha512-HMDBXGgA/yL8fXBb+n5IzyC5RMjWg2Wx/+lCfzYgsavpqUxqEaIAuSqUUj94ghK6kD5qi3GVC70WaW3bDAJNMw==} + '@antv/g-plugin-canvas-renderer@2.2.12': resolution: {integrity: sha512-9ydHAXx0IHcvYCgrhIxqA9IFpZ9eeKAqaQJW//43pxeXsMyfbCZlDC5ceCdFzPhhDo1+P98Thl89CMaHUo/Wdg==} + '@antv/g-plugin-canvas-renderer@2.2.14': + resolution: {integrity: sha512-ttmUjkGOsEW/g/Ysn/ezHCPEZdaDkoypF36ClgDswKURmJi0gm7AuO7QK8iFpd+1l6wuATUMURsVegZbUCmMqQ==} + '@antv/g-plugin-dom-interaction@2.1.15': resolution: {integrity: sha512-sxUobdgzst0P4bwSeMf9qiQLMvhtIBsEARAC7viuNNwno2D61TKBaQ/PMEohDlOsqLIbk/xI5Np9XGVwbAnNFQ==} + '@antv/g-plugin-dom-interaction@2.1.17': + resolution: {integrity: sha512-yTuuOcMc0Cfq6eZDm19EcoTITichw6gNx7Zl8y9CXB5IlA6FDdB+zA9n8lu510wu1kXY2X24X2u22rtaccMFLw==} + '@antv/g-plugin-dragndrop@2.0.5': resolution: {integrity: sha512-Ow9BfL4w6er8OhJxilmU4FOQvFyEWSD6ScRWHBmXqY45/8zcMuhTWd2KcMAmxxPMNmtGch4WeJdPurb0beH8DQ==} '@antv/g-plugin-html-renderer@2.1.15': resolution: {integrity: sha512-rur+VjrzYmdjoTgys+SJ4ngn8hejfJMbQwHilCxQTmnK0t7yJem0hIlKtvExL2J9EiJBajBvj3GxFEEgYOACoQ==} + '@antv/g-plugin-html-renderer@2.1.17': + resolution: {integrity: sha512-vthriz9yZ7pFw6IO4TDouE+YNwV9OnfYbkUefHrEPTUVtAukpMuUCf8ZOI4rWNsMHgHWhn1vgefTBzfc+Z57Fg==} + '@antv/g-plugin-image-loader@2.1.12': resolution: {integrity: sha512-Jgra9vOcfHO8Xq6yRoIBxl1e5UmI8ZjU5ahta3/C+lg/J+GUfI0FT4dB4Az0gAY5B1o2P/Gkd2K2PKyEcgYmLA==} + '@antv/g-plugin-image-loader@2.1.14': + resolution: {integrity: sha512-a2kx32eWJa7B/va9yrteC8Gx9q+KGw/IzhF0z6FptXy/Pcj+acx0YyMssv69vAp51Rdvw1sa8uusEqPhb+XcoQ==} + '@antv/g-plugin-rough-canvas-renderer@2.0.33': resolution: {integrity: sha512-3tzcm6evDI51oE4MnqhnmYl3ZB3pPDrRRtlgGPoMRZ1HowPZyjqKL73+Iy2DkgpEfJiSrdWKI0OBSHBebPfj1A==} - '@antv/g-web-animations-api@2.1.15': - resolution: {integrity: sha512-aCjFaN8OXE2Ev/k7vOLdnfeKexDSttG86pd3YF98Dx4ovfebnpvTpfb3Q+jIyPb6aWC1G4oWv8wgZZZug+7bIw==} + '@antv/g-plugin-rough-canvas-renderer@2.0.35': + resolution: {integrity: sha512-XCqzbkKuUIubRdjdDdLgdvCui+ohWsx3YhKfOv4Q9sj18i2Nt7d5lDzvqc8+V+FPVeZxcp1uT1nteVcUVgupSw==} + + '@antv/g-web-animations-api@2.1.17': + resolution: {integrity: sha512-nr3BEgUfUUsUHVonqLSLnwRjEUuXp3QauD+oR5hzjzMen1xt2EVjv6F5eBsIyVPZt1n+wVr9yuR3HQ5q5RmW8w==} '@antv/g2@5.1.21': resolution: {integrity: sha512-7HRWuiGN7sPK4K8ljl2/x0i3sphWNMymYFuR1BT9qo4wmMqQUgM+K+ISKMb3dXOg55eHmFje0OH80sZ53qhqPg==} - '@antv/g@6.1.15': - resolution: {integrity: sha512-JO/CuvLPzOoBHsNC1Dz/FDzytPzIsuU3B+RGC1/Vsi2qWUKwXD4l1/US3b5Q67WHU/WGYvLHfivRq1FyDGXilA==} + '@antv/g@6.1.17': + resolution: {integrity: sha512-FedCZn4xfdcfMs3CbpEuqQxvwMDA1XuOywXzKJHMTMO0mtylY0kS4zGpgt0bAPzgtO7OQYZcr3LTn4kxPaUJQw==} '@antv/path-util@3.0.1': resolution: {integrity: sha512-tpvAzMpF9Qm6ik2YSMqICNU5tco5POOW7S4XoxZAI/B0L26adU+Md/SmO0BBo2SpuywKvzPH3hPT3xmoyhr04Q==} @@ -13777,7 +13807,7 @@ snapshots: '@antv/component@2.0.1': dependencies: - '@antv/g': 6.1.15 + '@antv/g': 6.1.17 '@antv/scale': 0.4.16 '@antv/util': 3.3.7 svg-path-parser: 1.1.0 @@ -13847,9 +13877,9 @@ snapshots: '@antv/event-emitter@0.1.3': {} - '@antv/g-camera-api@2.0.29': + '@antv/g-camera-api@2.0.31': dependencies: - '@antv/g-lite': 2.2.10 + '@antv/g-lite': 2.2.12 '@antv/util': 3.3.7 '@babel/runtime': 7.26.0 gl-matrix: 3.4.3 @@ -13868,9 +13898,22 @@ snapshots: '@babel/runtime': 7.26.0 tslib: 2.6.3 - '@antv/g-dom-mutation-observer-api@2.0.26': + '@antv/g-canvas@2.0.35': dependencies: - '@antv/g-lite': 2.2.10 + '@antv/g-lite': 2.2.12 + '@antv/g-plugin-canvas-path-generator': 2.1.12 + '@antv/g-plugin-canvas-picker': 2.1.14 + '@antv/g-plugin-canvas-renderer': 2.2.14 + '@antv/g-plugin-dom-interaction': 2.1.17 + '@antv/g-plugin-html-renderer': 2.1.17 + '@antv/g-plugin-image-loader': 2.1.14 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + tslib: 2.6.3 + + '@antv/g-dom-mutation-observer-api@2.0.28': + dependencies: + '@antv/g-lite': 2.2.12 '@babel/runtime': 7.26.0 '@antv/g-lite@2.0.5': @@ -13894,6 +13937,17 @@ snapshots: rbush: 3.0.1 tslib: 2.6.3 + '@antv/g-lite@2.2.12': + dependencies: + '@antv/g-math': 3.0.0 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + d3-color: 3.1.0 + eventemitter3: 5.0.1 + gl-matrix: 3.4.3 + rbush: 3.0.1 + tslib: 2.6.3 + '@antv/g-math@3.0.0': dependencies: '@antv/util': 3.3.7 @@ -13906,6 +13960,12 @@ snapshots: '@babel/runtime': 7.26.0 tslib: 2.6.3 + '@antv/g-plugin-a11y@1.1.17': + dependencies: + '@antv/g-lite': 2.2.12 + '@babel/runtime': 7.26.0 + tslib: 2.6.3 + '@antv/g-plugin-canvas-path-generator@2.1.10': dependencies: '@antv/g-lite': 2.2.10 @@ -13914,6 +13974,14 @@ snapshots: '@babel/runtime': 7.26.0 tslib: 2.6.3 + '@antv/g-plugin-canvas-path-generator@2.1.12': + dependencies: + '@antv/g-lite': 2.2.12 + '@antv/g-math': 3.0.0 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + tslib: 2.6.3 + '@antv/g-plugin-canvas-picker@2.1.12': dependencies: '@antv/g-lite': 2.2.10 @@ -13925,6 +13993,17 @@ snapshots: gl-matrix: 3.4.3 tslib: 2.6.3 + '@antv/g-plugin-canvas-picker@2.1.14': + dependencies: + '@antv/g-lite': 2.2.12 + '@antv/g-math': 3.0.0 + '@antv/g-plugin-canvas-path-generator': 2.1.12 + '@antv/g-plugin-canvas-renderer': 2.2.14 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + gl-matrix: 3.4.3 + tslib: 2.6.3 + '@antv/g-plugin-canvas-renderer@2.2.12': dependencies: '@antv/g-lite': 2.2.10 @@ -13936,12 +14015,29 @@ snapshots: gl-matrix: 3.4.3 tslib: 2.6.3 + '@antv/g-plugin-canvas-renderer@2.2.14': + dependencies: + '@antv/g-lite': 2.2.12 + '@antv/g-math': 3.0.0 + '@antv/g-plugin-canvas-path-generator': 2.1.12 + '@antv/g-plugin-image-loader': 2.1.14 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + gl-matrix: 3.4.3 + tslib: 2.6.3 + '@antv/g-plugin-dom-interaction@2.1.15': dependencies: '@antv/g-lite': 2.2.10 '@babel/runtime': 7.26.0 tslib: 2.6.3 + '@antv/g-plugin-dom-interaction@2.1.17': + dependencies: + '@antv/g-lite': 2.2.12 + '@babel/runtime': 7.26.0 + tslib: 2.6.3 + '@antv/g-plugin-dragndrop@2.0.5': dependencies: '@antv/g-lite': 2.0.5 @@ -13956,6 +14052,14 @@ snapshots: gl-matrix: 3.4.3 tslib: 2.6.3 + '@antv/g-plugin-html-renderer@2.1.17': + dependencies: + '@antv/g-lite': 2.2.12 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + gl-matrix: 3.4.3 + tslib: 2.6.3 + '@antv/g-plugin-image-loader@2.1.12': dependencies: '@antv/g-lite': 2.2.10 @@ -13964,6 +14068,14 @@ snapshots: gl-matrix: 3.4.3 tslib: 2.6.3 + '@antv/g-plugin-image-loader@2.1.14': + dependencies: + '@antv/g-lite': 2.2.12 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + gl-matrix: 3.4.3 + tslib: 2.6.3 + '@antv/g-plugin-rough-canvas-renderer@2.0.33': dependencies: '@antv/g-canvas': 2.0.33 @@ -13973,9 +14085,18 @@ snapshots: roughjs: 4.6.6 tslib: 2.6.3 - '@antv/g-web-animations-api@2.1.15': + '@antv/g-plugin-rough-canvas-renderer@2.0.35': dependencies: - '@antv/g-lite': 2.2.10 + '@antv/g-canvas': 2.0.35 + '@antv/g-lite': 2.2.12 + '@antv/util': 3.3.7 + '@babel/runtime': 7.26.0 + roughjs: 4.6.6 + tslib: 2.6.3 + + '@antv/g-web-animations-api@2.1.17': + dependencies: + '@antv/g-lite': 2.2.12 '@antv/util': 3.3.7 '@babel/runtime': 7.26.0 tslib: 2.6.3 @@ -13985,8 +14106,8 @@ snapshots: '@antv/component': 2.0.1 '@antv/coord': 0.4.7 '@antv/event-emitter': 0.1.3 - '@antv/g': 6.1.15 - '@antv/g-canvas': 2.0.33 + '@antv/g': 6.1.17 + '@antv/g-canvas': 2.0.35 '@antv/g-plugin-dragndrop': 2.0.5 '@antv/path-util': 3.0.1 '@antv/scale': 0.4.16 @@ -14005,12 +14126,12 @@ snapshots: fmin: 0.0.2 pdfast: 0.2.0 - '@antv/g@6.1.15': + '@antv/g@6.1.17': dependencies: - '@antv/g-camera-api': 2.0.29 - '@antv/g-dom-mutation-observer-api': 2.0.26 - '@antv/g-lite': 2.2.10 - '@antv/g-web-animations-api': 2.1.15 + '@antv/g-camera-api': 2.0.31 + '@antv/g-dom-mutation-observer-api': 2.0.28 + '@antv/g-lite': 2.2.12 + '@antv/g-web-animations-api': 2.1.17 '@babel/runtime': 7.26.0 '@antv/path-util@3.0.1': @@ -22813,11 +22934,7 @@ snapshots: pretty-format: 26.6.2 throat: 5.0.0 transitivePeerDependencies: - - bufferutil - - canvas - supports-color - - ts-node - - utf-8-validate jest-leak-detector@24.9.0: dependencies: diff --git a/s2-site/package.json b/s2-site/package.json index 42fb2c9275..fdcf53fd08 100644 --- a/s2-site/package.json +++ b/s2-site/package.json @@ -29,10 +29,10 @@ "dependencies": { "@ant-design/icons": "^5.3.7", "@antv/dumi-theme-antv": "^0.5.5", - "@antv/g": "^6.1.15", - "@antv/g-canvas": "^2.0.33", - "@antv/g-plugin-a11y": "^1.1.15", - "@antv/g-plugin-rough-canvas-renderer": "^2.0.33", + "@antv/g": "^6.1.17", + "@antv/g-canvas": "^2.0.35", + "@antv/g-plugin-a11y": "^1.1.17", + "@antv/g-plugin-rough-canvas-renderer": "^2.0.35", "@antv/g2": "^5.1.21", "@antv/s2": "workspace:*", "@antv/s2-react": "workspace:*",