@visactor/vtable 1.13.3-alpha.6 → 1.14.0
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 +1 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -3
- package/cjs/core/BaseTable.js +9 -10
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/record-helper.js +1 -1
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/edit/edit-manager.d.ts +2 -2
- package/cjs/edit/edit-manager.js +16 -7
- package/cjs/edit/edit-manager.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-config.js +7 -1
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.js +4 -3
- package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/cjs/plugins/custom-cell-style.d.ts +1 -1
- package/cjs/plugins/custom-cell-style.js +1 -2
- package/cjs/plugins/custom-cell-style.js.map +1 -1
- package/cjs/state/checkbox/checkbox.js +9 -7
- package/cjs/state/checkbox/checkbox.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -3
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +3 -3
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +74 -45
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +2 -2
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.js +2 -2
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -3
- package/es/core/BaseTable.js +9 -10
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/record-helper.js +1 -1
- package/es/core/record-helper.js.map +1 -1
- package/es/edit/edit-manager.d.ts +2 -2
- package/es/edit/edit-manager.js +13 -4
- package/es/edit/edit-manager.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-config.js +6 -1
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-axis-domain.js +3 -3
- package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/es/plugins/custom-cell-style.d.ts +1 -1
- package/es/plugins/custom-cell-style.js +1 -2
- package/es/plugins/custom-cell-style.js.map +1 -1
- package/es/state/checkbox/checkbox.js +8 -7
- package/es/state/checkbox/checkbox.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -3
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +3 -3
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layout/chart-helper/get-axis-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAKrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAQ/E,MAAM,UAAU,yBAAyB,CAAC,GAAW,EAAE,GAAW,EAAE,MAA4B;;IAC9F,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE;QACjC,OAAO,SAAS,CAAC;KAClB;IAGD,IAAI,MAAM,CAAC,eAAe,EAAE;QAC1B,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C,WAAW,EAAE;gBAChB,WAAW,GAAG,QAAQ,CAAC;aACxB;iBAAM;gBACL,WAAW,GAAG,0BAA0B,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;aACjG;SACF;KACF;IAED,OAAO;QACL,WAAW;QACX,WAAW;KACZ,CAAC;AACJ,CAAC","file":"get-axis-config.js","sourcesContent":["import { isArray, isNumber, isValid, merge } from '@visactor/vutils';\nimport type { PivotHeaderLayoutMap } from '../pivot-header-layout';\nimport type { ITableAxisOption } from '../../ts-types/component/axis';\nimport type { PivotChart } from '../../PivotChart';\nimport type { CollectedValue } from '../../ts-types';\nimport { getNewRangeToAlign } from './zero-align';\nimport { Factory } from '../../core/factory';\nimport type { GetAxisDomainRangeAndLabels } from './get-axis-domain';\nimport { getQuadProps } from '../../scenegraph/utils/padding';\nimport { getProp } from '../../scenegraph/utils/get-prop';\nimport { getTickModeFunction, getZeroAlignTickAlignTicks } from './tick-align';\n\ntype AxisRange = {\n min: number;\n max: number;\n};\n\nexport type GetAxisConfigInPivotChart = (col: number, row: number, layout: PivotHeaderLayoutMap) => any;\nexport function getAxisConfigInPivotChart(col: number, row: number, layout: PivotHeaderLayoutMap): any {\n if (!layout._table.isPivotChart()) {\n return undefined;\n }\n\n // 是否是指标\n if (layout.indicatorsAsCol) {\n if (\n layout.hasTwoIndicatorAxes &&\n row === layout.columnHeaderLevelCount - 1 &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n const axisRange = getRange('top', col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 1, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col, row + 1);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col, row + 1, layout._table));\n\n // range for top axis\n const { range, ticks, axisOption, targetTicks, targetRange, index, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for bottom axis\n // const subAxisRange = getRange(\n // 'bottom',\n // col,\n // row + 1,\n // col,\n // layout.columnHeaderLevelCount - 1,\n // col,\n // row,\n // 0,\n // layout\n // );\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 顶部副指标轴\n return merge(\n {\n range: range\n },\n axisOption,\n {\n orient: 'top',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row).slice(0, 2);\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n let indicatorInfo = null;\n indicatorKeys?.forEach(key => {\n const info = layout.getIndicatorInfo(key);\n if (info) {\n indicatorInfo = info;\n }\n });\n\n const axisRange = getRange('bottom', col, row - 1, col, row, col, row, 0, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col, row - 1);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));\n\n // range for bottom axis\n const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for top axis\n // const subAxisRange = getRange('top', col, row - 1, col, row, col, row, 1, layout);\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 底侧指标轴\n return merge(\n {\n title: {\n visible: true,\n text: (indicatorInfo as any)?.title\n // autoRotate: true\n },\n range\n },\n axisOption,\n {\n orient: 'bottom',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row);\n if (isArray(rowDimensionKey)) {\n rowDimensionKey = rowDimensionKey[0];\n }\n const data = layout.dataset.collectedValues[rowDimensionKey] ?? ([] as string[]);\n\n const rowPath = layout.getRowKeysPath(col, row);\n const domain = ((data as any)[rowPath ?? ''] as Array<string>) ?? [];\n\n const { axisOption, theme, chartType } = getAxisOption(col + 1, row, 'left', layout);\n if (axisOption?.visible === false) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col + 1, row);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));\n\n const spec = layout.getRawChartSpec(col + 1, row);\n // 左侧维度轴\n return merge(\n {\n // domain: chartType === 'scatter' ? undefined : Array.from(domain),\n domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),\n // range: chartType === 'scatter' ? domain : undefined,\n range: axisOption?.type === 'linear' ? domain : undefined,\n title: {\n autoRotate: true\n }\n },\n axisOption,\n {\n orient: 'left',\n // type: chartType === 'scatter' ? axisOption?.type ?? 'linear' : 'band',\n type: axisOption?.type ?? 'band',\n __vtableChartTheme: theme,\n // 默认左侧维度轴对应的图表direction 为 horizontal\n // 散点图特殊处理\n inverse: transformInverse(\n axisOption,\n (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === Direction.horizontal\n ),\n __vtablePadding: padding\n }\n );\n }\n } else {\n if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row).slice(0, 2);\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n let indicatorInfo = null;\n indicatorKeys?.forEach(key => {\n const info = layout.getIndicatorInfo(key);\n if (info) {\n indicatorInfo = info;\n }\n });\n\n const axisRange = getRange('left', col + 1, row, col, row, col, row, 0, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col + 1, row);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));\n\n // range for left axis\n const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for right axis\n // const subAxisRange = getRange('right', col + 1, row, col, row, col, row, 1, layout);\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 左侧指标轴\n return merge(\n {\n title: {\n visible: true,\n text: (indicatorInfo as any)?.title,\n autoRotate: true\n },\n range: range\n },\n axisOption,\n {\n orient: 'left',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n col === layout.colCount - layout.rightFrozenColCount &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n const axisRange = getRange('right', col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 1, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col - 1, row);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col - 1, row, layout._table));\n\n // range for right axis\n const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for left axis\n // const subAxisRange = getRange('left', col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 0, layout);\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 右侧副指标轴\n return merge(\n {\n range: range,\n title: {\n autoRotate: true\n }\n },\n axisOption,\n {\n orient: 'right',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n\n let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount);\n if (isArray(columnDimensionKey)) {\n columnDimensionKey = columnDimensionKey[0];\n }\n const data = layout.dataset.collectedValues[columnDimensionKey] ?? ([] as string[]);\n\n const colPath = layout.getColKeysPath(col, row);\n const domain = ((data as any)?.[colPath ?? ''] as Array<string>) ?? [];\n\n const { axisOption, isPercent, theme, chartType } = getAxisOption(col, row - 1, 'bottom', layout);\n if (axisOption?.visible === false) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col, row - 1);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));\n\n // 底部维度轴\n return merge(\n {\n // domain: chartType === 'scatter' ? undefined : Array.from(domain),\n domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),\n // range: chartType === 'scatter' ? domain : undefined\n range: axisOption?.type === 'linear' ? domain : undefined\n },\n axisOption,\n {\n orient: 'bottom',\n // type: chartType === 'scatter' ? axisOption?.type ?? 'linear' : 'band',\n type: axisOption?.type ?? 'band',\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n }\n }\n\n return undefined;\n}\n\nexport function getAxisOption(col: number, row: number, orient: string, layout: PivotHeaderLayoutMap) {\n const spec = layout.getRawChartSpec(col, row);\n const axes = spec.axes ?? [];\n (layout._table as PivotChart).pivotChartAxes.forEach(axis => {\n const index = axes.findIndex((a: any) => {\n return axis.orient === a.orient;\n });\n if (index === -1) {\n axes.push(axis);\n }\n });\n\n if (spec && isArray(axes)) {\n const axisOption = axes.find((axis: any) => {\n return axis.orient === orient;\n });\n if (axisOption) {\n const { seriesIndex, seriesId } = axisOption;\n let seriesIndice;\n let seriesSpec: any;\n if (isValid(seriesId) && isArray(spec.series)) {\n seriesIndice = (isArray(seriesId) ? seriesId : [seriesId]).map(id => {\n const index = spec.series.findIndex((s: any) => s.id === id);\n if (index >= 0) {\n seriesSpec = spec.series[index];\n }\n return index;\n });\n } else if (isValid(seriesIndex) && isArray(spec.series)) {\n seriesIndice = seriesIndex;\n }\n const { isZeroAlign, isTickAlign } = checkZeroAlign(spec, orient, layout);\n return {\n axisOption,\n isPercent: spec.percent,\n isZeroAlign,\n isTickAlign,\n seriesIndice,\n theme: spec.theme,\n chartType: seriesSpec?.type ?? spec.type\n };\n }\n }\n const axisOption = ((layout._table as PivotChart).pivotChartAxes as ITableAxisOption[]).find(axisOption => {\n return axisOption.orient === orient;\n });\n const { isZeroAlign, isTickAlign } = checkZeroAlign(spec, orient, layout);\n return {\n axisOption,\n isPercent: false,\n // isZeroAlign: checkZeroAlign(spec, orient, layout),\n isZeroAlign,\n isTickAlign,\n theme: spec.theme,\n chartType: spec.type\n };\n}\n\nfunction checkZeroAlign(spec: any, orient: string, layout: PivotHeaderLayoutMap) {\n // check condition:\n // 1. two axes and one set sync\n // 2. axisId in sync is another\n const orients: string[] = [];\n if (orient === 'left' || orient === 'right') {\n orients.push('left', 'right');\n } else if (orient === 'top' || orient === 'bottom') {\n orients.push('top', 'bottom');\n }\n // const spec = layout.getRawChartSpec(col, row);\n let axesSpec;\n if (spec && isArray(spec.axes)) {\n axesSpec = spec.axes;\n } else {\n axesSpec = (layout._table as PivotChart).pivotChartAxes as ITableAxisOption[];\n }\n\n let isZeroAlign = false;\n let isTickAlign = false;\n if (isArray(axesSpec)) {\n const axes: any[] = [];\n axesSpec.forEach((axis: any) => {\n if (orients.includes(axis.orient)) {\n axes.push(axis);\n }\n });\n for (let i = 0; i < axes.length; i++) {\n const axis = axes[i];\n if (\n axis.sync &&\n // axis.sync.zeroAlign &&\n axis.sync.axisId &&\n axes.find(axisSync => {\n return axisSync.id === axis.sync.axisId;\n })\n ) {\n // return true;\n isZeroAlign = isZeroAlign || axis.sync.zeroAlign;\n isTickAlign = isTickAlign || axis.sync.tickAlign;\n }\n }\n }\n\n // return false;\n return {\n isZeroAlign,\n isTickAlign\n };\n}\n\nexport function getAxisRange(\n collectedValues: Record<string, Record<string, CollectedValue>>,\n indicatorKeys: string[],\n isZeroAlign: boolean,\n colPath: string,\n seriesId: number | number[]\n): AxisRange | null {\n if (isArray(seriesId)) {\n const range = { min: Infinity, max: -Infinity };\n for (let i = 0; i < seriesId.length; i++) {\n const singleRange = getAxisRange(collectedValues, indicatorKeys, isZeroAlign, colPath, seriesId[i]);\n if (singleRange) {\n range.min = Math.min(range.min, singleRange.min);\n range.max = Math.max(range.max, singleRange.max);\n }\n }\n if (isFinite(range.min) && isFinite(range.max)) {\n return range;\n }\n return null;\n }\n let defaultKey = indicatorKeys?.[seriesId];\n if (isArray(defaultKey)) {\n defaultKey = defaultKey[0];\n }\n if (!defaultKey) {\n return null;\n }\n // const data = collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]\n // ? collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]\n // : collectedValues[defaultKey];\n const data = collectedValues[defaultKey];\n const range = merge({}, (data?.[colPath ?? ''] as { min: number; max: number }) ?? { min: 0, max: 1 });\n\n if (range.positiveMax && range.positiveMax > range.max) {\n range.max = range.positiveMax;\n }\n if (range.negativeMin && range.negativeMin < range.min) {\n range.min = range.negativeMin;\n }\n if (range.min === range.max) {\n if (range.min > 0) {\n range.min = 0;\n } else {\n range.max = 0;\n }\n }\n\n return range;\n}\n\nexport function isTopOrBottomAxis(col: number, row: number, layout: PivotHeaderLayoutMap): boolean {\n if (!layout._table.isPivotChart()) {\n return false;\n }\n\n if (layout.indicatorsAsCol) {\n if (\n layout.hasTwoIndicatorAxes &&\n row === layout.columnHeaderLevelCount - 1 &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // 顶部副指标轴\n return true;\n } else if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // 底侧指标轴\n return true;\n }\n } else {\n if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // 底部维度轴\n return true;\n }\n }\n return false;\n}\n\nexport function isLeftOrRightAxis(col: number, row: number, layout: PivotHeaderLayoutMap): boolean {\n if (!layout._table.isPivotChart()) {\n return false;\n }\n\n if (layout.indicatorsAsCol) {\n if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // 左侧维度轴\n return true;\n }\n } else {\n if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // 左侧指标轴\n return true;\n } else if (\n col === layout.colCount - layout.rightFrozenColCount &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // 右侧副指标轴\n return true;\n }\n }\n return false;\n}\n\nconst enum Direction {\n vertical = 'vertical',\n horizontal = 'horizontal'\n}\n\n// align with vchart (packages/vchart/src/component/axis/cartesian/util/common.ts)\nfunction transformInverse(spec: any, isHorizontal: boolean) {\n // 这里处理下 direction === 'horizontal' 下的 Y 轴\n // 因为 Y 轴绘制的时候默认是从下至上绘制的,但是在 direction === 'horizontal' 场景下,图表应该是按照从上至下阅读的\n // 所以这里在这种场景下坐标轴会默认 inverse 已达到效果\n let inverse = spec?.inverse;\n if (isHorizontal && !isXAxis(spec?.orient)) {\n inverse = isValid(spec?.inverse) ? !spec?.inverse : true;\n }\n return inverse;\n}\n\ntype IOrientType = 'left' | 'top' | 'right' | 'bottom' | 'z';\nfunction isXAxis(orient: IOrientType) {\n return orient === 'bottom' || orient === 'top';\n}\n\nexport function hasLinearAxis(spec: any, tableAxesConfig: any, isHorizontal: boolean, isThisXAxis: boolean): boolean {\n if (!isArray(spec.axes) || spec.axes.length === 0) {\n return (isHorizontal && isThisXAxis) || (!isHorizontal && !isThisXAxis);\n }\n\n for (let i = 0; i < spec.axes.length; i++) {\n const axisSpec = spec.axes[i];\n if (!isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type === 'linear') {\n return true;\n }\n\n if (isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (!isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type === 'linear') {\n return true;\n }\n }\n\n if (isArray(tableAxesConfig) && tableAxesConfig.length > 0) {\n for (let i = 0; i < tableAxesConfig.length; i++) {\n const axisSpec = tableAxesConfig[i];\n if (!isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type === 'linear') {\n return true;\n }\n\n if (isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (!isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type === 'linear') {\n return true;\n }\n }\n }\n\n return (isHorizontal && isThisXAxis) || (!isHorizontal && !isThisXAxis);\n}\n\nfunction getRange(\n position: 'left' | 'right' | 'top' | 'bottom',\n colForAxisOption: number,\n rowForAxisOption: number,\n colForIndicatorKey: number,\n rowForIndicatorKey: number,\n col: number,\n row: number,\n defaultSeriesIndice: number,\n layout: PivotHeaderLayoutMap\n) {\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(colForIndicatorKey, rowForIndicatorKey);\n let path;\n if (position === 'top' || position === 'bottom') {\n path = layout.getColKeysPath(col, row);\n } else {\n path = layout.getRowKeysPath(col, row);\n }\n\n const rangeConfig = getChartAxisRange(\n colForAxisOption,\n rowForAxisOption,\n defaultSeriesIndice,\n position,\n indicatorKeys,\n path,\n layout\n );\n\n if (!rangeConfig) {\n return undefined;\n }\n\n const subAxisPosition =\n position === 'bottom' ? 'top' : position === 'top' ? 'bottom' : position === 'left' ? 'right' : 'left';\n\n const { targetRange, targetTicks } = getTargetRangeAndTicks(\n colForAxisOption,\n rowForAxisOption,\n rangeConfig.index,\n rangeConfig.isZeroAlign,\n rangeConfig.isTickAlign,\n rangeConfig.range,\n indicatorKeys,\n subAxisPosition,\n path,\n layout\n );\n\n if (rangeConfig.index !== 0 && targetTicks) {\n // reset range\n const getAxisDomainRangeAndLabels = Factory.getFunction(\n 'getAxisDomainRangeAndLabels'\n ) as GetAxisDomainRangeAndLabels;\n const { range: newRange, ticks: newTicks } = getAxisDomainRangeAndLabels(\n rangeConfig.range.min,\n rangeConfig.range.max,\n // merge({}, rangeConfig.axisOption, { nice: true, tick: { forceTickCount: targetTicks.length } }),\n rangeConfig.axisOption,\n rangeConfig.isZeroAlign,\n // layout._table.getColWidth(col)\n position === 'bottom' || position === 'top'\n ? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth\n : layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight, // avoid 0, 0 causes NaN\n {\n targetTicks,\n targetRange\n }\n );\n rangeConfig.range.min = newRange[0];\n rangeConfig.range.max = newRange[1];\n rangeConfig.ticks = newTicks;\n }\n\n (rangeConfig as any).targetRange = targetRange;\n (rangeConfig as any).targetTicks = targetTicks;\n\n return rangeConfig as typeof rangeConfig & { targetRange: AxisRange; targetTicks: number[] };\n}\n\nfunction getChartAxisRange(\n col: number,\n row: number,\n index: number,\n position: 'bottom' | 'top' | 'left' | 'right',\n indicatorKeys: string[],\n path: string,\n layout: PivotHeaderLayoutMap\n) {\n const { axisOption, isPercent, isZeroAlign, isTickAlign, seriesIndice, theme, chartType } = getAxisOption(\n col,\n row,\n position,\n layout\n );\n\n // if (axisOption?.visible === false) {\n // return undefined;\n // }\n\n const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, path, seriesIndice ?? index);\n\n if (!range) {\n return undefined;\n }\n\n if (isPercent) {\n range.min = range.min < 0 ? -1 : 0;\n range.max = range.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 let ticks;\n if (axisOption?.nice || isTickAlign) {\n const getAxisDomainRangeAndLabels = Factory.getFunction(\n 'getAxisDomainRangeAndLabels'\n ) as GetAxisDomainRangeAndLabels;\n const { range: axisRange, ticks: selfTicks } = getAxisDomainRangeAndLabels(\n range.min,\n range.max,\n axisOption,\n isZeroAlign,\n // layout._table.getColWidth(col)\n position === 'bottom' || position === 'top'\n ? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth\n : layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight // avoid 0, 0 causes NaN\n );\n if (axisOption?.nice) {\n range.min = axisRange[0];\n range.max = axisRange[1];\n }\n // if (isTickAlign) {\n // }\n ticks = selfTicks;\n }\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n }\n\n return {\n index: seriesIndice ?? index,\n range,\n ticks,\n isZeroAlign,\n isTickAlign,\n axisOption,\n theme,\n chartType\n };\n}\n\nexport function getAxisRangeAndTicks(\n col: number,\n row: number,\n index: number,\n position: 'bottom' | 'top' | 'left' | 'right',\n subAxisPosition: 'bottom' | 'top' | 'left' | 'right',\n indicatorKeys: string[],\n path: string,\n layout: PivotHeaderLayoutMap\n) {\n const { range, isZeroAlign, isTickAlign, axisOption } = getChartAxisRange(\n col,\n row,\n index,\n position,\n indicatorKeys,\n path,\n layout\n );\n const { targetRange, targetTicks } = getTargetRangeAndTicks(\n col,\n row,\n index,\n isZeroAlign,\n isTickAlign,\n range,\n indicatorKeys,\n subAxisPosition,\n path,\n layout\n );\n\n if (index !== 0 && targetTicks) {\n // reset range\n const getAxisDomainRangeAndLabels = Factory.getFunction(\n 'getAxisDomainRangeAndLabels'\n ) as GetAxisDomainRangeAndLabels;\n const { range: newRange, ticks: newTicks } = getAxisDomainRangeAndLabels(\n range.min,\n range.max,\n // merge({}, axisOption, { nice: true, tick: { forceTickCount: targetTicks.length } }),\n isZeroAlign,\n // layout._table.getColWidth(col)\n position === 'bottom' || position === 'top'\n ? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth\n : layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight, // avoid 0, 0 causes NaN\n {\n targetTicks,\n targetRange\n }\n );\n range.min = newRange[0];\n range.max = newRange[1];\n // axisOption.ticks = newTicks;\n }\n\n return {\n axisOption,\n range,\n targetTicks,\n targetRange\n };\n}\n\nfunction getTargetRangeAndTicks(\n col: number,\n row: number,\n index: number,\n isZeroAlign: boolean,\n isTickAlign: boolean,\n range: AxisRange,\n indicatorKeys: string[],\n subAxisPosition: 'bottom' | 'top' | 'left' | 'right',\n path: string,\n layout: PivotHeaderLayoutMap\n) {\n let targetTicks: number[];\n let targetRange: {\n max: number;\n min: number;\n };\n\n if (!isZeroAlign && !isTickAlign) {\n return {\n targetTicks,\n targetRange\n };\n }\n\n const subAxisRange = getChartAxisRange(\n col,\n row,\n indicatorKeys.length - 1 - index,\n subAxisPosition,\n indicatorKeys,\n path,\n layout\n );\n if (subAxisRange) {\n const { range: subRange, ticks: subTicks } = subAxisRange;\n targetRange = subRange;\n if (isZeroAlign) {\n const align = getNewRangeToAlign(range, subRange);\n if (align) {\n range.min = align.range1[0];\n range.max = align.range1[1];\n targetRange.min = align.range2[0];\n targetRange.max = align.range2[1];\n }\n }\n if (isTickAlign) {\n if (!isZeroAlign) {\n targetTicks = subTicks;\n } else {\n targetTicks = getZeroAlignTickAlignTicks(targetRange, col, row, index, subAxisPosition, layout);\n }\n }\n }\n\n return {\n targetTicks,\n targetRange\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/layout/chart-helper/get-axis-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAKrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,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AI,WAAW,EAAE;YACf,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAClD,IAAI,KAAK,EAAE;gBACT,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC5B,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC5B,WAAW,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAClC,WAAW,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aACnC;SACF;QACD,IAAI,WAAW,EAAE;YACf,IAAI,CAAC,WAAW,EAAE;gBAChB,WAAW,GAAG,QAAQ,CAAC;aACxB;iBAAM;gBACL,WAAW,GAAG,0BAA0B,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;aACjG;SACF;KACF;IAED,OAAO;QACL,WAAW;QACX,WAAW;KACZ,CAAC;AACJ,CAAC","file":"get-axis-config.js","sourcesContent":["import { isArray, isNumber, isValid, merge } from '@visactor/vutils';\nimport type { PivotHeaderLayoutMap } from '../pivot-header-layout';\nimport type { ITableAxisOption } from '../../ts-types/component/axis';\nimport type { PivotChart } from '../../PivotChart';\nimport type { CollectedValue } from '../../ts-types';\nimport { getNewRangeToAlign } from './zero-align';\nimport { Factory } from '../../core/factory';\nimport type { GetAxisDomainRangeAndLabels } from './get-axis-domain';\nimport { getQuadProps } from '../../scenegraph/utils/padding';\nimport { getProp } from '../../scenegraph/utils/get-prop';\nimport { getTickModeFunction, getZeroAlignTickAlignTicks } from './tick-align';\n\ntype AxisRange = {\n min: number;\n max: number;\n};\n\nexport type GetAxisConfigInPivotChart = (col: number, row: number, layout: PivotHeaderLayoutMap) => any;\nexport function getAxisConfigInPivotChart(col: number, row: number, layout: PivotHeaderLayoutMap): any {\n if (!layout._table.isPivotChart()) {\n return undefined;\n }\n\n // 是否是指标\n if (layout.indicatorsAsCol) {\n if (\n layout.hasTwoIndicatorAxes &&\n row === layout.columnHeaderLevelCount - 1 &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n const axisRange = getRange('top', col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 1, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col, row + 1);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col, row + 1, layout._table));\n\n // range for top axis\n const { range, ticks, axisOption, targetTicks, targetRange, index, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for bottom axis\n // const subAxisRange = getRange(\n // 'bottom',\n // col,\n // row + 1,\n // col,\n // layout.columnHeaderLevelCount - 1,\n // col,\n // row,\n // 0,\n // layout\n // );\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 顶部副指标轴\n return merge(\n {\n range: range\n },\n axisOption,\n {\n orient: 'top',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row).slice(0, 2);\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n let indicatorInfo = null;\n indicatorKeys?.forEach(key => {\n const info = layout.getIndicatorInfo(key);\n if (info) {\n indicatorInfo = info;\n }\n });\n\n const axisRange = getRange('bottom', col, row - 1, col, row, col, row, 0, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col, row - 1);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));\n\n // range for bottom axis\n const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for top axis\n // const subAxisRange = getRange('top', col, row - 1, col, row, col, row, 1, layout);\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 底侧指标轴\n return merge(\n {\n title: {\n visible: true,\n text: (indicatorInfo as any)?.title\n // autoRotate: true\n },\n range\n },\n axisOption,\n {\n orient: 'bottom',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row);\n if (isArray(rowDimensionKey)) {\n rowDimensionKey = rowDimensionKey[0];\n }\n const data = layout.dataset.collectedValues[rowDimensionKey] ?? ([] as string[]);\n\n const rowPath = layout.getRowKeysPath(col, row);\n const domain = ((data as any)[rowPath ?? ''] as Array<string>) ?? [];\n\n const { axisOption, theme, chartType } = getAxisOption(col + 1, row, 'left', layout);\n if (axisOption?.visible === false) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col + 1, row);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));\n\n const spec = layout.getRawChartSpec(col + 1, row);\n // 左侧维度轴\n return merge(\n {\n // domain: chartType === 'scatter' ? undefined : Array.from(domain),\n domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),\n // range: chartType === 'scatter' ? domain : undefined,\n range: axisOption?.type === 'linear' ? domain : undefined,\n title: {\n autoRotate: true\n }\n },\n axisOption,\n {\n orient: 'left',\n // type: chartType === 'scatter' ? axisOption?.type ?? 'linear' : 'band',\n type: axisOption?.type ?? 'band',\n __vtableChartTheme: theme,\n // 默认左侧维度轴对应的图表direction 为 horizontal\n // 散点图特殊处理\n inverse: transformInverse(\n axisOption,\n (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === Direction.horizontal\n ),\n __vtablePadding: padding\n }\n );\n }\n } else {\n if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row).slice(0, 2);\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n let indicatorInfo = null;\n indicatorKeys?.forEach(key => {\n const info = layout.getIndicatorInfo(key);\n if (info) {\n indicatorInfo = info;\n }\n });\n\n const axisRange = getRange('left', col + 1, row, col, row, col, row, 0, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col + 1, row);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col + 1, row, layout._table));\n\n // range for left axis\n const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for right axis\n // const subAxisRange = getRange('right', col + 1, row, col, row, col, row, 1, layout);\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 左侧指标轴\n return merge(\n {\n title: {\n visible: true,\n text: (indicatorInfo as any)?.title,\n autoRotate: true\n },\n range: range\n },\n axisOption,\n {\n orient: 'left',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n col === layout.colCount - layout.rightFrozenColCount &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n const axisRange = getRange('right', col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 1, layout);\n if (!axisRange) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col - 1, row);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col - 1, row, layout._table));\n\n // range for right axis\n const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;\n\n // if (isZeroAlign) {\n // // range for left axis\n // const subAxisRange = getRange('left', col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 0, layout);\n\n // if (subAxisRange) {\n // const { range: subRange } = subAxisRange;\n\n // const align = getNewRangeToAlign(range, subRange);\n // if (align) {\n // range.min = align.range1[0];\n // range.max = align.range1[1];\n // }\n // }\n // }\n\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n if (range.min > 0) {\n axisOption.zero = false;\n }\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n if (range.max < 0) {\n axisOption.zero = false;\n }\n }\n\n // 右侧副指标轴\n return merge(\n {\n range: range,\n title: {\n autoRotate: true\n }\n },\n axisOption,\n {\n orient: 'right',\n type: axisOption?.type || 'linear',\n label: {\n flush: true\n },\n tick: {\n tickMode: getTickModeFunction(targetTicks, targetRange, range, index)\n },\n __ticksForVTable: ticks,\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n } else if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);\n\n let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount);\n if (isArray(columnDimensionKey)) {\n columnDimensionKey = columnDimensionKey[0];\n }\n const data = layout.dataset.collectedValues[columnDimensionKey] ?? ([] as string[]);\n\n const colPath = layout.getColKeysPath(col, row);\n const domain = ((data as any)?.[colPath ?? ''] as Array<string>) ?? [];\n\n const { axisOption, isPercent, theme, chartType } = getAxisOption(col, row - 1, 'bottom', layout);\n if (axisOption?.visible === false) {\n return;\n }\n\n const chartCellStyle = layout._table._getCellStyle(col, row - 1);\n const padding = getQuadProps(getProp('padding', chartCellStyle, col, row - 1, layout._table));\n\n // 底部维度轴\n return merge(\n {\n // domain: chartType === 'scatter' ? undefined : Array.from(domain),\n domain: axisOption?.type === 'linear' ? undefined : Array.from(domain),\n // range: chartType === 'scatter' ? domain : undefined\n range: axisOption?.type === 'linear' ? domain : undefined\n },\n axisOption,\n {\n orient: 'bottom',\n // type: chartType === 'scatter' ? axisOption?.type ?? 'linear' : 'band',\n type: axisOption?.type ?? 'band',\n __vtableChartTheme: theme,\n __vtablePadding: padding\n }\n );\n }\n }\n\n return undefined;\n}\n\nexport function getAxisOption(col: number, row: number, orient: string, layout: PivotHeaderLayoutMap) {\n const spec = layout.getRawChartSpec(col, row);\n const axes = spec.axes ?? [];\n (layout._table as PivotChart).pivotChartAxes.forEach(axis => {\n const index = axes.findIndex((a: any) => {\n return axis.orient === a.orient;\n });\n if (index === -1) {\n axes.push(axis);\n }\n });\n\n if (spec && isArray(axes)) {\n const axisOption = axes.find((axis: any) => {\n return axis.orient === orient;\n });\n if (axisOption) {\n const { seriesIndex, seriesId } = axisOption;\n let seriesIndice;\n let seriesSpec: any;\n if (isValid(seriesId) && isArray(spec.series)) {\n seriesIndice = (isArray(seriesId) ? seriesId : [seriesId]).map(id => {\n const index = spec.series.findIndex((s: any) => s.id === id);\n if (index >= 0) {\n seriesSpec = spec.series[index];\n }\n return index;\n });\n } else if (isValid(seriesIndex) && isArray(spec.series)) {\n seriesIndice = seriesIndex;\n }\n const { isZeroAlign, isTickAlign } = checkZeroAlign(spec, orient, layout);\n return {\n axisOption,\n isPercent: spec.percent,\n isZeroAlign,\n isTickAlign,\n seriesIndice,\n theme: spec.theme,\n chartType: seriesSpec?.type ?? spec.type\n };\n }\n }\n const axisOption = ((layout._table as PivotChart).pivotChartAxes as ITableAxisOption[]).find(axisOption => {\n return axisOption.orient === orient;\n });\n const { isZeroAlign, isTickAlign } = checkZeroAlign(spec, orient, layout);\n return {\n axisOption,\n isPercent: false,\n // isZeroAlign: checkZeroAlign(spec, orient, layout),\n isZeroAlign,\n isTickAlign,\n theme: spec.theme,\n chartType: spec.type\n };\n}\n\nfunction checkZeroAlign(spec: any, orient: string, layout: PivotHeaderLayoutMap) {\n // check condition:\n // 1. two axes and one set sync\n // 2. axisId in sync is another\n const orients: string[] = [];\n if (orient === 'left' || orient === 'right') {\n orients.push('left', 'right');\n } else if (orient === 'top' || orient === 'bottom') {\n orients.push('top', 'bottom');\n }\n // const spec = layout.getRawChartSpec(col, row);\n let axesSpec;\n if (spec && isArray(spec.axes)) {\n axesSpec = spec.axes;\n } else {\n axesSpec = (layout._table as PivotChart).pivotChartAxes as ITableAxisOption[];\n }\n\n let isZeroAlign = false;\n let isTickAlign = false;\n if (isArray(axesSpec)) {\n const axes: any[] = [];\n axesSpec.forEach((axis: any) => {\n if (orients.includes(axis.orient)) {\n axes.push(axis);\n }\n });\n for (let i = 0; i < axes.length; i++) {\n const axis = axes[i];\n if (\n axis.sync &&\n // axis.sync.zeroAlign &&\n axis.sync.axisId &&\n axes.find(axisSync => {\n return axisSync.id === axis.sync.axisId;\n })\n ) {\n // return true;\n isZeroAlign = isZeroAlign || axis.sync.zeroAlign;\n isTickAlign = isTickAlign || axis.sync.tickAlign;\n }\n }\n }\n\n // return false;\n return {\n isZeroAlign,\n isTickAlign\n };\n}\n\nexport function getAxisRange(\n collectedValues: Record<string, Record<string, CollectedValue>>,\n indicatorKeys: string[],\n isZeroAlign: boolean,\n colPath: string,\n seriesId: number | number[]\n): AxisRange | null {\n if (isArray(seriesId)) {\n const range = { min: Infinity, max: -Infinity };\n for (let i = 0; i < seriesId.length; i++) {\n const singleRange = getAxisRange(collectedValues, indicatorKeys, isZeroAlign, colPath, seriesId[i]);\n if (singleRange) {\n range.min = Math.min(range.min, singleRange.min);\n range.max = Math.max(range.max, singleRange.max);\n }\n }\n if (isFinite(range.min) && isFinite(range.max)) {\n return range;\n }\n return null;\n }\n let defaultKey = indicatorKeys?.[seriesId];\n if (isArray(defaultKey)) {\n defaultKey = defaultKey[0];\n }\n if (!defaultKey) {\n return null;\n }\n // const data = collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]\n // ? collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]\n // : collectedValues[defaultKey];\n const data = collectedValues[defaultKey];\n const range = merge({}, (data?.[colPath ?? ''] as { min: number; max: number }) ?? { min: 0, max: 1 });\n\n if (range.positiveMax && range.positiveMax > range.max) {\n range.max = range.positiveMax;\n }\n if (range.negativeMin && range.negativeMin < range.min) {\n range.min = range.negativeMin;\n }\n if (range.min === range.max) {\n if (range.min > 0) {\n range.min = 0;\n } else {\n range.max = 0;\n }\n }\n\n return range;\n}\n\nexport function isTopOrBottomAxis(col: number, row: number, layout: PivotHeaderLayoutMap): boolean {\n if (!layout._table.isPivotChart()) {\n return false;\n }\n\n if (layout.indicatorsAsCol) {\n if (\n layout.hasTwoIndicatorAxes &&\n row === layout.columnHeaderLevelCount - 1 &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // 顶部副指标轴\n return true;\n } else if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // 底侧指标轴\n return true;\n }\n } else {\n if (\n row === layout.rowCount - layout.bottomFrozenRowCount &&\n col >= layout.rowHeaderLevelCount &&\n col < layout.colCount - layout.rightFrozenColCount\n ) {\n // 底部维度轴\n return true;\n }\n }\n return false;\n}\n\nexport function isLeftOrRightAxis(col: number, row: number, layout: PivotHeaderLayoutMap): boolean {\n if (!layout._table.isPivotChart()) {\n return false;\n }\n\n if (layout.indicatorsAsCol) {\n if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // 左侧维度轴\n return true;\n }\n } else {\n if (\n col === layout.rowHeaderLevelCount - 1 &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // 左侧指标轴\n return true;\n } else if (\n col === layout.colCount - layout.rightFrozenColCount &&\n row >= layout.columnHeaderLevelCount &&\n row < layout.rowCount - layout.bottomFrozenRowCount\n ) {\n // 右侧副指标轴\n return true;\n }\n }\n return false;\n}\n\nconst enum Direction {\n vertical = 'vertical',\n horizontal = 'horizontal'\n}\n\n// align with vchart (packages/vchart/src/component/axis/cartesian/util/common.ts)\nfunction transformInverse(spec: any, isHorizontal: boolean) {\n // 这里处理下 direction === 'horizontal' 下的 Y 轴\n // 因为 Y 轴绘制的时候默认是从下至上绘制的,但是在 direction === 'horizontal' 场景下,图表应该是按照从上至下阅读的\n // 所以这里在这种场景下坐标轴会默认 inverse 已达到效果\n let inverse = spec?.inverse;\n if (isHorizontal && !isXAxis(spec?.orient)) {\n inverse = isValid(spec?.inverse) ? !spec?.inverse : true;\n }\n return inverse;\n}\n\ntype IOrientType = 'left' | 'top' | 'right' | 'bottom' | 'z';\nfunction isXAxis(orient: IOrientType) {\n return orient === 'bottom' || orient === 'top';\n}\n\nexport function hasLinearAxis(spec: any, tableAxesConfig: any, isHorizontal: boolean, isThisXAxis: boolean): boolean {\n if (!isArray(spec.axes) || spec.axes.length === 0) {\n return (isHorizontal && isThisXAxis) || (!isHorizontal && !isThisXAxis);\n }\n\n for (let i = 0; i < spec.axes.length; i++) {\n const axisSpec = spec.axes[i];\n if (!isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type === 'linear') {\n return true;\n }\n\n if (isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (!isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type === 'linear') {\n return true;\n }\n }\n\n if (isArray(tableAxesConfig) && tableAxesConfig.length > 0) {\n for (let i = 0; i < tableAxesConfig.length; i++) {\n const axisSpec = tableAxesConfig[i];\n if (!isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type === 'linear') {\n return true;\n }\n\n if (isHorizontal && isThisXAxis && axisSpec.orient === 'bottom' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (!isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type !== 'linear') {\n return true;\n }\n\n if (isHorizontal && !isThisXAxis && axisSpec.orient === 'left' && axisSpec.type === 'linear') {\n return true;\n }\n }\n }\n\n return (isHorizontal && isThisXAxis) || (!isHorizontal && !isThisXAxis);\n}\n\nfunction getRange(\n position: 'left' | 'right' | 'top' | 'bottom',\n colForAxisOption: number,\n rowForAxisOption: number,\n colForIndicatorKey: number,\n rowForIndicatorKey: number,\n col: number,\n row: number,\n defaultSeriesIndice: number,\n layout: PivotHeaderLayoutMap\n) {\n const indicatorKeys = layout.getIndicatorKeyInChartSpec(colForIndicatorKey, rowForIndicatorKey);\n let path;\n if (position === 'top' || position === 'bottom') {\n path = layout.getColKeysPath(col, row);\n } else {\n path = layout.getRowKeysPath(col, row);\n }\n\n const rangeConfig = getChartAxisRange(\n colForAxisOption,\n rowForAxisOption,\n defaultSeriesIndice,\n position,\n indicatorKeys,\n path,\n layout\n );\n\n if (!rangeConfig) {\n return undefined;\n }\n\n const subAxisPosition =\n position === 'bottom' ? 'top' : position === 'top' ? 'bottom' : position === 'left' ? 'right' : 'left';\n\n const { targetRange, targetTicks } = getTargetRangeAndTicks(\n colForAxisOption,\n rowForAxisOption,\n rangeConfig.index,\n rangeConfig.isZeroAlign,\n rangeConfig.isTickAlign,\n rangeConfig.range,\n indicatorKeys,\n subAxisPosition,\n path,\n layout\n );\n\n if (rangeConfig.index !== 0 && targetTicks) {\n // reset range\n const getAxisDomainRangeAndLabels = Factory.getFunction(\n 'getAxisDomainRangeAndLabels'\n ) as GetAxisDomainRangeAndLabels;\n const { range: newRange, ticks: newTicks } = getAxisDomainRangeAndLabels(\n rangeConfig.range.min,\n rangeConfig.range.max,\n // merge({}, rangeConfig.axisOption, { nice: true, tick: { forceTickCount: targetTicks.length } }),\n rangeConfig.axisOption,\n rangeConfig.isZeroAlign,\n // layout._table.getColWidth(col)\n position === 'bottom' || position === 'top'\n ? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth\n : layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight, // avoid 0, 0 causes NaN\n {\n targetTicks,\n targetRange\n }\n );\n rangeConfig.range.min = newRange[0];\n rangeConfig.range.max = newRange[1];\n rangeConfig.ticks = newTicks;\n }\n\n (rangeConfig as any).targetRange = targetRange;\n (rangeConfig as any).targetTicks = targetTicks;\n\n return rangeConfig as typeof rangeConfig & { targetRange: AxisRange; targetTicks: number[] };\n}\n\nfunction getChartAxisRange(\n col: number,\n row: number,\n index: number,\n position: 'bottom' | 'top' | 'left' | 'right',\n indicatorKeys: string[],\n path: string,\n layout: PivotHeaderLayoutMap\n) {\n const { axisOption, isPercent, isZeroAlign, isTickAlign, seriesIndice, theme, chartType } = getAxisOption(\n col,\n row,\n position,\n layout\n );\n\n // if (axisOption?.visible === false) {\n // return undefined;\n // }\n\n const range = getAxisRange(layout.dataset.collectedValues, indicatorKeys, isZeroAlign, path, seriesIndice ?? index);\n\n if (!range) {\n return undefined;\n }\n\n if (isPercent) {\n range.min = range.min < 0 ? -1 : 0;\n range.max = range.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 let ticks;\n if (axisOption?.nice || isTickAlign) {\n const getAxisDomainRangeAndLabels = Factory.getFunction(\n 'getAxisDomainRangeAndLabels'\n ) as GetAxisDomainRangeAndLabels;\n const { range: axisRange, ticks: selfTicks } = getAxisDomainRangeAndLabels(\n range.min,\n range.max,\n axisOption,\n isZeroAlign,\n // layout._table.getColWidth(col)\n position === 'bottom' || position === 'top'\n ? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth\n : layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight // avoid 0, 0 causes NaN\n );\n if (axisOption?.nice) {\n range.min = axisRange[0];\n range.max = axisRange[1];\n }\n // if (isTickAlign) {\n // }\n ticks = selfTicks;\n }\n if (isNumber(axisOption?.min)) {\n range.min = axisOption.min;\n }\n if (isNumber(axisOption?.max)) {\n range.max = axisOption.max;\n }\n\n return {\n index: seriesIndice ?? index,\n range,\n ticks,\n isZeroAlign,\n isTickAlign,\n axisOption,\n theme,\n chartType\n };\n}\n\nexport function getAxisRangeAndTicks(\n col: number,\n row: number,\n index: number,\n position: 'bottom' | 'top' | 'left' | 'right',\n subAxisPosition: 'bottom' | 'top' | 'left' | 'right',\n indicatorKeys: string[],\n path: string,\n layout: PivotHeaderLayoutMap\n) {\n const { range, isZeroAlign, isTickAlign, axisOption } = getChartAxisRange(\n col,\n row,\n index,\n position,\n indicatorKeys,\n path,\n layout\n );\n const { targetRange, targetTicks } = getTargetRangeAndTicks(\n col,\n row,\n index,\n isZeroAlign,\n isTickAlign,\n range,\n indicatorKeys,\n subAxisPosition,\n path,\n layout\n );\n\n if (index !== 0 && targetTicks) {\n // reset range\n const getAxisDomainRangeAndLabels = Factory.getFunction(\n 'getAxisDomainRangeAndLabels'\n ) as GetAxisDomainRangeAndLabels;\n const { range: newRange, ticks: newTicks } = getAxisDomainRangeAndLabels(\n range.min,\n range.max,\n merge({}, axisOption, { nice: true, tick: { forceTickCount: targetTicks.length } }),\n isZeroAlign,\n // layout._table.getColWidth(col)\n position === 'bottom' || position === 'top'\n ? layout._table.getColWidth(col) || layout._table.tableNoFrameWidth\n : layout._table.getRowHeight(row) || layout._table.tableNoFrameHeight, // avoid 0, 0 causes NaN\n {\n targetTicks,\n targetRange\n }\n );\n range.min = newRange[0];\n range.max = newRange[1];\n // axisOption.ticks = newTicks;\n }\n\n return {\n axisOption,\n range,\n targetTicks,\n targetRange\n };\n}\n\nfunction getTargetRangeAndTicks(\n col: number,\n row: number,\n index: number,\n isZeroAlign: boolean,\n isTickAlign: boolean,\n range: AxisRange,\n indicatorKeys: string[],\n subAxisPosition: 'bottom' | 'top' | 'left' | 'right',\n path: string,\n layout: PivotHeaderLayoutMap\n) {\n let targetTicks: number[];\n let targetRange: {\n max: number;\n min: number;\n };\n\n if (!isZeroAlign && !isTickAlign) {\n return {\n targetTicks,\n targetRange\n };\n }\n\n const subAxisRange = getChartAxisRange(\n col,\n row,\n indicatorKeys.length - 1 - index,\n subAxisPosition,\n indicatorKeys,\n path,\n layout\n );\n if (subAxisRange) {\n const { range: subRange, ticks: subTicks } = subAxisRange;\n targetRange = subRange;\n if (isZeroAlign) {\n const align = getNewRangeToAlign(range, subRange);\n if (align) {\n range.min = align.range1[0];\n range.max = align.range1[1];\n targetRange.min = align.range2[0];\n targetRange.max = align.range2[1];\n }\n }\n if (isTickAlign) {\n if (!isZeroAlign) {\n targetTicks = subTicks;\n } else {\n targetTicks = getZeroAlignTickAlignTicks(targetRange, col, row, index, subAxisPosition, layout);\n }\n }\n }\n\n return {\n targetTicks,\n targetRange\n };\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import { THEME_CONSTANTS } from "../../components/axis/get-axis-attributes";
|
|
|
7
7
|
const DEFAULT_CONTINUOUS_TICK_COUNT = 5;
|
|
8
8
|
|
|
9
9
|
export function getAxisDomainRangeAndLabels(min, max, axisOption, isZeroAlign, axisLength, target) {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
11
11
|
if ((null == axisOption ? void 0 : axisOption.zero) && (min = Math.min(min, 0),
|
|
12
12
|
max = Math.max(max, 0)), null == axisOption ? void 0 : axisOption.expand) {
|
|
13
13
|
const domainMin = min, domainMax = max;
|
|
@@ -30,8 +30,8 @@ export function getAxisDomainRangeAndLabels(min, max, axisOption, isZeroAlign, a
|
|
|
30
30
|
})), "accurateFirst" === axisOption.niceType && (tickCount = Math.max(10, tickCount)),
|
|
31
31
|
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);
|
|
32
32
|
}
|
|
33
|
-
return delete scale._niceType, scaleTicks = (null !== (_k = null === (_j = null == target ? void 0 : target.targetTicks) || void 0 === _j ? void 0 : _j.length) && void 0 !== _k ? _k : null === (_l = null == axisOption ? void 0 : axisOption.tick) || void 0 === _l ? void 0 : _l.forceTickCount) ? scale.forceTicks(null !== (_o = null === (_m = null == target ? void 0 : target.targetTicks) || void 0 === _m ? void 0 : _m.length) && void 0 !== _o ? _o : null === (_p = null == axisOption ? void 0 : axisOption.tick) || void 0 === _p ? void 0 : _p.forceTickCount) : scale.ticks(
|
|
34
|
-
noDecimals: null === (
|
|
33
|
+
return delete scale._niceType, scaleTicks = (null !== (_k = null === (_j = null == target ? void 0 : target.targetTicks) || void 0 === _j ? void 0 : _j.length) && void 0 !== _k ? _k : null === (_l = null == axisOption ? void 0 : axisOption.tick) || void 0 === _l ? void 0 : _l.forceTickCount) ? scale.forceTicks(null !== (_o = null === (_m = null == target ? void 0 : target.targetTicks) || void 0 === _m ? void 0 : _m.length) && void 0 !== _o ? _o : null === (_p = null == axisOption ? void 0 : axisOption.tick) || void 0 === _p ? void 0 : _p.forceTickCount) : scale.ticks(isNumber(null === (_q = null == axisOption ? void 0 : axisOption.tick) || void 0 === _q ? void 0 : _q.tickCount) ? axisOption.tick.tickCount : 5, {
|
|
34
|
+
noDecimals: null === (_r = null == axisOption ? void 0 : axisOption.tick) || void 0 === _r ? void 0 : _r.noDecimals
|
|
35
35
|
}), {
|
|
36
36
|
range: scale.domain(),
|
|
37
37
|
ticks: scaleTicks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layout/chart-helper/get-axis-domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAE5E,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAQxC,MAAM,UAAU,2BAA2B,CACzC,GAAW,EACX,GAAW,EACX,UAAe,EACf,WAAoB,EACpB,UAAkB,EAElB,MAGC;;IAED,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,EAAE;QACpB,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACvB,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC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,CAAC,GAAG,CAAC,EAAE;YAC3D,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAC1B;KACF;IAED,OAAQ,KAAa,CAAC,SAAS,CAAC;IAChC,IAAI,UAAU,CAAC;IAEf,IAAI,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,0CAAE,MAAM,mCAAI,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,0CAAE,cAAc,EAAE;QACnE,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,0CAAE,MAAM,mCAAI,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,0CAAE,cAAc,CAAC,CAAC;KAChG;SAAM;QACL,UAAU,GAAG,KAAK,CAAC,KAAK,CACtB,QAAQ,CAAC,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,0CAAE,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,6BAA6B,EACjG;YACE,UAAU,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,0CAAE,UAAU;SACzC,CACF,CAAC;KACH;IAED,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;QACrB,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,KAAkB,EAClB,MAGC;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AAG3C,CAAC","file":"get-axis-domain.js","sourcesContent":["import { LinearScale, LogScale, SymlogScale } from '@visactor/vscale';\nimport { isFunction, isNil, isNumber, isValid } from '@visactor/vutils';\nimport { THEME_CONSTANTS } from '../../components/axis/get-axis-attributes';\n\nconst DEFAULT_CONTINUOUS_TICK_COUNT = 5;\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(\n min: number,\n max: number,\n axisOption: any,\n isZeroAlign: boolean,\n axisLength: number,\n // skipTick?: boolean,\n target?: {\n targetTicks: number[];\n targetRange: { min: number; max: number };\n }\n) {\n if (axisOption?.zero) {\n min = Math.min(min, 0);\n max = Math.max(max, 0);\n }\n if (axisOption?.expand) {\n const domainMin = min;\n const domainMax = max;\n if (isValid(axisOption.expand.min)) {\n min = domainMin - (domainMax - domainMin) * axisOption.expand.min;\n }\n if (isValid(axisOption.expand.max)) {\n max = domainMax + (domainMax - domainMin) * axisOption.expand.max;\n }\n }\n if (isNumber(axisOption?.min)) {\n min = axisOption.min;\n }\n if (isNumber(axisOption?.max)) {\n max = axisOption.max;\n }\n\n let scale;\n if (axisOption?.type === 'log') {\n scale = new LogScale();\n scale.base(axisOption?.base ?? 10);\n } else if (axisOption?.type === 'symlog') {\n scale = new SymlogScale();\n scale.constant(axisOption?.constant ?? 10);\n } else {\n scale = new LinearScale();\n }\n scale.domain([min, max], !!axisOption?.nice);\n\n if (target) {\n forceTickCountNice(scale as LinearScale, target);\n } else if (axisOption?.nice) {\n let tickCount = axisOption.tick?.forceTickCount ?? axisOption.tick?.tickCount ?? 10;\n if (isFunction(tickCount)) {\n tickCount = tickCount({\n axisLength,\n labelStyle: axisOption?.label?.style ?? {\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE\n }\n });\n }\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 delete (scale as any)._niceType; // ensure scaleTicks consistent in `measurement`, `component label` and `chart`\n let scaleTicks;\n\n if (target?.targetTicks?.length ?? axisOption?.tick?.forceTickCount) {\n scaleTicks = scale.forceTicks(target?.targetTicks?.length ?? axisOption?.tick?.forceTickCount);\n } else {\n scaleTicks = scale.ticks(\n isNumber(axisOption?.tick?.tickCount) ? axisOption.tick.tickCount : DEFAULT_CONTINUOUS_TICK_COUNT,\n {\n noDecimals: axisOption?.tick?.noDecimals\n }\n );\n }\n\n return {\n range: scale.domain(),\n ticks: scaleTicks\n };\n}\n\nfunction forceTickCountNice(\n scale: LinearScale,\n target: {\n targetTicks: number[];\n targetRange: { min: number; max: number };\n }\n) {\n scale.niceMax(target.targetTicks.length);\n\n // to do: nice new ticks\n}\n\nexport type GetAxisDomainRangeAndLabels = typeof getAxisDomainRangeAndLabels;\n"]}
|
|
@@ -17,7 +17,7 @@ export declare class CustomCellStylePlugin {
|
|
|
17
17
|
col?: number;
|
|
18
18
|
row?: number;
|
|
19
19
|
range?: CellRange;
|
|
20
|
-
}, customStyleId: string | undefined | null): void;
|
|
20
|
+
}, customStyleId: string | undefined | null, forceFastUpdate?: boolean): void;
|
|
21
21
|
updateCustomCell(customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]): void;
|
|
22
22
|
hasCustomCellStyle(customStyleId: string): boolean;
|
|
23
23
|
}
|
|
@@ -41,7 +41,7 @@ export class CustomCellStylePlugin {
|
|
|
41
41
|
if (cellStyle.customStyleId === customStyleId) if (cellPos.range) for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) this.table.scenegraph.updateCellContent(col, row); else this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
|
|
42
42
|
})), this.table.scenegraph.updateNextFrame();
|
|
43
43
|
}
|
|
44
|
-
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
44
|
+
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
45
45
|
var _a;
|
|
46
46
|
const index = this.customCellStyleArrangement.findIndex((style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row));
|
|
47
47
|
if (-1 === index && !customStyleId) return;
|
|
@@ -57,7 +57,6 @@ export class CustomCellStylePlugin {
|
|
|
57
57
|
customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
|
|
58
58
|
}
|
|
59
59
|
const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
|
|
60
|
-
let forceFastUpdate;
|
|
61
60
|
if (style) {
|
|
62
61
|
forceFastUpdate = !0;
|
|
63
62
|
for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/custom-cell-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EACL,aAAa,EAKd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAU1C,MAAM,OAAO,qBAAqB;IAKhC,YACE,KAAmB,EACnB,eAAkC,EAClC,0BAAwD;QAExD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC/D,CAAC;IAED,kBAAkB,CAAC,GAAW,EAAE,GAAW;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG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ACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,OAAO,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,CAAC,CAAC","file":"custom-cell-style.js","sourcesContent":["import { isValid, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport {\n cellStyleKeys,\n type CellRange,\n type ColumnStyleOption,\n type CustomCellStyle,\n type CustomCellStyleArrangement\n} from '../ts-types';\nimport type { Style } from '../body-helper/style';\nimport { Factory } from '../core/factory';\n\nexport interface ICustomCellStylePlugin {\n new (\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ): CustomCellStylePlugin;\n}\n\nexport class CustomCellStylePlugin {\n table: BaseTableAPI;\n customCellStyle: CustomCellStyle[];\n customCellStyleArrangement: CustomCellStyleArrangement[];\n\n constructor(\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ) {\n this.table = table;\n this.customCellStyle = customCellStyle;\n this.customCellStyleArrangement = customCellStyleArrangement;\n }\n\n getCustomCellStyle(col: number, row: number) {\n const customStyleIds = this.getCustomCellStyleIds(col, row);\n if (customStyleIds.length) {\n const styles: ColumnStyleOption[] = [];\n\n customStyleIds.forEach(customStyleId => {\n const styleOption = this.getCustomCellStyleOption(customStyleId);\n if (styleOption?.style) {\n styles.push(styleOption.style);\n }\n });\n\n return merge({}, ...styles);\n // const styleOption = this.getCustomCellStyleOption(customStyleId);\n // return styleOption?.style;\n }\n return undefined;\n }\n\n getCustomCellStyleIds(col: number, row: number) {\n // let customStyleId;\n const customStyleIds: string[] = [];\n\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n // eslint-disable-next-line no-loop-func\n this.customCellStyleArrangement.forEach(style => {\n if (style.cellPosition.range) {\n if (\n style.cellPosition.range.start.col <= c &&\n style.cellPosition.range.end.col >= c &&\n style.cellPosition.range.start.row <= r &&\n style.cellPosition.range.end.row >= r\n ) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n } else if (style.cellPosition.col === c && style.cellPosition.row === r) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n });\n }\n }\n\n return customStyleIds;\n }\n\n getCustomCellStyleOption(customStyleId: string) {\n return this.customCellStyle.find(style => style.id === customStyleId);\n }\n\n registerCustomCellStyle(customStyleId: string, customStyle: ColumnStyleOption | undefined | null) {\n const index = this.customCellStyle.findIndex(style => style.id === customStyleId);\n if (index === -1) {\n this.customCellStyle.push({\n id: customStyleId,\n style: customStyle\n });\n } else {\n this.customCellStyle[index] = {\n id: customStyleId,\n style: customStyle\n };\n }\n\n this.customCellStyleArrangement.forEach(cellStyle => {\n const cellPos = cellStyle.cellPosition;\n if (cellStyle.customStyleId === customStyleId) {\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);\n }\n }\n });\n this.table.scenegraph.updateNextFrame();\n }\n\n arrangeCustomCellStyle(\n cellPos: {\n col?: number;\n row?: number;\n range?: CellRange;\n },\n customStyleId: string | undefined | null\n ) {\n const index = this.customCellStyleArrangement.findIndex(style => {\n if (style.cellPosition.range && cellPos.range) {\n return (\n style.cellPosition.range.start.col === cellPos.range.start.col &&\n style.cellPosition.range.start.row === cellPos.range.start.row &&\n style.cellPosition.range.end.col === cellPos.range.end.col &&\n style.cellPosition.range.end.row === cellPos.range.end.row\n );\n }\n return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;\n });\n\n if (index === -1 && !customStyleId) {\n // do nothing\n return;\n } else if (index === -1 && customStyleId) {\n // add new style\n this.customCellStyleArrangement.push({\n cellPosition: {\n col: cellPos.col,\n row: cellPos.row,\n range: cellPos.range\n },\n customStyleId: customStyleId\n });\n } else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {\n // same style\n return;\n } else if (customStyleId) {\n // update style\n this.customCellStyleArrangement[index].customStyleId = customStyleId;\n } else {\n // delete useless style\n this.customCellStyleArrangement.splice(index, 1);\n }\n\n const style = this.getCustomCellStyleOption(customStyleId)?.style;\n let forceFastUpdate;\n if (style) {\n forceFastUpdate = true;\n for (const key in style) {\n if (cellStyleKeys.indexOf(key) === -1) {\n forceFastUpdate = false;\n break;\n }\n }\n }\n\n // update cell group\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n this.table.scenegraph.updateCellContent(c, r, forceFastUpdate);\n }\n }\n // this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row, forceFastUpdate);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateCustomCell(customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]) {\n this.customCellStyle.length = 0;\n this.customCellStyleArrangement.length = 0;\n customCellStyle.forEach((cellStyle: CustomCellStyle) => {\n this.registerCustomCellStyle(cellStyle.id, cellStyle.style);\n });\n customCellStyleArrangement.forEach((cellStyle: CustomCellStyleArrangement) => {\n this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);\n });\n }\n\n hasCustomCellStyle(customStyleId: string) {\n return this.customCellStyle.some(style => style.id === customStyleId);\n }\n}\n\nexport function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption): Style {\n cacheStyle = cacheStyle.clone();\n\n for (const key in customCellStyle) {\n const value = (customCellStyle as any)[key];\n if (isValid(value)) {\n (cacheStyle as any)[`_${key}`] = value;\n }\n }\n\n return cacheStyle;\n}\n\nexport const registerCustomCellStylePlugin = () => {\n Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin);\n};\n\n// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugins/custom-cell-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EACL,aAAa,EAKd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAU1C,MAAM,OAAO,qBAAqB;IAKhC,YACE,KAAmB,EACnB,eAAkC,EAClC,0BAAwD;QAExD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC/D,CAAC;IAED,kBAAkB,CAAC,GAAW,EAAE,GAAW;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC5D,IAAI,cAAc,CAAC,MAAM,EAAE;YACzB,MAAM,MAAM,GAAwB,EAAE,CAAC;YAEvC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;gBACrC,MAAM,WAAW,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;gBACjE,IAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,EAAE;oBACtB,MAAM,CAAC,IAAI,C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AC3G,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3C,eAAe,CAAC,OAAO,CAAC,CAAC,SAA0B,EAAE,EAAE;YACrD,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;QACH,0BAA0B,CAAC,OAAO,CAAC,CAAC,SAAqC,EAAE,EAAE;YAC3E,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,aAAqB;QACtC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC;IACxE,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,UAAiB,EAAE,eAAkC;IAC9E,UAAU,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IAEhC,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;QACjC,MAAM,KAAK,GAAI,eAAuB,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;YACjB,UAAkB,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;SACxC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,OAAO,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,CAAC,CAAC","file":"custom-cell-style.js","sourcesContent":["import { isValid, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport {\n cellStyleKeys,\n type CellRange,\n type ColumnStyleOption,\n type CustomCellStyle,\n type CustomCellStyleArrangement\n} from '../ts-types';\nimport type { Style } from '../body-helper/style';\nimport { Factory } from '../core/factory';\n\nexport interface ICustomCellStylePlugin {\n new (\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ): CustomCellStylePlugin;\n}\n\nexport class CustomCellStylePlugin {\n table: BaseTableAPI;\n customCellStyle: CustomCellStyle[];\n customCellStyleArrangement: CustomCellStyleArrangement[];\n\n constructor(\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ) {\n this.table = table;\n this.customCellStyle = customCellStyle;\n this.customCellStyleArrangement = customCellStyleArrangement;\n }\n\n getCustomCellStyle(col: number, row: number) {\n const customStyleIds = this.getCustomCellStyleIds(col, row);\n if (customStyleIds.length) {\n const styles: ColumnStyleOption[] = [];\n\n customStyleIds.forEach(customStyleId => {\n const styleOption = this.getCustomCellStyleOption(customStyleId);\n if (styleOption?.style) {\n styles.push(styleOption.style);\n }\n });\n\n return merge({}, ...styles);\n // const styleOption = this.getCustomCellStyleOption(customStyleId);\n // return styleOption?.style;\n }\n return undefined;\n }\n\n getCustomCellStyleIds(col: number, row: number) {\n // let customStyleId;\n const customStyleIds: string[] = [];\n\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n // eslint-disable-next-line no-loop-func\n this.customCellStyleArrangement.forEach(style => {\n if (style.cellPosition.range) {\n if (\n style.cellPosition.range.start.col <= c &&\n style.cellPosition.range.end.col >= c &&\n style.cellPosition.range.start.row <= r &&\n style.cellPosition.range.end.row >= r\n ) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n } else if (style.cellPosition.col === c && style.cellPosition.row === r) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n });\n }\n }\n\n return customStyleIds;\n }\n\n getCustomCellStyleOption(customStyleId: string) {\n return this.customCellStyle.find(style => style.id === customStyleId);\n }\n\n registerCustomCellStyle(customStyleId: string, customStyle: ColumnStyleOption | undefined | null) {\n const index = this.customCellStyle.findIndex(style => style.id === customStyleId);\n if (index === -1) {\n this.customCellStyle.push({\n id: customStyleId,\n style: customStyle\n });\n } else {\n this.customCellStyle[index] = {\n id: customStyleId,\n style: customStyle\n };\n }\n\n this.customCellStyleArrangement.forEach(cellStyle => {\n const cellPos = cellStyle.cellPosition;\n if (cellStyle.customStyleId === customStyleId) {\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);\n }\n }\n });\n this.table.scenegraph.updateNextFrame();\n }\n\n arrangeCustomCellStyle(\n cellPos: {\n col?: number;\n row?: number;\n range?: CellRange;\n },\n customStyleId: string | undefined | null,\n forceFastUpdate?: boolean\n ) {\n const index = this.customCellStyleArrangement.findIndex(style => {\n if (style.cellPosition.range && cellPos.range) {\n return (\n style.cellPosition.range.start.col === cellPos.range.start.col &&\n style.cellPosition.range.start.row === cellPos.range.start.row &&\n style.cellPosition.range.end.col === cellPos.range.end.col &&\n style.cellPosition.range.end.row === cellPos.range.end.row\n );\n }\n return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;\n });\n\n if (index === -1 && !customStyleId) {\n // do nothing\n return;\n } else if (index === -1 && customStyleId) {\n // add new style\n this.customCellStyleArrangement.push({\n cellPosition: {\n col: cellPos.col,\n row: cellPos.row,\n range: cellPos.range\n },\n customStyleId: customStyleId\n });\n } else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {\n // same style\n return;\n } else if (customStyleId) {\n // update style\n this.customCellStyleArrangement[index].customStyleId = customStyleId;\n } else {\n // delete useless style\n this.customCellStyleArrangement.splice(index, 1);\n }\n\n const style = this.getCustomCellStyleOption(customStyleId)?.style;\n // let forceFastUpdate;\n if (style) {\n forceFastUpdate = true;\n for (const key in style) {\n if (cellStyleKeys.indexOf(key) === -1) {\n forceFastUpdate = false;\n break;\n }\n }\n }\n\n // update cell group\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n this.table.scenegraph.updateCellContent(c, r, forceFastUpdate);\n }\n }\n // this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row, forceFastUpdate);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateCustomCell(customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]) {\n this.customCellStyle.length = 0;\n this.customCellStyleArrangement.length = 0;\n customCellStyle.forEach((cellStyle: CustomCellStyle) => {\n this.registerCustomCellStyle(cellStyle.id, cellStyle.style);\n });\n customCellStyleArrangement.forEach((cellStyle: CustomCellStyleArrangement) => {\n this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);\n });\n }\n\n hasCustomCellStyle(customStyleId: string) {\n return this.customCellStyle.some(style => style.id === customStyleId);\n }\n}\n\nexport function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption): Style {\n cacheStyle = cacheStyle.clone();\n\n for (const key in customCellStyle) {\n const value = (customCellStyle as any)[key];\n if (isValid(value)) {\n (cacheStyle as any)[`_${key}`] = value;\n }\n }\n\n return cacheStyle;\n}\n\nexport const registerCustomCellStylePlugin = () => {\n Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin);\n};\n\n// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin;\n"]}
|
|
@@ -56,14 +56,15 @@ export function initCheckedState(records, state) {
|
|
|
56
56
|
state._checkboxCellTypeFields.push(`_vtable_rowSeries_number_${i}`);
|
|
57
57
|
isNeedInitHeaderCheckedStateFromRecord = !0;
|
|
58
58
|
}
|
|
59
|
-
isNeedInitHeaderCheckedStateFromRecord && initRecordCheckState(state);
|
|
59
|
+
isNeedInitHeaderCheckedStateFromRecord && initRecordCheckState(records, state);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export function updateHeaderCheckedState(field, state, col, row) {
|
|
63
63
|
let allChecked = !0, allUnChecked = !0, hasChecked = !1;
|
|
64
64
|
return state.checkedState.forEach(((check_state, index) => {
|
|
65
|
+
var _a;
|
|
65
66
|
index = index.includes(",") ? index.split(",").map((item => Number(item))) : Number(index);
|
|
66
|
-
const tableIndex = state.table.getTableIndexByRecordIndex(index), mergeCell = state.table.transpose ? state.table.getCustomMerge(tableIndex, row) : state.table.getCustomMerge(col, tableIndex), data = state.table.dataSource.get(index);
|
|
67
|
+
const tableIndex = state.table.getTableIndexByRecordIndex(index), mergeCell = state.table.transpose ? state.table.getCustomMerge(tableIndex, row) : state.table.getCustomMerge(col, tableIndex), data = null === (_a = state.table.dataSource) || void 0 === _a ? void 0 : _a.get(index);
|
|
67
68
|
mergeCell || data.vtableMerge || (!0 !== (null == check_state ? void 0 : check_state[field]) ? allChecked = !1 : (allUnChecked = !1,
|
|
68
69
|
hasChecked = !0));
|
|
69
70
|
})), allChecked ? (state.headerCheckedState[field] = !0, allChecked) : allUnChecked ? (state.headerCheckedState[field] = !1,
|
|
@@ -149,12 +150,12 @@ export function getGroupCheckboxState(table) {
|
|
|
149
150
|
})), result;
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
function initRecordCheckState(state) {
|
|
153
|
-
const table = state.table, start = table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount, end = table.internalProps.transpose ? table.colCount : table.rowCount;
|
|
153
|
+
function initRecordCheckState(records, state) {
|
|
154
|
+
const table = state.table, start = table.isPivotTable() ? 0 : table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount, end = table.isPivotTable() ? isArray(records) ? records.length : 0 : table.internalProps.transpose ? table.colCount : table.rowCount;
|
|
154
155
|
for (let index = 0; index + start < end; index++) {
|
|
155
|
-
const record = table.dataSource.get(index);
|
|
156
|
+
const record = table.isPivotTable() ? records[index] : table.dataSource.get(index);
|
|
156
157
|
state._checkboxCellTypeFields.forEach((field => {
|
|
157
|
-
const value = record[field];
|
|
158
|
+
const value = record && record[field];
|
|
158
159
|
let isChecked;
|
|
159
160
|
if (isObject(value) ? isChecked = value.checked : "boolean" == typeof value && (isChecked = value),
|
|
160
161
|
null == isChecked) {
|
|
@@ -170,7 +171,7 @@ function initRecordCheckState(state) {
|
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
const dataIndex = state.table.dataSource.getIndexKey(index).toString();
|
|
174
|
+
const dataIndex = table.isPivotTable() ? index.toString() : state.table.dataSource.getIndexKey(index).toString();
|
|
174
175
|
state.checkedState.get(dataIndex) || state.checkedState.set(dataIndex, {}), state.checkedState.get(dataIndex)[field] = isChecked;
|
|
175
176
|
}));
|
|
176
177
|
}
|