@visactor/vtable 0.13.0-alpha.2 → 0.13.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable.js +12 -12
- package/cjs/ListTable.js.map +1 -1
- package/cjs/body-helper/style.js +2 -2
- package/cjs/body-helper/style.js.map +1 -1
- package/cjs/components/axis/get-axis-attributes.d.ts +137 -0
- package/cjs/components/axis/get-axis-attributes.js +10 -5
- package/cjs/components/axis/get-axis-attributes.js.map +1 -1
- package/cjs/components/axis/get-axis-component-size.js +32 -32
- package/cjs/components/axis/get-axis-component-size.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +2 -2
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/core/BaseTable.js +10 -9
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.js +5 -5
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/EventTarget.js +2 -2
- package/cjs/event/EventTarget.js.map +1 -1
- package/cjs/header-helper/style.js +2 -2
- package/cjs/header-helper/style.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +1 -1
- package/cjs/layout/pivot-header-layout.js +23 -23
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +5 -5
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/render/layout/container.js +3 -3
- package/cjs/render/layout/container.js.map +1 -1
- package/cjs/render/layout/icon.js +2 -2
- package/cjs/render/layout/icon.js.map +1 -1
- package/cjs/render/layout/image.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +11 -11
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +2 -2
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +41 -6
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +4 -4
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +23 -24
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +6 -3
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +10 -10
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +9 -7
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +7 -7
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/get-prop.js +4 -4
- package/cjs/scenegraph/utils/get-prop.js.map +1 -1
- package/cjs/state/state.js +4 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/NumberMap.js +2 -2
- package/cjs/tools/NumberMap.js.map +1 -1
- package/cjs/tools/diff-cell.d.ts +1 -1
- package/dist/vtable.js +2003 -1942
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/body-helper/style.js +1 -1
- package/es/body-helper/style.js.map +1 -1
- package/es/components/axis/get-axis-attributes.d.ts +137 -0
- package/es/components/axis/get-axis-attributes.js +8 -2
- package/es/components/axis/get-axis-attributes.js.map +1 -1
- package/es/components/axis/get-axis-component-size.js +33 -33
- package/es/components/axis/get-axis-component-size.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +1 -1
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/core/BaseTable.js +5 -6
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.js +3 -1
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/EventTarget.js +1 -1
- package/es/event/EventTarget.js.map +1 -1
- package/es/header-helper/style.js +1 -1
- package/es/header-helper/style.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +1 -1
- package/es/layout/pivot-header-layout.js +2 -2
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.js +2 -2
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/render/layout/container.js +1 -1
- package/es/render/layout/container.js.map +1 -1
- package/es/render/layout/icon.js +1 -1
- package/es/render/layout/icon.js.map +1 -1
- package/es/render/layout/image.js.map +1 -1
- package/es/scenegraph/component/custom.js +1 -1
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +1 -3
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +42 -4
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +20 -21
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +6 -3
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +10 -10
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +9 -7
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/scenegraph.js +8 -7
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/get-prop.js +1 -1
- package/es/scenegraph/utils/get-prop.js.map +1 -1
- package/es/state/state.js +1 -3
- package/es/state/state.js.map +1 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/NumberMap.js.map +1 -1
- package/es/tools/diff-cell.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/cell-type/spark-line-cell.ts"],"names":[],"mappings":";;;AACA,+CAA6D;AAC7D,6CAA2D;AAC3D,8CAA8C;AAC9C,+CAA4C;AAI5C,MAAM,MAAM,GAAe,IAAI,mBAAU,EAAE,CAAC;AAC5C,MAAM,MAAM,GAAgB,IAAI,oBAAW,EAAE,CAAC;AAE9C,SAAgB,wBAAwB,CACtC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OA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YACN,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;QACH,WAAW,CAAC,IAAI,GAAG,wBAAwB,CAAC;QAC5C,WAAW,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,MAAM,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,0CAAE,MAAM,mCAAI,MAAM;gBAC9C,SAAS,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,0CAAE,WAAW,mCAAI,CAAC;gBACjD,IAAI,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,0CAAE,IAAI,mCAAI,MAAM;gBAC1C,IAAI,EAAE,CAAC,MAAA,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,0CAAE,IAAI,mCAAI,CAAC,CAAC,GAAG,CAAC;gBAC3C,UAAU,EAAE,QAAQ;aACrB;SACF,CAAC,CAAC;QACH,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC3B,WAAmB,CAAC,KAAK,GAAG,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,mCAAI,KAAK,CAAC;KAC5D;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"spark-line-cell.js","sourcesContent":["import type { ILine, ISymbol, IThemeSpec } from '@visactor/vrender';\nimport { createLine, createSymbol } from '@visactor/vrender';\nimport { PointScale, LinearScale } from '@visactor/vscale';\nimport { isValid } from '../../../tools/util';\nimport { Group } from '../../graphic/group';\nimport type { CellInfo, SparklineSpec } from '../../../ts-types';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\n\nconst xScale: PointScale = new PointScale();\nconst yScale: LinearScale = new LinearScale();\n\nexport function createSparkLineCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n table: BaseTableAPI,\n cellTheme: IThemeSpec\n) {\n // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n }\n\n // chart\n const chartGroup = createSparkLine(col, row, width, height, padding, table);\n if (chartGroup) {\n cellGroup.appendChild(chartGroup);\n }\n\n return cellGroup;\n}\n\nfunction createSparkLine(\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n table: BaseTableAPI\n): Group | undefined {\n //获取场景树对象,根据当前单元格位置更改其位置\n //待定 TODO group需要设置shape属性吗\n let sparklineSpec: SparklineSpec;\n let chartGroup: Group;\n const chartSpecRaw = table.internalProps.layoutMap.getBody(col, row).sparklineSpec;\n const dataValue = table.getCellValue(col, row) as unknown as any[];\n\n if (!Array.isArray(dataValue)) {\n return undefined;\n }\n\n const x = padding[3];\n const y = padding[0];\n width -= padding[1] + padding[3];\n height -= padding[0] + padding[2];\n const left = 0;\n // const top = y;\n // const right = x + width;\n const bottom = height;\n if (typeof chartSpecRaw === 'function') {\n // 动态组织spec\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row) || '',\n value: table.getCellValue(col, row) || '',\n rect: table.getCellRangeRelativeRect(table.getCellRange(col, row)),\n table\n };\n sparklineSpec = chartSpecRaw(arg);\n chartGroup = createChartGroup(sparklineSpec, x, y, width, height);\n } else {\n sparklineSpec = chartSpecRaw;\n chartGroup = createChartGroup(chartSpecRaw, x, y, width, height);\n }\n\n // #region scale对x y轴映射\n const items: { x: number; y: number; defined?: boolean }[] = [];\n const dataItems: any[] = [];\n\n let xField;\n let yField;\n if (typeof sparklineSpec.xField === 'object') {\n xScale.domain(sparklineSpec.xField.domain);\n xField = sparklineSpec.xField.field;\n } else if (typeof sparklineSpec.xField === 'string') {\n const indexValues = dataValue.map((value: any) => value[sparklineSpec.xField as string]);\n xScale.domain(indexValues);\n xField = sparklineSpec.xField;\n } else {\n // xField未配置 data为数值数组的情况\n if (Array.isArray(dataValue)) {\n xScale.domain(Array.from({ length: dataValue.length }, (_, i) => i));\n xField = sparklineSpec.xField;\n }\n }\n xScale.range([0, width]);\n\n if (typeof sparklineSpec.yField === 'object') {\n yScale.domain(sparklineSpec.yField.domain);\n yField = sparklineSpec.yField.field;\n } else if (typeof sparklineSpec.yField === 'string') {\n // string类型 自动计算出domain\n const values = dataValue.map((value: any) => value[sparklineSpec.yField as string]);\n yScale.domain([Math.min(...values), Math.max(...values)]);\n yField = sparklineSpec.yField;\n } else {\n // yField未配置 检查data是否为数值数组\n if (Array.isArray(dataValue) && dataValue.every((value: any) => typeof value === 'number')) {\n yScale.domain([Math.min(...dataValue), Math.max(...dataValue)]);\n yField = sparklineSpec.yField;\n }\n }\n yScale.range([0, height]);\n\n if (typeof sparklineSpec.xField === 'object' && Array.isArray(sparklineSpec.xField.domain)) {\n // 如果xField.domain合法,需要按需补充null值点\n const values = dataValue.map((value: any) => value[(sparklineSpec.xField as any).field]);\n const domain = sparklineSpec.xField.domain;\n for (let i = 0; i < domain.length; i++) {\n let valid = false;\n for (let j = 0; j < values.length; j++) {\n // eslint-disable-next-line eqeqeq\n if (domain[i] == values[j]) {\n const data: any = dataValue[j];\n // 无效数据不进行scale,避免null被解析为0\n if (!isValid(data[xField]) || !isValid(data[yField])) {\n break;\n }\n items.push({\n x: left + xScale.scale(data[xField]),\n y: bottom - yScale.scale(data[yField]),\n defined: isValid(data[yField])\n });\n dataItems.push(data); //收集原始数据\n valid = true;\n break;\n }\n }\n\n if (!valid) {\n // 该domain的index没有在数据中,补充无效点\n items.push({\n x: left + xScale.scale(domain[i]),\n y: 0,\n defined: false\n });\n dataItems.push({ [xField]: domain[i], [yField]: null });\n }\n }\n } else {\n for (let i = 0; i < dataValue.length; i++) {\n const data: any = dataValue[i];\n items.push({\n x: left + xScale.scale(xField ? data[xField] : i),\n y: bottom - yScale.scale(yField ? data[yField] : data),\n defined: isValid(yField ? data[yField] : data),\n rawData: data\n } as any);\n dataItems.push(data);\n }\n }\n // #endregion\n\n // 更新线节点属性\n const line = chartGroup.getChildByName('sparkline-line') as ILine;\n if (line) {\n line.setAttribute('points', items);\n }\n (line as any).bandwidth = xScale.step();\n (line as any).min = yScale.range()[0];\n (line as any).max = yScale.range()[1];\n\n // 更新symbol节点属性\n const symbolGroup = chartGroup.getChildByName('sparkline-symbol-group') as ILine;\n if (symbolGroup) {\n const isShowIsolatedPoint = sparklineSpec.pointShowRule === 'isolatedPoint';\n if (sparklineSpec.pointShowRule === 'all') {\n for (let i = 0; i < items.length; i++) {\n const { x, y, defined } = items[i];\n if (defined) {\n const symbol: ISymbol = createSymbol({ x, y });\n symbolGroup.appendChild(symbol);\n }\n }\n } else if (isShowIsolatedPoint) {\n // 处理孤立点显示\n for (let i = 0; i < items.length; i++) {\n const { x, y, defined } = items[i];\n if (defined && (!items[i - 1] || !items[i - 1].defined) && (!items[i + 1] || !items[i + 1].defined)) {\n // 规范孤立数据显示Symbol的spec api\n const symbol: ISymbol = createSymbol({ x, y });\n symbolGroup.appendChild(symbol);\n }\n }\n }\n }\n return chartGroup;\n}\n\nfunction createChartGroup(\n spec: SparklineSpec | ((arg: CellInfo) => SparklineSpec),\n x: number,\n y: number,\n width: number,\n height: number\n): Group {\n let specObj: SparklineSpec;\n if (typeof spec === 'function') {\n // specObj = spec.apply(null, null);\n specObj = spec(null);\n } else {\n specObj = spec;\n }\n // 生成根节点\n const group = new Group({\n x,\n y,\n width,\n height,\n stroke: false,\n fill: false\n });\n group.name = 'sparkline';\n\n if (specObj.type === 'line') {\n // 生成line\n const line = createLine({\n x: 0,\n y: 0,\n curveType: specObj.smooth ? 'monotoneX' : 'linear',\n stroke: specObj.line?.style?.stroke ?? 'blue',\n lineWidth: specObj.line?.style?.strokeWidth ?? 2\n });\n line.name = 'sparkline-line';\n group.addChild(line);\n if (specObj.crosshair) {\n (line as any).hover = specObj.crosshair?.style ?? {\n stroke: '#000',\n interpolate: 'linear'\n };\n }\n\n // 生成symbol\n const symbolGroup = new Group({\n x: 0,\n y: 0,\n width,\n height,\n stroke: false,\n fill: false\n });\n symbolGroup.name = 'sparkline-symbol-group';\n symbolGroup.setTheme({\n symbol: {\n stroke: specObj.point?.style?.stroke ?? '#000',\n lineWidth: specObj.point?.style?.strokeWidth ?? 1,\n fill: specObj.point?.style?.fill ?? '#000',\n size: (specObj.point?.style?.size ?? 3) * 2, // 之前配置的是圆半径\n symbolType: 'circle'\n }\n });\n group.addChild(symbolGroup);\n (symbolGroup as any).hover = specObj.point?.hover ?? false;\n }\n return group;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/cell-type/spark-line-cell.ts"],"names":[],"mappings":";;;AACA,+CAA6D;AAC7D,6CAA2D;AAC3D,6CAA2C;AAC3C,+CAA4C;AAI5C,MAAM,MAAM,GAAe,IAAI,mBAAU,EAAE,CAAC;AAC5C,MAAM,MAAM,GAAgB,IAAI,oBAAW,EAAE,CAAC;AAE9C,SAAgB,wBAAwB,CACtC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,KAAmB,EACnB,SAAqB;;IAGrB,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,IAAI,aAAK,CAAC;YACpB,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;YACV,KAAK;YACL,MAAM;YAGN,SAAS,EAAE,MAAA,MAAA,SAAS,aAAT,SAAS,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,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,0CAAE,WAAW,mCAAI,CAAC;gBACjD,IAAI,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,0CAAE,IAAI,mCAAI,MAAM;gBAC1C,IAAI,EAAE,CAAC,MAAA,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,0CAAE,IAAI,mCAAI,CAAC,CAAC,GAAG,CAAC;gBAC3C,UAAU,EAAE,QAAQ;aACrB;SACF,CAAC,CAAC;QACH,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC3B,WAAmB,CAAC,KAAK,GAAG,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,KAAK,mCAAI,KAAK,CAAC;KAC5D;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"spark-line-cell.js","sourcesContent":["import type { ILine, ISymbol, IThemeSpec } from '@visactor/vrender';\nimport { createLine, createSymbol } from '@visactor/vrender';\nimport { PointScale, LinearScale } from '@visactor/vscale';\nimport { isValid } from '@visactor/vutils';\nimport { Group } from '../../graphic/group';\nimport type { CellInfo, SparklineSpec } from '../../../ts-types';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\n\nconst xScale: PointScale = new PointScale();\nconst yScale: LinearScale = new LinearScale();\n\nexport function createSparkLineCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n table: BaseTableAPI,\n cellTheme: IThemeSpec\n) {\n // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n }\n\n // chart\n const chartGroup = createSparkLine(col, row, width, height, padding, table);\n if (chartGroup) {\n cellGroup.appendChild(chartGroup);\n }\n\n return cellGroup;\n}\n\nfunction createSparkLine(\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n table: BaseTableAPI\n): Group | undefined {\n //获取场景树对象,根据当前单元格位置更改其位置\n //待定 TODO group需要设置shape属性吗\n let sparklineSpec: SparklineSpec;\n let chartGroup: Group;\n const chartSpecRaw = table.internalProps.layoutMap.getBody(col, row).sparklineSpec;\n const dataValue = table.getCellValue(col, row) as unknown as any[];\n\n if (!Array.isArray(dataValue)) {\n return undefined;\n }\n\n const x = padding[3];\n const y = padding[0];\n width -= padding[1] + padding[3];\n height -= padding[0] + padding[2];\n const left = 0;\n // const top = y;\n // const right = x + width;\n const bottom = height;\n if (typeof chartSpecRaw === 'function') {\n // 动态组织spec\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row) || '',\n value: table.getCellValue(col, row) || '',\n rect: table.getCellRangeRelativeRect(table.getCellRange(col, row)),\n table\n };\n sparklineSpec = chartSpecRaw(arg);\n chartGroup = createChartGroup(sparklineSpec, x, y, width, height);\n } else {\n sparklineSpec = chartSpecRaw;\n chartGroup = createChartGroup(chartSpecRaw, x, y, width, height);\n }\n\n // #region scale对x y轴映射\n const items: { x: number; y: number; defined?: boolean }[] = [];\n const dataItems: any[] = [];\n\n let xField;\n let yField;\n if (typeof sparklineSpec.xField === 'object') {\n xScale.domain(sparklineSpec.xField.domain);\n xField = sparklineSpec.xField.field;\n } else if (typeof sparklineSpec.xField === 'string') {\n const indexValues = dataValue.map((value: any) => value[sparklineSpec.xField as string]);\n xScale.domain(indexValues);\n xField = sparklineSpec.xField;\n } else {\n // xField未配置 data为数值数组的情况\n if (Array.isArray(dataValue)) {\n xScale.domain(Array.from({ length: dataValue.length }, (_, i) => i));\n xField = sparklineSpec.xField;\n }\n }\n xScale.range([0, width]);\n\n if (typeof sparklineSpec.yField === 'object') {\n yScale.domain(sparklineSpec.yField.domain);\n yField = sparklineSpec.yField.field;\n } else if (typeof sparklineSpec.yField === 'string') {\n // string类型 自动计算出domain\n const values = dataValue.map((value: any) => value[sparklineSpec.yField as string]);\n yScale.domain([Math.min(...values), Math.max(...values)]);\n yField = sparklineSpec.yField;\n } else {\n // yField未配置 检查data是否为数值数组\n if (Array.isArray(dataValue) && dataValue.every((value: any) => typeof value === 'number')) {\n yScale.domain([Math.min(...dataValue), Math.max(...dataValue)]);\n yField = sparklineSpec.yField;\n }\n }\n yScale.range([0, height]);\n\n if (typeof sparklineSpec.xField === 'object' && Array.isArray(sparklineSpec.xField.domain)) {\n // 如果xField.domain合法,需要按需补充null值点\n const values = dataValue.map((value: any) => value[(sparklineSpec.xField as any).field]);\n const domain = sparklineSpec.xField.domain;\n for (let i = 0; i < domain.length; i++) {\n let valid = false;\n for (let j = 0; j < values.length; j++) {\n // eslint-disable-next-line eqeqeq\n if (domain[i] == values[j]) {\n const data: any = dataValue[j];\n // 无效数据不进行scale,避免null被解析为0\n if (!isValid(data[xField]) || !isValid(data[yField])) {\n break;\n }\n items.push({\n x: left + xScale.scale(data[xField]),\n y: bottom - yScale.scale(data[yField]),\n defined: isValid(data[yField])\n });\n dataItems.push(data); //收集原始数据\n valid = true;\n break;\n }\n }\n\n if (!valid) {\n // 该domain的index没有在数据中,补充无效点\n items.push({\n x: left + xScale.scale(domain[i]),\n y: 0,\n defined: false\n });\n dataItems.push({ [xField]: domain[i], [yField]: null });\n }\n }\n } else {\n for (let i = 0; i < dataValue.length; i++) {\n const data: any = dataValue[i];\n items.push({\n x: left + xScale.scale(xField ? data[xField] : i),\n y: bottom - yScale.scale(yField ? data[yField] : data),\n defined: isValid(yField ? data[yField] : data),\n rawData: data\n } as any);\n dataItems.push(data);\n }\n }\n // #endregion\n\n // 更新线节点属性\n const line = chartGroup.getChildByName('sparkline-line') as ILine;\n if (line) {\n line.setAttribute('points', items);\n }\n (line as any).bandwidth = xScale.step();\n (line as any).min = yScale.range()[0];\n (line as any).max = yScale.range()[1];\n\n // 更新symbol节点属性\n const symbolGroup = chartGroup.getChildByName('sparkline-symbol-group') as ILine;\n if (symbolGroup) {\n const isShowIsolatedPoint = sparklineSpec.pointShowRule === 'isolatedPoint';\n if (sparklineSpec.pointShowRule === 'all') {\n for (let i = 0; i < items.length; i++) {\n const { x, y, defined } = items[i];\n if (defined) {\n const symbol: ISymbol = createSymbol({ x, y });\n symbolGroup.appendChild(symbol);\n }\n }\n } else if (isShowIsolatedPoint) {\n // 处理孤立点显示\n for (let i = 0; i < items.length; i++) {\n const { x, y, defined } = items[i];\n if (defined && (!items[i - 1] || !items[i - 1].defined) && (!items[i + 1] || !items[i + 1].defined)) {\n // 规范孤立数据显示Symbol的spec api\n const symbol: ISymbol = createSymbol({ x, y });\n symbolGroup.appendChild(symbol);\n }\n }\n }\n }\n return chartGroup;\n}\n\nfunction createChartGroup(\n spec: SparklineSpec | ((arg: CellInfo) => SparklineSpec),\n x: number,\n y: number,\n width: number,\n height: number\n): Group {\n let specObj: SparklineSpec;\n if (typeof spec === 'function') {\n // specObj = spec.apply(null, null);\n specObj = spec(null);\n } else {\n specObj = spec;\n }\n // 生成根节点\n const group = new Group({\n x,\n y,\n width,\n height,\n stroke: false,\n fill: false\n });\n group.name = 'sparkline';\n\n if (specObj.type === 'line') {\n // 生成line\n const line = createLine({\n x: 0,\n y: 0,\n curveType: specObj.smooth ? 'monotoneX' : 'linear',\n stroke: specObj.line?.style?.stroke ?? 'blue',\n lineWidth: specObj.line?.style?.strokeWidth ?? 2\n });\n line.name = 'sparkline-line';\n group.addChild(line);\n if (specObj.crosshair) {\n (line as any).hover = specObj.crosshair?.style ?? {\n stroke: '#000',\n interpolate: 'linear'\n };\n }\n\n // 生成symbol\n const symbolGroup = new Group({\n x: 0,\n y: 0,\n width,\n height,\n stroke: false,\n fill: false\n });\n symbolGroup.name = 'sparkline-symbol-group';\n symbolGroup.setTheme({\n symbol: {\n stroke: specObj.point?.style?.stroke ?? '#000',\n lineWidth: specObj.point?.style?.strokeWidth ?? 1,\n fill: specObj.point?.style?.fill ?? '#000',\n size: (specObj.point?.style?.size ?? 3) * 2, // 之前配置的是圆半径\n symbolType: 'circle'\n }\n });\n group.addChild(symbolGroup);\n (symbolGroup as any).hover = specObj.point?.hover ?? false;\n }\n return group;\n}\n"]}
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.createCellGroup = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("@visactor/vrender"),
|
|
7
|
+
const vrender_1 = require("@visactor/vrender"), vutils_1 = require("@visactor/vutils"), group_1 = require("../../graphic/group"), get_prop_1 = require("../../utils/get-prop"), text_icon_layout_1 = require("../../utils/text-icon-layout");
|
|
8
8
|
|
|
9
9
|
function createCellGroup(table, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme) {
|
|
10
10
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
11
11
|
const headerStyle = table._getCellStyle(col, row), functionalPadding = (0, get_prop_1.getFunctionalProp)("padding", headerStyle, col, row, table);
|
|
12
|
-
(0,
|
|
12
|
+
(0, vutils_1.isValid)(functionalPadding) && (padding = functionalPadding), (null === (_a = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _a ? void 0 : _a.textAlign) && (textAlign = null === (_b = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _b ? void 0 : _b.textAlign),
|
|
13
13
|
(null === (_c = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _c ? void 0 : _c.textBaseline) && (textBaseline = null === (_d = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _d ? void 0 : _d.textBaseline);
|
|
14
14
|
const autoRowHeight = "autoHeight" === table.heightMode, autoColWidth = "auto" === colWidth, autoWrapText = null !== (_e = headerStyle.autoWrapText) && void 0 !== _e ? _e : table.internalProps.autoWrapText, lineClamp = headerStyle.lineClamp, cellGroup = new group_1.Group({
|
|
15
15
|
x: xOrigin,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/cell-type/text-cell.ts"],"names":[],"mappings":";;;AAEA,+CAA8C;AAC9C,
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/cell-type/text-cell.ts"],"names":[],"mappings":";;;AAEA,+CAA8C;AAC9C,6CAA2C;AAC3C,+CAA4C;AAE5C,mDAAyD;AACzD,mEAAiE;AAoBjE,SAAgB,eAAe,CAC7B,KAAmB,EACnB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EAEX,QAAyB,EACzB,SAAiB,EACjB,UAAkB,EAClB,OAAiB,EACjB,SAA0B,EAC1B,YAAgC,EAChC,WAAoB,EACpB,mBAA0B,EAC1B,aAAsB,EACtB,SAAqB;;IAErB,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,IAAA,4BAAiB,EAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrF,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC,EAAE;QAC9B,OAAO,GAAG,iBAAiB,CAAC;KAC7B;IACD,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,SAAS,EAAE;QAC9B,SAAS,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE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AC,WAAW,CAAC,IAAI,CAAC,CAAC;SAC7B;KACF;IACD,IAAI,mBAAmB,EAAE;QACvB,SAAS,CAAC,aAAa,CAAC;YACtB,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,MAAA,mBAAmB,CAAC,SAAS,CAAC,KAAK,mCAAI,CAAC,CAAC;YACpF,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAA,mBAAmB,CAAC,SAAS,CAAC,MAAM,mCAAI,CAAC,CAAC;SACxF,CAAC,CAAC;KACJ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AA5GD,0CA4GC","file":"text-cell.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IThemeSpec } from '@visactor/vrender';\nimport { createArc } from '@visactor/vrender';\nimport { isValid } from '@visactor/vutils';\nimport { Group } from '../../graphic/group';\n// import { parseFont } from '../../utils/font';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { createCellContent } from '../../utils/text-icon-layout';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { getStyleTheme } from '../../../core/tableHelper';\n\n/**\n * @description: 创建单元格场景节点\n * @param {Group} columnGroup 列Group\n * @param {number} xOrigin 起始x坐标\n * @param {number} yOrigin 起始y坐标\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @param {number | 'auto'} colWidth 配置列宽\n * @param {number} padding 单元格padding\n * @param {CanvasTextAlign} textAlign\n * @param {CanvasTextBaseline} textBaseline\n * @param {boolean} noWrap 不进行折行(default column type)\n * @param {IThemeSpec} cellTheme 单元格主题\n * @return {Group}\n */\nexport function createCellGroup(\n table: BaseTableAPI,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n // rowHeight: number,\n colWidth: number | 'auto',\n cellWidth: number,\n cellHeight: number,\n padding: number[],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n customElementsGroup: Group,\n renderDefault: boolean,\n cellTheme: IThemeSpec\n): Group {\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n if (cellTheme?.text?.textAlign) {\n textAlign = cellTheme?.text?.textAlign;\n }\n if (cellTheme?.text?.textBaseline) {\n textBaseline = cellTheme?.text?.textBaseline;\n }\n const autoRowHeight = table.heightMode === 'autoHeight';\n const autoColWidth = colWidth === 'auto';\n const autoWrapText = headerStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const lineClamp = headerStyle.lineClamp;\n\n // cell\n const cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width: cellWidth,\n height: cellHeight,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n if (customElementsGroup) {\n cellGroup.appendChild(customElementsGroup);\n }\n if (renderDefault) {\n const textStr: string = table.getCellValue(col, row);\n let icons;\n if (mayHaveIcon) {\n icons = table.getCellIcons(col, row);\n }\n\n createCellContent(\n cellGroup,\n icons,\n textStr,\n padding as any,\n autoColWidth,\n autoRowHeight,\n autoWrapText,\n typeof lineClamp === 'number' ? lineClamp : undefined,\n // autoColWidth ? 0 : colWidth,\n // table.getRowHeight(row),\n cellWidth,\n cellHeight,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n\n if ((cellTheme as any)?._vtable?.marked) {\n const mark = createArc({\n x: cellGroup.attribute.width,\n y: 0,\n startAngle: Math.PI / 2,\n endAngle: Math.PI,\n outerRadius: 6,\n fill: '#3073F2',\n pickable: false\n });\n mark.name = 'mark';\n\n cellGroup.appendChild(mark);\n }\n }\n if (customElementsGroup) {\n cellGroup.setAttributes({\n width: Math.max(cellGroup.attribute.width, customElementsGroup.attribute.width ?? 0),\n height: Math.max(cellGroup.attribute.height, customElementsGroup.attribute.height ?? 0)\n });\n }\n return cellGroup;\n}\n\n// /**\n// * @description: 获取函数式赋值的样式,记录在cellTheme中\n// * @param {BaseTableAPI} table\n// * @param {number} col\n// * @param {number} row\n// * @param {IThemeSpec} cellTheme\n// * @return {IThemeSpec | undefined}\n// */\n// export function getCellTheme(\n// table: BaseTableAPI,\n// col: number,\n// row: number,\n// cellTheme?: IThemeSpec\n// ): IThemeSpec | undefined {\n// // get column header style\n// const headerStyle = table._getCellStyle(col, row);\n\n// const theme = getStyleTheme(headerStyle, table, col, row, getFunctionalProp).theme;\n\n// for (const prop in theme.group) {\n// if (isValid(theme.group[prop])) {\n// if (!cellTheme) {\n// cellTheme = {};\n// }\n\n// if (!cellTheme.group) {\n// cellTheme.group = {};\n// }\n\n// cellTheme.group[prop] = theme.group[prop];\n// }\n// }\n\n// for (const prop in theme.text) {\n// if (isValid(theme.text[prop])) {\n// if (!cellTheme) {\n// cellTheme = {};\n// }\n\n// if (!cellTheme.text) {\n// cellTheme.text = {};\n// }\n\n// cellTheme.text[prop] = theme.text[prop];\n// }\n// }\n\n// for (const prop in theme._vtable) {\n// if (isValid(theme._vtable[prop])) {\n// if (!cellTheme) {\n// cellTheme = {};\n// }\n\n// if (!(cellTheme as any)._vtable) {\n// (cellTheme as any)._vtable = {};\n// }\n\n// (cellTheme as any)._vtable[prop] = theme._vtable[prop];\n// }\n// }\n// return cellTheme;\n// }\n"]}
|
|
@@ -29,12 +29,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
29
29
|
value: !0
|
|
30
30
|
}), exports.createVideoCellGroup = void 0;
|
|
31
31
|
|
|
32
|
-
const vrender_1 = require("@visactor/vrender"), icons = __importStar(require("../../../icons")), group_1 = require("../../graphic/group"), keep_aspect_ratio_1 = require("../../utils/keep-aspect-ratio"), icon_1 = require("../../graphic/icon"), cell_pos_1 = require("../../utils/cell-pos"), image_cell_1 = require("./image-cell"), get_prop_1 = require("../../utils/get-prop"),
|
|
32
|
+
const vrender_1 = require("@visactor/vrender"), icons = __importStar(require("../../../icons")), group_1 = require("../../graphic/group"), keep_aspect_ratio_1 = require("../../utils/keep-aspect-ratio"), icon_1 = require("../../graphic/icon"), cell_pos_1 = require("../../utils/cell-pos"), image_cell_1 = require("./image-cell"), get_prop_1 = require("../../utils/get-prop"), vutils_1 = require("@visactor/vutils"), regedIcons = icons.get();
|
|
33
33
|
|
|
34
34
|
function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme) {
|
|
35
35
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
36
36
|
const headerStyle = table._getCellStyle(col, row), functionalPadding = (0, get_prop_1.getFunctionalProp)("padding", headerStyle, col, row, table);
|
|
37
|
-
(0,
|
|
37
|
+
(0, vutils_1.isValid)(functionalPadding) && (padding = functionalPadding), (null === (_a = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _a ? void 0 : _a.textAlign) && (textAlign = null === (_b = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _b ? void 0 : _b.textAlign),
|
|
38
38
|
(null === (_c = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _c ? void 0 : _c.textBaseline) && (textBaseline = null === (_d = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _d ? void 0 : _d.textBaseline);
|
|
39
39
|
const cellGroup = new group_1.Group({
|
|
40
40
|
x: xOrigin,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/cell-type/video-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAA4D;AAC5D,sDAAwC;AACxC,+CAA4C;AAC5C,qEAAwE;AACxE,6CAA0C;AAC1C,mDAAyD;AACzD,6CAAkD;AAClD,mDAAkE;AAClE,
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/cell-type/video-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAA4D;AAC5D,sDAAwC;AACxC,+CAA4C;AAC5C,qEAAwE;AACxE,6CAA0C;AAC1C,mDAAyD;AACzD,6CAAkD;AAClD,mDAAkE;AAClE,6CAA2C;AAG3C,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;AAE/B,SAAgB,oBAAoB,CAClC,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,eAAwB,EACxB,eAAwB,EACxB,OAAyC,EACzC,SAA0B,EAC1B,YAAgC,EAChC,KAAmB,EACnB,SAAqB;;IAErB,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,IAAA,4BAAiB,EAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAErF,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC,EAAE;QAC9B,OAAO,GAAG,iBAAiB,CAAC;KAC7B;IACD,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,SAAS,EAAE;QAC9B,SAAS,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,SAAS,CAAC;KACxC;IACD,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,YAAY,EAAE;QACjC,YAAY,GAAG,MAA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AW,CAAC,QAAQ,CAAC,CAAC;QAEhC,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,OAAO,GAAG,GAAS,EAAE;QAExB,KAAa,CAAC,KAAK,GAAI,UAAU,CAAC,UAAkB,CAAC,GAAG,CAAC;IAC5D,CAAC,CAAC;IACF,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC;IAClB,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAEtC,MAAM,KAAK,GAAW,IAAA,qBAAW,EAAC;QAChC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACb,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACb,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QACtC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QACxC,KAAK,EAAE,KAAY;QACnB,MAAM,EAAE,SAAmB;KAC5B,CAAC,CAAC;IACH,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;IACrB,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAE7B,OAAO,SAAS,CAAC;AACnB,CAAC;AAjID,oDAiIC","file":"video-cell.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { Cursor, IImage, IThemeSpec } from '@visactor/vrender';\nimport { createRect, createImage } from '@visactor/vrender';\nimport * as icons from '../../../icons';\nimport { Group } from '../../graphic/group';\nimport { calcKeepAspectRatioSize } from '../../utils/keep-aspect-ratio';\nimport { Icon } from '../../graphic/icon';\nimport { calcStartPosition } from '../../utils/cell-pos';\nimport { _adjustWidthHeight } from './image-cell';\nimport { getFunctionalProp, getProp } from '../../utils/get-prop';\nimport { isValid } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\n\nconst regedIcons = icons.get();\n\nexport function createVideoCellGroup(\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n keepAspectRatio: boolean,\n imageAutoSizing: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec\n) {\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n // const margin = getProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n if (cellTheme?.text?.textAlign) {\n textAlign = cellTheme?.text?.textAlign;\n }\n if (cellTheme?.text?.textBaseline) {\n textBaseline = cellTheme?.text?.textBaseline;\n }\n\n // cell\n const cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // childrenPickable: false,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n\n // video\n const value = table.getCellValue(col, row);\n const video = document.createElement('video');\n video.addEventListener('loadeddata', (): void => {\n if (imageAutoSizing) {\n _adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding);\n }\n const width = cellGroup.attribute.width;\n const height = cellGroup.attribute.height;\n // 更新宽高\n if (keepAspectRatio) {\n const { width: videoWidth, height: videoHeight } = calcKeepAspectRatioSize(\n video.videoWidth,\n video.videoHeight,\n width - padding[1] - padding[3],\n height - padding[0] - padding[2]\n );\n const pos = calcStartPosition(0, 0, width, height, videoWidth, videoHeight, textAlign, textBaseline, padding);\n\n image.setAttributes({\n width: videoWidth,\n height: videoHeight,\n x: pos.x,\n y: pos.y\n });\n } else {\n image.setAttributes({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[2] - padding[0]\n });\n }\n\n const left = 0;\n const top = 0;\n // 播放按钮\n const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);\n const anchorX =\n left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);\n const anchorY =\n top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);\n\n const playIcon: Icon = new Icon({\n x: anchorX - iconSize / 2,\n y: anchorY - iconSize / 2,\n width: iconSize,\n height: iconSize,\n image: (regedIcons.play as any).svg,\n cursor: (regedIcons.play as any).cursor\n });\n playIcon.name = 'play-icon';\n cellGroup.appendChild(playIcon);\n // 触发重绘\n table.scenegraph.updateNextFrame();\n });\n video.onerror = (): void => {\n // image.setAttribute('image', (regedIcons.damage_pic as any).svg);\n (image as any).image = (regedIcons.damage_pic as any).svg;\n };\n video.src = value;\n video.setAttribute('preload', 'auto');\n\n const image: IImage = createImage({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[2] - padding[0],\n image: video as any,\n cursor: 'pointer' as Cursor\n });\n image.name = 'image';\n cellGroup.appendChild(image);\n\n return cellGroup;\n}\n"]}
|
|
@@ -35,30 +35,29 @@ const compute_col_width_1 = require("../../layout/compute-col-width"), compute_r
|
|
|
35
35
|
function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
|
|
36
36
|
var _a, _b, _c, _d;
|
|
37
37
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
38
|
-
const {leftBottomCornerGroup: leftBottomCornerGroup, rightTopCornerGroup: rightTopCornerGroup, rightBottomCornerGroup: rightBottomCornerGroup} =
|
|
39
|
-
proxy.setParamsForRow(), proxy.setParamsForColumn(), (0, compute_col_width_1.computeColsWidth)(
|
|
40
|
-
(0, compute_row_height_1.computeRowsHeight)(
|
|
41
|
-
|
|
42
|
-
compute_col_width_1.computeColsWidth)(
|
|
43
|
-
|
|
44
|
-
compute_col_width_1.computeColsWidth)(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
(0, column_1.createColGroup)(
|
|
54
|
-
(0, column_1.createColGroup)(
|
|
55
|
-
|
|
56
|
-
(0, column_1.createColGroup)(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
column_1.createColGroup)(
|
|
61
|
-
(0, column_1.createColGroup)(bodyGroup, xOrigin, yOrigin, proxy.table.rowHeaderLevelCount, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), proxy.table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), "body", proxy.table),
|
|
38
|
+
const {table: table} = proxy, {leftBottomCornerGroup: leftBottomCornerGroup, rightTopCornerGroup: rightTopCornerGroup, rightBottomCornerGroup: rightBottomCornerGroup} = table.scenegraph;
|
|
39
|
+
proxy.setParamsForRow(), proxy.setParamsForColumn(), (0, compute_col_width_1.computeColsWidth)(table, 0, Math.min(proxy.firstScreenColLimit, table.colCount - 1)),
|
|
40
|
+
(0, compute_row_height_1.computeRowsHeight)(table, 0, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1)),
|
|
41
|
+
table.rightFrozenColCount > 0 && table.colCount - 1 > proxy.firstScreenColLimit && (0,
|
|
42
|
+
compute_col_width_1.computeColsWidth)(table, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1),
|
|
43
|
+
table.bottomFrozenRowCount > 0 && table.rowCount - 1 > proxy.firstScreenRowLimit && (0,
|
|
44
|
+
compute_col_width_1.computeColsWidth)(table, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1),
|
|
45
|
+
table.scenegraph.colHeaderGroup.setAttribute("x", table.getFrozenColsWidth()), table.scenegraph.rowHeaderGroup.setAttribute("y", table.getFrozenRowsHeight()),
|
|
46
|
+
table.scenegraph.bottomFrozenGroup.setAttribute("x", table.getFrozenColsWidth()),
|
|
47
|
+
table.scenegraph.rightFrozenGroup.setAttribute("y", table.getFrozenRowsHeight()),
|
|
48
|
+
table.scenegraph.bodyGroup.setAttributes({
|
|
49
|
+
x: table.getFrozenColsWidth(),
|
|
50
|
+
y: table.getFrozenRowsHeight()
|
|
51
|
+
}), (0, column_1.createColGroup)(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.columnHeaderLevelCount - 1, table.isListTable() ? "columnHeader" : "cornerHeader", table),
|
|
52
|
+
(0, column_1.createColGroup)(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), 0, table.columnHeaderLevelCount - 1, "columnHeader", table),
|
|
53
|
+
(0, column_1.createColGroup)(rowHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), table.isListTable() && !table.internalProps.transpose ? "body" : "rowHeader", table),
|
|
54
|
+
table.bottomFrozenRowCount > 0 && (table.isPivotChart() || (0, column_1.createColGroup)(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isListTable() ? "body" : "rowHeader", table),
|
|
55
|
+
(0, column_1.createColGroup)(bottomFrozenGroup, xOrigin, yOrigin, table.frozenColCount, Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isPivotChart() ? "rowHeader" : "body", table)),
|
|
56
|
+
table.rightFrozenColCount > 0 && (table.isPivotChart() || (0, column_1.createColGroup)(rightTopCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, 0, table.columnHeaderLevelCount - 1, "columnHeader", table),
|
|
57
|
+
(0, column_1.createColGroup)(rightFrozenGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), table.isPivotChart() ? "rowHeader" : "body", table)),
|
|
58
|
+
table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && !table.isPivotChart() && (0,
|
|
59
|
+
column_1.createColGroup)(rightBottomCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "body", table),
|
|
60
|
+
(0, column_1.createColGroup)(bodyGroup, xOrigin, yOrigin, table.frozenColCount, Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), "body", table),
|
|
62
61
|
bodyGroup.firstChild ? (proxy.currentRow = null !== (_b = null === (_a = bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.rowNumber) && void 0 !== _b ? _b : proxy.totalRow,
|
|
63
62
|
proxy.rowEnd = proxy.currentRow, proxy.rowUpdatePos = proxy.rowEnd, proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2),
|
|
64
63
|
proxy.currentCol = null !== (_d = null === (_c = bodyGroup.lastChild) || void 0 === _c ? void 0 : _c.col) && void 0 !== _d ? _d : proxy.totalCol,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{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KAAK,CAAC,QAAQ,EAAE,CAAC;SACxB;;CACF;AAzMD,8DAyMC","file":"create-group-for-first-screen.js","sourcesContent":["import type { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { createColGroup } from '../column';\nimport type { SceneProxy } from './proxy';\n\nexport async function createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n proxy: SceneProxy\n) {\n const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = proxy.table.scenegraph;\n\n // compute parameters\n proxy.setParamsForRow();\n proxy.setParamsForColumn();\n\n // compute colums width in first screen\n computeColsWidth(proxy.table, 0, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1));\n\n // compute rows height in first screen\n computeRowsHeight(proxy.table, 0, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1));\n\n if (proxy.table.rightFrozenColCount > 0 && proxy.table.colCount - 1 > proxy.firstScreenColLimit) {\n // compute right frozen row height\n computeColsWidth(\n proxy.table,\n proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1,\n proxy.table.colCount - 1\n );\n }\n if (proxy.table.bottomFrozenRowCount > 0 && proxy.table.rowCount - 1 > proxy.firstScreenRowLimit) {\n // compute bottom frozen row height\n computeColsWidth(\n proxy.table,\n proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1,\n proxy.table.rowCount - 1\n );\n }\n\n // update colHeaderGroup rowHeaderGroup bodyGroup position\n proxy.table.scenegraph.colHeaderGroup.setAttribute('x', proxy.table.getFrozenColsWidth());\n proxy.table.scenegraph.rowHeaderGroup.setAttribute('y', proxy.table.getFrozenRowsHeight());\n proxy.table.scenegraph.bottomFrozenGroup.setAttribute('x', proxy.table.getFrozenColsWidth());\n proxy.table.scenegraph.rightFrozenGroup.setAttribute('y', proxy.table.getFrozenRowsHeight());\n proxy.table.scenegraph.bodyGroup.setAttributes({\n x: proxy.table.getFrozenColsWidth(),\n y: proxy.table.getFrozenRowsHeight()\n });\n\n // create cornerHeaderGroup\n createColGroup(\n cornerHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n proxy.table.rowHeaderLevelCount - 1, // colEnd\n 0, // rowStart\n proxy.table.columnHeaderLevelCount - 1, // rowEnd\n 'cornerHeader', // CellType\n proxy.table\n );\n\n // create colHeaderGroup\n createColGroup(\n colHeaderGroup,\n xOrigin,\n yOrigin,\n proxy.table.rowHeaderLevelCount, // colStart\n Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), // colEnd\n 0, // rowStart\n proxy.table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n proxy.table\n );\n\n // create rowHeaderGroup\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n proxy.table.rowHeaderLevelCount - 1, // colEnd\n proxy.table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), // rowEnd\n 'rowHeader', // isHeader\n proxy.table\n );\n\n if (proxy.table.bottomFrozenRowCount > 0) {\n if (!proxy.table.isPivotChart()) {\n // create left bottom frozen\n createColGroup(\n leftBottomCornerGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n proxy.table.rowHeaderLevelCount - 1, // colEnd\n proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, // rowStart\n proxy.table.rowCount - 1, // rowEnd\n 'rowHeader', // isHeader\n proxy.table\n );\n }\n // create bottomFrozenGroup\n createColGroup(\n bottomFrozenGroup,\n xOrigin,\n yOrigin,\n proxy.table.rowHeaderLevelCount, // colStart\n Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), // colEnd\n proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, // rowStart\n proxy.table.rowCount - 1, // rowEnd\n 'body', // isHeader\n proxy.table\n );\n }\n\n if (proxy.table.rightFrozenColCount > 0) {\n if (!proxy.table.isPivotChart()) {\n // create right top frozen Group\n createColGroup(\n rightTopCornerGroup,\n xOrigin,\n yOrigin,\n proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, // colStart\n proxy.table.colCount - 1, // colEnd\n 0, // rowStart\n proxy.table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n proxy.table\n );\n }\n // create rightFrozenGroup\n createColGroup(\n rightFrozenGroup,\n xOrigin,\n yOrigin,\n proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, // colStart\n proxy.table.colCount - 1, // colEnd\n proxy.table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), // rowEnd\n 'body', // isHeader\n proxy.table\n );\n }\n\n if (proxy.table.bottomFrozenRowCount > 0 && proxy.table.rightFrozenColCount > 0 && !proxy.table.isPivotChart()) {\n // create right bottom frozen Group\n createColGroup(\n rightBottomCornerGroup,\n xOrigin,\n yOrigin,\n proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, // colStart\n proxy.table.colCount - 1, // colEnd\n proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, // rowStart\n proxy.table.rowCount - 1, // rowEnd\n 'body', // isHeader\n proxy.table\n );\n }\n\n // create bodyGroup\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n proxy.table.rowHeaderLevelCount, // colStart\n Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), // colEnd\n proxy.table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), // rowEnd\n 'body', // isHeader\n proxy.table\n );\n\n // update progress information\n if (!bodyGroup.firstChild) {\n // 无数据\n proxy.currentRow = proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol = proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n } else {\n proxy.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol = (bodyGroup.lastChild as Group)?.col ?? proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n\n // 开始异步任务\n await proxy.progress();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/create-group-for-first-screen.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sEAAkE;AAClE,wEAAoE;AACpE,sCAA2C;AAG3C,SAAsB,yBAAyB,CAC7C,iBAAwB,EACxB,cAAqB,EACrB,cAAqB,EACrB,gBAAuB,EACvB,iBAAwB,EACxB,SAAgB,EAChB,OAAe,EACf,OAAe,EACf,KAAiB;;;QAEjB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;QACxB,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC;QAGhG,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAG3B,IAAA,oCAAgB,EAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAA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,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAGtF,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;SACxB;;CACF;AAlMD,8DAkMC","file":"create-group-for-first-screen.js","sourcesContent":["import type { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { createColGroup } from '../column';\nimport type { SceneProxy } from './proxy';\n\nexport async function createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n proxy: SceneProxy\n) {\n const { table } = proxy;\n const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = table.scenegraph;\n\n // compute parameters\n proxy.setParamsForRow();\n proxy.setParamsForColumn();\n\n // compute colums width in first screen\n computeColsWidth(table, 0, Math.min(proxy.firstScreenColLimit, table.colCount - 1));\n\n // compute rows height in first screen\n computeRowsHeight(table, 0, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1));\n\n if (table.rightFrozenColCount > 0 && table.colCount - 1 > proxy.firstScreenColLimit) {\n // compute right frozen row height\n computeColsWidth(table, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1);\n }\n if (table.bottomFrozenRowCount > 0 && table.rowCount - 1 > proxy.firstScreenRowLimit) {\n // compute bottom frozen row height\n computeColsWidth(table, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1);\n }\n\n // update colHeaderGroup rowHeaderGroup bodyGroup position\n table.scenegraph.colHeaderGroup.setAttribute('x', table.getFrozenColsWidth());\n table.scenegraph.rowHeaderGroup.setAttribute('y', table.getFrozenRowsHeight());\n table.scenegraph.bottomFrozenGroup.setAttribute('x', table.getFrozenColsWidth());\n table.scenegraph.rightFrozenGroup.setAttribute('y', table.getFrozenRowsHeight());\n table.scenegraph.bodyGroup.setAttributes({\n x: table.getFrozenColsWidth(),\n y: table.getFrozenRowsHeight()\n });\n\n // create cornerHeaderGroup\n createColGroup(\n cornerHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n table.isListTable() ? 'columnHeader' : 'cornerHeader', // CellType\n table\n );\n\n // create colHeaderGroup\n createColGroup(\n colHeaderGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n\n // create rowHeaderGroup\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n table.isListTable() && !table.internalProps.transpose ? 'body' : 'rowHeader', // isHeader\n table\n );\n\n if (table.bottomFrozenRowCount > 0) {\n if (!table.isPivotChart()) {\n // create left bottom frozen\n createColGroup(\n leftBottomCornerGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n table.isListTable() ? 'body' : 'rowHeader', // isHeader\n table\n );\n }\n // create bottomFrozenGroup\n createColGroup(\n bottomFrozenGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n table.isPivotChart() ? 'rowHeader' : 'body', // isHeader\n table\n );\n }\n\n if (table.rightFrozenColCount > 0) {\n if (!table.isPivotChart()) {\n // create right top frozen Group\n createColGroup(\n rightTopCornerGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n }\n // create rightFrozenGroup\n createColGroup(\n rightFrozenGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n table.isPivotChart() ? 'rowHeader' : 'body', // isHeader\n table\n );\n }\n\n if (table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && !table.isPivotChart()) {\n // create right bottom frozen Group\n createColGroup(\n rightBottomCornerGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table\n );\n }\n\n // create bodyGroup\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n 'body', // isHeader\n table\n );\n\n // update progress information\n if (!bodyGroup.firstChild) {\n // 无数据\n proxy.currentRow = proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol = proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n } else {\n proxy.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol = (bodyGroup.lastChild as Group)?.col ?? proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n\n // 开始异步任务\n await proxy.progress();\n }\n}\n"]}
|
|
@@ -23,7 +23,6 @@ export declare class SceneProxy {
|
|
|
23
23
|
screenTopRow: number;
|
|
24
24
|
deltaY: number;
|
|
25
25
|
colLimit: number;
|
|
26
|
-
bodyLeftCol: number;
|
|
27
26
|
bodyRightCol: number;
|
|
28
27
|
totalCol: number;
|
|
29
28
|
colStart: number;
|
|
@@ -41,6 +40,7 @@ export declare class SceneProxy {
|
|
|
41
40
|
deltaX: number;
|
|
42
41
|
cellCache: Map<number, Group>;
|
|
43
42
|
constructor(table: BaseTableAPI);
|
|
43
|
+
get bodyLeftCol(): number;
|
|
44
44
|
setParamsForColumn(): void;
|
|
45
45
|
setParamsForRow(): void;
|
|
46
46
|
createGroupForFirstScreen(cornerHeaderGroup: Group, colHeaderGroup: Group, rowHeaderGroup: Group, rightFrozenGroup: Group, bottomFrozenGroup: Group, bodyGroup: Group, xOrigin: number, yOrigin: number): Promise<void>;
|
|
@@ -34,15 +34,18 @@ const vutils_1 = require("@visactor/vutils"), group_1 = require("../../graphic/g
|
|
|
34
34
|
|
|
35
35
|
class SceneProxy {
|
|
36
36
|
constructor(table) {
|
|
37
|
-
this.isRelease = !1, this.mode = "column", this.rowLimit =
|
|
37
|
+
this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0,
|
|
38
38
|
this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0,
|
|
39
39
|
this.deltaY = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.cellCache = new Map,
|
|
40
40
|
this.table = table, this.table.isPivotChart() ? (this.rowLimit = 100, this.colLimit = 100) : "autoHeight" === this.table.heightMode ? this.rowLimit = 100 : "autoWidth" === this.table.widthMode && (this.colLimit = 100),
|
|
41
41
|
this.table.internalProps.transpose ? this.mode = "row" : this.table.isPivotTable() && (this.mode = "pivot"),
|
|
42
42
|
this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount);
|
|
43
43
|
}
|
|
44
|
+
get bodyLeftCol() {
|
|
45
|
+
return this.table.frozenColCount;
|
|
46
|
+
}
|
|
44
47
|
setParamsForColumn() {
|
|
45
|
-
this.
|
|
48
|
+
this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;
|
|
46
49
|
const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);
|
|
47
50
|
this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1, this.colStart = this.bodyLeftCol;
|
|
48
51
|
const defaultColWidth = this.table.defaultColWidth;
|
|
@@ -212,7 +215,7 @@ class SceneProxy {
|
|
|
212
215
|
}
|
|
213
216
|
highPerformanceGetCell(col, row, getShadow) {
|
|
214
217
|
if (row >= this.table.columnHeaderLevelCount && row < this.table.rowCount - this.table.bottomFrozenRowCount && (row < this.rowStart || row > this.rowEnd)) return empty_group_1.emptyGroup;
|
|
215
|
-
if (col >= this.table.
|
|
218
|
+
if (col >= this.table.frozenColCount && col < this.table.colCount - this.table.rightFrozenColCount && (col < this.colStart || col > this.colEnd)) return empty_group_1.emptyGroup;
|
|
216
219
|
if (this.cellCache.get(col)) {
|
|
217
220
|
const cacheCellGoup = this.cellCache.get(col);
|
|
218
221
|
if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {
|