@visactor/vtable 0.13.4-alpha.0 → 0.13.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.
- package/cjs/components/axis/get-axis-attributes.d.ts +7 -0
- package/cjs/components/axis/get-axis-attributes.js +13 -17
- package/cjs/components/axis/get-axis-attributes.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/event.d.ts +1 -1
- package/cjs/event/event.js +4 -5
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +5 -8
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +1 -2
- package/cjs/event/sparkline-event.js +2 -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 -5
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.js +17 -7
- package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +3 -3
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +2 -4
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/tools/LimitPromiseQueue.js +1 -1
- package/cjs/tools/NumberMap.js +1 -1
- package/cjs/tools/Rect.js +1 -1
- package/cjs/ts-types/base-table.js +1 -1
- package/cjs/ts-types/common.js +1 -1
- package/cjs/ts-types/customElement.js +1 -1
- package/dist/vtable.js +34 -29
- package/dist/vtable.min.js +2 -2
- package/es/components/axis/get-axis-attributes.d.ts +7 -0
- package/es/components/axis/get-axis-attributes.js +1 -1
- package/es/components/axis/get-axis-attributes.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/event.d.ts +1 -1
- package/es/event/event.js +4 -5
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +5 -8
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +1 -2
- package/es/event/sparkline-event.js +2 -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 +7 -5
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/es/layout/chart-helper/get-axis-domain.js +19 -7
- package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +3 -3
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +2 -4
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/tools/LimitPromiseQueue.js +1 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/Rect.js +1 -1
- package/es/ts-types/base-table.js +1 -1
- package/es/ts-types/common.js +1 -1
- package/es/ts-types/customElement.js +1 -1
- package/package.json +3 -3
package/dist/vtable.js
CHANGED
|
@@ -40385,11 +40385,21 @@
|
|
|
40385
40385
|
}
|
|
40386
40386
|
|
|
40387
40387
|
const DEFAULT_CONTINUOUS_TICK_COUNT = 5;
|
|
40388
|
-
function getAxisDomainRangeAndLabels(min, max, axisOption, isZeroAlign, skipTick) {
|
|
40388
|
+
function getAxisDomainRangeAndLabels(min, max, axisOption, isZeroAlign, axisLength, skipTick) {
|
|
40389
40389
|
if (axisOption?.zero) {
|
|
40390
40390
|
min = Math.min(min, 0);
|
|
40391
40391
|
max = Math.max(max, 0);
|
|
40392
40392
|
}
|
|
40393
|
+
if (axisOption?.expand) {
|
|
40394
|
+
const domainMin = min;
|
|
40395
|
+
const domainMax = max;
|
|
40396
|
+
if (isValid$6(axisOption.expand.min)) {
|
|
40397
|
+
min = domainMin - (domainMax - domainMin) * axisOption.expand.min;
|
|
40398
|
+
}
|
|
40399
|
+
if (isValid$6(axisOption.expand.max)) {
|
|
40400
|
+
max = domainMax + (domainMax - domainMin) * axisOption.expand.max;
|
|
40401
|
+
}
|
|
40402
|
+
}
|
|
40393
40403
|
if (isNumber$6(axisOption?.min)) {
|
|
40394
40404
|
min = axisOption.min;
|
|
40395
40405
|
}
|
|
@@ -40411,6 +40421,14 @@
|
|
|
40411
40421
|
scale.domain([min, max], !!axisOption?.nice);
|
|
40412
40422
|
if (axisOption?.nice && !isZeroAlign) {
|
|
40413
40423
|
let tickCount = axisOption.tick?.forceTickCount ?? axisOption.tick?.tickCount ?? 10;
|
|
40424
|
+
if (isFunction$1(tickCount)) {
|
|
40425
|
+
tickCount = tickCount({
|
|
40426
|
+
axisLength,
|
|
40427
|
+
labelStyle: axisOption?.label?.style ?? {
|
|
40428
|
+
fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE
|
|
40429
|
+
}
|
|
40430
|
+
});
|
|
40431
|
+
}
|
|
40414
40432
|
if (axisOption.niceType === 'accurateFirst') {
|
|
40415
40433
|
tickCount = Math.max(10, tickCount);
|
|
40416
40434
|
}
|
|
@@ -40441,6 +40459,7 @@
|
|
|
40441
40459
|
if (!layout._table.isPivotChart()) {
|
|
40442
40460
|
return undefined;
|
|
40443
40461
|
}
|
|
40462
|
+
const table = layout._table;
|
|
40444
40463
|
if (layout.indicatorsAsCol) {
|
|
40445
40464
|
if (layout.hasTwoIndicatorAxes &&
|
|
40446
40465
|
row === layout.columnHeaderLevelCount - 1 &&
|
|
@@ -40460,7 +40479,7 @@
|
|
|
40460
40479
|
range.min = range.min < 0 ? -1 : 0;
|
|
40461
40480
|
range.max = range.max > 0 ? 1 : 0;
|
|
40462
40481
|
}
|
|
40463
|
-
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign);
|
|
40482
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, table.getColWidth(col));
|
|
40464
40483
|
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
40465
40484
|
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
40466
40485
|
if (isNumber$6(axisOption?.min)) {
|
|
@@ -40510,7 +40529,7 @@
|
|
|
40510
40529
|
range.min = range.min < 0 ? -1 : 0;
|
|
40511
40530
|
range.max = range.max > 0 ? 1 : 0;
|
|
40512
40531
|
}
|
|
40513
|
-
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign);
|
|
40532
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, table.getColWidth(col));
|
|
40514
40533
|
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
40515
40534
|
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
40516
40535
|
if (isNumber$6(axisOption?.min)) {
|
|
@@ -40590,7 +40609,7 @@
|
|
|
40590
40609
|
range.min = range.min < 0 ? -1 : 0;
|
|
40591
40610
|
range.max = range.max > 0 ? 1 : 0;
|
|
40592
40611
|
}
|
|
40593
|
-
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign);
|
|
40612
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, table.getRowHeight(row));
|
|
40594
40613
|
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
40595
40614
|
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
40596
40615
|
if (isNumber$6(axisOption?.min)) {
|
|
@@ -40638,7 +40657,7 @@
|
|
|
40638
40657
|
range.min = range.min < 0 ? -1 : 0;
|
|
40639
40658
|
range.max = range.max > 0 ? 1 : 0;
|
|
40640
40659
|
}
|
|
40641
|
-
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign);
|
|
40660
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, table.getRowHeight(row));
|
|
40642
40661
|
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
40643
40662
|
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
40644
40663
|
if (isNumber$6(axisOption?.min)) {
|
|
@@ -41412,9 +41431,6 @@
|
|
|
41412
41431
|
let rowStart = 0;
|
|
41413
41432
|
let rowEnd = 0;
|
|
41414
41433
|
if (row < scene.table.columnHeaderLevelCount) {
|
|
41415
|
-
scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);
|
|
41416
|
-
scene.rowHeaderGroup.setAttribute('y', scene.colHeaderGroup.attribute.y + detaY);
|
|
41417
|
-
scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);
|
|
41418
41434
|
rowStart = row + 1;
|
|
41419
41435
|
rowEnd = scene.table.columnHeaderLevelCount - 1;
|
|
41420
41436
|
}
|
|
@@ -50159,7 +50175,7 @@
|
|
|
50159
50175
|
eventManeger.dealColumnMover(eventArgsSet);
|
|
50160
50176
|
}
|
|
50161
50177
|
else {
|
|
50162
|
-
eventManeger.dealTableSelect(eventArgsSet
|
|
50178
|
+
eventManeger.dealTableSelect(eventArgsSet);
|
|
50163
50179
|
}
|
|
50164
50180
|
return;
|
|
50165
50181
|
}
|
|
@@ -50309,14 +50325,10 @@
|
|
|
50309
50325
|
}
|
|
50310
50326
|
}
|
|
50311
50327
|
else if (stateManeger.isSelecting()) {
|
|
50328
|
+
table.stateManeger.endSelectCells();
|
|
50312
50329
|
if (table.stateManeger.select?.ranges?.length) {
|
|
50313
50330
|
const lastCol = table.stateManeger.select.ranges[table.stateManeger.select.ranges.length - 1].end.col;
|
|
50314
50331
|
const lastRow = table.stateManeger.select.ranges[table.stateManeger.select.ranges.length - 1].end.row;
|
|
50315
|
-
table.fireListeners(TABLE_EVENT_TYPE.SELECTED_CELL, {
|
|
50316
|
-
ranges: table.stateManeger.select.ranges,
|
|
50317
|
-
col: lastCol,
|
|
50318
|
-
row: lastRow
|
|
50319
|
-
});
|
|
50320
50332
|
if (table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
|
|
50321
50333
|
const cellsEvent = {
|
|
50322
50334
|
event: e.nativeEvent,
|
|
@@ -50546,8 +50558,7 @@
|
|
|
50546
50558
|
const target = e.target;
|
|
50547
50559
|
if (target &&
|
|
50548
50560
|
!target.isDescendantsOf(table.scenegraph.tableGroup) &&
|
|
50549
|
-
target !== table.scenegraph.tableGroup
|
|
50550
|
-
target !== table.scenegraph.stage) {
|
|
50561
|
+
target !== table.scenegraph.tableGroup) {
|
|
50551
50562
|
stateManeger.updateInteractionState(InteractionState.default);
|
|
50552
50563
|
eventManeger.dealTableHover();
|
|
50553
50564
|
eventManeger.dealTableSelect();
|
|
@@ -51157,7 +51168,7 @@
|
|
|
51157
51168
|
}
|
|
51158
51169
|
dealMenuHover(eventArgsSet) {
|
|
51159
51170
|
}
|
|
51160
|
-
dealTableSelect(eventArgsSet
|
|
51171
|
+
dealTableSelect(eventArgsSet) {
|
|
51161
51172
|
if (!eventArgsSet) {
|
|
51162
51173
|
this.table.stateManeger.updateSelectPos(-1, -1);
|
|
51163
51174
|
return false;
|
|
@@ -51168,17 +51179,10 @@
|
|
|
51168
51179
|
return false;
|
|
51169
51180
|
}
|
|
51170
51181
|
const define = this.table.getBodyColumnDefine(eventArgs.col, eventArgs.row);
|
|
51171
|
-
if (this.table.isHeader(eventArgs.col, eventArgs.row) &&
|
|
51172
|
-
(define?.disableHeaderSelect || this.table.stateManeger.select?.disableHeader)) {
|
|
51173
|
-
if (!isSelectMoving) {
|
|
51174
|
-
this.table.stateManeger.updateSelectPos(-1, -1);
|
|
51175
|
-
}
|
|
51182
|
+
if (this.table.isHeader(eventArgs.col, eventArgs.row) && define?.disableHeaderSelect) {
|
|
51176
51183
|
return false;
|
|
51177
51184
|
}
|
|
51178
51185
|
else if (!this.table.isHeader(eventArgs.col, eventArgs.row) && define?.disableSelect) {
|
|
51179
|
-
if (!isSelectMoving) {
|
|
51180
|
-
this.table.stateManeger.updateSelectPos(-1, -1);
|
|
51181
|
-
}
|
|
51182
51186
|
return false;
|
|
51183
51187
|
}
|
|
51184
51188
|
if (this.table.isPivotChart() &&
|
|
@@ -54092,7 +54096,7 @@
|
|
|
54092
54096
|
return TABLE_EVENT_TYPE;
|
|
54093
54097
|
}
|
|
54094
54098
|
options;
|
|
54095
|
-
version = "0.13.4-alpha.
|
|
54099
|
+
version = "0.13.4-alpha.2";
|
|
54096
54100
|
pagination;
|
|
54097
54101
|
id = `VTable${Date.now()}`;
|
|
54098
54102
|
headerStyleCache;
|
|
@@ -56363,6 +56367,7 @@
|
|
|
56363
56367
|
}
|
|
56364
56368
|
function getChartAxes(col, row, layout) {
|
|
56365
56369
|
const axes = [];
|
|
56370
|
+
const table = layout._table;
|
|
56366
56371
|
if (layout.indicatorsAsCol) {
|
|
56367
56372
|
const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
|
|
56368
56373
|
const colPath = layout.getColKeysPath(col, row);
|
|
@@ -56378,7 +56383,7 @@
|
|
|
56378
56383
|
range.max = Math.max(range.max, 0);
|
|
56379
56384
|
}
|
|
56380
56385
|
if (axisOption?.nice) {
|
|
56381
|
-
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign);
|
|
56386
|
+
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, table.getColWidth(col));
|
|
56382
56387
|
range.min = axisRange[0];
|
|
56383
56388
|
range.max = axisRange[1];
|
|
56384
56389
|
}
|
|
@@ -56439,7 +56444,7 @@
|
|
|
56439
56444
|
range.max = Math.max(range.max, 0);
|
|
56440
56445
|
}
|
|
56441
56446
|
if (axisOption?.nice) {
|
|
56442
|
-
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign);
|
|
56447
|
+
const { range: axisRange } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption, isZeroAlign, table.getRowHeight(row));
|
|
56443
56448
|
range.min = axisRange[0];
|
|
56444
56449
|
range.max = axisRange[1];
|
|
56445
56450
|
}
|
|
@@ -63977,7 +63982,7 @@
|
|
|
63977
63982
|
return new Tag(params ? params.attribute : {});
|
|
63978
63983
|
}
|
|
63979
63984
|
|
|
63980
|
-
const version = "0.13.4-alpha.
|
|
63985
|
+
const version = "0.13.4-alpha.2";
|
|
63981
63986
|
function getIcons() {
|
|
63982
63987
|
return get$1();
|
|
63983
63988
|
}
|