@visactor/vtable 0.11.1-alpha.2 → 0.11.1-alpha.3
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/components/axis/linear-scale.js +1 -1
- package/cjs/components/axis/linear-scale.js.map +1 -1
- package/cjs/components/util/tick-data/continuous.js +1 -1
- package/cjs/components/util/tick-data/continuous.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +5 -2
- package/cjs/core/BaseTable.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/chart-helper/get-axis-domain.js +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +4 -4
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +3 -2
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/padding.d.ts +6 -1
- package/cjs/scenegraph/utils/padding.js +9 -4
- package/cjs/scenegraph/utils/padding.js.map +1 -1
- package/cjs/tools/NumberMap.d.ts +1 -0
- package/cjs/tools/NumberMap.js +5 -0
- package/cjs/tools/NumberMap.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/dist/vtable.js +42 -21
- package/dist/vtable.min.js +3 -3
- package/es/components/axis/linear-scale.js +1 -1
- package/es/components/axis/linear-scale.js.map +1 -1
- package/es/components/util/tick-data/continuous.js +1 -1
- package/es/components/util/tick-data/continuous.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +5 -2
- package/es/core/BaseTable.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/chart-helper/get-axis-domain.js +1 -1
- package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +4 -4
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +1 -1
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/scenegraph.js +3 -2
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/padding.d.ts +6 -1
- package/es/scenegraph/utils/padding.js +9 -3
- package/es/scenegraph/utils/padding.js.map +1 -1
- package/es/tools/NumberMap.d.ts +1 -0
- package/es/tools/NumberMap.js +5 -0
- package/es/tools/NumberMap.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { PivotChart } from './PivotChart';
|
|
|
12
12
|
import type { MousePointerCellEvent } from './ts-types/events';
|
|
13
13
|
import * as CustomLayout from './render/layout';
|
|
14
14
|
export * from './render/jsx';
|
|
15
|
-
export declare const version = "0.11.1-alpha.
|
|
15
|
+
export declare const version = "0.11.1-alpha.3";
|
|
16
16
|
export { TYPES, core, ListTable, ListTableConstructorOptions, PivotTable, PivotTableConstructorOptions, PivotChartConstructorOptions, PivotChart, IHeaderTreeDefine, IDimension, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
|
|
17
17
|
declare function getIcons(): {
|
|
18
18
|
[key: string]: TYPES.ColumnIconOption;
|
package/es/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import * as CustomLayout from "./render/layout";
|
|
|
24
24
|
|
|
25
25
|
export * from "./render/jsx";
|
|
26
26
|
|
|
27
|
-
export const version = "0.11.1-alpha.
|
|
27
|
+
export const version = "0.11.1-alpha.3";
|
|
28
28
|
|
|
29
29
|
export { TYPES, core, ListTable, PivotTable, PivotChart, themes, data, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
|
|
30
30
|
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,oCAAoC,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAiB3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAEhD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAIxC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAYV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACb,CAAC;AAGF,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AACD,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport 'core-js/proposals/reflect-metadata'; // wait for vrender fix\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nexport * from './render/jsx';\n\nexport const version = \"0.11.1-alpha.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,oCAAoC,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAiB3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAEhD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAIxC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAYV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACb,CAAC;AAGF,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AACD,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport 'core-js/proposals/reflect-metadata'; // wait for vrender fix\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nexport * from './render/jsx';\n\nexport const version = \"0.11.1-alpha.3\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
|
|
@@ -15,7 +15,7 @@ export function getAxisDomainRangeAndLabels(min, max, axisOption, skipTick) {
|
|
|
15
15
|
isNil(axisOption.min) && isNil(axisOption.max) ? scale.nice(tickCount) : isValid(axisOption.min) && isNil(axisOption.max) ? scale.niceMax(tickCount) : isNil(axisOption.min) && isValid(axisOption.max) && scale.niceMin(tickCount);
|
|
16
16
|
}
|
|
17
17
|
let scaleTicks;
|
|
18
|
-
return
|
|
18
|
+
return skipTick || (scaleTicks = scale.ticks(null !== (_e = null == axisOption ? void 0 : axisOption.tickCount) && void 0 !== _e ? _e : DEFAULT_CONTINUOUS_TICK_COUNT, {
|
|
19
19
|
noDecimals: null === (_f = null == axisOption ? void 0 : axisOption.tick) || void 0 === _f ? void 0 : _f.noDecimals
|
|
20
20
|
})), {
|
|
21
21
|
range: scale.domain(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["layout/chart-helper/get-axis-domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AASvF,MAAM,UAAU,2BAA2B,CAAC,GAAW,EAAE,GAAW,EAAE,UAAe,EAAE,QAAkB;;IACvG,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,EAAE;QACpB,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,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IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAC3D,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAC1B;KACF;IAED,IAAI,UAAU,CAAC;IACf,IAAI,CAAC,QAAQ,EAAE;QACb,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,mCAAI,6BAA6B,EAAE;YAC/E,UAAU,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,0CAAE,UAAU;SACzC,CAAC,CAAC;KAEJ;IAED,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;QACrB,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC","file":"get-axis-domain.js","sourcesContent":["import { LinearScale } from '@visactor/vscale';\nimport { isNil, isValid } from '@visactor/vutils';\nimport { DEFAULT_CONTINUOUS_TICK_COUNT } from '../../components/util/tick-data/config';\n\n/**\n * @description: get axis nice domain and tick label text\n * @param {number} min\n * @param {number} max\n * @param {ITableAxisOption} axisOption\n * @return {*}\n */\nexport function getAxisDomainRangeAndLabels(min: number, max: number, axisOption: any, skipTick?: boolean) {\n if (axisOption?.zero) {\n min = Math.min(min, 0);\n max = Math.max(max, 0);\n }\n\n const scale = new LinearScale();\n scale.domain([min, max], !!axisOption?.nice);\n\n if (axisOption?.nice) {\n let tickCount = axisOption.tick?.forceTickCount ?? axisOption.tick?.tickCount ?? 10;\n // 如果配置了精度优先,那么最低是10\n // 否则就直接使用tickCount即可\n if (axisOption.niceType === 'accurateFirst') {\n tickCount = Math.max(10, tickCount);\n }\n if (isNil(axisOption.min) && isNil(axisOption.max)) {\n scale.nice(tickCount);\n } else if (isValid(axisOption.min) && isNil(axisOption.max)) {\n scale.niceMax(tickCount);\n } else if (isNil(axisOption.min) && isValid(axisOption.max)) {\n scale.niceMin(tickCount);\n }\n }\n\n let scaleTicks;\n if (!skipTick) {\n scaleTicks = scale.ticks(axisOption?.tickCount ?? DEFAULT_CONTINUOUS_TICK_COUNT, {\n noDecimals: axisOption?.tick?.noDecimals\n });\n // console.log(scaleTicks);\n }\n\n return {\n range: scale.domain(),\n ticks: scaleTicks\n };\n}\n"]}
|
|
@@ -44,8 +44,8 @@ export function getChartAxes(col, row, layout) {
|
|
|
44
44
|
if (isPercent && (range.min = range.min < 0 ? -1 : 0, range.max = range.max > 0 ? 1 : 0),
|
|
45
45
|
((null == axisOption ? void 0 : axisOption.zero) || range.min === range.max) && (range.min = Math.min(range.min, 0),
|
|
46
46
|
range.max = Math.max(range.max, 0)), null == axisOption ? void 0 : axisOption.nice) {
|
|
47
|
-
const {
|
|
48
|
-
range.min =
|
|
47
|
+
const {ticks: ticks} = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
48
|
+
range.min = ticks[0], range.max = ticks[ticks.length - 1];
|
|
49
49
|
}
|
|
50
50
|
isNumber(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min),
|
|
51
51
|
isNumber(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max),
|
|
@@ -108,8 +108,8 @@ export function getChartAxes(col, row, layout) {
|
|
|
108
108
|
if (isPercent && (range.min = range.min < 0 ? -1 : 0, range.max = range.max > 0 ? 1 : 0),
|
|
109
109
|
((null == axisOption ? void 0 : axisOption.zero) || range.min === range.max) && (range.min = Math.min(range.min, 0),
|
|
110
110
|
range.max = Math.max(range.max, 0)), null == axisOption ? void 0 : axisOption.nice) {
|
|
111
|
-
const {
|
|
112
|
-
range.min =
|
|
111
|
+
const {ticks: ticks} = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
112
|
+
range.min = ticks[0], range.max = ticks[ticks.length - 1];
|
|
113
113
|
}
|
|
114
114
|
isNumber(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min),
|
|
115
115
|
isNumber(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max),
|
|
@@ -1 +1 @@
|
|
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,GAAG,UAAU,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;oBAClG,WAAW,CAAC,MAAA,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,EAAE,mCAAI,MAAA,SAAS,CAAC,IAAI,0CAAE,EAAE,mCAAI,MAAM,CAAC,GAAG,CAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,EAAE;wBACpF,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,SAAS,CAAC;iBACf;qBAAM;oBACL,WAAW,CAAC,MAAA,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,EAAE,mCAAI,MAAA,SAAS,CAAC,IAAI,0CAAE,EAAE,mCAAI,MAAM,CAAC,GAAG,SAAS,CAAC;iBAC9E;aACF;QACH,CAAC,CAAC,CAAC;QACH,OAAO,WAAW,CAAC;KACpB;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3B,CAAC","file":"get-chart-spec.js","sourcesContent":["import { cloneDeep, isArray, isNumber, merge } from '@visactor/vutils';\nimport type { PivotLayoutMap } from '../pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../pivot-header-layout';\nimport type { SimpleHeaderLayoutMap } from '../simple-header-layout';\nimport { checkZeroAlign, getAxisOption } from './get-axis-config';\nimport { getAxisDomainRangeAndLabels } from './get-axis-domain';\n\nconst NO_AXISID_FRO_VTABLE = 'NO_AXISID_FRO_VTABLE';\n\nexport function getRawChartSpec(col: number, row: number, layout: PivotLayoutMap | PivotHeaderLayoutMap): any {\n const paths = layout.getCellHeaderPaths(col, row);\n let indicatorObj;\n if (layout.indicatorsAsCol) {\n const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;\n indicatorObj = layout.columnObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n } else {\n const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;\n indicatorObj = layout.columnObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n }\n const chartSpec = indicatorObj?.chartSpec;\n\n return chartSpec;\n}\n\nexport function getChartSpec(col: number, row: number, layout: PivotLayoutMap): any {\n let chartSpec = layout.getRawChartSpec(col, row);\n if (chartSpec) {\n chartSpec = cloneDeep(chartSpec);\n chartSpec.sortDataByAxis = true;\n if (isArray(chartSpec.series)) {\n chartSpec.series.forEach((serie: any) => {\n serie.sortDataByAxis = true;\n });\n }\n chartSpec.axes = layout.getChartAxes(col, row);\n chartSpec.padding = 0;\n chartSpec.dataZoom = []; // Do not support datazoom temply\n return chartSpec;\n }\n return null;\n}\n\nexport function getChartAxes(col: number, row: number, layout: PivotLayoutMap): any {\n const axes = [];\n if (layout.indicatorsAsCol) {\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n const colIndex = layout.getRecordIndexByCol(col);\n indicatorKeys.forEach((key, index) => {\n if (isArray(key)) {\n key = key[0];\n }\n\n const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'bottom' : 'top', layout);\n\n const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n ? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n : layout.dataset.collectedValues[key];\n const range = merge(\n {},\n (data?.[\n layout.getColKeysPath()?.[colIndex]?.[Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)] ??\n ''\n ] as { max?: number; min?: number }) ?? { min: 0, max: 1 }\n );\n if (isPercent) {\n (range as any).min = (range as any).min < 0 ? -1 : 0;\n (range as any).max = (range as any).max > 0 ? 1 : 0;\n }\n if (axisOption?.zero || range.min === range.max) {\n range.min = Math.min(range.min, 0);\n range.max = Math.max(range.max, 0);\n }\n if (axisOption?.nice) {\n const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);\n range.min = axisRange[0];\n range.max = axisRange[1];\n }\n if (isNumber(axisOption?.min)) {\n (range as any).min = axisOption.min;\n }\n if (isNumber(axisOption?.max)) {\n (range as any).max = axisOption.max;\n }\n axes.push(\n merge(\n {\n range\n },\n axisOption,\n {\n type: 'linear',\n orient: index === 0 ? 'bottom' : 'top',\n // visible: true,\n label: { visible: false },\n title: { visible: false },\n domainLine: { visible: false },\n seriesIndex: index,\n height: -1,\n\n sync: { axisId: NO_AXISID_FRO_VTABLE } // hack for fs\n }\n )\n );\n });\n\n let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, col)[0];\n if (isArray(rowDimensionKey)) {\n rowDimensionKey = rowDimensionKey[0];\n }\n const data =\n layout.dataset.cacheCollectedValues[rowDimensionKey] ||\n layout.dataset.collectedValues[rowDimensionKey] ||\n ([] as string[]);\n const recordRow = layout.getRecordIndexByRow(row);\n const rowPath = layout.getRowKeysPath()[recordRow];\n const domain = data[rowPath?.[rowPath?.length - 1] ?? ''] as Set<string>;\n\n const { axisOption, isPercent } = getAxisOption(col, row, 'left', layout);\n axes.push(\n merge(\n {\n domain: Array.from(domain ?? [])\n },\n axisOption,\n {\n type: 'band',\n orient: 'left',\n // visible: true,\n label: { visible: false, space: 0 },\n domainLine: { visible: false },\n tick: { visible: false },\n subTick: { visible: false },\n title: { visible: false },\n // height: -1,\n width: -1\n // autoIndent: false,\n }\n )\n );\n } else {\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n const rowIndex = layout.getRecordIndexByRow(row);\n indicatorKeys.forEach((key, index) => {\n if (isArray(key)) {\n key = key[0];\n }\n\n const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);\n\n const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n ? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n : layout.dataset.collectedValues[key];\n const range = merge(\n {},\n (data?.[\n layout.getRowKeysPath()[rowIndex]?.[Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)] ?? ''\n ] as { max?: number; min?: number }) ?? { min: 0, max: 1 }\n );\n if (isPercent) {\n (range as any).min = (range as any).min < 0 ? -1 : 0;\n (range as any).max = (range as any).max > 0 ? 1 : 0;\n }\n if (axisOption?.zero || range.min === range.max) {\n range.min = Math.min(range.min, 0);\n range.max = Math.max(range.max, 0);\n }\n if (axisOption?.nice) {\n const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);\n range.min = axisRange[0];\n range.max = axisRange[1];\n }\n if (isNumber(axisOption?.min)) {\n (range as any).min = axisOption.min;\n }\n if (isNumber(axisOption?.max)) {\n (range as any).max = axisOption.max;\n }\n axes.push(\n merge(\n {\n range\n },\n axisOption,\n {\n type: 'linear',\n orient: index === 0 ? 'left' : 'right',\n // visible: true,\n label: { visible: false },\n // label: { flush: true },\n title: { visible: false },\n domainLine: { visible: false },\n seriesIndex: index,\n width: -1,\n // grid: index === 0 ? undefined : { visible: false }\n\n sync: { axisId: NO_AXISID_FRO_VTABLE } // hack for fs\n }\n )\n );\n });\n\n let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];\n if (isArray(columnDimensionKey)) {\n columnDimensionKey = columnDimensionKey[0];\n }\n const data =\n layout.dataset.cacheCollectedValues[columnDimensionKey] ||\n layout.dataset.collectedValues[columnDimensionKey] ||\n ([] as string[]);\n const recordCol = layout.getRecordIndexByCol(col);\n const colPath = layout.getColKeysPath()[recordCol];\n const domain: string[] | Set<string> = (data?.[colPath?.[colPath?.length - 1] ?? ''] as Set<string>) ?? [];\n\n const { axisOption, isPercent } = getAxisOption(col, row, 'bottom', layout);\n axes.push(\n merge(\n {\n domain: Array.from(domain)\n },\n axisOption,\n {\n type: 'band',\n orient: 'bottom',\n visible: true,\n label: { visible: false, space: 0 },\n domainLine: { visible: false },\n tick: { visible: false },\n subTick: { visible: false },\n title: { visible: false },\n height: -1\n // autoIndent: false,\n }\n )\n );\n }\n return axes;\n}\n/**\n * 获取单元格对应spec的dataId。\n * 如果是spec外层的dataId,则是string,否则通过series获取到的是Record<string, string> => <dataId, series-chart的指标key用于过滤数据>\n * @param col\n * @param row\n * @param layout\n * @returns\n */\nexport function getChartDataId(\n col: number,\n row: number,\n layout: PivotLayoutMap | PivotHeaderLayoutMap | SimpleHeaderLayoutMap\n): string | Record<string, string> {\n const chartSpec = layout.getRawChartSpec(col, row);\n // 如果chartSpec配置了组合图 series 则需要考虑 series中存在的多个指标\n if (chartSpec?.series) {\n const dataIdfield: Record<string, string> = {};\n\n if (chartSpec.data?.id) {\n dataIdfield[chartSpec.data.id] = undefined;\n }\n chartSpec?.series.forEach((seriesSpec: any) => {\n if (!seriesSpec.data?.fromDataId) {\n if (!seriesSpec.data?.transforms) {\n const seriesField = seriesSpec.direction === 'horizontal' ? seriesSpec.xField : seriesSpec.yField;\n dataIdfield[seriesSpec.data?.id ?? chartSpec.data?.id ?? 'data'] = seriesSpec.data?.id\n ? seriesField\n : undefined;\n } else {\n dataIdfield[seriesSpec.data?.id ?? chartSpec.data?.id ?? 'data'] = undefined;\n }\n }\n });\n return dataIdfield;\n }\n return chartSpec.data.id;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["layout/chart-helper/get-chart-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIvE,OAAO,EAAkB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAEpD,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,GAAW,EAAE,MAA6C;;IACrG,MAAM,KAAK,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClD,IAAI,YAAY,CAAC;IACjB,IAAI,MAAM,CAAC,eAAe,EAAE;QAC1B,MAAM,YAAY,GAAG,MA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AAC;iBAC9E;aACF;QACH,CAAC,CAAC,CAAC;QACH,OAAO,WAAW,CAAC;KACpB;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3B,CAAC","file":"get-chart-spec.js","sourcesContent":["import { cloneDeep, isArray, isNumber, merge } from '@visactor/vutils';\nimport type { PivotLayoutMap } from '../pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../pivot-header-layout';\nimport type { SimpleHeaderLayoutMap } from '../simple-header-layout';\nimport { checkZeroAlign, getAxisOption } from './get-axis-config';\nimport { getAxisDomainRangeAndLabels } from './get-axis-domain';\n\nconst NO_AXISID_FRO_VTABLE = 'NO_AXISID_FRO_VTABLE';\n\nexport function getRawChartSpec(col: number, row: number, layout: PivotLayoutMap | PivotHeaderLayoutMap): any {\n const paths = layout.getCellHeaderPaths(col, row);\n let indicatorObj;\n if (layout.indicatorsAsCol) {\n const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;\n indicatorObj = layout.columnObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n } else {\n const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;\n indicatorObj = layout.columnObjects.find(indicator => indicator.indicatorKey === indicatorKey);\n }\n const chartSpec = indicatorObj?.chartSpec;\n\n return chartSpec;\n}\n\nexport function getChartSpec(col: number, row: number, layout: PivotLayoutMap): any {\n let chartSpec = layout.getRawChartSpec(col, row);\n if (chartSpec) {\n chartSpec = cloneDeep(chartSpec);\n chartSpec.sortDataByAxis = true;\n if (isArray(chartSpec.series)) {\n chartSpec.series.forEach((serie: any) => {\n serie.sortDataByAxis = true;\n });\n }\n chartSpec.axes = layout.getChartAxes(col, row);\n chartSpec.padding = 0;\n chartSpec.dataZoom = []; // Do not support datazoom temply\n return chartSpec;\n }\n return null;\n}\n\nexport function getChartAxes(col: number, row: number, layout: PivotLayoutMap): any {\n const axes = [];\n if (layout.indicatorsAsCol) {\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n const colIndex = layout.getRecordIndexByCol(col);\n indicatorKeys.forEach((key, index) => {\n if (isArray(key)) {\n key = key[0];\n }\n\n const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'bottom' : 'top', layout);\n\n const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n ? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n : layout.dataset.collectedValues[key];\n const range = merge(\n {},\n (data?.[\n layout.getColKeysPath()?.[colIndex]?.[Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)] ??\n ''\n ] as { max?: number; min?: number }) ?? { min: 0, max: 1 }\n );\n if (isPercent) {\n (range as any).min = (range as any).min < 0 ? -1 : 0;\n (range as any).max = (range as any).max > 0 ? 1 : 0;\n }\n if (axisOption?.zero || range.min === range.max) {\n range.min = Math.min(range.min, 0);\n range.max = Math.max(range.max, 0);\n }\n if (axisOption?.nice) {\n const { ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);\n range.min = ticks[0];\n range.max = ticks[ticks.length - 1];\n }\n if (isNumber(axisOption?.min)) {\n (range as any).min = axisOption.min;\n }\n if (isNumber(axisOption?.max)) {\n (range as any).max = axisOption.max;\n }\n axes.push(\n merge(\n {\n range\n },\n axisOption,\n {\n type: 'linear',\n orient: index === 0 ? 'bottom' : 'top',\n // visible: true,\n label: { visible: false },\n title: { visible: false },\n domainLine: { visible: false },\n seriesIndex: index,\n height: -1,\n\n sync: { axisId: NO_AXISID_FRO_VTABLE } // hack for fs\n }\n )\n );\n });\n\n let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, col)[0];\n if (isArray(rowDimensionKey)) {\n rowDimensionKey = rowDimensionKey[0];\n }\n const data =\n layout.dataset.cacheCollectedValues[rowDimensionKey] ||\n layout.dataset.collectedValues[rowDimensionKey] ||\n ([] as string[]);\n const recordRow = layout.getRecordIndexByRow(row);\n const rowPath = layout.getRowKeysPath()[recordRow];\n const domain = data[rowPath?.[rowPath?.length - 1] ?? ''] as Set<string>;\n\n const { axisOption, isPercent } = getAxisOption(col, row, 'left', layout);\n axes.push(\n merge(\n {\n domain: Array.from(domain ?? [])\n },\n axisOption,\n {\n type: 'band',\n orient: 'left',\n // visible: true,\n label: { visible: false, space: 0 },\n domainLine: { visible: false },\n tick: { visible: false },\n subTick: { visible: false },\n title: { visible: false },\n // height: -1,\n width: -1\n // autoIndent: false,\n }\n )\n );\n } else {\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n const rowIndex = layout.getRecordIndexByRow(row);\n indicatorKeys.forEach((key, index) => {\n if (isArray(key)) {\n key = key[0];\n }\n\n const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);\n\n const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n ? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]\n : layout.dataset.collectedValues[key];\n const range = merge(\n {},\n (data?.[\n layout.getRowKeysPath()[rowIndex]?.[Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)] ?? ''\n ] as { max?: number; min?: number }) ?? { min: 0, max: 1 }\n );\n if (isPercent) {\n (range as any).min = (range as any).min < 0 ? -1 : 0;\n (range as any).max = (range as any).max > 0 ? 1 : 0;\n }\n if (axisOption?.zero || range.min === range.max) {\n range.min = Math.min(range.min, 0);\n range.max = Math.max(range.max, 0);\n }\n if (axisOption?.nice) {\n const { ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);\n range.min = ticks[0];\n range.max = ticks[ticks.length - 1];\n }\n if (isNumber(axisOption?.min)) {\n (range as any).min = axisOption.min;\n }\n if (isNumber(axisOption?.max)) {\n (range as any).max = axisOption.max;\n }\n axes.push(\n merge(\n {\n range\n },\n axisOption,\n {\n type: 'linear',\n orient: index === 0 ? 'left' : 'right',\n // visible: true,\n label: { visible: false },\n // label: { flush: true },\n title: { visible: false },\n domainLine: { visible: false },\n seriesIndex: index,\n width: -1,\n // grid: index === 0 ? undefined : { visible: false }\n\n sync: { axisId: NO_AXISID_FRO_VTABLE } // hack for fs\n }\n )\n );\n });\n\n let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];\n if (isArray(columnDimensionKey)) {\n columnDimensionKey = columnDimensionKey[0];\n }\n const data =\n layout.dataset.cacheCollectedValues[columnDimensionKey] ||\n layout.dataset.collectedValues[columnDimensionKey] ||\n ([] as string[]);\n const recordCol = layout.getRecordIndexByCol(col);\n const colPath = layout.getColKeysPath()[recordCol];\n const domain: string[] | Set<string> = (data?.[colPath?.[colPath?.length - 1] ?? ''] as Set<string>) ?? [];\n\n const { axisOption, isPercent } = getAxisOption(col, row, 'bottom', layout);\n axes.push(\n merge(\n {\n domain: Array.from(domain)\n },\n axisOption,\n {\n type: 'band',\n orient: 'bottom',\n visible: true,\n label: { visible: false, space: 0 },\n domainLine: { visible: false },\n tick: { visible: false },\n subTick: { visible: false },\n title: { visible: false },\n height: -1\n // autoIndent: false,\n }\n )\n );\n }\n return axes;\n}\n/**\n * 获取单元格对应spec的dataId。\n * 如果是spec外层的dataId,则是string,否则通过series获取到的是Record<string, string> => <dataId, series-chart的指标key用于过滤数据>\n * @param col\n * @param row\n * @param layout\n * @returns\n */\nexport function getChartDataId(\n col: number,\n row: number,\n layout: PivotLayoutMap | PivotHeaderLayoutMap | SimpleHeaderLayoutMap\n): string | Record<string, string> {\n const chartSpec = layout.getRawChartSpec(col, row);\n // 如果chartSpec配置了组合图 series 则需要考虑 series中存在的多个指标\n if (chartSpec?.series) {\n const dataIdfield: Record<string, string> = {};\n\n if (chartSpec.data?.id) {\n dataIdfield[chartSpec.data.id] = undefined;\n }\n chartSpec?.series.forEach((seriesSpec: any) => {\n if (!seriesSpec.data?.fromDataId) {\n if (!seriesSpec.data?.transforms) {\n const seriesField = seriesSpec.direction === 'horizontal' ? seriesSpec.xField : seriesSpec.yField;\n dataIdfield[seriesSpec.data?.id ?? chartSpec.data?.id ?? 'data'] = seriesSpec.data?.id\n ? seriesField\n : undefined;\n } else {\n dataIdfield[seriesSpec.data?.id ?? chartSpec.data?.id ?? 'data'] = undefined;\n }\n }\n });\n return dataIdfield;\n }\n return chartSpec.data.id;\n}\n"]}
|
|
@@ -86,7 +86,7 @@ export function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeight
|
|
|
86
86
|
export function computeRowHeight(row, startCol, endCol, table) {
|
|
87
87
|
let maxHeight = 0;
|
|
88
88
|
if (table.isPivotChart() && row >= table.columnHeaderLevelCount && row < table.rowCount - table.bottomFrozenRowCount) {
|
|
89
|
-
if (!table.internalProps.layoutMap.indicatorsAsCol) return table.
|
|
89
|
+
if (!table.internalProps.layoutMap.indicatorsAsCol) return table.getDefaultRowHeight(row);
|
|
90
90
|
{
|
|
91
91
|
const optimunHeight = table.internalProps.layoutMap.getOptimunHeightForChart(row);
|
|
92
92
|
if (optimunHeight > 0) return optimunHeight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,MAAM,YAAY,GAAG,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Z,IAAI,EAAE,KAAK;YACX,QAAQ;YACR,SAAS;YACT,UAAU;YACV,UAAU;YACV,UAAU;YACV,SAAS,EAAE,YAAY;SACxB,CAAC,CAAC;QACH,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC9C;SAAM;QAEL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\n\nconst utilTextMark = new WrapText({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n if (table.heightMode === 'autoHeight' || table.heightMode === 'adaptive') {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount) {\n return;\n }\n\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const totalDrawHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n let actualHeight = 0;\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n let rowHeight;\n if (row === table.rowCount - table.bottomFrozenRowCount - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table.setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n if (update) {\n newHeights[row] = newHeights[row] * factor;\n } else {\n table.setRowHeight(row, table.getRowHeight(row) * factor);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n return table.getRowHeight(row);\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (typeof customHeight === 'number') {\n maxHeight = Math.max(customHeight, maxHeight);\n continue;\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n // height = (customLayoutObj.rootContainer as VGroup).attribute.height ?? 0;\n } else if (customLayoutObj.rootContainer) {\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n height = size.height ?? 0;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n } else {\n height = customRender?.expectedHeight ?? 0;\n }\n return height / spanRow;\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC;IAChC,SAAS,EAAE,IAAI;CAEhB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,QAAQ,CAAC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,EAAE;CACf,CAAC,CAAC;AAEH,MAAM,UAAU,iBAAiB,CAC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AAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\n\nconst utilTextMark = new WrapText({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n if (table.heightMode === 'autoHeight' || table.heightMode === 'adaptive') {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount) {\n return;\n }\n\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const totalDrawHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n let actualHeight = 0;\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n let rowHeight;\n if (row === table.rowCount - table.bottomFrozenRowCount - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table.setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n if (update) {\n newHeights[row] = newHeights[row] * factor;\n } else {\n table.setRowHeight(row, table.getRowHeight(row) * factor);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n return table.getDefaultRowHeight(row);\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (typeof customHeight === 'number') {\n maxHeight = Math.max(customHeight, maxHeight);\n continue;\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n // height = (customLayoutObj.rootContainer as VGroup).attribute.height ?? 0;\n } else if (customLayoutObj.rootContainer) {\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n height = size.height ?? 0;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n } else {\n height = customRender?.expectedHeight ?? 0;\n }\n return height / spanRow;\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
|
|
@@ -397,9 +397,10 @@ export class Scenegraph {
|
|
|
397
397
|
computeRowsHeight(this.table, 0, this.table.rowCount - 1, !0, !0);
|
|
398
398
|
}
|
|
399
399
|
resize() {
|
|
400
|
-
"adaptive" === this.table.widthMode
|
|
400
|
+
("adaptive" === this.table.widthMode || this.table.autoFillWidth) && this.recalculateColWidths(),
|
|
401
|
+
("adaptive" === this.table.heightMode || this.table.autoFillHeight) && this.recalculateRowHeights(),
|
|
401
402
|
this.dealWidthMode(), this.dealHeightMode(), this.dealFrozen(), this.updateTableSize(),
|
|
402
|
-
this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), "adaptive"
|
|
403
|
+
this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight) && this.updateChartSize(this.table.rowHeaderLevelCount),
|
|
403
404
|
this.updateNextFrame();
|
|
404
405
|
}
|
|
405
406
|
updateTableSize() {
|