@visactor/vtable 0.25.4-alpha.0 → 0.25.4-alpha.2

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.
Files changed (33) hide show
  1. package/cjs/core/BaseTable.js +20 -4
  2. package/cjs/core/BaseTable.js.map +1 -1
  3. package/cjs/index.d.ts +1 -1
  4. package/cjs/index.js +1 -1
  5. package/cjs/index.js.map +1 -1
  6. package/cjs/layout/pivot-header-layout.d.ts +1 -0
  7. package/cjs/layout/pivot-header-layout.js +19 -3
  8. package/cjs/layout/pivot-header-layout.js.map +1 -1
  9. package/cjs/scenegraph/graphic/group.d.ts +1 -1
  10. package/cjs/scenegraph/graphic/group.js.map +1 -1
  11. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  12. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  13. package/cjs/scenegraph/group-creater/column-helper.js +1 -1
  14. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  15. package/cjs/vrender.js.map +1 -1
  16. package/dist/vtable.js +71 -7
  17. package/dist/vtable.min.js +2 -2
  18. package/es/core/BaseTable.js +20 -4
  19. package/es/core/BaseTable.js.map +1 -1
  20. package/es/index.d.ts +1 -1
  21. package/es/index.js +1 -1
  22. package/es/index.js.map +1 -1
  23. package/es/layout/pivot-header-layout.d.ts +1 -0
  24. package/es/layout/pivot-header-layout.js +19 -3
  25. package/es/layout/pivot-header-layout.js.map +1 -1
  26. package/es/scenegraph/graphic/group.d.ts +1 -1
  27. package/es/scenegraph/graphic/group.js.map +1 -1
  28. package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  29. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  30. package/es/scenegraph/group-creater/column-helper.js +1 -1
  31. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  32. package/es/vrender.js.map +1 -1
  33. package/package.json +4 -4
package/es/index.d.ts CHANGED
@@ -16,7 +16,7 @@ import { renderChart } from './scenegraph/graphic/contributions/chart-render-hel
16
16
  import { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';
17
17
  export { getDataCellPath } from './tools/get-data-path';
18
18
  export * from './render/jsx';
19
- export declare const version = "0.25.4-alpha.0";
19
+ export declare const version = "0.25.4-alpha.2";
20
20
  export { TYPES, core, ListTable, ListTableConstructorOptions, PivotTable, PivotTableConstructorOptions, PivotChartConstructorOptions, PivotChart, IHeaderTreeDefine, IDimension, IIndicator, ITitleDefine, ICornerDefine, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout, updateCell, renderChart, graphicUtil, setCustomAlphabetCharSet, restoreMeasureText };
21
21
  declare function getIcons(): {
22
22
  [key: string]: TYPES.ColumnIconOption;
package/es/index.js CHANGED
@@ -34,7 +34,7 @@ export { getDataCellPath } from "./tools/get-data-path";
34
34
 
35
35
  export * from "./render/jsx";
36
36
 
37
- export const version = "0.25.4-alpha.0";
37
+ export const version = "0.25.4-alpha.2";
38
38
 
39
39
  export { TYPES, core, ListTable, PivotTable, PivotChart, themes, data, getIcons, clearGlobal, register, DataStatistics, CustomLayout, updateCell, renderChart, graphicUtil, setCustomAlphabetCharSet, restoreMeasureText };
40
40
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC5D,kBAAkB,EAAE,CAAC;AAErB,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;AAsB3D,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,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,wDAAwD,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAK/F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAIxC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAiBV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,kBAAkB,EACnB,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 { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\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 IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\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\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.25.4-alpha.0\";\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 IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout,\n updateCell,\n renderChart,\n graphicUtil,\n setCustomAlphabetCharSet,\n restoreMeasureText\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"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC5D,kBAAkB,EAAE,CAAC;AAErB,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;AAsB3D,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,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,wDAAwD,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAK/F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAIxC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAiBV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,kBAAkB,EACnB,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 { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\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 IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\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\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.25.4-alpha.2\";\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 IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout,\n updateCell,\n renderChart,\n graphicUtil,\n setCustomAlphabetCharSet,\n restoreMeasureText\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"]}
@@ -226,4 +226,5 @@ export declare class PivotHeaderLayoutMap implements LayoutMapAPI {
226
226
  getSeriesNumberHeader(col: number, row: number): SeriesNumberColumnData;
227
227
  getSeriesNumberBody(col: number, row: number): SeriesNumberColumnData;
228
228
  changeTreeNodeTitle(col: number, row: number, value: string): void;
229
+ clearCellIds(): void;
229
230
  }
@@ -111,7 +111,8 @@ export class PivotHeaderLayoutMap {
111
111
  this._chartPaddingOuter = null !== (_g = isArray(bandAxisConfig.paddingOuter) ? bandAxisConfig.paddingOuter[0] : bandAxisConfig.paddingOuter) && void 0 !== _g ? _g : 0),
112
112
  this._chartItemSpanSize > 0 || (null === (_h = indicatorObject.chartSpec.series) || void 0 === _h || _h.find((seriesObject => (seriesObject.barWidth && "number" == typeof seriesObject.barWidth && (this._chartItemSpanSize = seriesObject.barWidth),
113
113
  this._chartItemSpanSize > 0))), !1);
114
- }))), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber), this.setColumnWidths();
114
+ }))), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber), this.setColumnWidths(),
115
+ this.clearCellIds();
115
116
  }
