@wcardinal/wcardinal-ui 0.282.0 → 0.283.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/dist/types/wcardinal/ui/d-chart-axis-bar.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-bar.d.ts +20 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +19 -24
- package/dist/types/wcardinal/ui/d-chart-axis-base-tick-container.d.ts +29 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-tick-major-gridline.d.ts +19 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-tick-major.d.ts +20 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-tick-minor.d.ts +17 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +11 -19
- package/dist/types/wcardinal/ui/d-chart-axis-container-impl.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-chart-axis-container.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-chart-axis-tick-container.d.ts +7 -0
- package/dist/types/wcardinal/ui/d-chart-axis-tick-major-gridline.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-axis-tick-major.d.ts +7 -0
- package/dist/types/wcardinal/ui/d-chart-axis-tick-minor.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-axis.d.ts +4 -0
- package/dist/wcardinal/ui/d-chart-axis-bar.js +6 -0
- package/dist/wcardinal/ui/d-chart-axis-bar.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-bar.js +105 -0
- package/dist/wcardinal/ui/d-chart-axis-base-bar.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +3 -7
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +225 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-major-gridline.js +83 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-major-gridline.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-major.js +89 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-major.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js +75 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base.js +35 -388
- package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-container-impl.js +5 -3
- package/dist/wcardinal/ui/d-chart-axis-container-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-container.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-tick-container.js +6 -0
- package/dist/wcardinal/ui/d-chart-axis-tick-container.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-tick-major-gridline.js +6 -0
- package/dist/wcardinal/ui/d-chart-axis-tick-major-gridline.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-tick-major.js +6 -0
- package/dist/wcardinal/ui/d-chart-axis-tick-major.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-tick-minor.js +6 -0
- package/dist/wcardinal/ui/d-chart-axis-tick-minor.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +488 -286
- package/dist/wcardinal-ui.js +488 -286
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.283.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -31633,7 +31633,7 @@
|
|
|
31633
31633
|
* Copyright (C) 2019 Toshiba Corporation
|
|
31634
31634
|
* SPDX-License-Identifier: Apache-2.0
|
|
31635
31635
|
*/
|
|
31636
|
-
var isNaN = function (target) {
|
|
31636
|
+
var isNaN$1 = function (target) {
|
|
31637
31637
|
return target !== target;
|
|
31638
31638
|
};
|
|
31639
31639
|
|
|
@@ -31723,7 +31723,7 @@
|
|
|
31723
31723
|
EShapeActionRuntimeOpenDialogTime.prototype.toNumber = function (value, min, max) {
|
|
31724
31724
|
if (value != null) {
|
|
31725
31725
|
var num = +value;
|
|
31726
|
-
if (!isNaN(num)) {
|
|
31726
|
+
if (!isNaN$1(num)) {
|
|
31727
31727
|
return Math.min(max, Math.max(min, num));
|
|
31728
31728
|
}
|
|
31729
31729
|
}
|
|
@@ -45025,8 +45025,8 @@
|
|
|
45025
45025
|
this.grid.snap(px, x);
|
|
45026
45026
|
this.grid.snap(py, y);
|
|
45027
45027
|
//
|
|
45028
|
-
result.x = isNaN(x.distance) ? NaN : x.result;
|
|
45029
|
-
result.y = isNaN(y.distance) ? NaN : y.result;
|
|
45028
|
+
result.x = isNaN$1(x.distance) ? NaN : x.result;
|
|
45029
|
+
result.y = isNaN$1(y.distance) ? NaN : y.result;
|
|
45030
45030
|
return result;
|
|
45031
45031
|
};
|
|
45032
45032
|
ESnapper.prototype.toSnapped = function (point, result) {
|
|
@@ -45036,7 +45036,7 @@
|
|
|
45036
45036
|
this.snap(point, result);
|
|
45037
45037
|
var x = result.x;
|
|
45038
45038
|
var y = result.y;
|
|
45039
|
-
result.set(isNaN(x) ? px : x, isNaN(y) ? py : y);
|
|
45039
|
+
result.set(isNaN$1(x) ? px : x, isNaN$1(y) ? py : y);
|
|
45040
45040
|
}
|
|
45041
45041
|
else {
|
|
45042
45042
|
result.set(px, py);
|
|
@@ -45056,23 +45056,23 @@
|
|
|
45056
45056
|
workTranslate.set(point.x + dx, point.y + dy);
|
|
45057
45057
|
this.snap(workTranslate, workTranslate);
|
|
45058
45058
|
// X
|
|
45059
|
-
if (!isNaN(workTranslate.x)) {
|
|
45059
|
+
if (!isNaN$1(workTranslate.x)) {
|
|
45060
45060
|
var newDx = workTranslate.x - point.x;
|
|
45061
|
-
if (isNaN(x) || Math.abs(newDx - dx) < Math.abs(x - dx)) {
|
|
45061
|
+
if (isNaN$1(x) || Math.abs(newDx - dx) < Math.abs(x - dx)) {
|
|
45062
45062
|
x = newDx;
|
|
45063
45063
|
}
|
|
45064
45064
|
}
|
|
45065
45065
|
// Y
|
|
45066
|
-
if (!isNaN(workTranslate.y)) {
|
|
45066
|
+
if (!isNaN$1(workTranslate.y)) {
|
|
45067
45067
|
var newDy = workTranslate.y - point.y;
|
|
45068
|
-
if (isNaN(y) || Math.abs(newDy - dy) < Math.abs(y - dy)) {
|
|
45068
|
+
if (isNaN$1(y) || Math.abs(newDy - dy) < Math.abs(y - dy)) {
|
|
45069
45069
|
y = newDy;
|
|
45070
45070
|
}
|
|
45071
45071
|
}
|
|
45072
45072
|
}
|
|
45073
45073
|
}
|
|
45074
|
-
result.x = isNaN(x) ? dx : x;
|
|
45075
|
-
result.y = isNaN(y) ? dy : y;
|
|
45074
|
+
result.x = isNaN$1(x) ? dx : x;
|
|
45075
|
+
result.y = isNaN$1(y) ? dy : y;
|
|
45076
45076
|
return result;
|
|
45077
45077
|
};
|
|
45078
45078
|
ESnapper.prototype.prepareForRotate = function (modifier) {
|
|
@@ -45170,7 +45170,7 @@
|
|
|
45170
45170
|
ESnapper.prototype.setScaleSnappedResult = function (distance, length, move, axis, // true => x axis, false y axis
|
|
45171
45171
|
result) {
|
|
45172
45172
|
if (EPSILON < length) {
|
|
45173
|
-
if (isNaN(result.distance) || distance < result.distance) {
|
|
45173
|
+
if (isNaN$1(result.distance) || distance < result.distance) {
|
|
45174
45174
|
result.distance = distance;
|
|
45175
45175
|
var newScale = 1 + move / length;
|
|
45176
45176
|
if (axis) {
|
|
@@ -45191,7 +45191,7 @@
|
|
|
45191
45191
|
var x = work.x;
|
|
45192
45192
|
var y = work.y;
|
|
45193
45193
|
// X coordinate
|
|
45194
|
-
if (!isNaN(x)) {
|
|
45194
|
+
if (!isNaN$1(x)) {
|
|
45195
45195
|
var nx = Math.abs(normal.x);
|
|
45196
45196
|
if (EPSILON < nx) {
|
|
45197
45197
|
var dx = (x - tx) / normal.x;
|
|
@@ -45201,7 +45201,7 @@
|
|
|
45201
45201
|
}
|
|
45202
45202
|
}
|
|
45203
45203
|
// Y coordinate
|
|
45204
|
-
if (!isNaN(y)) {
|
|
45204
|
+
if (!isNaN$1(y)) {
|
|
45205
45205
|
var ny = Math.abs(normal.y);
|
|
45206
45206
|
if (EPSILON < ny) {
|
|
45207
45207
|
var dy = (y - ty) / normal.y;
|
|
@@ -45225,8 +45225,8 @@
|
|
|
45225
45225
|
this.snap(work, work);
|
|
45226
45226
|
var x = work.x;
|
|
45227
45227
|
var y = work.y;
|
|
45228
|
-
if (isNaN(x)) {
|
|
45229
|
-
if (isNaN(y)) {
|
|
45228
|
+
if (isNaN$1(x)) {
|
|
45229
|
+
if (isNaN$1(y)) {
|
|
45230
45230
|
return;
|
|
45231
45231
|
}
|
|
45232
45232
|
else {
|
|
@@ -45234,7 +45234,7 @@
|
|
|
45234
45234
|
}
|
|
45235
45235
|
}
|
|
45236
45236
|
else {
|
|
45237
|
-
if (isNaN(y)) {
|
|
45237
|
+
if (isNaN$1(y)) {
|
|
45238
45238
|
y = ty;
|
|
45239
45239
|
}
|
|
45240
45240
|
}
|
|
@@ -45254,7 +45254,7 @@
|
|
|
45254
45254
|
var dx = x - tx;
|
|
45255
45255
|
var dy = y - ty;
|
|
45256
45256
|
var distance = Math.abs(dx * dx + dy * dy);
|
|
45257
|
-
if (isNaN(result.distance) || distance < result.distance) {
|
|
45257
|
+
if (isNaN$1(result.distance) || distance < result.distance) {
|
|
45258
45258
|
result.distance = distance;
|
|
45259
45259
|
var mdx = x - point.x;
|
|
45260
45260
|
var mdy = y - point.y;
|
|
@@ -45309,7 +45309,7 @@
|
|
|
45309
45309
|
this.calcScaleSnappedXY(transform, points[2], points[3], points[1], normals, lengths, work);
|
|
45310
45310
|
break;
|
|
45311
45311
|
}
|
|
45312
|
-
if (!isNaN(work.distance)) {
|
|
45312
|
+
if (!isNaN$1(work.distance)) {
|
|
45313
45313
|
scale.copyFrom(work.scale);
|
|
45314
45314
|
if (keepRatio) {
|
|
45315
45315
|
switch (anchor) {
|
|
@@ -54173,8 +54173,7 @@
|
|
|
54173
54173
|
var _a;
|
|
54174
54174
|
return {
|
|
54175
54175
|
style: (_a = options === null || options === void 0 ? void 0 : options.style) !== null && _a !== void 0 ? _a : theme.getStyle(),
|
|
54176
|
-
stroke: this.toBarStroke(theme, options === null || options === void 0 ? void 0 : options.stroke)
|
|
54177
|
-
shape: undefined
|
|
54176
|
+
stroke: this.toBarStroke(theme, options === null || options === void 0 ? void 0 : options.stroke)
|
|
54178
54177
|
};
|
|
54179
54178
|
};
|
|
54180
54179
|
DChartAxisBaseOptionParser.prototype.toTickContainer = function (theme, options) {
|
|
@@ -54206,7 +54205,6 @@
|
|
|
54206
54205
|
stroke: stroke,
|
|
54207
54206
|
text: this.toMajorTickText(theme, major === null || major === void 0 ? void 0 : major.text),
|
|
54208
54207
|
formatter: this.toMajorTickFormatter(theme, major),
|
|
54209
|
-
shapes: undefined,
|
|
54210
54208
|
gridline: this.toTickMajorGridline(theme, major === null || major === void 0 ? void 0 : major.gridline, optionsStyle, optionsStroke)
|
|
54211
54209
|
};
|
|
54212
54210
|
};
|
|
@@ -54216,8 +54214,7 @@
|
|
|
54216
54214
|
return {
|
|
54217
54215
|
enable: (_c = options === null || options === void 0 ? void 0 : options.enable) !== null && _c !== void 0 ? _c : theme.getMajorTickGridlineEnable(),
|
|
54218
54216
|
style: style,
|
|
54219
|
-
stroke: this.toTickMajorGridlineStroke(theme, options === null || options === void 0 ? void 0 : options.stroke, optionsStroke)
|
|
54220
|
-
shapes: undefined
|
|
54217
|
+
stroke: this.toTickMajorGridlineStroke(theme, options === null || options === void 0 ? void 0 : options.stroke, optionsStroke)
|
|
54221
54218
|
};
|
|
54222
54219
|
};
|
|
54223
54220
|
DChartAxisBaseOptionParser.prototype.toTickPosition = function (tickPosition) {
|
|
@@ -54262,8 +54259,7 @@
|
|
|
54262
54259
|
size: (_g = minor === null || minor === void 0 ? void 0 : minor.size) !== null && _g !== void 0 ? _g : theme.getMinorTickSize(),
|
|
54263
54260
|
position: this.toTickPosition(position),
|
|
54264
54261
|
style: style,
|
|
54265
|
-
stroke: this.toTickMinorStroke(theme, minor === null || minor === void 0 ? void 0 : minor.stroke, options === null || options === void 0 ? void 0 : options.stroke)
|
|
54266
|
-
shapes: undefined
|
|
54262
|
+
stroke: this.toTickMinorStroke(theme, minor === null || minor === void 0 ? void 0 : minor.stroke, options === null || options === void 0 ? void 0 : options.stroke)
|
|
54267
54263
|
};
|
|
54268
54264
|
};
|
|
54269
54265
|
DChartAxisBaseOptionParser.prototype.toBarStroke = function (theme, options) {
|
|
@@ -54486,55 +54482,83 @@
|
|
|
54486
54482
|
* Copyright (C) 2019 Toshiba Corporation
|
|
54487
54483
|
* SPDX-License-Identifier: Apache-2.0
|
|
54488
54484
|
*/
|
|
54489
|
-
var
|
|
54490
|
-
function
|
|
54491
|
-
|
|
54492
|
-
this._theme = theme;
|
|
54485
|
+
var DChartAxisBaseBar = /** @class */ (function () {
|
|
54486
|
+
function DChartAxisBaseBar(parser) {
|
|
54487
|
+
this._parser = parser;
|
|
54493
54488
|
this._index = 0;
|
|
54494
|
-
var parser = new DChartAxisBaseOptionParser(theme, options);
|
|
54495
|
-
this._coordinateIndex = parser.coordinateIndex;
|
|
54496
|
-
this._padding = parser.padding;
|
|
54497
|
-
this._position = parser.position;
|
|
54498
|
-
var tick = parser.tick;
|
|
54499
|
-
this._tick = tick;
|
|
54500
|
-
this._label = parser.label;
|
|
54501
|
-
this._bar = parser.bar;
|
|
54502
|
-
this._majorTicks = [];
|
|
54503
|
-
this._minorTicks = [];
|
|
54504
54489
|
}
|
|
54505
|
-
Object.defineProperty(
|
|
54490
|
+
Object.defineProperty(DChartAxisBaseBar.prototype, "shape", {
|
|
54506
54491
|
get: function () {
|
|
54507
|
-
|
|
54492
|
+
var result = this._shape;
|
|
54493
|
+
if (result == null) {
|
|
54494
|
+
result = this.newShape();
|
|
54495
|
+
this._shape = result;
|
|
54496
|
+
}
|
|
54497
|
+
return result;
|
|
54508
54498
|
},
|
|
54509
54499
|
enumerable: false,
|
|
54510
54500
|
configurable: true
|
|
54511
54501
|
});
|
|
54512
|
-
|
|
54513
|
-
var
|
|
54514
|
-
var
|
|
54515
|
-
|
|
54502
|
+
DChartAxisBaseBar.prototype.newShape = function () {
|
|
54503
|
+
var _a;
|
|
54504
|
+
var parser = this._parser;
|
|
54505
|
+
var bar = parser.bar;
|
|
54506
|
+
var result = new EShapeBar();
|
|
54507
|
+
result.points.position = this.newShapePosition();
|
|
54508
|
+
result.points.style = (_a = bar.style) !== null && _a !== void 0 ? _a : EShapePointsStyle.NONE;
|
|
54509
|
+
result.stroke.copy(bar.stroke);
|
|
54510
|
+
result.text.copy(parser.label);
|
|
54511
|
+
return result;
|
|
54512
|
+
};
|
|
54513
|
+
DChartAxisBaseBar.prototype.newShapePosition = function () {
|
|
54514
|
+
switch (this._parser.position) {
|
|
54515
|
+
case DChartAxisPosition.LEFT:
|
|
54516
|
+
case DChartAxisPosition.RIGHT:
|
|
54517
|
+
return EShapeBarPosition.TOP;
|
|
54518
|
+
default:
|
|
54519
|
+
return EShapeBarPosition.LEFT;
|
|
54520
|
+
}
|
|
54521
|
+
};
|
|
54522
|
+
DChartAxisBaseBar.prototype.bind = function (container, index) {
|
|
54523
|
+
this._container = container;
|
|
54524
|
+
this._index = index;
|
|
54525
|
+
this.shape.attach(container.container);
|
|
54526
|
+
};
|
|
54527
|
+
DChartAxisBaseBar.prototype.unbind = function () {
|
|
54528
|
+
var shape = this._shape;
|
|
54529
|
+
if (shape != null) {
|
|
54530
|
+
shape.detach();
|
|
54531
|
+
}
|
|
54532
|
+
this._index = 0;
|
|
54533
|
+
this._container = undefined;
|
|
54534
|
+
};
|
|
54535
|
+
DChartAxisBaseBar.prototype.update = function () {
|
|
54536
|
+
var container = this._container;
|
|
54537
|
+
var index = this._index;
|
|
54538
|
+
var shape = this._shape;
|
|
54539
|
+
if (shape != null && container != null) {
|
|
54516
54540
|
var plotArea = container.plotArea;
|
|
54517
54541
|
var plotAreaWidth = plotArea.width;
|
|
54518
54542
|
var plotAreaHeight = plotArea.height;
|
|
54519
|
-
var
|
|
54543
|
+
var offset = this._parser.padding * index;
|
|
54520
54544
|
shape.disallowUploadedUpdate();
|
|
54521
54545
|
var position = shape.transform.position;
|
|
54522
54546
|
var size = shape.size;
|
|
54523
|
-
switch (this.
|
|
54547
|
+
switch (this._parser.position) {
|
|
54524
54548
|
case DChartAxisPosition.TOP:
|
|
54525
|
-
position.set(plotAreaWidth * 0.5, 0 -
|
|
54549
|
+
position.set(plotAreaWidth * 0.5, 0 - offset);
|
|
54526
54550
|
size.set(plotAreaWidth, 0);
|
|
54527
54551
|
break;
|
|
54528
54552
|
case DChartAxisPosition.BOTTOM:
|
|
54529
|
-
position.set(plotAreaWidth * 0.5, plotAreaHeight +
|
|
54553
|
+
position.set(plotAreaWidth * 0.5, plotAreaHeight + offset);
|
|
54530
54554
|
size.set(plotAreaWidth, 0);
|
|
54531
54555
|
break;
|
|
54532
54556
|
case DChartAxisPosition.LEFT:
|
|
54533
|
-
position.set(0 -
|
|
54557
|
+
position.set(0 - offset, plotAreaHeight * 0.5);
|
|
54534
54558
|
size.set(0, plotAreaHeight);
|
|
54535
54559
|
break;
|
|
54536
54560
|
case DChartAxisPosition.RIGHT:
|
|
54537
|
-
position.set(plotAreaWidth +
|
|
54561
|
+
position.set(plotAreaWidth + offset, plotAreaHeight * 0.5);
|
|
54538
54562
|
size.set(0, plotAreaHeight);
|
|
54539
54563
|
break;
|
|
54540
54564
|
}
|
|
@@ -54543,8 +54567,342 @@
|
|
|
54543
54567
|
}
|
|
54544
54568
|
return false;
|
|
54545
54569
|
};
|
|
54546
|
-
|
|
54547
|
-
var
|
|
54570
|
+
DChartAxisBaseBar.prototype.destroy = function () {
|
|
54571
|
+
var shape = this._shape;
|
|
54572
|
+
if (shape != null) {
|
|
54573
|
+
shape.destroy();
|
|
54574
|
+
}
|
|
54575
|
+
this._index = 0;
|
|
54576
|
+
this._container = undefined;
|
|
54577
|
+
};
|
|
54578
|
+
return DChartAxisBaseBar;
|
|
54579
|
+
}());
|
|
54580
|
+
|
|
54581
|
+
var DChartAxisBaseTickMajorGridline = /** @class */ (function () {
|
|
54582
|
+
function DChartAxisBaseTickMajorGridline(parser) {
|
|
54583
|
+
this._parser = parser;
|
|
54584
|
+
this._index = 0;
|
|
54585
|
+
}
|
|
54586
|
+
Object.defineProperty(DChartAxisBaseTickMajorGridline.prototype, "shapes", {
|
|
54587
|
+
get: function () {
|
|
54588
|
+
var result = this._shapes;
|
|
54589
|
+
if (result == null) {
|
|
54590
|
+
result = this.newShapes();
|
|
54591
|
+
this._shapes = result;
|
|
54592
|
+
}
|
|
54593
|
+
return result;
|
|
54594
|
+
},
|
|
54595
|
+
enumerable: false,
|
|
54596
|
+
configurable: true
|
|
54597
|
+
});
|
|
54598
|
+
DChartAxisBaseTickMajorGridline.prototype.newShapes = function () {
|
|
54599
|
+
var _a;
|
|
54600
|
+
var result = [];
|
|
54601
|
+
var tick = this._parser.tick;
|
|
54602
|
+
var major = tick.major;
|
|
54603
|
+
var gridline = major.gridline;
|
|
54604
|
+
if (tick.enable && gridline.enable) {
|
|
54605
|
+
var capacity = major.capacity;
|
|
54606
|
+
var style = (_a = gridline.style) !== null && _a !== void 0 ? _a : EShapePointsStyle.NONE;
|
|
54607
|
+
var position = this.newShapePosition();
|
|
54608
|
+
for (var i = 0; i < capacity; ++i) {
|
|
54609
|
+
var shape = new EShapeBar();
|
|
54610
|
+
shape.points.position = position;
|
|
54611
|
+
shape.points.style = style;
|
|
54612
|
+
shape.stroke.copy(gridline.stroke);
|
|
54613
|
+
result.push(shape);
|
|
54614
|
+
}
|
|
54615
|
+
}
|
|
54616
|
+
return result;
|
|
54617
|
+
};
|
|
54618
|
+
DChartAxisBaseTickMajorGridline.prototype.newShapePosition = function () {
|
|
54619
|
+
switch (this._parser.position) {
|
|
54620
|
+
case DChartAxisPosition.LEFT:
|
|
54621
|
+
case DChartAxisPosition.RIGHT:
|
|
54622
|
+
return EShapeBarPosition.LEFT;
|
|
54623
|
+
default:
|
|
54624
|
+
return EShapeBarPosition.TOP;
|
|
54625
|
+
}
|
|
54626
|
+
};
|
|
54627
|
+
DChartAxisBaseTickMajorGridline.prototype.bind = function (container, index) {
|
|
54628
|
+
this._container = container;
|
|
54629
|
+
this._index = index;
|
|
54630
|
+
var shapes = this.shapes;
|
|
54631
|
+
var containerContainer = container.container;
|
|
54632
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54633
|
+
shapes[i].attach(containerContainer);
|
|
54634
|
+
}
|
|
54635
|
+
};
|
|
54636
|
+
DChartAxisBaseTickMajorGridline.prototype.unbind = function () {
|
|
54637
|
+
var shapes = this._shapes;
|
|
54638
|
+
if (shapes != null) {
|
|
54639
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54640
|
+
shapes[i].detach();
|
|
54641
|
+
}
|
|
54642
|
+
}
|
|
54643
|
+
this._index = 0;
|
|
54644
|
+
this._container = undefined;
|
|
54645
|
+
};
|
|
54646
|
+
DChartAxisBaseTickMajorGridline.prototype.destroy = function () {
|
|
54647
|
+
var shapes = this._shapes;
|
|
54648
|
+
if (shapes != null) {
|
|
54649
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54650
|
+
shapes[i].destroy();
|
|
54651
|
+
}
|
|
54652
|
+
}
|
|
54653
|
+
this._index = 0;
|
|
54654
|
+
this._container = undefined;
|
|
54655
|
+
};
|
|
54656
|
+
return DChartAxisBaseTickMajorGridline;
|
|
54657
|
+
}());
|
|
54658
|
+
|
|
54659
|
+
var DChartAxisBaseTickMajor = /** @class */ (function () {
|
|
54660
|
+
function DChartAxisBaseTickMajor(parser) {
|
|
54661
|
+
this._parser = parser;
|
|
54662
|
+
this._index = 0;
|
|
54663
|
+
this._gridline = new DChartAxisBaseTickMajorGridline(parser);
|
|
54664
|
+
}
|
|
54665
|
+
Object.defineProperty(DChartAxisBaseTickMajor.prototype, "shapes", {
|
|
54666
|
+
get: function () {
|
|
54667
|
+
var result = this._shapes;
|
|
54668
|
+
if (result == null) {
|
|
54669
|
+
result = this.newShapes();
|
|
54670
|
+
this._shapes = result;
|
|
54671
|
+
}
|
|
54672
|
+
return result;
|
|
54673
|
+
},
|
|
54674
|
+
enumerable: false,
|
|
54675
|
+
configurable: true
|
|
54676
|
+
});
|
|
54677
|
+
DChartAxisBaseTickMajor.prototype.newShapes = function () {
|
|
54678
|
+
var _a;
|
|
54679
|
+
var result = [];
|
|
54680
|
+
var tick = this._parser.tick;
|
|
54681
|
+
if (tick.enable) {
|
|
54682
|
+
var major = tick.major;
|
|
54683
|
+
var capacity = major.capacity;
|
|
54684
|
+
var size = major.size;
|
|
54685
|
+
var position = major.position;
|
|
54686
|
+
var style = (_a = major.style) !== null && _a !== void 0 ? _a : EShapePointsStyle.NONE;
|
|
54687
|
+
for (var i = 0; i < capacity; ++i) {
|
|
54688
|
+
var shape = new EShapeBar();
|
|
54689
|
+
shape.points.position = position;
|
|
54690
|
+
shape.points.size = size;
|
|
54691
|
+
shape.points.style = style;
|
|
54692
|
+
shape.stroke.copy(major.stroke);
|
|
54693
|
+
shape.text.copy(major.text);
|
|
54694
|
+
shape.size.set(0, 0);
|
|
54695
|
+
result.push(shape);
|
|
54696
|
+
}
|
|
54697
|
+
}
|
|
54698
|
+
return result;
|
|
54699
|
+
};
|
|
54700
|
+
Object.defineProperty(DChartAxisBaseTickMajor.prototype, "gridline", {
|
|
54701
|
+
get: function () {
|
|
54702
|
+
return this._gridline;
|
|
54703
|
+
},
|
|
54704
|
+
enumerable: false,
|
|
54705
|
+
configurable: true
|
|
54706
|
+
});
|
|
54707
|
+
DChartAxisBaseTickMajor.prototype.bind = function (container, index) {
|
|
54708
|
+
this._container = container;
|
|
54709
|
+
this._index = index;
|
|
54710
|
+
// Gridline
|
|
54711
|
+
this._gridline.bind(container, index);
|
|
54712
|
+
// Ticks
|
|
54713
|
+
var shapes = this.shapes;
|
|
54714
|
+
var containerContainer = container.container;
|
|
54715
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54716
|
+
shapes[i].attach(containerContainer);
|
|
54717
|
+
}
|
|
54718
|
+
};
|
|
54719
|
+
DChartAxisBaseTickMajor.prototype.unbind = function () {
|
|
54720
|
+
var shapes = this._shapes;
|
|
54721
|
+
if (shapes != null) {
|
|
54722
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54723
|
+
shapes[i].detach();
|
|
54724
|
+
}
|
|
54725
|
+
}
|
|
54726
|
+
this._gridline.unbind();
|
|
54727
|
+
this._index = 0;
|
|
54728
|
+
this._container = undefined;
|
|
54729
|
+
};
|
|
54730
|
+
DChartAxisBaseTickMajor.prototype.destroy = function () {
|
|
54731
|
+
var shapes = this._shapes;
|
|
54732
|
+
if (shapes != null) {
|
|
54733
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54734
|
+
shapes[i].destroy();
|
|
54735
|
+
}
|
|
54736
|
+
}
|
|
54737
|
+
this._gridline.destroy();
|
|
54738
|
+
this._index = 0;
|
|
54739
|
+
this._container = undefined;
|
|
54740
|
+
};
|
|
54741
|
+
return DChartAxisBaseTickMajor;
|
|
54742
|
+
}());
|
|
54743
|
+
|
|
54744
|
+
var DChartAxisBaseTickMinor = /** @class */ (function () {
|
|
54745
|
+
function DChartAxisBaseTickMinor(parser) {
|
|
54746
|
+
this._parser = parser;
|
|
54747
|
+
this._index = 0;
|
|
54748
|
+
}
|
|
54749
|
+
Object.defineProperty(DChartAxisBaseTickMinor.prototype, "shapes", {
|
|
54750
|
+
get: function () {
|
|
54751
|
+
var result = this._shapes;
|
|
54752
|
+
if (result == null) {
|
|
54753
|
+
result = this.newShapes();
|
|
54754
|
+
this._shapes = result;
|
|
54755
|
+
}
|
|
54756
|
+
return result;
|
|
54757
|
+
},
|
|
54758
|
+
enumerable: false,
|
|
54759
|
+
configurable: true
|
|
54760
|
+
});
|
|
54761
|
+
DChartAxisBaseTickMinor.prototype.newShapes = function () {
|
|
54762
|
+
var _a;
|
|
54763
|
+
var result = [];
|
|
54764
|
+
var tick = this._parser.tick;
|
|
54765
|
+
if (tick.enable) {
|
|
54766
|
+
var minor = tick.minor;
|
|
54767
|
+
var count = minor.count;
|
|
54768
|
+
var size = minor.size;
|
|
54769
|
+
var position = minor.position;
|
|
54770
|
+
var style = (_a = minor.style) !== null && _a !== void 0 ? _a : EShapePointsStyle.NONE;
|
|
54771
|
+
var major = tick.major;
|
|
54772
|
+
for (var i = 0, imax = (major.capacity + 1) * count; i < imax; ++i) {
|
|
54773
|
+
var shape = new EShapeBar();
|
|
54774
|
+
shape.points.position = position;
|
|
54775
|
+
shape.points.size = size;
|
|
54776
|
+
shape.points.style = style;
|
|
54777
|
+
shape.stroke.copy(minor.stroke);
|
|
54778
|
+
shape.size.set(0, 0);
|
|
54779
|
+
result.push(shape);
|
|
54780
|
+
}
|
|
54781
|
+
}
|
|
54782
|
+
return result;
|
|
54783
|
+
};
|
|
54784
|
+
DChartAxisBaseTickMinor.prototype.bind = function (container, index) {
|
|
54785
|
+
this._container = container;
|
|
54786
|
+
this._index = index;
|
|
54787
|
+
var shapes = this.shapes;
|
|
54788
|
+
var containerContainer = container.container;
|
|
54789
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54790
|
+
shapes[i].attach(containerContainer);
|
|
54791
|
+
}
|
|
54792
|
+
};
|
|
54793
|
+
DChartAxisBaseTickMinor.prototype.unbind = function () {
|
|
54794
|
+
var shapes = this._shapes;
|
|
54795
|
+
if (shapes != null) {
|
|
54796
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54797
|
+
shapes[i].detach();
|
|
54798
|
+
}
|
|
54799
|
+
}
|
|
54800
|
+
this._index = 0;
|
|
54801
|
+
this._container = undefined;
|
|
54802
|
+
};
|
|
54803
|
+
DChartAxisBaseTickMinor.prototype.destroy = function () {
|
|
54804
|
+
var shapes = this._shapes;
|
|
54805
|
+
if (shapes != null) {
|
|
54806
|
+
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
54807
|
+
shapes[i].destroy();
|
|
54808
|
+
}
|
|
54809
|
+
}
|
|
54810
|
+
this._index = 0;
|
|
54811
|
+
this._container = undefined;
|
|
54812
|
+
};
|
|
54813
|
+
return DChartAxisBaseTickMinor;
|
|
54814
|
+
}());
|
|
54815
|
+
|
|
54816
|
+
var DChartAxisBaseTickContainer = /** @class */ (function () {
|
|
54817
|
+
function DChartAxisBaseTickContainer(parser) {
|
|
54818
|
+
this._parser = parser;
|
|
54819
|
+
this._index = 0;
|
|
54820
|
+
this._major = new DChartAxisBaseTickMajor(parser);
|
|
54821
|
+
this._minor = new DChartAxisBaseTickMinor(parser);
|
|
54822
|
+
this._majorTicks = [];
|
|
54823
|
+
this._minorTicks = [];
|
|
54824
|
+
}
|
|
54825
|
+
Object.defineProperty(DChartAxisBaseTickContainer.prototype, "major", {
|
|
54826
|
+
get: function () {
|
|
54827
|
+
return this._major;
|
|
54828
|
+
},
|
|
54829
|
+
enumerable: false,
|
|
54830
|
+
configurable: true
|
|
54831
|
+
});
|
|
54832
|
+
Object.defineProperty(DChartAxisBaseTickContainer.prototype, "minor", {
|
|
54833
|
+
get: function () {
|
|
54834
|
+
return this._minor;
|
|
54835
|
+
},
|
|
54836
|
+
enumerable: false,
|
|
54837
|
+
configurable: true
|
|
54838
|
+
});
|
|
54839
|
+
DChartAxisBaseTickContainer.prototype.bind = function (container, index) {
|
|
54840
|
+
this._container = container;
|
|
54841
|
+
this._index = index;
|
|
54842
|
+
this._major.bind(container, index);
|
|
54843
|
+
this._minor.bind(container, index);
|
|
54844
|
+
};
|
|
54845
|
+
DChartAxisBaseTickContainer.prototype.unbind = function () {
|
|
54846
|
+
this._minor.unbind();
|
|
54847
|
+
this._major.unbind();
|
|
54848
|
+
this._index = 0;
|
|
54849
|
+
this._container = undefined;
|
|
54850
|
+
};
|
|
54851
|
+
DChartAxisBaseTickContainer.prototype.update = function () {
|
|
54852
|
+
var container = this._container;
|
|
54853
|
+
var majorShapes = this._major.shapes;
|
|
54854
|
+
var minorShapes = this._minor.shapes;
|
|
54855
|
+
if (container != null && majorShapes && minorShapes) {
|
|
54856
|
+
var plotArea = container.plotArea;
|
|
54857
|
+
var bounds = plotArea.getBoundsInContainer();
|
|
54858
|
+
var transform = plotArea.container.transform.localTransform;
|
|
54859
|
+
var gridlineShapes = this._major.gridline.shapes;
|
|
54860
|
+
var parser = this._parser;
|
|
54861
|
+
var offset = parser.padding * this._index;
|
|
54862
|
+
var coordinate = void 0;
|
|
54863
|
+
switch (parser.position) {
|
|
54864
|
+
case DChartAxisPosition.TOP:
|
|
54865
|
+
coordinate = plotArea.coordinate.x.get(parser.coordinateIndex);
|
|
54866
|
+
if (coordinate) {
|
|
54867
|
+
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
|
|
54868
|
+
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
|
|
54869
|
+
var plotAreaHeight = plotArea.height;
|
|
54870
|
+
return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaHeight);
|
|
54871
|
+
}
|
|
54872
|
+
break;
|
|
54873
|
+
case DChartAxisPosition.BOTTOM:
|
|
54874
|
+
coordinate = plotArea.coordinate.x.get(parser.coordinateIndex);
|
|
54875
|
+
if (coordinate) {
|
|
54876
|
+
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
|
|
54877
|
+
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
|
|
54878
|
+
var plotAreaHeight = plotArea.height;
|
|
54879
|
+
return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + offset, transform, plotAreaHeight);
|
|
54880
|
+
}
|
|
54881
|
+
break;
|
|
54882
|
+
case DChartAxisPosition.LEFT:
|
|
54883
|
+
coordinate = plotArea.coordinate.y.get(parser.coordinateIndex);
|
|
54884
|
+
if (coordinate) {
|
|
54885
|
+
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
|
|
54886
|
+
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
|
|
54887
|
+
var plotAreaWidth = plotArea.width;
|
|
54888
|
+
return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaWidth);
|
|
54889
|
+
}
|
|
54890
|
+
break;
|
|
54891
|
+
case DChartAxisPosition.RIGHT:
|
|
54892
|
+
coordinate = plotArea.coordinate.y.get(parser.coordinateIndex);
|
|
54893
|
+
if (coordinate) {
|
|
54894
|
+
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
|
|
54895
|
+
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
|
|
54896
|
+
var plotAreaWidth = plotArea.width;
|
|
54897
|
+
return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + offset, transform, plotAreaWidth);
|
|
54898
|
+
}
|
|
54899
|
+
break;
|
|
54900
|
+
}
|
|
54901
|
+
}
|
|
54902
|
+
return false;
|
|
54903
|
+
};
|
|
54904
|
+
DChartAxisBaseTickContainer.prototype.updateX = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionY, transform, plotAreaHeight) {
|
|
54905
|
+
var tick = this._parser.tick;
|
|
54548
54906
|
var majorTick = tick.major;
|
|
54549
54907
|
var majorCount = majorTick.count;
|
|
54550
54908
|
var majorCapacity = majorTick.capacity;
|
|
@@ -54605,8 +54963,8 @@
|
|
|
54605
54963
|
}
|
|
54606
54964
|
return true;
|
|
54607
54965
|
};
|
|
54608
|
-
|
|
54609
|
-
var tick = this.
|
|
54966
|
+
DChartAxisBaseTickContainer.prototype.updateY = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionX, transform, plotAreaWidth) {
|
|
54967
|
+
var tick = this._parser.tick;
|
|
54610
54968
|
var majorTick = tick.major;
|
|
54611
54969
|
var majorCount = majorTick.count;
|
|
54612
54970
|
var majorCapacity = majorTick.capacity;
|
|
@@ -54667,235 +55025,79 @@
|
|
|
54667
55025
|
}
|
|
54668
55026
|
return true;
|
|
54669
55027
|
};
|
|
54670
|
-
|
|
54671
|
-
|
|
54672
|
-
|
|
54673
|
-
|
|
54674
|
-
|
|
54675
|
-
var plotArea = container.plotArea;
|
|
54676
|
-
var bounds = plotArea.getBoundsInContainer();
|
|
54677
|
-
var transform = plotArea.container.transform.localTransform;
|
|
54678
|
-
var gridlineShapes = tick.major.gridline.shapes;
|
|
54679
|
-
var coordinateIndex = this._coordinateIndex;
|
|
54680
|
-
var padding = this._padding * this._index;
|
|
54681
|
-
var coordinate = void 0;
|
|
54682
|
-
switch (this._position) {
|
|
54683
|
-
case DChartAxisPosition.TOP:
|
|
54684
|
-
coordinate = plotArea.coordinate.x.get(coordinateIndex);
|
|
54685
|
-
if (coordinate) {
|
|
54686
|
-
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
|
|
54687
|
-
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
|
|
54688
|
-
var plotAreaHeight = plotArea.height;
|
|
54689
|
-
return this.updateTicksX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - padding, transform, plotAreaHeight);
|
|
54690
|
-
}
|
|
54691
|
-
break;
|
|
54692
|
-
case DChartAxisPosition.BOTTOM:
|
|
54693
|
-
coordinate = plotArea.coordinate.x.get(coordinateIndex);
|
|
54694
|
-
if (coordinate) {
|
|
54695
|
-
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
|
|
54696
|
-
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
|
|
54697
|
-
var plotAreaHeight = plotArea.height;
|
|
54698
|
-
return this.updateTicksX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + padding, transform, plotAreaHeight);
|
|
54699
|
-
}
|
|
54700
|
-
break;
|
|
54701
|
-
case DChartAxisPosition.LEFT:
|
|
54702
|
-
coordinate = plotArea.coordinate.y.get(coordinateIndex);
|
|
54703
|
-
if (coordinate) {
|
|
54704
|
-
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
|
|
54705
|
-
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
|
|
54706
|
-
var plotAreaWidth = plotArea.width;
|
|
54707
|
-
return this.updateTicksY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - padding, transform, plotAreaWidth);
|
|
54708
|
-
}
|
|
54709
|
-
break;
|
|
54710
|
-
case DChartAxisPosition.RIGHT:
|
|
54711
|
-
coordinate = plotArea.coordinate.y.get(coordinateIndex);
|
|
54712
|
-
if (coordinate) {
|
|
54713
|
-
var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
|
|
54714
|
-
var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
|
|
54715
|
-
var plotAreaWidth = plotArea.width;
|
|
54716
|
-
return this.updateTicksY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + padding, transform, plotAreaWidth);
|
|
54717
|
-
}
|
|
54718
|
-
break;
|
|
54719
|
-
}
|
|
54720
|
-
}
|
|
54721
|
-
return false;
|
|
55028
|
+
DChartAxisBaseTickContainer.prototype.destroy = function () {
|
|
55029
|
+
this._major.destroy();
|
|
55030
|
+
this._minor.destroy();
|
|
55031
|
+
this._index = 0;
|
|
55032
|
+
this._container = undefined;
|
|
54722
55033
|
};
|
|
55034
|
+
return DChartAxisBaseTickContainer;
|
|
55035
|
+
}());
|
|
55036
|
+
|
|
55037
|
+
/*
|
|
55038
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
55039
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
55040
|
+
*/
|
|
55041
|
+
var DChartAxisBase = /** @class */ (function () {
|
|
55042
|
+
function DChartAxisBase(options) {
|
|
55043
|
+
var theme = this.toTheme(options);
|
|
55044
|
+
this._theme = theme;
|
|
55045
|
+
var parser = new DChartAxisBaseOptionParser(theme, options);
|
|
55046
|
+
this._parser = parser;
|
|
55047
|
+
this._index = 0;
|
|
55048
|
+
this._bar = new DChartAxisBaseBar(parser);
|
|
55049
|
+
this._tick = new DChartAxisBaseTickContainer(parser);
|
|
55050
|
+
}
|
|
55051
|
+
Object.defineProperty(DChartAxisBase.prototype, "position", {
|
|
55052
|
+
get: function () {
|
|
55053
|
+
return this._parser.position;
|
|
55054
|
+
},
|
|
55055
|
+
enumerable: false,
|
|
55056
|
+
configurable: true
|
|
55057
|
+
});
|
|
55058
|
+
Object.defineProperty(DChartAxisBase.prototype, "bar", {
|
|
55059
|
+
get: function () {
|
|
55060
|
+
return this._bar;
|
|
55061
|
+
},
|
|
55062
|
+
enumerable: false,
|
|
55063
|
+
configurable: true
|
|
55064
|
+
});
|
|
55065
|
+
Object.defineProperty(DChartAxisBase.prototype, "tick", {
|
|
55066
|
+
get: function () {
|
|
55067
|
+
return this._tick;
|
|
55068
|
+
},
|
|
55069
|
+
enumerable: false,
|
|
55070
|
+
configurable: true
|
|
55071
|
+
});
|
|
54723
55072
|
DChartAxisBase.prototype.bind = function (container, index) {
|
|
54724
55073
|
this._container = container;
|
|
54725
55074
|
this._index = index;
|
|
54726
|
-
|
|
54727
|
-
|
|
54728
|
-
var bar = this._bar;
|
|
54729
|
-
var barShape = bar.shape;
|
|
54730
|
-
if (!barShape) {
|
|
54731
|
-
var position = this._position;
|
|
54732
|
-
var barPosition = position === DChartAxisPosition.LEFT || position === DChartAxisPosition.RIGHT
|
|
54733
|
-
? EShapeBarPosition.TOP
|
|
54734
|
-
: EShapeBarPosition.LEFT;
|
|
54735
|
-
var barStyle = bar.style || EShapePointsStyle.NONE;
|
|
54736
|
-
barShape = new EShapeBar();
|
|
54737
|
-
barShape.points.position = barPosition;
|
|
54738
|
-
barShape.points.style = barStyle;
|
|
54739
|
-
barShape.stroke.copy(bar.stroke);
|
|
54740
|
-
barShape.text.copy(this._label);
|
|
54741
|
-
this._bar.shape = barShape;
|
|
54742
|
-
}
|
|
54743
|
-
barShape.attach(container.container);
|
|
54744
|
-
// Major tick gridline
|
|
54745
|
-
var tick = this._tick;
|
|
54746
|
-
var tickMajor = tick.major;
|
|
54747
|
-
var gridline = tickMajor.gridline;
|
|
54748
|
-
var gridlineShapes = gridline.shapes;
|
|
54749
|
-
if (!gridlineShapes && tick.enable && gridline.enable) {
|
|
54750
|
-
gridlineShapes = [];
|
|
54751
|
-
gridline.shapes = gridlineShapes;
|
|
54752
|
-
var position = this._position;
|
|
54753
|
-
var gridlinePosition = position === DChartAxisPosition.LEFT || position === DChartAxisPosition.RIGHT
|
|
54754
|
-
? EShapeBarPosition.LEFT
|
|
54755
|
-
: EShapeBarPosition.TOP;
|
|
54756
|
-
var gridlineCapacity = tickMajor.capacity;
|
|
54757
|
-
var gridlineStyle = gridline.style || EShapePointsStyle.NONE;
|
|
54758
|
-
for (var i = 0; i < gridlineCapacity; ++i) {
|
|
54759
|
-
var gridlineShape = new EShapeBar();
|
|
54760
|
-
gridlineShape.points.position = gridlinePosition;
|
|
54761
|
-
gridlineShape.points.style = gridlineStyle;
|
|
54762
|
-
gridlineShape.stroke.copy(gridline.stroke);
|
|
54763
|
-
gridlineShapes.push(gridlineShape);
|
|
54764
|
-
}
|
|
54765
|
-
}
|
|
54766
|
-
if (gridlineShapes) {
|
|
54767
|
-
for (var i = 0, imax = gridlineShapes.length; i < imax; ++i) {
|
|
54768
|
-
gridlineShapes[i].attach(tickShapeContainer);
|
|
54769
|
-
}
|
|
54770
|
-
}
|
|
54771
|
-
// Major ticks
|
|
54772
|
-
var tickMajorShapes = tickMajor.shapes;
|
|
54773
|
-
if (!tickMajorShapes && tick.enable) {
|
|
54774
|
-
tickMajorShapes = [];
|
|
54775
|
-
tickMajor.shapes = tickMajorShapes;
|
|
54776
|
-
var tickMajorCapacity = tickMajor.capacity;
|
|
54777
|
-
var tickMajorSize = tickMajor.size;
|
|
54778
|
-
var tickMajorPosition = tickMajor.position;
|
|
54779
|
-
var tickMajorStyle = tickMajor.style || EShapePointsStyle.NONE;
|
|
54780
|
-
for (var i = 0; i < tickMajorCapacity; ++i) {
|
|
54781
|
-
var tickMajorShape = new EShapeBar();
|
|
54782
|
-
tickMajorShape.points.position = tickMajorPosition;
|
|
54783
|
-
tickMajorShape.points.size = tickMajorSize;
|
|
54784
|
-
tickMajorShape.points.style = tickMajorStyle;
|
|
54785
|
-
tickMajorShape.stroke.copy(tickMajor.stroke);
|
|
54786
|
-
tickMajorShape.text.copy(tickMajor.text);
|
|
54787
|
-
tickMajorShape.size.set(0, 0);
|
|
54788
|
-
tickMajorShapes.push(tickMajorShape);
|
|
54789
|
-
}
|
|
54790
|
-
}
|
|
54791
|
-
if (tickMajorShapes) {
|
|
54792
|
-
for (var i = 0, imax = tickMajorShapes.length; i < imax; ++i) {
|
|
54793
|
-
tickMajorShapes[i].attach(tickShapeContainer);
|
|
54794
|
-
}
|
|
54795
|
-
}
|
|
54796
|
-
// Minor ticks
|
|
54797
|
-
var tickMinor = tick.minor;
|
|
54798
|
-
var tickMinorShapes = tickMinor.shapes;
|
|
54799
|
-
if (!tickMinorShapes && tick.enable) {
|
|
54800
|
-
tickMinorShapes = [];
|
|
54801
|
-
tickMinor.shapes = tickMinorShapes;
|
|
54802
|
-
var tickMinorCount = tickMinor.count;
|
|
54803
|
-
var tickMinorSize = tickMinor.size;
|
|
54804
|
-
var tickMinorPosition = tickMinor.position;
|
|
54805
|
-
var tickMinorStyle = tickMinor.style || EShapePointsStyle.NONE;
|
|
54806
|
-
for (var i = 0, imax = (tickMajor.capacity + 1) * tickMinorCount; i < imax; ++i) {
|
|
54807
|
-
var tickMinorShape = new EShapeBar();
|
|
54808
|
-
tickMinorShape.points.position = tickMinorPosition;
|
|
54809
|
-
tickMinorShape.points.size = tickMinorSize;
|
|
54810
|
-
tickMinorShape.points.style = tickMinorStyle;
|
|
54811
|
-
tickMinorShape.stroke.copy(tickMinor.stroke);
|
|
54812
|
-
tickMinorShape.size.set(0, 0);
|
|
54813
|
-
tickMinorShapes.push(tickMinorShape);
|
|
54814
|
-
}
|
|
54815
|
-
}
|
|
54816
|
-
if (tickMinorShapes) {
|
|
54817
|
-
for (var i = 0, imax = tickMinorShapes.length; i < imax; ++i) {
|
|
54818
|
-
tickMinorShapes[i].attach(tickShapeContainer);
|
|
54819
|
-
}
|
|
54820
|
-
}
|
|
55075
|
+
this._bar.bind(container, index);
|
|
55076
|
+
this._tick.bind(container, index);
|
|
54821
55077
|
};
|
|
54822
55078
|
DChartAxisBase.prototype.unbind = function () {
|
|
54823
|
-
|
|
54824
|
-
|
|
54825
|
-
|
|
54826
|
-
barShape.detach();
|
|
54827
|
-
}
|
|
54828
|
-
// Major ticks
|
|
54829
|
-
var tick = this._tick;
|
|
54830
|
-
var tickMajorShapes = tick.major.shapes;
|
|
54831
|
-
if (tickMajorShapes) {
|
|
54832
|
-
for (var i = 0, imax = tickMajorShapes.length; i < imax; ++i) {
|
|
54833
|
-
tickMajorShapes[i].detach();
|
|
54834
|
-
}
|
|
54835
|
-
}
|
|
54836
|
-
// Major tick gridlines
|
|
54837
|
-
var tickMajorGridlineShapes = tick.major.gridline.shapes;
|
|
54838
|
-
if (tickMajorGridlineShapes) {
|
|
54839
|
-
for (var i = 0, imax = tickMajorGridlineShapes.length; i < imax; ++i) {
|
|
54840
|
-
tickMajorGridlineShapes[i].detach();
|
|
54841
|
-
}
|
|
54842
|
-
}
|
|
54843
|
-
// Minor ticks
|
|
54844
|
-
var tickMinorShapes = tick.minor.shapes;
|
|
54845
|
-
if (tickMinorShapes) {
|
|
54846
|
-
for (var i = 0, imax = tickMinorShapes.length; i < imax; ++i) {
|
|
54847
|
-
tickMinorShapes[i].detach();
|
|
54848
|
-
}
|
|
54849
|
-
}
|
|
54850
|
-
//
|
|
55079
|
+
this._tick.unbind();
|
|
55080
|
+
this._bar.unbind();
|
|
55081
|
+
this._index = 0;
|
|
54851
55082
|
this._container = undefined;
|
|
54852
55083
|
};
|
|
54853
55084
|
DChartAxisBase.prototype.update = function () {
|
|
54854
|
-
var
|
|
54855
|
-
|
|
54856
|
-
|
|
54857
|
-
var
|
|
54858
|
-
if (
|
|
55085
|
+
var isBarUpdated = this._bar.update();
|
|
55086
|
+
var isTicksUpdated = this._tick.update();
|
|
55087
|
+
if (isBarUpdated || isTicksUpdated) {
|
|
55088
|
+
var container = this._container;
|
|
55089
|
+
if (container) {
|
|
54859
55090
|
DApplications.update(container.plotArea);
|
|
54860
55091
|
}
|
|
54861
55092
|
}
|
|
54862
55093
|
};
|
|
54863
55094
|
DChartAxisBase.prototype.onRender = function () {
|
|
54864
|
-
|
|
54865
|
-
|
|
54866
|
-
this.updateBar(container);
|
|
54867
|
-
this.updateTicks(container);
|
|
54868
|
-
}
|
|
55095
|
+
this._bar.update();
|
|
55096
|
+
this._tick.update();
|
|
54869
55097
|
};
|
|
54870
55098
|
DChartAxisBase.prototype.destroy = function () {
|
|
54871
|
-
|
|
54872
|
-
|
|
54873
|
-
if (barShape) {
|
|
54874
|
-
barShape.destroy();
|
|
54875
|
-
}
|
|
54876
|
-
// Major ticks
|
|
54877
|
-
var tick = this._tick;
|
|
54878
|
-
var tickMajorShapes = tick.major.shapes;
|
|
54879
|
-
if (tickMajorShapes) {
|
|
54880
|
-
for (var i = 0, imax = tickMajorShapes.length; i < imax; ++i) {
|
|
54881
|
-
tickMajorShapes[i].destroy();
|
|
54882
|
-
}
|
|
54883
|
-
}
|
|
54884
|
-
// Major tick gridlines
|
|
54885
|
-
var tickMajorGridlineShapes = tick.major.gridline.shapes;
|
|
54886
|
-
if (tickMajorGridlineShapes) {
|
|
54887
|
-
for (var i = 0, imax = tickMajorGridlineShapes.length; i < imax; ++i) {
|
|
54888
|
-
tickMajorGridlineShapes[i].destroy();
|
|
54889
|
-
}
|
|
54890
|
-
}
|
|
54891
|
-
// Minor ticks
|
|
54892
|
-
var tickMinorShapes = tick.minor.shapes;
|
|
54893
|
-
if (tickMinorShapes) {
|
|
54894
|
-
for (var i = 0, imax = tickMinorShapes.length; i < imax; ++i) {
|
|
54895
|
-
tickMinorShapes[i].destroy();
|
|
54896
|
-
}
|
|
54897
|
-
}
|
|
54898
|
-
//
|
|
55099
|
+
this._bar.destroy();
|
|
55100
|
+
this._tick.destroy();
|
|
54899
55101
|
this._container = undefined;
|
|
54900
55102
|
};
|
|
54901
55103
|
DChartAxisBase.prototype.toTheme = function (options) {
|
|
@@ -54952,7 +55154,7 @@
|
|
|
54952
55154
|
};
|
|
54953
55155
|
DChartAxisContainerImpl.prototype.get = function (position, index) {
|
|
54954
55156
|
var list = this._list;
|
|
54955
|
-
var axes = list.get(position);
|
|
55157
|
+
var axes = list.get(toEnum(position, DChartAxisPosition));
|
|
54956
55158
|
if (axes) {
|
|
54957
55159
|
if (0 <= index && index < axes.length) {
|
|
54958
55160
|
return axes[index];
|
|
@@ -54970,7 +55172,7 @@
|
|
|
54970
55172
|
};
|
|
54971
55173
|
DChartAxisContainerImpl.prototype.clear = function (position) {
|
|
54972
55174
|
var list = this._list;
|
|
54973
|
-
var axes = list.get(position);
|
|
55175
|
+
var axes = list.get(toEnum(position, DChartAxisPosition));
|
|
54974
55176
|
if (axes) {
|
|
54975
55177
|
for (var i = 0, imax = axes.length; i < imax; ++i) {
|
|
54976
55178
|
axes[i].destroy();
|
|
@@ -54981,7 +55183,7 @@
|
|
|
54981
55183
|
};
|
|
54982
55184
|
DChartAxisContainerImpl.prototype.size = function (position) {
|
|
54983
55185
|
var list = this._list;
|
|
54984
|
-
var axes = list.get(position);
|
|
55186
|
+
var axes = list.get(toEnum(position, DChartAxisPosition));
|
|
54985
55187
|
if (axes) {
|
|
54986
55188
|
return axes.length;
|
|
54987
55189
|
}
|
|
@@ -55548,11 +55750,11 @@
|
|
|
55548
55750
|
return this;
|
|
55549
55751
|
};
|
|
55550
55752
|
DChartRegionImpl.prototype.add = function (from, to) {
|
|
55551
|
-
if (!isNaN(from)) {
|
|
55552
|
-
this.from = isNaN(this.from) ? from : Math.min(this.from, from);
|
|
55753
|
+
if (!isNaN$1(from)) {
|
|
55754
|
+
this.from = isNaN$1(this.from) ? from : Math.min(this.from, from);
|
|
55553
55755
|
}
|
|
55554
|
-
if (!isNaN(to)) {
|
|
55555
|
-
this.to = isNaN(this.to) ? to : Math.max(this.to, to);
|
|
55756
|
+
if (!isNaN$1(to)) {
|
|
55757
|
+
this.to = isNaN$1(this.to) ? to : Math.max(this.to, to);
|
|
55556
55758
|
}
|
|
55557
55759
|
return this;
|
|
55558
55760
|
};
|
|
@@ -55673,7 +55875,7 @@
|
|
|
55673
55875
|
DChartCoordinateLinear.prototype.doFit_ = function (pixelFrom, pixelTo, region, result) {
|
|
55674
55876
|
var regionFrom = region.from;
|
|
55675
55877
|
var regionTo = region.to;
|
|
55676
|
-
if (!(isNaN(regionFrom) || isNaN(regionTo))) {
|
|
55878
|
+
if (!(isNaN$1(regionFrom) || isNaN$1(regionTo))) {
|
|
55677
55879
|
// Scale
|
|
55678
55880
|
var newScale = 1;
|
|
55679
55881
|
var regionSize = regionTo - regionFrom;
|
|
@@ -55972,7 +56174,7 @@
|
|
|
55972
56174
|
DChartCoordinateLog.prototype.doFit_ = function (pixelFrom, pixelTo, region, result) {
|
|
55973
56175
|
var regionFrom = region.from;
|
|
55974
56176
|
var regionTo = region.to;
|
|
55975
|
-
if (!(isNaN(regionFrom) || isNaN(regionTo))) {
|
|
56177
|
+
if (!(isNaN$1(regionFrom) || isNaN$1(regionTo))) {
|
|
55976
56178
|
// Scale
|
|
55977
56179
|
var newScale = 1;
|
|
55978
56180
|
var regionFromMapped = this.map(regionFrom);
|
|
@@ -56768,13 +56970,13 @@
|
|
|
56768
56970
|
DChartRegionImplObservable.prototype.set = function (from, to) {
|
|
56769
56971
|
var isChanged = false;
|
|
56770
56972
|
if (from != null && this._from !== from) {
|
|
56771
|
-
if (!isNaN(this._from) || !isNaN(from)) {
|
|
56973
|
+
if (!isNaN$1(this._from) || !isNaN$1(from)) {
|
|
56772
56974
|
this._from = from;
|
|
56773
56975
|
isChanged = true;
|
|
56774
56976
|
}
|
|
56775
56977
|
}
|
|
56776
56978
|
if (to != null && this._to !== to) {
|
|
56777
|
-
if (!isNaN(this._to) || !isNaN(to)) {
|
|
56979
|
+
if (!isNaN$1(this._to) || !isNaN$1(to)) {
|
|
56778
56980
|
this._to = to;
|
|
56779
56981
|
isChanged = true;
|
|
56780
56982
|
}
|
|
@@ -56786,12 +56988,12 @@
|
|
|
56786
56988
|
};
|
|
56787
56989
|
DChartRegionImplObservable.prototype.add = function (from, to) {
|
|
56788
56990
|
var newFrom;
|
|
56789
|
-
if (!isNaN(from)) {
|
|
56790
|
-
newFrom = isNaN(this.from) ? from : Math.min(this.from, from);
|
|
56991
|
+
if (!isNaN$1(from)) {
|
|
56992
|
+
newFrom = isNaN$1(this.from) ? from : Math.min(this.from, from);
|
|
56791
56993
|
}
|
|
56792
56994
|
var newTo;
|
|
56793
|
-
if (!isNaN(to)) {
|
|
56794
|
-
newTo = isNaN(this.to) ? to : Math.max(this.to, to);
|
|
56995
|
+
if (!isNaN$1(to)) {
|
|
56996
|
+
newTo = isNaN$1(this.to) ? to : Math.max(this.to, to);
|
|
56795
56997
|
}
|
|
56796
56998
|
return this.set(newFrom, newTo);
|
|
56797
56999
|
};
|
|
@@ -73307,7 +73509,7 @@
|
|
|
73307
73509
|
DynamicSDFFontGenerator: DynamicSDFFontGenerator,
|
|
73308
73510
|
isArray: isArray,
|
|
73309
73511
|
isFunction: isFunction,
|
|
73310
|
-
isNaN: isNaN,
|
|
73512
|
+
isNaN: isNaN$1,
|
|
73311
73513
|
isNumber: isNumber,
|
|
73312
73514
|
isObject: isObject,
|
|
73313
73515
|
isString: isString,
|