@wcardinal/wcardinal-ui 0.290.0 → 0.292.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.
Files changed (69) hide show
  1. package/dist/types/wcardinal/ui/d-chart-axis-bar.d.ts +5 -0
  2. package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +69 -37
  3. package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +54 -20
  4. package/dist/types/wcardinal/ui/d-chart-axis-base-tick-container.d.ts +17 -6
  5. package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +10 -8
  6. package/dist/types/wcardinal/ui/d-chart-axis-tick-container.d.ts +5 -0
  7. package/dist/types/wcardinal/ui/d-chart-axis-tick-major.d.ts +4 -0
  8. package/dist/types/wcardinal/ui/d-chart-axis-tick-minor.d.ts +4 -0
  9. package/dist/types/wcardinal/ui/d-chart-axis-x-datetime.d.ts +3 -2
  10. package/dist/types/wcardinal/ui/d-chart-axis-x.d.ts +3 -3
  11. package/dist/types/wcardinal/ui/d-chart-axis-y.d.ts +3 -3
  12. package/dist/types/wcardinal/ui/d-chart-coordinate-base.d.ts +52 -0
  13. package/dist/types/wcardinal/ui/d-chart-coordinate-linear.d.ts +4 -46
  14. package/dist/types/wcardinal/ui/d-chart-coordinate-log.d.ts +4 -42
  15. package/dist/types/wcardinal/ui/d-table-body.d.ts +7 -0
  16. package/dist/types/wcardinal/ui/index.d.ts +11 -0
  17. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.d.ts +7 -0
  18. package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.d.ts +7 -0
  19. package/dist/wcardinal/ui/d-chart-axis-bar.js.map +1 -1
  20. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +152 -34
  21. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
  22. package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
  23. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +64 -43
  24. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
  25. package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js +1 -0
  26. package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js.map +1 -1
  27. package/dist/wcardinal/ui/d-chart-axis-base.js +21 -4
  28. package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
  29. package/dist/wcardinal/ui/d-chart-axis-tick-container.js.map +1 -1
  30. package/dist/wcardinal/ui/d-chart-axis-tick-major.js.map +1 -1
  31. package/dist/wcardinal/ui/d-chart-axis-tick-minor.js.map +1 -1
  32. package/dist/wcardinal/ui/d-chart-axis-x-datetime.js.map +1 -1
  33. package/dist/wcardinal/ui/d-chart-axis-x.js.map +1 -1
  34. package/dist/wcardinal/ui/d-chart-axis-y.js.map +1 -1
  35. package/dist/wcardinal/ui/d-chart-coordinate-base.js +186 -0
  36. package/dist/wcardinal/ui/d-chart-coordinate-base.js.map +1 -0
  37. package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js +2 -1
  38. package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js.map +1 -1
  39. package/dist/wcardinal/ui/d-chart-coordinate-linear.js +9 -165
  40. package/dist/wcardinal/ui/d-chart-coordinate-linear.js.map +1 -1
  41. package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js +2 -1
  42. package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js.map +1 -1
  43. package/dist/wcardinal/ui/d-chart-coordinate-log.js +9 -153
  44. package/dist/wcardinal/ui/d-chart-coordinate-log.js.map +1 -1
  45. package/dist/wcardinal/ui/d-chart-series-line-of-any.js +4 -2
  46. package/dist/wcardinal/ui/d-chart-series-line-of-any.js.map +1 -1
  47. package/dist/wcardinal/ui/d-scroll-bar-vertical.js +1 -0
  48. package/dist/wcardinal/ui/d-scroll-bar-vertical.js.map +1 -1
  49. package/dist/wcardinal/ui/d-table-body.js +39 -0
  50. package/dist/wcardinal/ui/d-table-body.js.map +1 -1
  51. package/dist/wcardinal/ui/d-table.js +3 -3
  52. package/dist/wcardinal/ui/d-table.js.map +1 -1
  53. package/dist/wcardinal/ui/index.js +11 -0
  54. package/dist/wcardinal/ui/index.js.map +1 -1
  55. package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js +21 -0
  56. package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js.map +1 -1
  57. package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js +21 -0
  58. package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js.map +1 -1
  59. package/dist/wcardinal-ui-theme-dark.js +22 -1
  60. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  61. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  62. package/dist/wcardinal-ui-theme-white.js +22 -1
  63. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  64. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  65. package/dist/wcardinal-ui.cjs.js +781 -652
  66. package/dist/wcardinal-ui.js +739 -652
  67. package/dist/wcardinal-ui.min.js +2 -2
  68. package/dist/wcardinal-ui.min.js.map +1 -1
  69. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.290.0
2
+ Winter Cardinal UI v0.292.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -48931,6 +48931,27 @@ var DThemeWhiteChartAxisBase = /** @class */ (function () {
48931
48931
  DThemeWhiteChartAxisBase.prototype.getMinorTickStyle = function () {
48932
48932
  return undefined;
48933
48933
  };
48934
+ DThemeWhiteChartAxisBase.prototype.getMinorTickTextAlignHorizontal = function (position) {
48935
+ return this.getMajorTickTextAlignHorizontal(position);
48936
+ };
48937
+ DThemeWhiteChartAxisBase.prototype.getMinorTickTextAlignVertical = function (position) {
48938
+ return this.getMajorTickTextAlignVertical(position);
48939
+ };
48940
+ DThemeWhiteChartAxisBase.prototype.getMinorTickTextDirection = function () {
48941
+ return this.getMajorTickTextDirection();
48942
+ };
48943
+ DThemeWhiteChartAxisBase.prototype.getMinorTickTextColor = function () {
48944
+ return this.getStrokeColor();
48945
+ };
48946
+ DThemeWhiteChartAxisBase.prototype.getMinorTickTextFormat = function () {
48947
+ return undefined;
48948
+ };
48949
+ DThemeWhiteChartAxisBase.prototype.getMinorTickTextPaddingHorizontal = function () {
48950
+ return this.getMajorTickTextPaddingHorizontal();
48951
+ };
48952
+ DThemeWhiteChartAxisBase.prototype.getMinorTickTextPaddingVertical = function () {
48953
+ return this.getMajorTickTextPaddingVertical();
48954
+ };
48934
48955
  DThemeWhiteChartAxisBase.prototype.getMinorTickStrokeEnable = function () {
48935
48956
  return true;
48936
48957
  };
@@ -58070,6 +58091,27 @@ var DThemeDarkChartAxisBase = /** @class */ (function () {
58070
58091
  DThemeDarkChartAxisBase.prototype.getMinorTickStyle = function () {
58071
58092
  return undefined;
58072
58093
  };
58094
+ DThemeDarkChartAxisBase.prototype.getMinorTickTextAlignHorizontal = function (position) {
58095
+ return this.getMajorTickTextAlignHorizontal(position);
58096
+ };
58097
+ DThemeDarkChartAxisBase.prototype.getMinorTickTextAlignVertical = function (position) {
58098
+ return this.getMajorTickTextAlignVertical(position);
58099
+ };
58100
+ DThemeDarkChartAxisBase.prototype.getMinorTickTextDirection = function () {
58101
+ return this.getMajorTickTextDirection();
58102
+ };
58103
+ DThemeDarkChartAxisBase.prototype.getMinorTickTextColor = function () {
58104
+ return this.getStrokeColor();
58105
+ };
58106
+ DThemeDarkChartAxisBase.prototype.getMinorTickTextFormat = function () {
58107
+ return undefined;
58108
+ };
58109
+ DThemeDarkChartAxisBase.prototype.getMinorTickTextPaddingHorizontal = function () {
58110
+ return this.getMajorTickTextPaddingHorizontal();
58111
+ };
58112
+ DThemeDarkChartAxisBase.prototype.getMinorTickTextPaddingVertical = function () {
58113
+ return this.getMajorTickTextPaddingVertical();
58114
+ };
58073
58115
  DThemeDarkChartAxisBase.prototype.getMinorTickStrokeEnable = function () {
58074
58116
  return true;
58075
58117
  };
@@ -71192,6 +71234,7 @@ var DScrollBarVertical = /** @class */ (function (_super) {
71192
71234
  var barLength = space * this._end + thumbMinimumLength - barStart;
71193
71235
  thumb.position.set(0, barStart);
71194
71236
  thumb.resize(width, barLength);
71237
+ thumb.updateTransform();
71195
71238
  };
71196
71239
  return DScrollBarVertical;
71197
71240
  }(DScrollBar));
@@ -72438,6 +72481,106 @@ var DCanvas = /** @class */ (function (_super) {
72438
72481
  return DCanvas;
72439
72482
  }(DBase));
72440
72483
 
72484
+ /*
72485
+ * Copyright (C) 2019 Toshiba Corporation
72486
+ * SPDX-License-Identifier: Apache-2.0
72487
+ */
72488
+ var DChartAxisBaseBar = /** @class */ (function () {
72489
+ function DChartAxisBaseBar(parser) {
72490
+ this._parser = parser;
72491
+ this._index = 0;
72492
+ }
72493
+ Object.defineProperty(DChartAxisBaseBar.prototype, "shape", {
72494
+ get: function () {
72495
+ var result = this._shape;
72496
+ if (result == null) {
72497
+ result = this.newShape();
72498
+ this._shape = result;
72499
+ }
72500
+ return result;
72501
+ },
72502
+ enumerable: false,
72503
+ configurable: true
72504
+ });
72505
+ DChartAxisBaseBar.prototype.newShape = function () {
72506
+ var _a;
72507
+ var parser = this._parser;
72508
+ var bar = parser.bar;
72509
+ var result = new EShapeBar();
72510
+ result.points.position = this.newShapePosition();
72511
+ result.points.style = (_a = bar.style) !== null && _a !== void 0 ? _a : EShapePointsStyle.NONE;
72512
+ result.stroke.copy(bar.stroke);
72513
+ result.text.copy(parser.label);
72514
+ return result;
72515
+ };
72516
+ DChartAxisBaseBar.prototype.newShapePosition = function () {
72517
+ switch (this._parser.position) {
72518
+ case DChartAxisPosition.LEFT:
72519
+ case DChartAxisPosition.RIGHT:
72520
+ return EShapeBarPosition.TOP;
72521
+ default:
72522
+ return EShapeBarPosition.LEFT;
72523
+ }
72524
+ };
72525
+ DChartAxisBaseBar.prototype.bind = function (container, index) {
72526
+ this._container = container;
72527
+ this._index = index;
72528
+ this.shape.attach(container.container);
72529
+ };
72530
+ DChartAxisBaseBar.prototype.unbind = function () {
72531
+ var shape = this._shape;
72532
+ if (shape != null) {
72533
+ shape.detach();
72534
+ }
72535
+ this._index = 0;
72536
+ this._container = undefined;
72537
+ };
72538
+ DChartAxisBaseBar.prototype.update = function () {
72539
+ var container = this._container;
72540
+ var index = this._index;
72541
+ var shape = this._shape;
72542
+ if (shape != null && container != null) {
72543
+ var plotArea = container.plotArea;
72544
+ var plotAreaWidth = plotArea.width;
72545
+ var plotAreaHeight = plotArea.height;
72546
+ var offset = this._parser.padding * index;
72547
+ shape.disallowUploadedUpdate();
72548
+ var position = shape.transform.position;
72549
+ var size = shape.size;
72550
+ switch (this._parser.position) {
72551
+ case DChartAxisPosition.TOP:
72552
+ position.set(plotAreaWidth * 0.5, 0 - offset);
72553
+ size.set(plotAreaWidth, 0);
72554
+ break;
72555
+ case DChartAxisPosition.BOTTOM:
72556
+ position.set(plotAreaWidth * 0.5, plotAreaHeight + offset);
72557
+ size.set(plotAreaWidth, 0);
72558
+ break;
72559
+ case DChartAxisPosition.LEFT:
72560
+ position.set(0 - offset, plotAreaHeight * 0.5);
72561
+ size.set(0, plotAreaHeight);
72562
+ break;
72563
+ case DChartAxisPosition.RIGHT:
72564
+ position.set(plotAreaWidth + offset, plotAreaHeight * 0.5);
72565
+ size.set(0, plotAreaHeight);
72566
+ break;
72567
+ }
72568
+ shape.allowUploadedUpdate();
72569
+ return true;
72570
+ }
72571
+ return false;
72572
+ };
72573
+ DChartAxisBaseBar.prototype.destroy = function () {
72574
+ var shape = this._shape;
72575
+ if (shape != null) {
72576
+ shape.destroy();
72577
+ }
72578
+ this._index = 0;
72579
+ this._container = undefined;
72580
+ };
72581
+ return DChartAxisBaseBar;
72582
+ }());
72583
+
72441
72584
  /*
72442
72585
  * Copyright (C) 2019 Toshiba Corporation
72443
72586
  * SPDX-License-Identifier: Apache-2.0
@@ -72447,7 +72590,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72447
72590
  var _a, _b;
72448
72591
  this._coordinateIndex = (_a = options === null || options === void 0 ? void 0 : options.coordinate) !== null && _a !== void 0 ? _a : 0;
72449
72592
  this._position = this.toPosition(theme, options);
72450
- this._tick = this.toTickContainer(theme, options);
72593
+ this._tick = this.toTick(theme, options);
72451
72594
  this._label = this.toLabel(theme, options);
72452
72595
  this._padding = (_b = options === null || options === void 0 ? void 0 : options.padding) !== null && _b !== void 0 ? _b : theme.getPadding();
72453
72596
  this._bar = this.toBar(theme, options);
@@ -72511,13 +72654,13 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72511
72654
  stroke: this.toBarStroke(theme, options === null || options === void 0 ? void 0 : options.stroke)
72512
72655
  };
72513
72656
  };
72514
- DChartAxisBaseOptionParser.prototype.toTickContainer = function (theme, options) {
72657
+ DChartAxisBaseOptionParser.prototype.toTick = function (theme, options) {
72515
72658
  var _a;
72516
72659
  var tick = options === null || options === void 0 ? void 0 : options.tick;
72517
72660
  return {
72518
72661
  enable: (_a = tick === null || tick === void 0 ? void 0 : tick.enable) !== null && _a !== void 0 ? _a : theme.getTickEnable(),
72519
72662
  major: this.toTickMajor(theme, tick),
72520
- minor: this.toMinorTick(theme, tick)
72663
+ minor: this.toTickMinor(theme, tick)
72521
72664
  };
72522
72665
  };
72523
72666
  DChartAxisBaseOptionParser.prototype.toTickMajor = function (theme, options) {
@@ -72538,8 +72681,8 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72538
72681
  position: this.toTickPosition(position),
72539
72682
  style: style,
72540
72683
  stroke: stroke,
72541
- text: this.toMajorTickText(theme, major === null || major === void 0 ? void 0 : major.text),
72542
- formatter: this.toMajorTickFormatter(theme, major),
72684
+ text: this.toTickMajorText(theme, major === null || major === void 0 ? void 0 : major.text),
72685
+ formatter: this.toTickMajorFormatter(theme, major),
72543
72686
  gridline: this.toTickMajorGridline(theme, major === null || major === void 0 ? void 0 : major.gridline, optionsStyle, optionsStroke)
72544
72687
  };
72545
72688
  };
@@ -72583,7 +72726,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72583
72726
  }
72584
72727
  }
72585
72728
  };
72586
- DChartAxisBaseOptionParser.prototype.toMinorTick = function (theme, options) {
72729
+ DChartAxisBaseOptionParser.prototype.toTickMinor = function (theme, options) {
72587
72730
  var _a, _b, _c, _d, _e, _f, _g;
72588
72731
  var minor = options === null || options === void 0 ? void 0 : options.minor;
72589
72732
  var position = (_b = (_a = minor === null || minor === void 0 ? void 0 : minor.position) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.position) !== null && _b !== void 0 ? _b : theme.getMinorTickPosition();
@@ -72594,7 +72737,9 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72594
72737
  size: (_g = minor === null || minor === void 0 ? void 0 : minor.size) !== null && _g !== void 0 ? _g : theme.getMinorTickSize(),
72595
72738
  position: this.toTickPosition(position),
72596
72739
  style: style,
72597
- stroke: this.toTickMinorStroke(theme, minor === null || minor === void 0 ? void 0 : minor.stroke, options === null || options === void 0 ? void 0 : options.stroke)
72740
+ stroke: this.toTickMinorStroke(theme, minor === null || minor === void 0 ? void 0 : minor.stroke, options === null || options === void 0 ? void 0 : options.stroke),
72741
+ text: this.toTickMinorText(theme, minor === null || minor === void 0 ? void 0 : minor.text),
72742
+ formatter: this.toTickMinorFormatter(theme, minor)
72598
72743
  };
72599
72744
  };
72600
72745
  DChartAxisBaseOptionParser.prototype.toBarStroke = function (theme, options) {
@@ -72620,7 +72765,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72620
72765
  width: (_h = (_g = optionsA.width) !== null && _g !== void 0 ? _g : optionsB.width) !== null && _h !== void 0 ? _h : width,
72621
72766
  align: (_k = (_j = optionsA.align) !== null && _j !== void 0 ? _j : optionsB.align) !== null && _k !== void 0 ? _k : align,
72622
72767
  side: (_m = (_l = optionsA.side) !== null && _l !== void 0 ? _l : optionsB.side) !== null && _m !== void 0 ? _m : side,
72623
- style: (_p = (_o = optionsA.style) !== null && _o !== void 0 ? _o : optionsB.style) !== null && _p !== void 0 ? _p : style
72768
+ style: this.toStrokeStyle((_p = (_o = optionsA.style) !== null && _o !== void 0 ? _o : optionsB.style) !== null && _p !== void 0 ? _p : style)
72624
72769
  };
72625
72770
  }
72626
72771
  else {
@@ -72631,7 +72776,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72631
72776
  width: (_t = optionsA.width) !== null && _t !== void 0 ? _t : width,
72632
72777
  align: (_u = optionsA.align) !== null && _u !== void 0 ? _u : align,
72633
72778
  side: (_v = optionsA.side) !== null && _v !== void 0 ? _v : side,
72634
- style: (_w = optionsA.style) !== null && _w !== void 0 ? _w : style
72779
+ style: this.toStrokeStyle((_w = optionsA.style) !== null && _w !== void 0 ? _w : style)
72635
72780
  };
72636
72781
  }
72637
72782
  }
@@ -72643,7 +72788,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72643
72788
  width: (_0 = optionsB.width) !== null && _0 !== void 0 ? _0 : width,
72644
72789
  align: (_1 = optionsB.align) !== null && _1 !== void 0 ? _1 : align,
72645
72790
  side: (_2 = optionsB.side) !== null && _2 !== void 0 ? _2 : side,
72646
- style: (_3 = optionsB.style) !== null && _3 !== void 0 ? _3 : style
72791
+ style: this.toStrokeStyle((_3 = optionsB.style) !== null && _3 !== void 0 ? _3 : style)
72647
72792
  };
72648
72793
  }
72649
72794
  else {
@@ -72658,12 +72803,28 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72658
72803
  };
72659
72804
  }
72660
72805
  };
72661
- DChartAxisBaseOptionParser.prototype.toMajorTickFormatter = function (theme, options) {
72806
+ DChartAxisBaseOptionParser.prototype.toStrokeStyle = function (target) {
72807
+ if (isString(target)) {
72808
+ return EShapeStrokeStyle[target];
72809
+ }
72810
+ else if (isArray(target)) {
72811
+ var result = EShapeStrokeStyle.NONE;
72812
+ for (var i = 0, imax = target.length; i < imax; ++i) {
72813
+ result |= EShapeStrokeStyle[target[i]];
72814
+ }
72815
+ return result;
72816
+ }
72817
+ return target;
72818
+ };
72819
+ DChartAxisBaseOptionParser.prototype.toTickMajorFormatter = function (theme, options) {
72662
72820
  var text = options === null || options === void 0 ? void 0 : options.text;
72663
72821
  if (text) {
72664
- var format = text.format;
72665
- if (format != null) {
72666
- return NumberFormatters.create(format);
72822
+ var format_1 = text.format;
72823
+ if (format_1 === null) {
72824
+ return undefined;
72825
+ }
72826
+ else if (format_1 != null) {
72827
+ return NumberFormatters.create(format_1);
72667
72828
  }
72668
72829
  else {
72669
72830
  var formatter = text.formatter;
@@ -72674,28 +72835,32 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72674
72835
  }
72675
72836
  }
72676
72837
  }
72677
- return NumberFormatters.create(theme.getMajorTickTextFormat());
72838
+ var format = theme.getMajorTickTextFormat();
72839
+ if (format != null) {
72840
+ return NumberFormatters.create(format);
72841
+ }
72842
+ return undefined;
72678
72843
  };
72679
- DChartAxisBaseOptionParser.prototype.toMajorTickText = function (theme, options) {
72844
+ DChartAxisBaseOptionParser.prototype.toTickMajorText = function (theme, options) {
72680
72845
  options = options || {};
72681
72846
  return {
72682
72847
  format: options.format,
72683
- color: this.toMajorTickTextColor(theme, options.color),
72848
+ color: this.toTickMajorTextColor(theme, options.color),
72684
72849
  alpha: options.alpha,
72685
72850
  family: options.family,
72686
72851
  size: options.size,
72687
- weight: options.weight,
72688
- align: this.toMajorTickTextAlign(theme, options.align),
72689
- offset: this.toMajorTickTextOffset(theme, options.offset),
72690
- style: options.style,
72691
- outline: this.toMajorTickTextOutline(theme, options.outline),
72692
- spacing: this.toMajorTickTextSpacing(theme, options.spacing),
72852
+ weight: toEnum(options.weight, EShapeTextWeight),
72853
+ align: this.toTickMajorTextAlign(theme, options.align),
72854
+ offset: this.toTickMajorTextOffset(theme, options.offset),
72855
+ style: toEnum(options.style, EShapeTextStyle),
72856
+ outline: this.toTickMajorTextOutline(theme, options.outline),
72857
+ spacing: this.toTickMajorTextSpacing(theme, options.spacing),
72693
72858
  direction: this.toTickMajorTextDirection(theme, options.direction),
72694
- padding: this.toMajorTickTextPadding(theme, options.padding),
72859
+ padding: this.toTickMajorTextPadding(theme, options.padding),
72695
72860
  clipping: options.clipping
72696
72861
  };
72697
72862
  };
72698
- DChartAxisBaseOptionParser.prototype.toMajorTickTextOutline = function (theme, options) {
72863
+ DChartAxisBaseOptionParser.prototype.toTickMajorTextOutline = function (theme, options) {
72699
72864
  if (options) {
72700
72865
  return {
72701
72866
  enable: options.enable,
@@ -72705,7 +72870,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72705
72870
  };
72706
72871
  }
72707
72872
  };
72708
- DChartAxisBaseOptionParser.prototype.toMajorTickTextAlign = function (theme, options) {
72873
+ DChartAxisBaseOptionParser.prototype.toTickMajorTextAlign = function (theme, options) {
72709
72874
  var _a, _b;
72710
72875
  var position = this._position;
72711
72876
  return {
@@ -72713,7 +72878,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72713
72878
  vertical: (_b = options === null || options === void 0 ? void 0 : options.vertical) !== null && _b !== void 0 ? _b : theme.getMajorTickTextAlignVertical(position)
72714
72879
  };
72715
72880
  };
72716
- DChartAxisBaseOptionParser.prototype.toMajorTickTextOffset = function (theme, options) {
72881
+ DChartAxisBaseOptionParser.prototype.toTickMajorTextOffset = function (theme, options) {
72717
72882
  if (options) {
72718
72883
  return {
72719
72884
  horizontal: options.horizontal,
@@ -72721,7 +72886,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72721
72886
  };
72722
72887
  }
72723
72888
  };
72724
- DChartAxisBaseOptionParser.prototype.toMajorTickTextSpacing = function (theme, options) {
72889
+ DChartAxisBaseOptionParser.prototype.toTickMajorTextSpacing = function (theme, options) {
72725
72890
  if (options) {
72726
72891
  return {
72727
72892
  horizontal: options.horizontal,
@@ -72729,7 +72894,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72729
72894
  };
72730
72895
  }
72731
72896
  };
72732
- DChartAxisBaseOptionParser.prototype.toMajorTickTextPadding = function (theme, options) {
72897
+ DChartAxisBaseOptionParser.prototype.toTickMajorTextPadding = function (theme, options) {
72733
72898
  var _a, _b;
72734
72899
  return {
72735
72900
  horizontal: (_a = options === null || options === void 0 ? void 0 : options.horizontal) !== null && _a !== void 0 ? _a : theme.getMajorTickTextPaddingHorizontal(),
@@ -72737,11 +72902,102 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72737
72902
  };
72738
72903
  };
72739
72904
  DChartAxisBaseOptionParser.prototype.toTickMajorTextDirection = function (theme, options) {
72740
- return options !== null && options !== void 0 ? options : theme.getMajorTickTextDirection();
72905
+ return toEnum(options !== null && options !== void 0 ? options : theme.getMajorTickTextDirection(), EShapeTextDirection);
72741
72906
  };
72742
- DChartAxisBaseOptionParser.prototype.toMajorTickTextColor = function (theme, options) {
72907
+ DChartAxisBaseOptionParser.prototype.toTickMajorTextColor = function (theme, options) {
72743
72908
  return options !== null && options !== void 0 ? options : theme.getMajorTickTextColor();
72744
72909
  };
72910
+ DChartAxisBaseOptionParser.prototype.toTickMinorFormatter = function (theme, options) {
72911
+ var text = options === null || options === void 0 ? void 0 : options.text;
72912
+ if (text) {
72913
+ var format_2 = text.format;
72914
+ if (format_2 === null) {
72915
+ return undefined;
72916
+ }
72917
+ else if (format_2 != null) {
72918
+ return NumberFormatters.create(format_2);
72919
+ }
72920
+ else {
72921
+ var formatter = text.formatter;
72922
+ if (formatter) {
72923
+ return {
72924
+ format: formatter
72925
+ };
72926
+ }
72927
+ }
72928
+ }
72929
+ var format = theme.getMinorTickTextFormat();
72930
+ if (format != null) {
72931
+ return NumberFormatters.create(format);
72932
+ }
72933
+ return undefined;
72934
+ };
72935
+ DChartAxisBaseOptionParser.prototype.toTickMinorText = function (theme, options) {
72936
+ options = options || {};
72937
+ return {
72938
+ format: options.format,
72939
+ color: this.toTickMinorTextColor(theme, options.color),
72940
+ alpha: options.alpha,
72941
+ family: options.family,
72942
+ size: options.size,
72943
+ weight: toEnum(options.weight, EShapeTextWeight),
72944
+ align: this.toTickMinorTextAlign(theme, options.align),
72945
+ offset: this.toTickMinorTextOffset(theme, options.offset),
72946
+ style: toEnum(options.style, EShapeTextStyle),
72947
+ outline: this.toTickMinorTextOutline(theme, options.outline),
72948
+ spacing: this.toTickMinorTextSpacing(theme, options.spacing),
72949
+ direction: this.toTickMinorTextDirection(theme, options.direction),
72950
+ padding: this.toTickMinorTextPadding(theme, options.padding),
72951
+ clipping: options.clipping
72952
+ };
72953
+ };
72954
+ DChartAxisBaseOptionParser.prototype.toTickMinorTextOutline = function (theme, options) {
72955
+ if (options) {
72956
+ return {
72957
+ enable: options.enable,
72958
+ color: options.color,
72959
+ alpha: options.alpha,
72960
+ width: options.width
72961
+ };
72962
+ }
72963
+ };
72964
+ DChartAxisBaseOptionParser.prototype.toTickMinorTextAlign = function (theme, options) {
72965
+ var _a, _b;
72966
+ var position = this._position;
72967
+ return {
72968
+ horizontal: (_a = options === null || options === void 0 ? void 0 : options.horizontal) !== null && _a !== void 0 ? _a : theme.getMinorTickTextAlignHorizontal(position),
72969
+ vertical: (_b = options === null || options === void 0 ? void 0 : options.vertical) !== null && _b !== void 0 ? _b : theme.getMinorTickTextAlignVertical(position)
72970
+ };
72971
+ };
72972
+ DChartAxisBaseOptionParser.prototype.toTickMinorTextOffset = function (theme, options) {
72973
+ if (options) {
72974
+ return {
72975
+ horizontal: options.horizontal,
72976
+ vertical: options.vertical
72977
+ };
72978
+ }
72979
+ };
72980
+ DChartAxisBaseOptionParser.prototype.toTickMinorTextSpacing = function (theme, options) {
72981
+ if (options) {
72982
+ return {
72983
+ horizontal: options.horizontal,
72984
+ vertical: options.vertical
72985
+ };
72986
+ }
72987
+ };
72988
+ DChartAxisBaseOptionParser.prototype.toTickMinorTextPadding = function (theme, options) {
72989
+ var _a, _b;
72990
+ return {
72991
+ horizontal: (_a = options === null || options === void 0 ? void 0 : options.horizontal) !== null && _a !== void 0 ? _a : theme.getMinorTickTextPaddingHorizontal(),
72992
+ vertical: (_b = options === null || options === void 0 ? void 0 : options.vertical) !== null && _b !== void 0 ? _b : theme.getMinorTickTextPaddingVertical()
72993
+ };
72994
+ };
72995
+ DChartAxisBaseOptionParser.prototype.toTickMinorTextDirection = function (theme, options) {
72996
+ return toEnum(options !== null && options !== void 0 ? options : theme.getMinorTickTextDirection(), EShapeTextDirection);
72997
+ };
72998
+ DChartAxisBaseOptionParser.prototype.toTickMinorTextColor = function (theme, options) {
72999
+ return options !== null && options !== void 0 ? options : theme.getMinorTickTextColor();
73000
+ };
72745
73001
  DChartAxisBaseOptionParser.prototype.toLabel = function (theme, options) {
72746
73002
  var label = options === null || options === void 0 ? void 0 : options.label;
72747
73003
  if (label) {
@@ -72751,10 +73007,10 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72751
73007
  alpha: label.alpha,
72752
73008
  family: label.family,
72753
73009
  size: label.size,
72754
- weight: label.weight,
73010
+ weight: toEnum(label.weight, EShapeTextWeight),
72755
73011
  align: this.toLabelAlign(theme, label.align),
72756
73012
  offset: this.toLabelOffset(theme, label.offset),
72757
- style: label.style,
73013
+ style: toEnum(label.style, EShapeTextStyle),
72758
73014
  outline: this.toLabelOutline(theme, label.outline),
72759
73015
  spacing: this.toLabelSpacing(theme, label.spacing),
72760
73016
  direction: this.toLabelDirection(theme, label.direction),
@@ -72805,7 +73061,7 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72805
73061
  };
72806
73062
  };
72807
73063
  DChartAxisBaseOptionParser.prototype.toLabelDirection = function (theme, options) {
72808
- return options !== null && options !== void 0 ? options : theme.getLabelDirection();
73064
+ return toEnum(options !== null && options !== void 0 ? options : theme.getLabelDirection(), EShapeTextDirection);
72809
73065
  };
72810
73066
  DChartAxisBaseOptionParser.prototype.toLabelColor = function (theme, options) {
72811
73067
  return options !== null && options !== void 0 ? options : theme.getLabelColor();
@@ -72813,106 +73069,6 @@ var DChartAxisBaseOptionParser = /** @class */ (function () {
72813
73069
  return DChartAxisBaseOptionParser;
72814
73070
  }());
72815
73071
 
72816
- /*
72817
- * Copyright (C) 2019 Toshiba Corporation
72818
- * SPDX-License-Identifier: Apache-2.0
72819
- */
72820
- var DChartAxisBaseBar = /** @class */ (function () {
72821
- function DChartAxisBaseBar(parser) {
72822
- this._parser = parser;
72823
- this._index = 0;
72824
- }
72825
- Object.defineProperty(DChartAxisBaseBar.prototype, "shape", {
72826
- get: function () {
72827
- var result = this._shape;
72828
- if (result == null) {
72829
- result = this.newShape();
72830
- this._shape = result;
72831
- }
72832
- return result;
72833
- },
72834
- enumerable: false,
72835
- configurable: true
72836
- });
72837
- DChartAxisBaseBar.prototype.newShape = function () {
72838
- var _a;
72839
- var parser = this._parser;
72840
- var bar = parser.bar;
72841
- var result = new EShapeBar();
72842
- result.points.position = this.newShapePosition();
72843
- result.points.style = (_a = bar.style) !== null && _a !== void 0 ? _a : EShapePointsStyle.NONE;
72844
- result.stroke.copy(bar.stroke);
72845
- result.text.copy(parser.label);
72846
- return result;
72847
- };
72848
- DChartAxisBaseBar.prototype.newShapePosition = function () {
72849
- switch (this._parser.position) {
72850
- case DChartAxisPosition.LEFT:
72851
- case DChartAxisPosition.RIGHT:
72852
- return EShapeBarPosition.TOP;
72853
- default:
72854
- return EShapeBarPosition.LEFT;
72855
- }
72856
- };
72857
- DChartAxisBaseBar.prototype.bind = function (container, index) {
72858
- this._container = container;
72859
- this._index = index;
72860
- this.shape.attach(container.container);
72861
- };
72862
- DChartAxisBaseBar.prototype.unbind = function () {
72863
- var shape = this._shape;
72864
- if (shape != null) {
72865
- shape.detach();
72866
- }
72867
- this._index = 0;
72868
- this._container = undefined;
72869
- };
72870
- DChartAxisBaseBar.prototype.update = function () {
72871
- var container = this._container;
72872
- var index = this._index;
72873
- var shape = this._shape;
72874
- if (shape != null && container != null) {
72875
- var plotArea = container.plotArea;
72876
- var plotAreaWidth = plotArea.width;
72877
- var plotAreaHeight = plotArea.height;
72878
- var offset = this._parser.padding * index;
72879
- shape.disallowUploadedUpdate();
72880
- var position = shape.transform.position;
72881
- var size = shape.size;
72882
- switch (this._parser.position) {
72883
- case DChartAxisPosition.TOP:
72884
- position.set(plotAreaWidth * 0.5, 0 - offset);
72885
- size.set(plotAreaWidth, 0);
72886
- break;
72887
- case DChartAxisPosition.BOTTOM:
72888
- position.set(plotAreaWidth * 0.5, plotAreaHeight + offset);
72889
- size.set(plotAreaWidth, 0);
72890
- break;
72891
- case DChartAxisPosition.LEFT:
72892
- position.set(0 - offset, plotAreaHeight * 0.5);
72893
- size.set(0, plotAreaHeight);
72894
- break;
72895
- case DChartAxisPosition.RIGHT:
72896
- position.set(plotAreaWidth + offset, plotAreaHeight * 0.5);
72897
- size.set(0, plotAreaHeight);
72898
- break;
72899
- }
72900
- shape.allowUploadedUpdate();
72901
- return true;
72902
- }
72903
- return false;
72904
- };
72905
- DChartAxisBaseBar.prototype.destroy = function () {
72906
- var shape = this._shape;
72907
- if (shape != null) {
72908
- shape.destroy();
72909
- }
72910
- this._index = 0;
72911
- this._container = undefined;
72912
- };
72913
- return DChartAxisBaseBar;
72914
- }());
72915
-
72916
73072
  var DChartAxisBaseTickMajorGridline = /** @class */ (function () {
72917
73073
  function DChartAxisBaseTickMajorGridline(parser) {
72918
73074
  this._parser = parser;
@@ -73110,6 +73266,7 @@ var DChartAxisBaseTickMinor = /** @class */ (function () {
73110
73266
  shape.points.size = size;
73111
73267
  shape.points.style = style;
73112
73268
  shape.stroke.copy(minor.stroke);
73269
+ shape.text.copy(minor.text);
73113
73270
  shape.size.set(0, 0);
73114
73271
  result.push(shape);
73115
73272
  }
@@ -73149,11 +73306,11 @@ var DChartAxisBaseTickMinor = /** @class */ (function () {
73149
73306
  }());
73150
73307
 
73151
73308
  var DChartAxisBaseTickContainer = /** @class */ (function () {
73152
- function DChartAxisBaseTickContainer(parser) {
73309
+ function DChartAxisBaseTickContainer(parser, options) {
73153
73310
  this._parser = parser;
73154
73311
  this._index = 0;
73155
- this._major = new DChartAxisBaseTickMajor(parser);
73156
- this._minor = new DChartAxisBaseTickMinor(parser);
73312
+ this._major = this.newMajor(parser, options);
73313
+ this._minor = this.newMinor(parser, options);
73157
73314
  this._majorTicks = [];
73158
73315
  this._minorTicks = [];
73159
73316
  }
@@ -73164,6 +73321,9 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73164
73321
  enumerable: false,
73165
73322
  configurable: true
73166
73323
  });
73324
+ DChartAxisBaseTickContainer.prototype.newMajor = function (parser, options) {
73325
+ return new DChartAxisBaseTickMajor(parser);
73326
+ };
73167
73327
  Object.defineProperty(DChartAxisBaseTickContainer.prototype, "minor", {
73168
73328
  get: function () {
73169
73329
  return this._minor;
@@ -73171,6 +73331,9 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73171
73331
  enumerable: false,
73172
73332
  configurable: true
73173
73333
  });
73334
+ DChartAxisBaseTickContainer.prototype.newMinor = function (parser, options) {
73335
+ return new DChartAxisBaseTickMinor(parser);
73336
+ };
73174
73337
  DChartAxisBaseTickContainer.prototype.bind = function (container, index) {
73175
73338
  this._container = container;
73176
73339
  this._index = index;
@@ -73247,9 +73410,10 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73247
73410
  var minorCountPerMajor = minorTick.count;
73248
73411
  var minorCount = (majorCapacity + 1) * minorCountPerMajor;
73249
73412
  var minorStep = minorTick.step;
73413
+ var minorFormatter = minorTick.formatter;
73250
73414
  var majorTicks = this._majorTicks;
73251
73415
  var minorTicks = this._minorTicks;
73252
- coordinate.ticks(domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73416
+ this.newTicks(coordinate, domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73253
73417
  var a = transform.a;
73254
73418
  var tx = transform.tx;
73255
73419
  for (var i = 0; i < majorCapacity; ++i) {
@@ -73260,24 +73424,15 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73260
73424
  var majorTickProjectedPosition = majorTicks[imajorTick + 1];
73261
73425
  var majotTickPositionX = a * majorTickProjectedPosition + tx;
73262
73426
  var majorTickStep = majorTicks[imajorTick + 2];
73263
- majorShape.disallowUploadedUpdate();
73264
- majorShape.visible = true;
73265
- majorShape.transform.position.set(majotTickPositionX, shapePositionY);
73266
- majorShape.text.value = majorFormatter.format(majorTickPosition, majorTickStep);
73267
- majorShape.allowUploadedUpdate();
73427
+ this.showMajor(majorShape, majotTickPositionX, shapePositionY, majorFormatter === null || majorFormatter === void 0 ? void 0 : majorFormatter.format(majorTickPosition, majorTickStep));
73268
73428
  if (i < gridlineShapes.length) {
73269
- var gridlineShape = gridlineShapes[i];
73270
- gridlineShape.disallowUploadedUpdate();
73271
- gridlineShape.visible = true;
73272
- gridlineShape.transform.position.set(majotTickPositionX, plotAreaHeight * 0.5);
73273
- gridlineShape.size.set(0, plotAreaHeight);
73274
- gridlineShape.allowUploadedUpdate();
73429
+ this.showMajorGridline(gridlineShapes[i], majorTickPosition, majotTickPositionX, plotAreaHeight * 0.5, 0, plotAreaHeight);
73275
73430
  }
73276
73431
  }
73277
73432
  else {
73278
- majorShape.visible = false;
73433
+ this.hideMajor(majorShape);
73279
73434
  if (i < gridlineShapes.length) {
73280
- gridlineShapes[i].visible = false;
73435
+ this.hideMajorGridline(gridlineShapes[i]);
73281
73436
  }
73282
73437
  }
73283
73438
  }
@@ -73285,15 +73440,14 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73285
73440
  var minorShape = minorShapes[i];
73286
73441
  var iminorTick = i * 3;
73287
73442
  var minorTickPosition = minorTicks[iminorTick + 0];
73288
- var minorTickProjectedPosition = minorTicks[iminorTick + 1];
73289
73443
  if (!isNaN(minorTickPosition)) {
73290
- minorShape.disallowUploadedUpdate();
73291
- minorShape.visible = true;
73292
- minorShape.transform.position.set(a * minorTickProjectedPosition + tx, shapePositionY);
73293
- minorShape.allowUploadedUpdate();
73444
+ var minorTickProjectedPosition = minorTicks[iminorTick + 1];
73445
+ var minorTickPositionX = a * minorTickProjectedPosition + tx;
73446
+ var minorTickStep = minorTicks[iminorTick + 2];
73447
+ this.showMinor(minorShape, minorTickPositionX, shapePositionY, minorFormatter === null || minorFormatter === void 0 ? void 0 : minorFormatter.format(minorTickPosition, minorTickStep));
73294
73448
  }
73295
73449
  else {
73296
- minorShape.visible = false;
73450
+ this.hideMinor(minorShape);
73297
73451
  }
73298
73452
  }
73299
73453
  return true;
@@ -73309,9 +73463,10 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73309
73463
  var minorCountPerMajor = minorTick.count;
73310
73464
  var minorCount = (majorCapacity + 1) * minorCountPerMajor;
73311
73465
  var minorStep = minorTick.step;
73466
+ var minorFormatter = minorTick.formatter;
73312
73467
  var majorTicks = this._majorTicks;
73313
73468
  var minorTicks = this._minorTicks;
73314
- coordinate.ticks(domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73469
+ this.newTicks(coordinate, domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73315
73470
  var d = transform.d;
73316
73471
  var ty = transform.ty;
73317
73472
  for (var i = 0; i < majorCapacity; ++i) {
@@ -73322,24 +73477,15 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73322
73477
  var majorTickProjectedPosition = majorTicks[imajorTick + 1];
73323
73478
  var majotTickPositionY = d * majorTickProjectedPosition + ty;
73324
73479
  var majorTickStep = majorTicks[imajorTick + 2];
73325
- majorShape.disallowUploadedUpdate();
73326
- majorShape.visible = true;
73327
- majorShape.transform.position.set(shapePositionX, majotTickPositionY);
73328
- majorShape.text.value = majorFormatter.format(majorTickPosition, majorTickStep);
73329
- majorShape.allowUploadedUpdate();
73480
+ this.showMajor(majorShape, shapePositionX, majotTickPositionY, majorFormatter === null || majorFormatter === void 0 ? void 0 : majorFormatter.format(majorTickPosition, majorTickStep));
73330
73481
  if (i < gridlineShapes.length) {
73331
- var gridlineShape = gridlineShapes[i];
73332
- gridlineShape.disallowUploadedUpdate();
73333
- gridlineShape.visible = true;
73334
- gridlineShape.transform.position.set(plotAreaWidth * 0.5, majotTickPositionY);
73335
- gridlineShape.size.set(plotAreaWidth, 0);
73336
- gridlineShape.allowUploadedUpdate();
73482
+ this.showMajorGridline(gridlineShapes[i], majorTickPosition, plotAreaWidth * 0.5, majotTickPositionY, plotAreaWidth, 0);
73337
73483
  }
73338
73484
  }
73339
73485
  else {
73340
- majorShape.visible = false;
73486
+ this.hideMajor(majorShape);
73341
73487
  if (i < gridlineShapes.length) {
73342
- gridlineShapes[i].visible = false;
73488
+ this.hideMajorGridline(gridlineShapes[i]);
73343
73489
  }
73344
73490
  }
73345
73491
  }
@@ -73347,19 +73493,51 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73347
73493
  var minorShape = minorShapes[i];
73348
73494
  var iminorTick = i * 3;
73349
73495
  var minorTickPosition = minorTicks[iminorTick + 0];
73350
- var minorTickProjectedPosition = minorTicks[iminorTick + 1];
73351
73496
  if (!isNaN(minorTickPosition)) {
73352
- minorShape.disallowUploadedUpdate();
73353
- minorShape.visible = true;
73354
- minorShape.transform.position.set(shapePositionX, d * minorTickProjectedPosition + ty);
73355
- minorShape.allowUploadedUpdate();
73497
+ var minorTickProjectedPosition = minorTicks[iminorTick + 1];
73498
+ var minorTickPositionY = d * minorTickProjectedPosition + ty;
73499
+ var minorTickStep = minorTicks[iminorTick + 2];
73500
+ this.showMinor(minorShape, shapePositionX, minorTickPositionY, minorFormatter === null || minorFormatter === void 0 ? void 0 : minorFormatter.format(minorTickPosition, minorTickStep));
73356
73501
  }
73357
73502
  else {
73358
- minorShape.visible = false;
73503
+ this.hideMinor(minorShape);
73359
73504
  }
73360
73505
  }
73361
73506
  return true;
73362
73507
  };
73508
+ DChartAxisBaseTickContainer.prototype.showMajor = function (shape, x, y, text) {
73509
+ shape.disallowUploadedUpdate();
73510
+ shape.visible = true;
73511
+ shape.transform.position.set(x, y);
73512
+ shape.text.value = text != null ? text : "";
73513
+ shape.allowUploadedUpdate();
73514
+ };
73515
+ DChartAxisBaseTickContainer.prototype.showMajorGridline = function (shape, value, x, y, sx, sy) {
73516
+ shape.disallowUploadedUpdate();
73517
+ shape.visible = true;
73518
+ shape.transform.position.set(x, y);
73519
+ shape.size.set(sx, sy);
73520
+ shape.allowUploadedUpdate();
73521
+ };
73522
+ DChartAxisBaseTickContainer.prototype.hideMajor = function (shape) {
73523
+ shape.visible = false;
73524
+ };
73525
+ DChartAxisBaseTickContainer.prototype.hideMajorGridline = function (shape) {
73526
+ shape.visible = false;
73527
+ };
73528
+ DChartAxisBaseTickContainer.prototype.showMinor = function (shape, x, y, text) {
73529
+ shape.disallowUploadedUpdate();
73530
+ shape.visible = true;
73531
+ shape.transform.position.set(x, y);
73532
+ shape.text.value = text != null ? text : "";
73533
+ shape.allowUploadedUpdate();
73534
+ };
73535
+ DChartAxisBaseTickContainer.prototype.hideMinor = function (shape) {
73536
+ shape.visible = false;
73537
+ };
73538
+ DChartAxisBaseTickContainer.prototype.newTicks = function (coordinate, domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult) {
73539
+ coordinate.ticks(domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult);
73540
+ };
73363
73541
  DChartAxisBaseTickContainer.prototype.destroy = function () {
73364
73542
  this._major.destroy();
73365
73543
  this._minor.destroy();
@@ -73377,12 +73555,22 @@ var DChartAxisBase = /** @class */ (function () {
73377
73555
  function DChartAxisBase(options) {
73378
73556
  var theme = this.toTheme(options);
73379
73557
  this._theme = theme;
73380
- var parser = new DChartAxisBaseOptionParser(theme, options);
73558
+ var parser = this.newParser(theme, options);
73381
73559
  this._parser = parser;
73382
73560
  this._index = 0;
73383
- this._bar = new DChartAxisBaseBar(parser);
73384
- this._tick = new DChartAxisBaseTickContainer(parser);
73561
+ this._bar = this.newBar(parser, theme, options);
73562
+ this._tick = this.newTick(parser, theme, options);
73385
73563
  }
73564
+ Object.defineProperty(DChartAxisBase.prototype, "parser", {
73565
+ get: function () {
73566
+ return this._parser;
73567
+ },
73568
+ enumerable: false,
73569
+ configurable: true
73570
+ });
73571
+ DChartAxisBase.prototype.newParser = function (theme, options) {
73572
+ return new DChartAxisBaseOptionParser(theme, options);
73573
+ };
73386
73574
  Object.defineProperty(DChartAxisBase.prototype, "position", {
73387
73575
  get: function () {
73388
73576
  return this._parser.position;
@@ -73397,6 +73585,9 @@ var DChartAxisBase = /** @class */ (function () {
73397
73585
  enumerable: false,
73398
73586
  configurable: true
73399
73587
  });
73588
+ DChartAxisBase.prototype.newBar = function (parser, theme, options) {
73589
+ return new DChartAxisBaseBar(parser);
73590
+ };
73400
73591
  Object.defineProperty(DChartAxisBase.prototype, "tick", {
73401
73592
  get: function () {
73402
73593
  return this._tick;
@@ -73404,6 +73595,9 @@ var DChartAxisBase = /** @class */ (function () {
73404
73595
  enumerable: false,
73405
73596
  configurable: true
73406
73597
  });
73598
+ DChartAxisBase.prototype.newTick = function (parser, theme, options) {
73599
+ return new DChartAxisBaseTickContainer(parser);
73600
+ };
73407
73601
  DChartAxisBase.prototype.bind = function (container, index) {
73408
73602
  this._container = container;
73409
73603
  this._index = index;
@@ -73436,7 +73630,8 @@ var DChartAxisBase = /** @class */ (function () {
73436
73630
  this._container = undefined;
73437
73631
  };
73438
73632
  DChartAxisBase.prototype.toTheme = function (options) {
73439
- return (options && options.theme) || this.getThemeDefault();
73633
+ var _a;
73634
+ return (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : this.getThemeDefault();
73440
73635
  };
73441
73636
  DChartAxisBase.prototype.getThemeDefault = function () {
73442
73637
  return DThemes.getInstance().get(this.getType());
@@ -73634,6 +73829,342 @@ var DChartCoordinateDirection = {
73634
73829
  Y: 1
73635
73830
  };
73636
73831
 
73832
+ /*
73833
+ * Copyright (C) 2019 Toshiba Corporation
73834
+ * SPDX-License-Identifier: Apache-2.0
73835
+ */
73836
+ var DChartCoordinateTransformImpl = /** @class */ (function () {
73837
+ function DChartCoordinateTransformImpl(options) {
73838
+ this._theme = this.toTheme(options);
73839
+ this._id = 0;
73840
+ this._isTranslationEnabled = options === null || options === void 0 ? void 0 : options.translation;
73841
+ this._translate = 0;
73842
+ this._isScalingEnabled = options === null || options === void 0 ? void 0 : options.scaling;
73843
+ this._scale = 1;
73844
+ this._itranslate = 0;
73845
+ this._iscale = 1;
73846
+ }
73847
+ Object.defineProperty(DChartCoordinateTransformImpl.prototype, "id", {
73848
+ get: function () {
73849
+ return this._id;
73850
+ },
73851
+ enumerable: false,
73852
+ configurable: true
73853
+ });
73854
+ Object.defineProperty(DChartCoordinateTransformImpl.prototype, "translate", {
73855
+ get: function () {
73856
+ return this._translate;
73857
+ },
73858
+ set: function (translate) {
73859
+ this.set(translate);
73860
+ },
73861
+ enumerable: false,
73862
+ configurable: true
73863
+ });
73864
+ Object.defineProperty(DChartCoordinateTransformImpl.prototype, "scale", {
73865
+ get: function () {
73866
+ return this._scale;
73867
+ },
73868
+ set: function (scale) {
73869
+ this.set(undefined, scale);
73870
+ },
73871
+ enumerable: false,
73872
+ configurable: true
73873
+ });
73874
+ DChartCoordinateTransformImpl.prototype.bind = function (container, direction) {
73875
+ this.set(0, direction === DChartCoordinateDirection.X ? +1 : -1);
73876
+ };
73877
+ DChartCoordinateTransformImpl.prototype.unbind = function () {
73878
+ // DO NOTHING
73879
+ };
73880
+ DChartCoordinateTransformImpl.prototype.set = function (translate, scale) {
73881
+ var isChanged = false;
73882
+ if (translate != null &&
73883
+ this._isTranslationEnabled !== false &&
73884
+ this._translate !== translate) {
73885
+ isChanged = true;
73886
+ this._translate = translate;
73887
+ }
73888
+ if (scale != null && this._isScalingEnabled !== false && this._scale !== scale) {
73889
+ isChanged = true;
73890
+ this._scale = scale;
73891
+ }
73892
+ if (isChanged) {
73893
+ this._id += 1;
73894
+ this._iscale = this._theme.isZero(this._scale) ? 0 : 1 / this._scale;
73895
+ this._itranslate = -this._translate * this._iscale;
73896
+ }
73897
+ };
73898
+ DChartCoordinateTransformImpl.prototype.blend = function (ratio, mark) {
73899
+ var ratioi = 1 - ratio;
73900
+ var newTranslate = mark.newTranslate * ratio + mark.oldTranslate * ratioi;
73901
+ var newScale = mark.newScale * ratio + mark.oldScale * ratioi;
73902
+ this.set(newTranslate, newScale);
73903
+ };
73904
+ DChartCoordinateTransformImpl.prototype.map = function (value) {
73905
+ return this._translate + this._scale * value;
73906
+ };
73907
+ DChartCoordinateTransformImpl.prototype.mapAll = function (values, ifrom, iend, stride, offset) {
73908
+ var translate = this._translate;
73909
+ var scale = this._scale;
73910
+ for (var i = ifrom + offset; i < iend; i += stride) {
73911
+ values[i] = translate + scale * values[i];
73912
+ }
73913
+ };
73914
+ DChartCoordinateTransformImpl.prototype.unmap = function (value) {
73915
+ return this._itranslate + this._iscale * value;
73916
+ };
73917
+ DChartCoordinateTransformImpl.prototype.unmapAll = function (values, ifrom, iend, stride, offset) {
73918
+ var itranslate = this._itranslate;
73919
+ var iscale = this._iscale;
73920
+ for (var i = ifrom + offset; i < iend; i += stride) {
73921
+ values[i] = itranslate + iscale * values[i];
73922
+ }
73923
+ };
73924
+ DChartCoordinateTransformImpl.prototype.toTheme = function (options) {
73925
+ return (options && options.theme) || this.getThemeDefault();
73926
+ };
73927
+ DChartCoordinateTransformImpl.prototype.getThemeDefault = function () {
73928
+ return DThemes.getInstance().get(this.getType());
73929
+ };
73930
+ DChartCoordinateTransformImpl.prototype.getType = function () {
73931
+ return "DChartCoordinateTransform";
73932
+ };
73933
+ return DChartCoordinateTransformImpl;
73934
+ }());
73935
+
73936
+ var DChartCoordinateTransformMarkImpl = /** @class */ (function () {
73937
+ function DChartCoordinateTransformMarkImpl() {
73938
+ this.oldTranslate = 0;
73939
+ this.oldScale = 1;
73940
+ this.newTranslate = 0;
73941
+ this.newScale = 1;
73942
+ }
73943
+ DChartCoordinateTransformMarkImpl.prototype.set = function (translate, scale) {
73944
+ if (translate != null) {
73945
+ this.newTranslate = translate;
73946
+ }
73947
+ if (scale != null) {
73948
+ this.newScale = scale;
73949
+ }
73950
+ };
73951
+ return DChartCoordinateTransformMarkImpl;
73952
+ }());
73953
+
73954
+ /*
73955
+ * Copyright (C) 2019 Toshiba Corporation
73956
+ * SPDX-License-Identifier: Apache-2.0
73957
+ */
73958
+ var DChartRegionImpl = /** @class */ (function () {
73959
+ function DChartRegionImpl(from, to) {
73960
+ this.from = from;
73961
+ this.to = to;
73962
+ }
73963
+ DChartRegionImpl.prototype.set = function (from, to) {
73964
+ if (from != null) {
73965
+ this.from = from;
73966
+ }
73967
+ if (to != null) {
73968
+ this.to = to;
73969
+ }
73970
+ return this;
73971
+ };
73972
+ DChartRegionImpl.prototype.add = function (from, to) {
73973
+ if (!isNaN$1(from)) {
73974
+ this.from = isNaN$1(this.from) ? from : Math.min(this.from, from);
73975
+ }
73976
+ if (!isNaN$1(to)) {
73977
+ this.to = isNaN$1(this.to) ? to : Math.max(this.to, to);
73978
+ }
73979
+ return this;
73980
+ };
73981
+ DChartRegionImpl.prototype.clear = function () {
73982
+ this.from = NaN;
73983
+ this.to = NaN;
73984
+ return this;
73985
+ };
73986
+ return DChartRegionImpl;
73987
+ }());
73988
+
73989
+ /*
73990
+ * Copyright (C) 2019 Toshiba Corporation
73991
+ * SPDX-License-Identifier: Apache-2.0
73992
+ */
73993
+ var DChartCoordinateBase = /** @class */ (function () {
73994
+ function DChartCoordinateBase(options) {
73995
+ this._id = 0;
73996
+ this._direction = DChartCoordinateDirection.X;
73997
+ this._theme = this.toTheme(options);
73998
+ this._transform = this.newTransform(options === null || options === void 0 ? void 0 : options.transform);
73999
+ this._tick = this.newTick(options === null || options === void 0 ? void 0 : options.tick);
74000
+ this._work = this.newRegion();
74001
+ this._mark = this.newMark();
74002
+ this._from = options === null || options === void 0 ? void 0 : options.from;
74003
+ this._to = options === null || options === void 0 ? void 0 : options.to;
74004
+ }
74005
+ DChartCoordinateBase.prototype.newTransform = function (options) {
74006
+ return new DChartCoordinateTransformImpl(options);
74007
+ };
74008
+ DChartCoordinateBase.prototype.newRegion = function () {
74009
+ return new DChartRegionImpl(NaN, NaN);
74010
+ };
74011
+ DChartCoordinateBase.prototype.newMark = function () {
74012
+ return new DChartCoordinateTransformMarkImpl();
74013
+ };
74014
+ Object.defineProperty(DChartCoordinateBase.prototype, "from", {
74015
+ get: function () {
74016
+ return this._from;
74017
+ },
74018
+ set: function (from) {
74019
+ this._from = from;
74020
+ },
74021
+ enumerable: false,
74022
+ configurable: true
74023
+ });
74024
+ Object.defineProperty(DChartCoordinateBase.prototype, "to", {
74025
+ get: function () {
74026
+ return this._to;
74027
+ },
74028
+ set: function (to) {
74029
+ this._to = to;
74030
+ },
74031
+ enumerable: false,
74032
+ configurable: true
74033
+ });
74034
+ DChartCoordinateBase.prototype.bind = function (container, direction) {
74035
+ this._container = container;
74036
+ this._direction = direction;
74037
+ this._transform.bind(container, direction);
74038
+ };
74039
+ DChartCoordinateBase.prototype.unbind = function () {
74040
+ this._container = undefined;
74041
+ this._transform.unbind();
74042
+ };
74043
+ DChartCoordinateBase.prototype.fit = function (from, to) {
74044
+ this.doFit(from, to, this._transform);
74045
+ };
74046
+ DChartCoordinateBase.prototype.mark = function (from, to) {
74047
+ var mark = this._mark;
74048
+ var transform = this._transform;
74049
+ mark.oldTranslate = transform.translate;
74050
+ mark.oldScale = transform.scale;
74051
+ this.doFit(from, to, mark);
74052
+ };
74053
+ DChartCoordinateBase.prototype.blend = function (ratio) {
74054
+ this._transform.blend(ratio, this._mark);
74055
+ };
74056
+ DChartCoordinateBase.prototype.doFit = function (from, to, result) {
74057
+ var container = this._container;
74058
+ if (container) {
74059
+ var plotArea = container.container.plotArea;
74060
+ var padding = plotArea.padding;
74061
+ var work = this._work;
74062
+ switch (this._direction) {
74063
+ case DChartCoordinateDirection.X:
74064
+ this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
74065
+ break;
74066
+ case DChartCoordinateDirection.Y:
74067
+ this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
74068
+ break;
74069
+ }
74070
+ }
74071
+ };
74072
+ DChartCoordinateBase.prototype.toFitDomain = function (from, to, plotArea, result) {
74073
+ if (from == null) {
74074
+ from = this._from;
74075
+ }
74076
+ if (to == null) {
74077
+ to = this._to;
74078
+ }
74079
+ if (from != null && to != null) {
74080
+ result.set(from, to);
74081
+ }
74082
+ else {
74083
+ plotArea.series.getDomain(this, result);
74084
+ result.set(from, to);
74085
+ }
74086
+ return result;
74087
+ };
74088
+ DChartCoordinateBase.prototype.toFitRange = function (from, to, plotArea, result) {
74089
+ if (from == null) {
74090
+ from = this._from;
74091
+ }
74092
+ if (to == null) {
74093
+ to = this._to;
74094
+ }
74095
+ if (from != null && to != null) {
74096
+ result.set(from, to);
74097
+ }
74098
+ else {
74099
+ plotArea.series.getRange(this, result);
74100
+ result.set(from, to);
74101
+ }
74102
+ return result;
74103
+ };
74104
+ DChartCoordinateBase.prototype.doFit_ = function (pixelFrom, pixelTo, region, result) {
74105
+ var regionFrom = region.from;
74106
+ var regionTo = region.to;
74107
+ if (!(isNaN$1(regionFrom) || isNaN$1(regionTo))) {
74108
+ // Scale
74109
+ var newScale = 1;
74110
+ var regionFromMapped = this.map(regionFrom);
74111
+ var regionToMapped = this.map(regionTo);
74112
+ var regionSizeMapped = regionToMapped - regionFromMapped;
74113
+ if (!this._theme.isZero(regionSizeMapped)) {
74114
+ var pixelSize = pixelTo - pixelFrom;
74115
+ newScale = pixelSize / regionSizeMapped;
74116
+ }
74117
+ else {
74118
+ newScale = pixelTo < pixelFrom ? -1 : 1;
74119
+ }
74120
+ // Translation
74121
+ var newTranslation = pixelFrom - regionFromMapped * newScale;
74122
+ // Done
74123
+ result.set(newTranslation, newScale);
74124
+ }
74125
+ };
74126
+ Object.defineProperty(DChartCoordinateBase.prototype, "id", {
74127
+ get: function () {
74128
+ return this._id;
74129
+ },
74130
+ enumerable: false,
74131
+ configurable: true
74132
+ });
74133
+ Object.defineProperty(DChartCoordinateBase.prototype, "transform", {
74134
+ get: function () {
74135
+ return this._transform;
74136
+ },
74137
+ enumerable: false,
74138
+ configurable: true
74139
+ });
74140
+ DChartCoordinateBase.prototype.map = function (value) {
74141
+ return value;
74142
+ };
74143
+ DChartCoordinateBase.prototype.mapAll = function (values, ifrom, iend, stride, offset) {
74144
+ // DO NOTHING
74145
+ };
74146
+ DChartCoordinateBase.prototype.unmap = function (value) {
74147
+ return value;
74148
+ };
74149
+ DChartCoordinateBase.prototype.unmapAll = function (values, ifrom, iend, stride, offset) {
74150
+ // DO NOTHING
74151
+ };
74152
+ DChartCoordinateBase.prototype.ticks = function (domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult) {
74153
+ this._tick.calculate(domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult, this);
74154
+ };
74155
+ DChartCoordinateBase.prototype.toTheme = function (options) {
74156
+ var _a;
74157
+ return (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : this.getThemeDefault();
74158
+ };
74159
+ DChartCoordinateBase.prototype.getThemeDefault = function () {
74160
+ return DThemes.getInstance().get(this.getType());
74161
+ };
74162
+ DChartCoordinateBase.prototype.getType = function () {
74163
+ return "DChartCoordinate";
74164
+ };
74165
+ return DChartCoordinateBase;
74166
+ }());
74167
+
73637
74168
  /*
73638
74169
  * Copyright (C) 2019 Toshiba Corporation
73639
74170
  * SPDX-License-Identifier: Apache-2.0
@@ -73933,7 +74464,8 @@ var DChartCoordinateLinearTick = /** @class */ (function () {
73933
74464
  }
73934
74465
  };
73935
74466
  DChartCoordinateLinearTick.prototype.toTheme = function (options) {
73936
- return (options && options.theme) || this.getThemeDefault();
74467
+ var _a;
74468
+ return (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : this.getThemeDefault();
73937
74469
  };
73938
74470
  DChartCoordinateLinearTick.prototype.getThemeDefault = function () {
73939
74471
  return DThemes.getInstance().get(this.getType());
@@ -73948,325 +74480,16 @@ var DChartCoordinateLinearTick = /** @class */ (function () {
73948
74480
  * Copyright (C) 2019 Toshiba Corporation
73949
74481
  * SPDX-License-Identifier: Apache-2.0
73950
74482
  */
73951
- var DChartCoordinateTransformImpl = /** @class */ (function () {
73952
- function DChartCoordinateTransformImpl(options) {
73953
- this._theme = this.toTheme(options);
73954
- this._id = 0;
73955
- this._isTranslationEnabled = options === null || options === void 0 ? void 0 : options.translation;
73956
- this._translate = 0;
73957
- this._isScalingEnabled = options === null || options === void 0 ? void 0 : options.scaling;
73958
- this._scale = 1;
73959
- this._itranslate = 0;
73960
- this._iscale = 1;
73961
- }
73962
- Object.defineProperty(DChartCoordinateTransformImpl.prototype, "id", {
73963
- get: function () {
73964
- return this._id;
73965
- },
73966
- enumerable: false,
73967
- configurable: true
73968
- });
73969
- Object.defineProperty(DChartCoordinateTransformImpl.prototype, "translate", {
73970
- get: function () {
73971
- return this._translate;
73972
- },
73973
- set: function (translate) {
73974
- this.set(translate);
73975
- },
73976
- enumerable: false,
73977
- configurable: true
73978
- });
73979
- Object.defineProperty(DChartCoordinateTransformImpl.prototype, "scale", {
73980
- get: function () {
73981
- return this._scale;
73982
- },
73983
- set: function (scale) {
73984
- this.set(undefined, scale);
73985
- },
73986
- enumerable: false,
73987
- configurable: true
73988
- });
73989
- DChartCoordinateTransformImpl.prototype.bind = function (container, direction) {
73990
- this.set(0, direction === DChartCoordinateDirection.X ? +1 : -1);
73991
- };
73992
- DChartCoordinateTransformImpl.prototype.unbind = function () {
73993
- // DO NOTHING
73994
- };
73995
- DChartCoordinateTransformImpl.prototype.set = function (translate, scale) {
73996
- var isChanged = false;
73997
- if (translate != null &&
73998
- this._isTranslationEnabled !== false &&
73999
- this._translate !== translate) {
74000
- isChanged = true;
74001
- this._translate = translate;
74002
- }
74003
- if (scale != null && this._isScalingEnabled !== false && this._scale !== scale) {
74004
- isChanged = true;
74005
- this._scale = scale;
74006
- }
74007
- if (isChanged) {
74008
- this._id += 1;
74009
- this._iscale = this._theme.isZero(this._scale) ? 0 : 1 / this._scale;
74010
- this._itranslate = -this._translate * this._iscale;
74011
- }
74012
- };
74013
- DChartCoordinateTransformImpl.prototype.blend = function (ratio, mark) {
74014
- var ratioi = 1 - ratio;
74015
- var newTranslate = mark.newTranslate * ratio + mark.oldTranslate * ratioi;
74016
- var newScale = mark.newScale * ratio + mark.oldScale * ratioi;
74017
- this.set(newTranslate, newScale);
74018
- };
74019
- DChartCoordinateTransformImpl.prototype.map = function (value) {
74020
- return this._translate + this._scale * value;
74021
- };
74022
- DChartCoordinateTransformImpl.prototype.mapAll = function (values, ifrom, iend, stride, offset) {
74023
- var translate = this._translate;
74024
- var scale = this._scale;
74025
- for (var i = ifrom + offset; i < iend; i += stride) {
74026
- values[i] = translate + scale * values[i];
74027
- }
74028
- };
74029
- DChartCoordinateTransformImpl.prototype.unmap = function (value) {
74030
- return this._itranslate + this._iscale * value;
74031
- };
74032
- DChartCoordinateTransformImpl.prototype.unmapAll = function (values, ifrom, iend, stride, offset) {
74033
- var itranslate = this._itranslate;
74034
- var iscale = this._iscale;
74035
- for (var i = ifrom + offset; i < iend; i += stride) {
74036
- values[i] = itranslate + iscale * values[i];
74037
- }
74038
- };
74039
- DChartCoordinateTransformImpl.prototype.toTheme = function (options) {
74040
- return (options && options.theme) || this.getThemeDefault();
74041
- };
74042
- DChartCoordinateTransformImpl.prototype.getThemeDefault = function () {
74043
- return DThemes.getInstance().get(this.getType());
74044
- };
74045
- DChartCoordinateTransformImpl.prototype.getType = function () {
74046
- return "DChartCoordinateTransform";
74047
- };
74048
- return DChartCoordinateTransformImpl;
74049
- }());
74050
-
74051
- var DChartCoordinateTransformMarkImpl = /** @class */ (function () {
74052
- function DChartCoordinateTransformMarkImpl() {
74053
- this.oldTranslate = 0;
74054
- this.oldScale = 1;
74055
- this.newTranslate = 0;
74056
- this.newScale = 1;
74057
- }
74058
- DChartCoordinateTransformMarkImpl.prototype.set = function (translate, scale) {
74059
- if (translate != null) {
74060
- this.newTranslate = translate;
74061
- }
74062
- if (scale != null) {
74063
- this.newScale = scale;
74064
- }
74065
- };
74066
- return DChartCoordinateTransformMarkImpl;
74067
- }());
74068
-
74069
- /*
74070
- * Copyright (C) 2019 Toshiba Corporation
74071
- * SPDX-License-Identifier: Apache-2.0
74072
- */
74073
- var DChartRegionImpl = /** @class */ (function () {
74074
- function DChartRegionImpl(from, to) {
74075
- this.from = from;
74076
- this.to = to;
74077
- }
74078
- DChartRegionImpl.prototype.set = function (from, to) {
74079
- if (from != null) {
74080
- this.from = from;
74081
- }
74082
- if (to != null) {
74083
- this.to = to;
74084
- }
74085
- return this;
74086
- };
74087
- DChartRegionImpl.prototype.add = function (from, to) {
74088
- if (!isNaN$1(from)) {
74089
- this.from = isNaN$1(this.from) ? from : Math.min(this.from, from);
74090
- }
74091
- if (!isNaN$1(to)) {
74092
- this.to = isNaN$1(this.to) ? to : Math.max(this.to, to);
74093
- }
74094
- return this;
74095
- };
74096
- DChartRegionImpl.prototype.clear = function () {
74097
- this.from = NaN;
74098
- this.to = NaN;
74099
- return this;
74100
- };
74101
- return DChartRegionImpl;
74102
- }());
74103
-
74104
- /*
74105
- * Copyright (C) 2019 Toshiba Corporation
74106
- * SPDX-License-Identifier: Apache-2.0
74107
- */
74108
- var DChartCoordinateLinear = /** @class */ (function () {
74109
- function DChartCoordinateLinear(options) {
74110
- this._id = 0;
74111
- this._direction = DChartCoordinateDirection.X;
74112
- this._theme = this.toTheme(options);
74113
- this._transform = new DChartCoordinateTransformImpl(options === null || options === void 0 ? void 0 : options.transform);
74114
- this._tick = new DChartCoordinateLinearTick(options === null || options === void 0 ? void 0 : options.tick);
74115
- this._work = new DChartRegionImpl(NaN, NaN);
74116
- this._mark = new DChartCoordinateTransformMarkImpl();
74117
- this._from = options === null || options === void 0 ? void 0 : options.from;
74118
- this._to = options === null || options === void 0 ? void 0 : options.to;
74483
+ var DChartCoordinateLinear = /** @class */ (function (_super) {
74484
+ __extends(DChartCoordinateLinear, _super);
74485
+ function DChartCoordinateLinear() {
74486
+ return _super !== null && _super.apply(this, arguments) || this;
74119
74487
  }
74120
- Object.defineProperty(DChartCoordinateLinear.prototype, "from", {
74121
- get: function () {
74122
- return this._from;
74123
- },
74124
- set: function (from) {
74125
- this._from = from;
74126
- },
74127
- enumerable: false,
74128
- configurable: true
74129
- });
74130
- Object.defineProperty(DChartCoordinateLinear.prototype, "to", {
74131
- get: function () {
74132
- return this._to;
74133
- },
74134
- set: function (to) {
74135
- this._to = to;
74136
- },
74137
- enumerable: false,
74138
- configurable: true
74139
- });
74140
- DChartCoordinateLinear.prototype.bind = function (container, direction) {
74141
- this._container = container;
74142
- this._direction = direction;
74143
- this._transform.bind(container, direction);
74144
- };
74145
- DChartCoordinateLinear.prototype.unbind = function () {
74146
- this._container = undefined;
74147
- this._transform.unbind();
74148
- };
74149
- DChartCoordinateLinear.prototype.fit = function (from, to) {
74150
- this.doFit(from, to, this._transform);
74151
- };
74152
- DChartCoordinateLinear.prototype.mark = function (from, to) {
74153
- var mark = this._mark;
74154
- var transform = this._transform;
74155
- mark.oldTranslate = transform.translate;
74156
- mark.oldScale = transform.scale;
74157
- this.doFit(from, to, mark);
74158
- };
74159
- DChartCoordinateLinear.prototype.blend = function (ratio) {
74160
- this._transform.blend(ratio, this._mark);
74161
- };
74162
- DChartCoordinateLinear.prototype.doFit = function (from, to, result) {
74163
- var container = this._container;
74164
- if (container) {
74165
- var plotArea = container.container.plotArea;
74166
- var padding = plotArea.padding;
74167
- var work = this._work;
74168
- switch (this._direction) {
74169
- case DChartCoordinateDirection.X:
74170
- this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
74171
- break;
74172
- case DChartCoordinateDirection.Y:
74173
- this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
74174
- break;
74175
- }
74176
- }
74177
- };
74178
- DChartCoordinateLinear.prototype.toFitDomain = function (from, to, plotArea, result) {
74179
- if (from == null) {
74180
- from = this._from;
74181
- }
74182
- if (to == null) {
74183
- to = this._to;
74184
- }
74185
- if (from != null && to != null) {
74186
- result.set(from, to);
74187
- }
74188
- else {
74189
- plotArea.series.getDomain(this, result);
74190
- result.set(from, to);
74191
- }
74192
- return result;
74193
- };
74194
- DChartCoordinateLinear.prototype.toFitRange = function (from, to, plotArea, result) {
74195
- if (from == null) {
74196
- from = this._from;
74197
- }
74198
- if (to == null) {
74199
- to = this._to;
74200
- }
74201
- if (from != null && to != null) {
74202
- result.set(from, to);
74203
- }
74204
- else {
74205
- plotArea.series.getRange(this, result);
74206
- result.set(from, to);
74207
- }
74208
- return result;
74209
- };
74210
- DChartCoordinateLinear.prototype.doFit_ = function (pixelFrom, pixelTo, region, result) {
74211
- var regionFrom = region.from;
74212
- var regionTo = region.to;
74213
- if (!(isNaN$1(regionFrom) || isNaN$1(regionTo))) {
74214
- // Scale
74215
- var newScale = 1;
74216
- var regionSize = regionTo - regionFrom;
74217
- if (!this._theme.isZero(regionSize)) {
74218
- var pixelSize = pixelTo - pixelFrom;
74219
- newScale = pixelSize / regionSize;
74220
- }
74221
- else {
74222
- newScale = pixelTo < pixelFrom ? -1 : 1;
74223
- }
74224
- // Translation
74225
- var newTranslation = pixelFrom - regionFrom * newScale;
74226
- // Done
74227
- result.set(newTranslation, newScale);
74228
- }
74229
- };
74230
- Object.defineProperty(DChartCoordinateLinear.prototype, "id", {
74231
- get: function () {
74232
- return this._id;
74233
- },
74234
- enumerable: false,
74235
- configurable: true
74236
- });
74237
- Object.defineProperty(DChartCoordinateLinear.prototype, "transform", {
74238
- get: function () {
74239
- return this._transform;
74240
- },
74241
- enumerable: false,
74242
- configurable: true
74243
- });
74244
- DChartCoordinateLinear.prototype.map = function (value) {
74245
- return value;
74246
- };
74247
- DChartCoordinateLinear.prototype.mapAll = function (values, ifrom, iend, stride, offset) {
74248
- // DO NOTHING
74249
- };
74250
- DChartCoordinateLinear.prototype.unmap = function (value) {
74251
- return value;
74252
- };
74253
- DChartCoordinateLinear.prototype.unmapAll = function (values, ifrom, iend, stride, offset) {
74254
- // DO NOTHING
74255
- };
74256
- DChartCoordinateLinear.prototype.ticks = function (domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult) {
74257
- this._tick.calculate(domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult, this);
74258
- };
74259
- DChartCoordinateLinear.prototype.toTheme = function (options) {
74260
- return (options && options.theme) || this.getThemeDefault();
74261
- };
74262
- DChartCoordinateLinear.prototype.getThemeDefault = function () {
74263
- return DThemes.getInstance().get(this.getType());
74264
- };
74265
- DChartCoordinateLinear.prototype.getType = function () {
74266
- return "DChartCoordinate";
74488
+ DChartCoordinateLinear.prototype.newTick = function (options) {
74489
+ return new DChartCoordinateLinearTick(options);
74267
74490
  };
74268
74491
  return DChartCoordinateLinear;
74269
- }());
74492
+ }(DChartCoordinateBase));
74270
74493
 
74271
74494
  /*
74272
74495
  * Copyright (C) 2019 Toshiba Corporation
@@ -74391,7 +74614,8 @@ var DChartCoordinateLogTick = /** @class */ (function () {
74391
74614
  }
74392
74615
  };
74393
74616
  DChartCoordinateLogTick.prototype.toTheme = function (options) {
74394
- return (options && options.theme) || this.getThemeDefault();
74617
+ var _a;
74618
+ return (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : this.getThemeDefault();
74395
74619
  };
74396
74620
  DChartCoordinateLogTick.prototype.getThemeDefault = function () {
74397
74621
  return DThemes.getInstance().get(this.getType());
@@ -74406,142 +74630,14 @@ var DChartCoordinateLogTick = /** @class */ (function () {
74406
74630
  * Copyright (C) 2019 Toshiba Corporation
74407
74631
  * SPDX-License-Identifier: Apache-2.0
74408
74632
  */
74409
- var DChartCoordinateLog = /** @class */ (function () {
74410
- function DChartCoordinateLog(options) {
74411
- this._id = 0;
74412
- this._direction = DChartCoordinateDirection.X;
74413
- this._theme = this.toTheme(options);
74414
- this._transform = new DChartCoordinateTransformImpl(options === null || options === void 0 ? void 0 : options.transform);
74415
- this._tick = new DChartCoordinateLogTick(options === null || options === void 0 ? void 0 : options.tick);
74416
- this._work = new DChartRegionImpl(NaN, NaN);
74417
- this._mark = new DChartCoordinateTransformMarkImpl();
74418
- this._from = options === null || options === void 0 ? void 0 : options.from;
74419
- this._to = options === null || options === void 0 ? void 0 : options.to;
74633
+ var DChartCoordinateLog = /** @class */ (function (_super) {
74634
+ __extends(DChartCoordinateLog, _super);
74635
+ function DChartCoordinateLog() {
74636
+ return _super !== null && _super.apply(this, arguments) || this;
74420
74637
  }
74421
- Object.defineProperty(DChartCoordinateLog.prototype, "from", {
74422
- get: function () {
74423
- return this._from;
74424
- },
74425
- set: function (from) {
74426
- this._from = from;
74427
- },
74428
- enumerable: false,
74429
- configurable: true
74430
- });
74431
- Object.defineProperty(DChartCoordinateLog.prototype, "to", {
74432
- get: function () {
74433
- return this._to;
74434
- },
74435
- set: function (to) {
74436
- this._to = to;
74437
- },
74438
- enumerable: false,
74439
- configurable: true
74440
- });
74441
- DChartCoordinateLog.prototype.bind = function (container, direction) {
74442
- this._container = container;
74443
- this._direction = direction;
74444
- };
74445
- DChartCoordinateLog.prototype.unbind = function () {
74446
- this._container = undefined;
74447
- };
74448
- DChartCoordinateLog.prototype.fit = function (from, to) {
74449
- this.doFit(from, to, this._transform);
74450
- };
74451
- DChartCoordinateLog.prototype.mark = function (from, to) {
74452
- var mark = this._mark;
74453
- var transform = this._transform;
74454
- mark.oldTranslate = transform.translate;
74455
- mark.oldScale = transform.scale;
74456
- this.doFit(from, to, mark);
74457
- };
74458
- DChartCoordinateLog.prototype.blend = function (ratio) {
74459
- this._transform.blend(ratio, this._mark);
74460
- };
74461
- DChartCoordinateLog.prototype.doFit = function (from, to, result) {
74462
- var container = this._container;
74463
- if (container) {
74464
- var plotArea = container.container.plotArea;
74465
- var padding = plotArea.padding;
74466
- var work = this._work;
74467
- switch (this._direction) {
74468
- case DChartCoordinateDirection.X:
74469
- this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
74470
- break;
74471
- case DChartCoordinateDirection.Y:
74472
- this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
74473
- break;
74474
- }
74475
- }
74476
- };
74477
- DChartCoordinateLog.prototype.toFitDomain = function (from, to, plotArea, result) {
74478
- if (from == null) {
74479
- from = this._from;
74480
- }
74481
- if (to == null) {
74482
- to = this._to;
74483
- }
74484
- if (from != null && to != null) {
74485
- result.set(from, to);
74486
- }
74487
- else {
74488
- plotArea.series.getDomain(this, result);
74489
- result.set(from, to);
74490
- }
74491
- return result;
74492
- };
74493
- DChartCoordinateLog.prototype.toFitRange = function (from, to, plotArea, result) {
74494
- if (from == null) {
74495
- from = this._from;
74496
- }
74497
- if (to == null) {
74498
- to = this._to;
74499
- }
74500
- if (from != null && to != null) {
74501
- result.set(from, to);
74502
- }
74503
- else {
74504
- plotArea.series.getRange(this, result);
74505
- result.set(from, to);
74506
- }
74507
- return result;
74638
+ DChartCoordinateLog.prototype.newTick = function (options) {
74639
+ return new DChartCoordinateLogTick(options);
74508
74640
  };
74509
- DChartCoordinateLog.prototype.doFit_ = function (pixelFrom, pixelTo, region, result) {
74510
- var regionFrom = region.from;
74511
- var regionTo = region.to;
74512
- if (!(isNaN$1(regionFrom) || isNaN$1(regionTo))) {
74513
- // Scale
74514
- var newScale = 1;
74515
- var regionFromMapped = this.map(regionFrom);
74516
- var regionToMapped = this.map(regionTo);
74517
- var regionSizeMapped = regionToMapped - regionFromMapped;
74518
- if (!this._theme.isZero(regionSizeMapped)) {
74519
- var pixelSize = pixelTo - pixelFrom;
74520
- newScale = pixelSize / regionSizeMapped;
74521
- }
74522
- else {
74523
- newScale = pixelTo < pixelFrom ? -1 : 1;
74524
- }
74525
- // Translation
74526
- var newTranslation = pixelFrom - regionFromMapped * newScale;
74527
- // Done
74528
- result.set(newTranslation, newScale);
74529
- }
74530
- };
74531
- Object.defineProperty(DChartCoordinateLog.prototype, "id", {
74532
- get: function () {
74533
- return this._id;
74534
- },
74535
- enumerable: false,
74536
- configurable: true
74537
- });
74538
- Object.defineProperty(DChartCoordinateLog.prototype, "transform", {
74539
- get: function () {
74540
- return this._transform;
74541
- },
74542
- enumerable: false,
74543
- configurable: true
74544
- });
74545
74641
  DChartCoordinateLog.prototype.map = function (value) {
74546
74642
  return Math.log(Math.max(0, value)) / Math.LN10;
74547
74643
  };
@@ -74560,20 +74656,8 @@ var DChartCoordinateLog = /** @class */ (function () {
74560
74656
  values[i] = Math.pow(10, values[i]);
74561
74657
  }
74562
74658
  };
74563
- DChartCoordinateLog.prototype.ticks = function (domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult) {
74564
- this._tick.calculate(domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult, this);
74565
- };
74566
- DChartCoordinateLog.prototype.toTheme = function (options) {
74567
- return (options && options.theme) || this.getThemeDefault();
74568
- };
74569
- DChartCoordinateLog.prototype.getThemeDefault = function () {
74570
- return DThemes.getInstance().get(this.getType());
74571
- };
74572
- DChartCoordinateLog.prototype.getType = function () {
74573
- return "DChartCoordinate";
74574
- };
74575
74659
  return DChartCoordinateLog;
74576
- }());
74660
+ }(DChartCoordinateBase));
74577
74661
 
74578
74662
  /*
74579
74663
  * Copyright (C) 2019 Toshiba Corporation
@@ -76126,10 +76210,12 @@ var DChartSeriesBase = /** @class */ (function (_super) {
76126
76210
  var DChartSeriesLineOfAny = /** @class */ (function (_super) {
76127
76211
  __extends(DChartSeriesLineOfAny, _super);
76128
76212
  function DChartSeriesLineOfAny(options) {
76129
- var _this = _super.call(this, options) || this;
76213
+ var _this = this;
76214
+ var _a;
76215
+ _this = _super.call(this, options) || this;
76130
76216
  _this._line = null;
76131
76217
  _this._options = options;
76132
- _this._points = (options && options.points) || [];
76218
+ _this._points = (_a = options === null || options === void 0 ? void 0 : options.points) !== null && _a !== void 0 ? _a : [];
76133
76219
  _this._pointId = 0;
76134
76220
  _this._pointIdUpdated = NaN;
76135
76221
  return _this;
@@ -87491,6 +87577,43 @@ var DTableBody = /** @class */ (function (_super) {
87491
87577
  result.height -= dy;
87492
87578
  }
87493
87579
  };
87580
+ /**
87581
+ * Scroll to the given row or row index.
87582
+ *
87583
+ * @param target a row or an row index to which the body scrolls to.
87584
+ * @returns true if succeeded
87585
+ */
87586
+ DTableBody.prototype.scrollTo = function (target) {
87587
+ var parent = this.parent;
87588
+ if (parent == null) {
87589
+ return false;
87590
+ }
87591
+ var parentParent = parent.parent;
87592
+ if (parentParent == null) {
87593
+ return false;
87594
+ }
87595
+ var rowIndexMapped = -1;
87596
+ if (isNumber(target)) {
87597
+ if (0 <= target && target < this.data.mapped.size()) {
87598
+ rowIndexMapped = target;
87599
+ }
87600
+ }
87601
+ else {
87602
+ this.data.mapped.each(function (row, _, index) {
87603
+ if (row === target) {
87604
+ rowIndexMapped = index;
87605
+ return false;
87606
+ }
87607
+ return true;
87608
+ });
87609
+ }
87610
+ if (rowIndexMapped < 0) {
87611
+ return false;
87612
+ }
87613
+ parent.position.y = Math.max(Math.min(0, parentParent.height - parent.height), -rowIndexMapped * this._rowHeight);
87614
+ DApplications.update(this);
87615
+ return true;
87616
+ };
87494
87617
  DTableBody.prototype.toRowIndexMapped = function (local) {
87495
87618
  if (0 <= this.parent.position.y + local.y) {
87496
87619
  return Math.floor(local.y / this._rowHeight);
@@ -89044,7 +89167,7 @@ var toPathGetter = function (path, def) {
89044
89167
  }
89045
89168
  else {
89046
89169
  return function (row) {
89047
- return key_1 in row ? row[key_1] : def;
89170
+ return Object.prototype.hasOwnProperty.call(row, key_1) ? row[key_1] : def;
89048
89171
  };
89049
89172
  }
89050
89173
  }
@@ -89063,7 +89186,7 @@ var toPathGetter = function (path, def) {
89063
89186
  row = row[path[i]];
89064
89187
  }
89065
89188
  var key = path[path.length - 1];
89066
- return key in row ? row[key] : def;
89189
+ return Object.prototype.hasOwnProperty.call(row, key) ? row[key] : def;
89067
89190
  };
89068
89191
  }
89069
89192
  }
@@ -89119,7 +89242,7 @@ var toColumnDataChecker = function (path) {
89119
89242
  if (pathLength_1 <= 1) {
89120
89243
  var key_3 = path[0];
89121
89244
  return function (row) {
89122
- return key_3 in row;
89245
+ return Object.prototype.hasOwnProperty.call(row, key_3);
89123
89246
  };
89124
89247
  }
89125
89248
  else {
@@ -91352,7 +91475,12 @@ exports.DCanvas = DCanvas;
91352
91475
  exports.DCanvasContainer = DCanvasContainer;
91353
91476
  exports.DChart = DChart;
91354
91477
  exports.DChartAxisBase = DChartAxisBase;
91478
+ exports.DChartAxisBaseBar = DChartAxisBaseBar;
91355
91479
  exports.DChartAxisBaseOptionParser = DChartAxisBaseOptionParser;
91480
+ exports.DChartAxisBaseTickContainer = DChartAxisBaseTickContainer;
91481
+ exports.DChartAxisBaseTickMajor = DChartAxisBaseTickMajor;
91482
+ exports.DChartAxisBaseTickMajorGridline = DChartAxisBaseTickMajorGridline;
91483
+ exports.DChartAxisBaseTickMinor = DChartAxisBaseTickMinor;
91356
91484
  exports.DChartAxisContainerImpl = DChartAxisContainerImpl;
91357
91485
  exports.DChartAxisPosition = DChartAxisPosition;
91358
91486
  exports.DChartAxisTickPosition = DChartAxisTickPosition;
@@ -91361,6 +91489,7 @@ exports.DChartAxisXDatetime = DChartAxisXDatetime;
91361
91489
  exports.DChartAxisY = DChartAxisY;
91362
91490
  exports.DChartColorSet1 = DChartColorSet1;
91363
91491
  exports.DChartColorSet2 = DChartColorSet2;
91492
+ exports.DChartCoordinateBase = DChartCoordinateBase;
91364
91493
  exports.DChartCoordinateContainerImpl = DChartCoordinateContainerImpl;
91365
91494
  exports.DChartCoordinateContainerSubImpl = DChartCoordinateContainerSubImpl;
91366
91495
  exports.DChartCoordinateDirection = DChartCoordinateDirection;