116
117
  handleRowSeriesNumber(rowSeriesNumber) {
117
118
  var _a;
@@ -499,7 +500,7 @@ export class PivotHeaderLayoutMap {
499
500
  return this.columnHeaderTitle && (count += 1), this._table.isPivotChart() && this.indicatorsAsCol && !this.hasTwoIndicatorAxes && checkHasCartesianChart(this) && (count -= 1),
500
501
  void (this.columnHeaderLevelCount = count);
501
502
  }
502
- this.columnHeaderLevelCount = 0;
503
+ this.columnHeaderLevelCount = this.indicatorsAsCol ? this.hideIndicatorName ? 0 : 1 : 0;
503
504
  }
504
505
  resetRowHeaderLevelCount() {
505
506
  var _a, _b;
@@ -1365,7 +1366,7 @@ export class PivotHeaderLayoutMap {
1365
1366
  this.rowDimensionTree = new DimensionTree(null !== (_b = this.rowTree) && void 0 !== _b ? _b : [], this.sharedVar, this.rowHierarchyType, "tree" === this.rowHierarchyType ? this.rowExpandLevel : void 0),
1366
1367
  this._generateColHeaderIds(), this.colIndex = 0, this._generateRowHeaderIds(), this.resetColumnHeaderLevelCount(),
1367
1368
  this._rowHeaderCellIds_FULL = transpose(this._rowHeaderCellIds_FULL), this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e,
1368
- o)), {}), this.setPagination(this.pagination);
1369
+ o)), {}), this.setPagination(this.pagination), this.clearCellIds();
1369
1370
  }
1370
1371
  isSeriesNumberInHeader(col, row) {
1371
1372
  return this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount && row < this.headerLevelCount || this.rightRowSeriesNumberColumnCount > 0 && row >= 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount && row < this.headerLevelCount;
@@ -1394,6 +1395,21 @@ export class PivotHeaderLayoutMap {
1394
1395
  const id = this.getCellId(col, row);
1395
1396
  this._headerObjectMap[id].title = value;
1396
1397
  }
1398
+ clearCellIds() {
1399
+ if (!this.showColumnHeader) if (this.indicatorsAsCol && !this.hideIndicatorName) {
1400
+ const indicatorIndex = this.colDimensionKeys.indexOf(IndicatorDimensionKeyPlaceholder);
1401
+ this._columnHeaderCellIds = this._columnHeaderCellIds.splice(indicatorIndex, 1);
1402
+ } else this._columnHeaderCellIds.splice(0, this._columnHeaderCellIds.length);
1403
+ if (!this.showRowHeader) if (this.indicatorsAsCol || this.hideIndicatorName) this._rowHeaderCellIds_FULL.forEach((cellIds => {
1404
+ cellIds.splice(0, cellIds.length);
1405
+ })); else {
1406
+ const indicatorIndex = this.rowDimensionKeys.indexOf(IndicatorDimensionKeyPlaceholder);
1407
+ this._rowHeaderCellIds_FULL.forEach((cellIds => {
1408
+ const indicator = cellIds.splice(indicatorIndex, 1);
1409
+ cellIds.splice(0, cellIds.length), cellIds.push(indicator[0]);
1410
+ }));
1411
+ }
1412
+ }
1397
1413
  }
1398
1414
 
1399
1415
  function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {