@visactor/vtable 0.10.3-alpha.2 → 0.10.3-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/axis/get-axis-component-size.js +12 -4
- package/cjs/components/axis/get-axis-component-size.js.map +1 -1
- package/cjs/components/axis/linear-scale.js +2 -2
- package/cjs/components/axis/linear-scale.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.d.ts +2 -1
- package/cjs/layout/chart-helper/get-axis-config.js +46 -37
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.d.ts +4 -0
- package/cjs/layout/chart-helper/get-axis-domain.js +31 -0
- package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -0
- package/cjs/layout/chart-helper/get-chart-spec.js +25 -11
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/ts-types/component/axis.d.ts +1 -0
- package/cjs/ts-types/component/axis.js.map +1 -1
- package/dist/vtable.js +124 -37
- package/dist/vtable.min.js +2 -2
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/axis/get-axis-component-size.js +13 -5
- package/es/components/axis/get-axis-component-size.js.map +1 -1
- package/es/components/axis/linear-scale.js +2 -2
- package/es/components/axis/linear-scale.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.d.ts +2 -1
- package/es/layout/chart-helper/get-axis-config.js +44 -33
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-axis-domain.d.ts +4 -0
- package/es/layout/chart-helper/get-axis-domain.js +25 -0
- package/es/layout/chart-helper/get-axis-domain.js.map +1 -0
- package/es/layout/chart-helper/get-chart-spec.js +25 -11
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/ts-types/component/axis.d.ts +1 -0
- package/es/ts-types/component/axis.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ts-types/component/axis.ts"],"names":[],"mappings":"","file":"axis.js","sourcesContent":["import type { ICartesianAxisSpec } from '@visactor/vchart';\n\nexport type ICellAxisOption = Omit<ICartesianAxisSpec, 'type'> &\n (\n | {\n type: 'band';\n domain: (number | string)[];\n }\n | {\n type: 'linear' | 'time';\n range: {\n min: number;\n max: number;\n };\n }\n );\n\nexport type ITableAxisOption = ICartesianAxisSpec;\n"]}
|
|
1
|
+
{"version":3,"sources":["ts-types/component/axis.ts"],"names":[],"mappings":"","file":"axis.js","sourcesContent":["import type { ICartesianAxisSpec } from '@visactor/vchart';\n\nexport type ICellAxisOption = Omit<ICartesianAxisSpec, 'type'> &\n (\n | {\n type: 'band';\n domain: (number | string)[];\n }\n | {\n type: 'linear' | 'time';\n range: {\n min: number;\n max: number;\n };\n __ticksForVTable?: number[];\n }\n );\n\nexport type ITableAxisOption = ICartesianAxisSpec;\n"]}
|
package/dist/vtable.js
CHANGED
|
@@ -40774,6 +40774,9 @@
|
|
|
40774
40774
|
else if (isNil(this.domain?.min) && isValid(this.domain?.max)) {
|
|
40775
40775
|
this.nice && this._scale.niceMin(tickCount);
|
|
40776
40776
|
}
|
|
40777
|
+
else {
|
|
40778
|
+
this.nice && this._scale.nice(tickCount);
|
|
40779
|
+
}
|
|
40777
40780
|
}
|
|
40778
40781
|
dataToPosition(values) {
|
|
40779
40782
|
return this.valueToPosition(values[0]);
|
|
@@ -40846,7 +40849,9 @@
|
|
|
40846
40849
|
else if (isNil(this.domain?.min) && isValid(this.domain?.max)) {
|
|
40847
40850
|
this._scale.niceMin(tickCount);
|
|
40848
40851
|
}
|
|
40849
|
-
else
|
|
40852
|
+
else {
|
|
40853
|
+
this._scale.nice(tickCount);
|
|
40854
|
+
}
|
|
40850
40855
|
}
|
|
40851
40856
|
}
|
|
40852
40857
|
includeZero(domain) {
|
|
@@ -46867,6 +46872,40 @@
|
|
|
46867
46872
|
bind(GroupRenderContribution).toService(AdjustColorGroupAfterRenderContribution);
|
|
46868
46873
|
});
|
|
46869
46874
|
|
|
46875
|
+
function getAxisDomainRangeAndLabels(min, max, axisOption, skipTick) {
|
|
46876
|
+
if (axisOption?.zero) {
|
|
46877
|
+
min = Math.min(min, 0);
|
|
46878
|
+
max = Math.max(max, 0);
|
|
46879
|
+
}
|
|
46880
|
+
const scale = new LinearScale();
|
|
46881
|
+
scale.domain([min, max], !!axisOption?.nice);
|
|
46882
|
+
if (axisOption?.nice) {
|
|
46883
|
+
let tickCount = axisOption.tick?.forceTickCount ?? axisOption.tick?.tickCount ?? 10;
|
|
46884
|
+
if (axisOption.niceType === 'accurateFirst') {
|
|
46885
|
+
tickCount = Math.max(10, tickCount);
|
|
46886
|
+
}
|
|
46887
|
+
if (isNil(axisOption.min) && isNil(axisOption.max)) {
|
|
46888
|
+
scale.nice(tickCount);
|
|
46889
|
+
}
|
|
46890
|
+
else if (isValid(axisOption.min) && isNil(axisOption.max)) {
|
|
46891
|
+
scale.niceMax(tickCount);
|
|
46892
|
+
}
|
|
46893
|
+
else if (isNil(axisOption.min) && isValid(axisOption.max)) {
|
|
46894
|
+
scale.niceMin(tickCount);
|
|
46895
|
+
}
|
|
46896
|
+
}
|
|
46897
|
+
let scaleTicks;
|
|
46898
|
+
if (!skipTick) {
|
|
46899
|
+
scaleTicks = scale.ticks(axisOption?.tickCount ?? DEFAULT_CONTINUOUS_TICK_COUNT, {
|
|
46900
|
+
noDecimals: axisOption?.tick?.noDecimals
|
|
46901
|
+
});
|
|
46902
|
+
}
|
|
46903
|
+
return {
|
|
46904
|
+
range: scale.domain(),
|
|
46905
|
+
ticks: scaleTicks
|
|
46906
|
+
};
|
|
46907
|
+
}
|
|
46908
|
+
|
|
46870
46909
|
function getAxisConfigInPivotChart(col, row, layout) {
|
|
46871
46910
|
if (!layout._table.isPivotChart()) {
|
|
46872
46911
|
return undefined;
|
|
@@ -46884,7 +46923,7 @@
|
|
|
46884
46923
|
if (!defaultKey) {
|
|
46885
46924
|
return undefined;
|
|
46886
46925
|
}
|
|
46887
|
-
const isZeroAlign =
|
|
46926
|
+
const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row + 1, 'top', layout);
|
|
46888
46927
|
const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
46889
46928
|
? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
46890
46929
|
: layout.dataset.collectedValues[defaultKey];
|
|
@@ -46892,7 +46931,6 @@
|
|
|
46892
46931
|
const range = data
|
|
46893
46932
|
? data[layout.getColKeysPath()[index][Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]]
|
|
46894
46933
|
: { max: 1, min: 0 };
|
|
46895
|
-
const { axisOption, isPercent } = getAxisOption(col, row + 1, 'top', layout);
|
|
46896
46934
|
if (range.min === range.max) {
|
|
46897
46935
|
if (range.min > 0) {
|
|
46898
46936
|
range.min = 0;
|
|
@@ -46908,6 +46946,9 @@
|
|
|
46908
46946
|
range.min = range.min < 0 ? -1 : 0;
|
|
46909
46947
|
range.max = range.max > 0 ? 1 : 0;
|
|
46910
46948
|
}
|
|
46949
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
46950
|
+
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
46951
|
+
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
46911
46952
|
if (isNumber$1(axisOption?.min)) {
|
|
46912
46953
|
range.min = axisOption.min;
|
|
46913
46954
|
}
|
|
@@ -46921,7 +46962,8 @@
|
|
|
46921
46962
|
type: 'linear',
|
|
46922
46963
|
label: {
|
|
46923
46964
|
flush: true
|
|
46924
|
-
}
|
|
46965
|
+
},
|
|
46966
|
+
__ticksForVTable: ticks
|
|
46925
46967
|
});
|
|
46926
46968
|
}
|
|
46927
46969
|
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
@@ -46932,12 +46974,12 @@
|
|
|
46932
46974
|
if (isArray(defaultKey)) {
|
|
46933
46975
|
defaultKey = defaultKey[0];
|
|
46934
46976
|
}
|
|
46935
|
-
const isZeroAlign =
|
|
46977
|
+
const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row - 1, 'bottom', layout);
|
|
46936
46978
|
const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
46937
46979
|
? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
46938
46980
|
: layout.dataset.collectedValues[defaultKey];
|
|
46939
46981
|
const index = layout.getRecordIndexByCol(col);
|
|
46940
|
-
const range = merge$2({}, data?.[layout.getColKeysPath()?.[index]?.[Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]] ?? { min: 0, max: 1 });
|
|
46982
|
+
const range = merge$2({}, data?.[layout.getColKeysPath()?.[index]?.[Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)] ?? ''] ?? { min: 0, max: 1 });
|
|
46941
46983
|
if (range.min === range.max) {
|
|
46942
46984
|
if (range.min > 0) {
|
|
46943
46985
|
range.min = 0;
|
|
@@ -46953,7 +46995,6 @@
|
|
|
46953
46995
|
indicatorInfo = info;
|
|
46954
46996
|
}
|
|
46955
46997
|
});
|
|
46956
|
-
const { axisOption, isPercent } = getAxisOption(col, row - 1, 'bottom', layout);
|
|
46957
46998
|
if (axisOption?.visible === false) {
|
|
46958
46999
|
return;
|
|
46959
47000
|
}
|
|
@@ -46961,6 +47002,9 @@
|
|
|
46961
47002
|
range.min = range.min < 0 ? -1 : 0;
|
|
46962
47003
|
range.max = range.max > 0 ? 1 : 0;
|
|
46963
47004
|
}
|
|
47005
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
47006
|
+
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
47007
|
+
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
46964
47008
|
if (isNumber$1(axisOption?.min)) {
|
|
46965
47009
|
range.min = axisOption.min;
|
|
46966
47010
|
}
|
|
@@ -46978,7 +47022,8 @@
|
|
|
46978
47022
|
type: 'linear',
|
|
46979
47023
|
label: {
|
|
46980
47024
|
flush: true
|
|
46981
|
-
}
|
|
47025
|
+
},
|
|
47026
|
+
__ticksForVTable: ticks
|
|
46982
47027
|
});
|
|
46983
47028
|
}
|
|
46984
47029
|
else if (col === layout.rowHeaderLevelCount - 1 &&
|
|
@@ -47016,7 +47061,7 @@
|
|
|
47016
47061
|
if (isArray(defaultKey)) {
|
|
47017
47062
|
defaultKey = defaultKey[0];
|
|
47018
47063
|
}
|
|
47019
|
-
const isZeroAlign =
|
|
47064
|
+
const { axisOption, isPercent, isZeroAlign } = getAxisOption(col + 1, row, 'left', layout);
|
|
47020
47065
|
const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
47021
47066
|
? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
47022
47067
|
: layout.dataset.collectedValues[defaultKey];
|
|
@@ -47037,7 +47082,6 @@
|
|
|
47037
47082
|
indicatorInfo = info;
|
|
47038
47083
|
}
|
|
47039
47084
|
});
|
|
47040
|
-
const { axisOption, isPercent } = getAxisOption(col + 1, row, 'left', layout);
|
|
47041
47085
|
if (axisOption?.visible === false) {
|
|
47042
47086
|
return;
|
|
47043
47087
|
}
|
|
@@ -47045,6 +47089,9 @@
|
|
|
47045
47089
|
range.min = range.min < 0 ? -1 : 0;
|
|
47046
47090
|
range.max = range.max > 0 ? 1 : 0;
|
|
47047
47091
|
}
|
|
47092
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
47093
|
+
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
47094
|
+
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
47048
47095
|
if (isNumber$1(axisOption?.min)) {
|
|
47049
47096
|
range.min = axisOption.min;
|
|
47050
47097
|
}
|
|
@@ -47063,7 +47110,8 @@
|
|
|
47063
47110
|
type: 'linear',
|
|
47064
47111
|
label: {
|
|
47065
47112
|
flush: true
|
|
47066
|
-
}
|
|
47113
|
+
},
|
|
47114
|
+
__ticksForVTable: ticks
|
|
47067
47115
|
});
|
|
47068
47116
|
}
|
|
47069
47117
|
else if (col === layout.colCount - layout.rightFrozenColCount &&
|
|
@@ -47077,13 +47125,12 @@
|
|
|
47077
47125
|
if (!defaultKey) {
|
|
47078
47126
|
return undefined;
|
|
47079
47127
|
}
|
|
47080
|
-
const isZeroAlign =
|
|
47128
|
+
const { axisOption, isPercent, isZeroAlign } = getAxisOption(col - 1, row, 'right', layout);
|
|
47081
47129
|
const data = layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
47082
47130
|
? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
|
|
47083
47131
|
: layout.dataset.collectedValues[defaultKey];
|
|
47084
47132
|
const index = layout.getRecordIndexByRow(row);
|
|
47085
47133
|
const range = merge$2({}, data?.[layout.getRowKeysPath()[index]?.[Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)] ?? ''] ?? { min: 0, max: 1 });
|
|
47086
|
-
const { axisOption, isPercent } = getAxisOption(col - 1, row, 'right', layout);
|
|
47087
47134
|
if (range.min === range.max) {
|
|
47088
47135
|
if (range.min > 0) {
|
|
47089
47136
|
range.min = 0;
|
|
@@ -47099,6 +47146,9 @@
|
|
|
47099
47146
|
range.min = range.min < 0 ? -1 : 0;
|
|
47100
47147
|
range.max = range.max > 0 ? 1 : 0;
|
|
47101
47148
|
}
|
|
47149
|
+
const { range: niceRange, ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
47150
|
+
range.min = !isNaN(niceRange[0]) ? niceRange[0] : 0;
|
|
47151
|
+
range.max = !isNaN(niceRange[1]) ? niceRange[1] : 1;
|
|
47102
47152
|
if (isNumber$1(axisOption?.min)) {
|
|
47103
47153
|
range.min = axisOption.min;
|
|
47104
47154
|
}
|
|
@@ -47115,7 +47165,8 @@
|
|
|
47115
47165
|
type: 'linear',
|
|
47116
47166
|
label: {
|
|
47117
47167
|
flush: true
|
|
47118
|
-
}
|
|
47168
|
+
},
|
|
47169
|
+
__ticksForVTable: ticks
|
|
47119
47170
|
});
|
|
47120
47171
|
}
|
|
47121
47172
|
else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
|
|
@@ -47152,7 +47203,8 @@
|
|
|
47152
47203
|
if (axisOption) {
|
|
47153
47204
|
return {
|
|
47154
47205
|
axisOption,
|
|
47155
|
-
isPercent: spec.percent
|
|
47206
|
+
isPercent: spec.percent,
|
|
47207
|
+
isZeroAlign: checkZeroAlign(spec, orient, layout)
|
|
47156
47208
|
};
|
|
47157
47209
|
}
|
|
47158
47210
|
}
|
|
@@ -47161,10 +47213,11 @@
|
|
|
47161
47213
|
});
|
|
47162
47214
|
return {
|
|
47163
47215
|
axisOption,
|
|
47164
|
-
isPercent: false
|
|
47216
|
+
isPercent: false,
|
|
47217
|
+
isZeroAlign: checkZeroAlign(spec, orient, layout)
|
|
47165
47218
|
};
|
|
47166
47219
|
}
|
|
47167
|
-
function checkZeroAlign(
|
|
47220
|
+
function checkZeroAlign(spec, orient, layout) {
|
|
47168
47221
|
const orients = [];
|
|
47169
47222
|
if (orient === 'left' || orient === 'right') {
|
|
47170
47223
|
orients.push('left', 'right');
|
|
@@ -47172,7 +47225,6 @@
|
|
|
47172
47225
|
else if (orient === 'top' || orient === 'bottom') {
|
|
47173
47226
|
orients.push('top', 'bottom');
|
|
47174
47227
|
}
|
|
47175
|
-
const spec = layout.getRawChartSpec(col, row);
|
|
47176
47228
|
let axesSpec;
|
|
47177
47229
|
if (spec && isArray(spec.axes)) {
|
|
47178
47230
|
axesSpec = spec.axes;
|
|
@@ -47226,12 +47278,19 @@
|
|
|
47226
47278
|
});
|
|
47227
47279
|
}
|
|
47228
47280
|
else {
|
|
47229
|
-
|
|
47230
|
-
|
|
47231
|
-
|
|
47232
|
-
|
|
47233
|
-
|
|
47234
|
-
|
|
47281
|
+
let ticks;
|
|
47282
|
+
if (isArray(config.__ticksForVTable)) {
|
|
47283
|
+
ticks = config.__ticksForVTable;
|
|
47284
|
+
}
|
|
47285
|
+
else {
|
|
47286
|
+
const range = attribute.range;
|
|
47287
|
+
const minNumber = Math.abs(range.min) > 1 ? Math.round(range.min) : range.min;
|
|
47288
|
+
const maxNumber = Math.abs(range.max) > 1 ? Math.round(range.max) : range.max;
|
|
47289
|
+
const minString = formatDecimal(minNumber);
|
|
47290
|
+
const maxString = formatDecimal(maxNumber);
|
|
47291
|
+
ticks = [minString, maxString];
|
|
47292
|
+
}
|
|
47293
|
+
ticks.forEach(text => {
|
|
47235
47294
|
if (attribute.label.formatMethod) {
|
|
47236
47295
|
text = attribute.label.formatMethod(text);
|
|
47237
47296
|
}
|
|
@@ -47289,12 +47348,19 @@
|
|
|
47289
47348
|
});
|
|
47290
47349
|
}
|
|
47291
47350
|
else {
|
|
47292
|
-
|
|
47293
|
-
|
|
47294
|
-
|
|
47295
|
-
|
|
47296
|
-
|
|
47297
|
-
|
|
47351
|
+
let ticks;
|
|
47352
|
+
if (isArray(config.__ticksForVTable)) {
|
|
47353
|
+
ticks = config.__ticksForVTable;
|
|
47354
|
+
}
|
|
47355
|
+
else {
|
|
47356
|
+
const range = attribute.range;
|
|
47357
|
+
const minNumber = Math.abs(range.min) > 1 ? Math.round(range.min) : range.min;
|
|
47358
|
+
const maxNumber = Math.abs(range.max) > 1 ? Math.round(range.max) : range.max;
|
|
47359
|
+
const minString = formatDecimal(minNumber);
|
|
47360
|
+
const maxString = formatDecimal(maxNumber);
|
|
47361
|
+
ticks = [minString, maxString];
|
|
47362
|
+
}
|
|
47363
|
+
ticks.forEach(text => {
|
|
47298
47364
|
if (attribute.label.formatMethod) {
|
|
47299
47365
|
text = attribute.label.formatMethod(text);
|
|
47300
47366
|
}
|
|
@@ -57391,7 +57457,7 @@
|
|
|
57391
57457
|
return TABLE_EVENT_TYPE;
|
|
57392
57458
|
}
|
|
57393
57459
|
options;
|
|
57394
|
-
version = "0.10.3-alpha.
|
|
57460
|
+
version = "0.10.3-alpha.3";
|
|
57395
57461
|
pagination;
|
|
57396
57462
|
id = `VTable${Date.now()}`;
|
|
57397
57463
|
headerStyleCache;
|
|
@@ -59548,12 +59614,12 @@
|
|
|
59548
59614
|
if (isArray(key)) {
|
|
59549
59615
|
key = key[0];
|
|
59550
59616
|
}
|
|
59551
|
-
const isZeroAlign =
|
|
59617
|
+
const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'bottom' : 'top', layout);
|
|
59552
59618
|
const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
|
|
59553
59619
|
? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
|
|
59554
59620
|
: layout.dataset.collectedValues[key];
|
|
59555
|
-
const range = merge$2({}, data?.[layout.getColKeysPath()?.[colIndex]?.[Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]
|
|
59556
|
-
|
|
59621
|
+
const range = merge$2({}, data?.[layout.getColKeysPath()?.[colIndex]?.[Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)] ??
|
|
59622
|
+
''] ?? { min: 0, max: 1 });
|
|
59557
59623
|
if (isPercent) {
|
|
59558
59624
|
range.min = range.min < 0 ? -1 : 0;
|
|
59559
59625
|
range.max = range.max > 0 ? 1 : 0;
|
|
@@ -59562,6 +59628,17 @@
|
|
|
59562
59628
|
range.min = Math.min(range.min, 0);
|
|
59563
59629
|
range.max = Math.max(range.max, 0);
|
|
59564
59630
|
}
|
|
59631
|
+
if (axisOption?.nice) {
|
|
59632
|
+
const { ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
59633
|
+
range.min = ticks[0];
|
|
59634
|
+
range.max = ticks[ticks.length - 1];
|
|
59635
|
+
}
|
|
59636
|
+
if (isNumber$1(axisOption?.min)) {
|
|
59637
|
+
range.min = axisOption.min;
|
|
59638
|
+
}
|
|
59639
|
+
if (isNumber$1(axisOption?.max)) {
|
|
59640
|
+
range.max = axisOption.max;
|
|
59641
|
+
}
|
|
59565
59642
|
axes.push(merge$2({
|
|
59566
59643
|
range
|
|
59567
59644
|
}, axisOption, {
|
|
@@ -59606,12 +59683,11 @@
|
|
|
59606
59683
|
if (isArray(key)) {
|
|
59607
59684
|
key = key[0];
|
|
59608
59685
|
}
|
|
59609
|
-
const isZeroAlign =
|
|
59686
|
+
const { axisOption, isPercent, isZeroAlign } = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);
|
|
59610
59687
|
const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
|
|
59611
59688
|
? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
|
|
59612
59689
|
: layout.dataset.collectedValues[key];
|
|
59613
59690
|
const range = merge$2({}, data?.[layout.getRowKeysPath()[rowIndex]?.[Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)] ?? ''] ?? { min: 0, max: 1 });
|
|
59614
|
-
const { axisOption, isPercent } = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);
|
|
59615
59691
|
if (isPercent) {
|
|
59616
59692
|
range.min = range.min < 0 ? -1 : 0;
|
|
59617
59693
|
range.max = range.max > 0 ? 1 : 0;
|
|
@@ -59620,6 +59696,17 @@
|
|
|
59620
59696
|
range.min = Math.min(range.min, 0);
|
|
59621
59697
|
range.max = Math.max(range.max, 0);
|
|
59622
59698
|
}
|
|
59699
|
+
if (axisOption?.nice) {
|
|
59700
|
+
const { ticks } = getAxisDomainRangeAndLabels(range.min, range.max, axisOption);
|
|
59701
|
+
range.min = ticks[0];
|
|
59702
|
+
range.max = ticks[ticks.length - 1];
|
|
59703
|
+
}
|
|
59704
|
+
if (isNumber$1(axisOption?.min)) {
|
|
59705
|
+
range.min = axisOption.min;
|
|
59706
|
+
}
|
|
59707
|
+
if (isNumber$1(axisOption?.max)) {
|
|
59708
|
+
range.max = axisOption.max;
|
|
59709
|
+
}
|
|
59623
59710
|
axes.push(merge$2({
|
|
59624
59711
|
range
|
|
59625
59712
|
}, axisOption, {
|
|
@@ -66778,7 +66865,7 @@
|
|
|
66778
66865
|
percentCalc: percentCalc
|
|
66779
66866
|
});
|
|
66780
66867
|
|
|
66781
|
-
const version = "0.10.3-alpha.
|
|
66868
|
+
const version = "0.10.3-alpha.3";
|
|
66782
66869
|
function getIcons() {
|
|
66783
66870
|
return get$1();
|
|
66784
66871
|
}
|