@wcardinal/wcardinal-ui 0.295.0 → 0.296.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.
@@ -8,6 +8,8 @@ import { DChartAxisTickMinor } from "./d-chart-axis-tick-minor";
8
8
  import { DChartCoordinate } from "./d-chart-coordinate";
9
9
  import { DChartCoordinateTickMajorStepFunction } from "./d-chart-coordinate-tick-major-step-function";
10
10
  import { DChartCoordinateTickMinorStepFunction } from "./d-chart-coordinate-tick-minor-step-function";
11
+ import { DChartPlotArea } from "./d-chart-plot-area";
12
+ import { DChartRegion } from "./d-chart-region";
11
13
  import { EShape } from "./shape/e-shape";
12
14
  export interface DChartAxisBaseTickContainerOptions {
13
15
  }
@@ -19,6 +21,7 @@ export declare class DChartAxisBaseTickContainer<CHART extends DBase = DBase, OP
19
21
  protected _minor: DChartAxisTickMinor<CHART>;
20
22
  protected _majorTicks: number[];
21
23
  protected _minorTicks: number[];
24
+ protected _work: DChartRegion;
22
25
  constructor(parser: DChartAxisBaseOptionParser, options?: OPTIONS);
23
26
  get major(): DChartAxisTickMajor<CHART>;
24
27
  protected newMajor(parser: DChartAxisBaseOptionParser, options?: OPTIONS): DChartAxisTickMajor<CHART>;
@@ -27,8 +30,10 @@ export declare class DChartAxisBaseTickContainer<CHART extends DBase = DBase, OP
27
30
  bind(container: DChartAxisContainer<CHART>, index: number): void;
28
31
  unbind(): void;
29
32
  update(): boolean;
33
+ protected getDomain(plotArea: DChartPlotArea<CHART>, coordinate: DChartCoordinate<CHART>, result: DChartRegion): DChartRegion;
34
+ protected getRange(plotArea: DChartPlotArea<CHART>, coordinate: DChartCoordinate<CHART>, result: DChartRegion): DChartRegion;
30
35
  protected updateX(domainMin: number, domainMax: number, coordinate: DChartCoordinate<CHART>, majorShapes: EShape[], minorShapes: EShape[], gridlineShapes: EShape[], shapePositionY: number, transform: Matrix, plotAreaHeight: number): boolean;
31
- protected updateY(domainMin: number, domainMax: number, coordinate: DChartCoordinate<CHART>, majorShapes: EShape[], minorShapes: EShape[], gridlineShapes: EShape[], shapePositionX: number, transform: Matrix, plotAreaWidth: number): boolean;
36
+ protected updateY(rangeMin: number, rangeMax: number, coordinate: DChartCoordinate<CHART>, majorShapes: EShape[], minorShapes: EShape[], gridlineShapes: EShape[], shapePositionX: number, transform: Matrix, plotAreaWidth: number): boolean;
32
37
  protected showMajor(shape: EShape, x: number, y: number, text?: string): void;
33
38
  protected showMajorGridline(shape: EShape, value: number, x: number, y: number, sx: number, sy: number): void;
34
39
  protected hideMajor(shape: EShape): void;
@@ -36,6 +36,8 @@ export declare abstract class DChartCoordinateBase<CHART extends DBase = DBase>
36
36
  mark(from?: number, to?: number): void;
37
37
  blend(ratio: number): void;
38
38
  protected doFit(from: number | undefined, to: number | undefined, result: DChartCoordinateTransformMark | DChartCoordinateTransform<CHART>): void;
39
+ protected getPixelDomain(plotArea: DChartPlotArea<CHART>, result: DChartRegion): DChartRegion;
40
+ protected getPixelRange(plotArea: DChartPlotArea<CHART>, result: DChartRegion): DChartRegion;
39
41
  protected toFitDomain(from: number | undefined, to: number | undefined, plotArea: DChartPlotArea<CHART>, result: DChartRegion): DChartRegion;
40
42
  protected toFitRange(from: number | undefined, to: number | undefined, plotArea: DChartPlotArea<CHART>, result: DChartRegion): DChartRegion;
41
43
  protected doFit_(pixelFrom: number, pixelTo: number, region: DChartRegion, result: DChartCoordinateTransformMark | DChartCoordinateTransform<CHART>): void;
@@ -1,6 +1,7 @@
1
1
  import { DChartAxisBaseTickMajor } from "./d-chart-axis-base-tick-major";
2
2
  import { DChartAxisBaseTickMinor } from "./d-chart-axis-base-tick-minor";
3
3
  import { DChartAxisPosition } from "./d-chart-axis-position";
4
+ import { DChartRegionImpl } from "./d-chart-region-impl";
4
5
  var DChartAxisBaseTickContainer = /** @class */ (function () {
5
6
  function DChartAxisBaseTickContainer(parser, options) {
6
7
  this._parser = parser;
@@ -9,6 +10,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
9
10
  this._minor = this.newMinor(parser, options);
10
11
  this._majorTicks = [];
11
12
  this._minorTicks = [];
13
+ this._work = new DChartRegionImpl(0, 0);
12
14
  }
13
15
  Object.defineProperty(DChartAxisBaseTickContainer.prototype, "major", {
14
16
  get: function () {
@@ -48,7 +50,6 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
48
50
  var minorShapes = this._minor.shapes;
49
51
  if (container != null && majorShapes && minorShapes) {
50
52
  var plotArea = container.plotArea;
51
- var bounds = plotArea.getBoundsInContainer();
52
53
  var transform = plotArea.container.transform.localTransform;
53
54
  var gridlineShapes = this._major.gridline.shapes;
54
55
  var parser = this._parser;
@@ -58,43 +59,49 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
58
59
  case DChartAxisPosition.TOP:
59
60
  coordinate = plotArea.coordinate.x.get(parser.coordinate);
60
61
  if (coordinate) {
61
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
62
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
62
+ var domain = this.getDomain(plotArea, coordinate, this._work);
63
63
  var plotAreaHeight = plotArea.height;
64
- return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaHeight);
64
+ return this.updateX(domain.from, domain.to, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaHeight);
65
65
  }
66
66
  break;
67
67
  case DChartAxisPosition.BOTTOM:
68
68
  coordinate = plotArea.coordinate.x.get(parser.coordinate);
69
69
  if (coordinate) {
70
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
71
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
70
+ var domain = this.getDomain(plotArea, coordinate, this._work);
72
71
  var plotAreaHeight = plotArea.height;
73
- return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + offset, transform, plotAreaHeight);
72
+ return this.updateX(domain.from, domain.to, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + offset, transform, plotAreaHeight);
74
73
  }
75
74
  break;
76
75
  case DChartAxisPosition.LEFT:
77
76
  coordinate = plotArea.coordinate.y.get(parser.coordinate);
78
77
  if (coordinate) {
79
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
80
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
78
+ var range = this.getRange(plotArea, coordinate, this._work);
81
79
  var plotAreaWidth = plotArea.width;
82
- return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaWidth);
80
+ return this.updateY(range.from, range.to, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaWidth);
83
81
  }
84
82
  break;
85
83
  case DChartAxisPosition.RIGHT:
86
84
  coordinate = plotArea.coordinate.y.get(parser.coordinate);
87
85
  if (coordinate) {
88
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
89
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
86
+ var range = this.getRange(plotArea, coordinate, this._work);
90
87
  var plotAreaWidth = plotArea.width;
91
- return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + offset, transform, plotAreaWidth);
88
+ return this.updateY(range.from, range.to, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + offset, transform, plotAreaWidth);
92
89
  }
93
90
  break;
94
91
  }
95
92
  }
96
93
  return false;
97
94
  };
95
+ DChartAxisBaseTickContainer.prototype.getDomain = function (plotArea, coordinate, result) {
96
+ var bounds = plotArea.getBoundsInContainer();
97
+ var transform = coordinate.transform;
98
+ return result.set(coordinate.unmap(transform.unmap(bounds.x)), coordinate.unmap(transform.unmap(bounds.x + bounds.width)));
99
+ };
100
+ DChartAxisBaseTickContainer.prototype.getRange = function (plotArea, coordinate, result) {
101
+ var bounds = plotArea.getBoundsInContainer();
102
+ var transform = coordinate.transform;
103
+ return result.set(coordinate.unmap(transform.unmap(bounds.y)), coordinate.unmap(transform.unmap(bounds.y + bounds.height)));
104
+ };
98
105
  DChartAxisBaseTickContainer.prototype.updateX = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionY, transform, plotAreaHeight) {
99
106
  var tick = this._parser.tick;
100
107
  var majorTick = tick.major;
@@ -148,7 +155,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
148
155
  }
149
156
  return true;
150
157
  };
151
- DChartAxisBaseTickContainer.prototype.updateY = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionX, transform, plotAreaWidth) {
158
+ DChartAxisBaseTickContainer.prototype.updateY = function (rangeMin, rangeMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionX, transform, plotAreaWidth) {
152
159
  var tick = this._parser.tick;
153
160
  var majorTick = tick.major;
154
161
  var majorCount = majorTick.count;
@@ -162,7 +169,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
162
169
  var minorFormatter = minorTick.formatter;
163
170
  var majorTicks = this._majorTicks;
164
171
  var minorTicks = this._minorTicks;
165
- this.newTicks(coordinate, domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
172
+ this.newTicks(coordinate, rangeMin, rangeMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
166
173
  var d = transform.d;
167
174
  var ty = transform.ty;
168
175
  for (var i = 0; i < majorCapacity; ++i) {
@@ -1 +1 @@
1
- {"version":3,"file":"d-chart-axis-base-tick-container.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-base-tick-container.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAA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M,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC7B,CAAC;IACF,kCAAC;AAAD,CAAC,AAvaD,IAuaC","sourcesContent":["import { Matrix } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { DChartAxisBaseOptionParser } from \"./d-chart-axis-base-options-parser\";\nimport { DChartAxisBaseTickMajor } from \"./d-chart-axis-base-tick-major\";\nimport { DChartAxisBaseTickMinor } from \"./d-chart-axis-base-tick-minor\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { DChartAxisPosition } from \"./d-chart-axis-position\";\nimport { DChartAxisTickContainer } from \"./d-chart-axis-tick-container\";\nimport { DChartAxisTickMajor } from \"./d-chart-axis-tick-major\";\nimport { DChartAxisTickMinor } from \"./d-chart-axis-tick-minor\";\nimport { DChartCoordinate } from \"./d-chart-coordinate\";\nimport { DChartCoordinateTickMajorStepFunction } from \"./d-chart-coordinate-tick-major-step-function\";\nimport { DChartCoordinateTickMinorStepFunction } from \"./d-chart-coordinate-tick-minor-step-function\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DChartAxisBaseTickContainerOptions {}\n\nexport class DChartAxisBaseTickContainer<\n\tCHART extends DBase = DBase,\n\tOPTIONS extends DChartAxisBaseTickContainerOptions = DChartAxisBaseTickContainerOptions\n> implements DChartAxisTickContainer<CHART>\n{\n\tprotected _parser: DChartAxisBaseOptionParser;\n\tprotected _container?: DChartAxisContainer<CHART>;\n\tprotected _index: number;\n\tprotected _major: DChartAxisTickMajor<CHART>;\n\tprotected _minor: DChartAxisTickMinor<CHART>;\n\tprotected _majorTicks: number[];\n\tprotected _minorTicks: number[];\n\n\tconstructor(parser: DChartAxisBaseOptionParser, options?: OPTIONS) {\n\t\tthis._parser = parser;\n\t\tthis._index = 0;\n\t\tthis._major = this.newMajor(parser, options);\n\t\tthis._minor = this.newMinor(parser, options);\n\t\tthis._majorTicks = [];\n\t\tthis._minorTicks = [];\n\t}\n\n\tget major(): DChartAxisTickMajor<CHART> {\n\t\treturn this._major;\n\t}\n\n\tprotected newMajor(\n\t\tparser: DChartAxisBaseOptionParser,\n\t\toptions?: OPTIONS\n\t): DChartAxisTickMajor<CHART> {\n\t\treturn new DChartAxisBaseTickMajor(parser);\n\t}\n\n\tget minor(): DChartAxisTickMinor<CHART> {\n\t\treturn this._minor;\n\t}\n\n\tprotected newMinor(\n\t\tparser: DChartAxisBaseOptionParser,\n\t\toptions?: OPTIONS\n\t): DChartAxisTickMinor<CHART> {\n\t\treturn new DChartAxisBaseTickMinor(parser);\n\t}\n\n\tbind(container: DChartAxisContainer<CHART>, index: number): void {\n\t\tthis._container = container;\n\t\tthis._index = index;\n\t\tthis._major.bind(container, index);\n\t\tthis._minor.bind(container, index);\n\t}\n\n\tunbind(): void {\n\t\tthis._minor.unbind();\n\t\tthis._major.unbind();\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n\n\tupdate(): boolean {\n\t\tconst container = this._container;\n\t\tconst majorShapes = this._major.shapes;\n\t\tconst minorShapes = this._minor.shapes;\n\t\tif (container != null && majorShapes && minorShapes) {\n\t\t\tconst plotArea = container.plotArea;\n\t\t\tconst bounds = plotArea.getBoundsInContainer();\n\t\t\tconst transform = plotArea.container.transform.localTransform;\n\t\t\tconst gridlineShapes = this._major.gridline.shapes;\n\n\t\t\tconst parser = this._parser;\n\t\t\tconst offset = parser.padding * this._index;\n\t\t\tlet coordinate: DChartCoordinate<CHART> | null;\n\t\t\tswitch (parser.position) {\n\t\t\t\tcase DChartAxisPosition.TOP:\n\t\t\t\t\tcoordinate = plotArea.coordinate.x.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));\n\t\t\t\t\t\tconst domainTo = coordinate.unmap(\n\t\t\t\t\t\t\tcoordinate.transform.unmap(bounds.x + bounds.width)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst plotAreaHeight = plotArea.height;\n\t\t\t\t\t\treturn this.updateX(\n\t\t\t\t\t\t\tdomainFrom,\n\t\t\t\t\t\t\tdomainTo,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\t0 - offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaHeight\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.BOTTOM:\n\t\t\t\t\tcoordinate = plotArea.coordinate.x.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));\n\t\t\t\t\t\tconst domainTo = coordinate.unmap(\n\t\t\t\t\t\t\tcoordinate.transform.unmap(bounds.x + bounds.width)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst plotAreaHeight = plotArea.height;\n\t\t\t\t\t\treturn this.updateX(\n\t\t\t\t\t\t\tdomainFrom,\n\t\t\t\t\t\t\tdomainTo,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\tplotAreaHeight + offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaHeight\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.LEFT:\n\t\t\t\t\tcoordinate = plotArea.coordinate.y.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));\n\t\t\t\t\t\tconst domainTo = coordinate.unmap(\n\t\t\t\t\t\t\tcoordinate.transform.unmap(bounds.y + bounds.height)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst plotAreaWidth = plotArea.width;\n\t\t\t\t\t\treturn this.updateY(\n\t\t\t\t\t\t\tdomainFrom,\n\t\t\t\t\t\t\tdomainTo,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\t0 - offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaWidth\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.RIGHT:\n\t\t\t\t\tcoordinate = plotArea.coordinate.y.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));\n\t\t\t\t\t\tconst domainTo = coordinate.unmap(\n\t\t\t\t\t\t\tcoordinate.transform.unmap(bounds.y + bounds.height)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst plotAreaWidth = plotArea.width;\n\t\t\t\t\t\treturn this.updateY(\n\t\t\t\t\t\t\tdomainFrom,\n\t\t\t\t\t\t\tdomainTo,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\tplotAreaWidth + offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaWidth\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected updateX(\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tmajorShapes: EShape[],\n\t\tminorShapes: EShape[],\n\t\tgridlineShapes: EShape[],\n\t\tshapePositionY: number,\n\t\ttransform: Matrix,\n\t\tplotAreaHeight: number\n\t): boolean {\n\t\tconst tick = this._parser.tick;\n\t\tconst majorTick = tick.major;\n\t\tconst majorCount = majorTick.count;\n\t\tconst majorCapacity = majorTick.capacity;\n\t\tconst majorStep = majorTick.step;\n\t\tconst majorFormatter = majorTick.formatter;\n\t\tconst minorTick = tick.minor;\n\t\tconst minorCountPerMajor = minorTick.count;\n\t\tconst minorCount = (majorCapacity + 1) * minorCountPerMajor;\n\t\tconst minorStep = minorTick.step;\n\t\tconst minorFormatter = minorTick.formatter;\n\t\tconst majorTicks = this._majorTicks;\n\t\tconst minorTicks = this._minorTicks;\n\t\tthis.newTicks(\n\t\t\tcoordinate,\n\t\t\tdomainMin,\n\t\t\tdomainMax,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorTicks,\n\t\t\tminorTicks\n\t\t);\n\n\t\tconst a = transform.a;\n\t\tconst tx = transform.tx;\n\t\tfor (let i = 0; i < majorCapacity; ++i) {\n\t\t\tconst majorShape = majorShapes[i];\n\t\t\tconst imajorTick = i * 3;\n\t\t\tconst majorTickPosition = majorTicks[imajorTick + 0];\n\t\t\tif (!isNaN(majorTickPosition)) {\n\t\t\t\tconst majorTickProjectedPosition = majorTicks[imajorTick + 1];\n\t\t\t\tconst majotTickPositionX = a * majorTickProjectedPosition + tx;\n\t\t\t\tconst majorTickStep = majorTicks[imajorTick + 2];\n\t\t\t\tthis.showMajor(\n\t\t\t\t\tmajorShape,\n\t\t\t\t\tmajotTickPositionX,\n\t\t\t\t\tshapePositionY,\n\t\t\t\t\tmajorFormatter?.format(majorTickPosition, majorTickStep)\n\t\t\t\t);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.showMajorGridline(\n\t\t\t\t\t\tgridlineShapes[i],\n\t\t\t\t\t\tmajorTickPosition,\n\t\t\t\t\t\tmajotTickPositionX,\n\t\t\t\t\t\tplotAreaHeight * 0.5,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tplotAreaHeight\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hideMajor(majorShape);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.hideMajorGridline(gridlineShapes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < minorCount; ++i) {\n\t\t\tconst minorShape = minorShapes[i];\n\t\t\tconst iminorTick = i * 3;\n\t\t\tconst minorTickPosition = minorTicks[iminorTick + 0];\n\t\t\tif (!isNaN(minorTickPosition)) {\n\t\t\t\tconst minorTickProjectedPosition = minorTicks[iminorTick + 1];\n\t\t\t\tconst minorTickPositionX = a * minorTickProjectedPosition + tx;\n\t\t\t\tconst minorTickStep = minorTicks[iminorTick + 2];\n\t\t\t\tthis.showMinor(\n\t\t\t\t\tminorShape,\n\t\t\t\t\tminorTickPositionX,\n\t\t\t\t\tshapePositionY,\n\t\t\t\t\tminorFormatter?.format(minorTickPosition, minorTickStep)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.hideMinor(minorShape);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected updateY(\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tmajorShapes: EShape[],\n\t\tminorShapes: EShape[],\n\t\tgridlineShapes: EShape[],\n\t\tshapePositionX: number,\n\t\ttransform: Matrix,\n\t\tplotAreaWidth: number\n\t): boolean {\n\t\tconst tick = this._parser.tick;\n\t\tconst majorTick = tick.major;\n\t\tconst majorCount = majorTick.count;\n\t\tconst majorCapacity = majorTick.capacity;\n\t\tconst majorStep = majorTick.step;\n\t\tconst majorFormatter = majorTick.formatter;\n\t\tconst minorTick = tick.minor;\n\t\tconst minorCountPerMajor = minorTick.count;\n\t\tconst minorCount = (majorCapacity + 1) * minorCountPerMajor;\n\t\tconst minorStep = minorTick.step;\n\t\tconst minorFormatter = minorTick.formatter;\n\t\tconst majorTicks = this._majorTicks;\n\t\tconst minorTicks = this._minorTicks;\n\t\tthis.newTicks(\n\t\t\tcoordinate,\n\t\t\tdomainMin,\n\t\t\tdomainMax,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorTicks,\n\t\t\tminorTicks\n\t\t);\n\n\t\tconst d = transform.d;\n\t\tconst ty = transform.ty;\n\t\tfor (let i = 0; i < majorCapacity; ++i) {\n\t\t\tconst majorShape = majorShapes[i];\n\t\t\tconst imajorTick = i * 3;\n\t\t\tconst majorTickPosition = majorTicks[imajorTick + 0];\n\t\t\tif (!isNaN(majorTickPosition)) {\n\t\t\t\tconst majorTickProjectedPosition = majorTicks[imajorTick + 1];\n\t\t\t\tconst majotTickPositionY = d * majorTickProjectedPosition + ty;\n\t\t\t\tconst majorTickStep = majorTicks[imajorTick + 2];\n\t\t\t\tthis.showMajor(\n\t\t\t\t\tmajorShape,\n\t\t\t\t\tshapePositionX,\n\t\t\t\t\tmajotTickPositionY,\n\t\t\t\t\tmajorFormatter?.format(majorTickPosition, majorTickStep)\n\t\t\t\t);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.showMajorGridline(\n\t\t\t\t\t\tgridlineShapes[i],\n\t\t\t\t\t\tmajorTickPosition,\n\t\t\t\t\t\tplotAreaWidth * 0.5,\n\t\t\t\t\t\tmajotTickPositionY,\n\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\t0\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hideMajor(majorShape);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.hideMajorGridline(gridlineShapes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < minorCount; ++i) {\n\t\t\tconst minorShape = minorShapes[i];\n\t\t\tconst iminorTick = i * 3;\n\t\t\tconst minorTickPosition = minorTicks[iminorTick + 0];\n\t\t\tif (!isNaN(minorTickPosition)) {\n\t\t\t\tconst minorTickProjectedPosition = minorTicks[iminorTick + 1];\n\t\t\t\tconst minorTickPositionY = d * minorTickProjectedPosition + ty;\n\t\t\t\tconst minorTickStep = minorTicks[iminorTick + 2];\n\t\t\t\tthis.showMinor(\n\t\t\t\t\tminorShape,\n\t\t\t\t\tshapePositionX,\n\t\t\t\t\tminorTickPositionY,\n\t\t\t\t\tminorFormatter?.format(minorTickPosition, minorTickStep)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.hideMinor(minorShape);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected showMajor(shape: EShape, x: number, y: number, text?: string): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tshape.visible = true;\n\t\tshape.transform.position.set(x, y);\n\t\tshape.text.value = text != null ? text : \"\";\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tprotected showMajorGridline(\n\t\tshape: EShape,\n\t\tvalue: number,\n\t\tx: number,\n\t\ty: number,\n\t\tsx: number,\n\t\tsy: number\n\t): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tshape.visible = true;\n\t\tshape.transform.position.set(x, y);\n\t\tshape.size.set(sx, sy);\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tprotected hideMajor(shape: EShape): void {\n\t\tshape.visible = false;\n\t}\n\n\tprotected hideMajorGridline(shape: EShape): void {\n\t\tshape.visible = false;\n\t}\n\n\tprotected showMinor(shape: EShape, x: number, y: number, text?: string): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tshape.visible = true;\n\t\tshape.transform.position.set(x, y);\n\t\tshape.text.value = text != null ? text : \"\";\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tprotected hideMinor(shape: EShape): void {\n\t\tshape.visible = false;\n\t}\n\n\tprotected newTicks(\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tmajorCount: number,\n\t\tmajorCapacity: number,\n\t\tmajorStep: number | DChartCoordinateTickMajorStepFunction | undefined,\n\t\tminorCountPerMajor: number,\n\t\tminorCount: number,\n\t\tminorStep: number | DChartCoordinateTickMinorStepFunction | undefined,\n\t\tmajorResult: number[],\n\t\tminorResult: number[]\n\t): void {\n\t\tcoordinate.ticks(\n\t\t\tdomainMin,\n\t\t\tdomainMax,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorResult,\n\t\t\tminorResult\n\t\t);\n\t}\n\n\tdestroy(): void {\n\t\tthis._major.destroy();\n\t\tthis._minor.destroy();\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-chart-axis-base-tick-container.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-base-tick-container.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAS7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKzD;IAcC,qCAAY,MAAkC,EAAE,OAAiB;QAChE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC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I,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC7B,CAAC;IACF,kCAAC;AAAD,CAAC,AAtbD,IAsbC","sourcesContent":["import { Matrix } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { DChartAxisBaseOptionParser } from \"./d-chart-axis-base-options-parser\";\nimport { DChartAxisBaseTickMajor } from \"./d-chart-axis-base-tick-major\";\nimport { DChartAxisBaseTickMinor } from \"./d-chart-axis-base-tick-minor\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { DChartAxisPosition } from \"./d-chart-axis-position\";\nimport { DChartAxisTickContainer } from \"./d-chart-axis-tick-container\";\nimport { DChartAxisTickMajor } from \"./d-chart-axis-tick-major\";\nimport { DChartAxisTickMinor } from \"./d-chart-axis-tick-minor\";\nimport { DChartCoordinate } from \"./d-chart-coordinate\";\nimport { DChartCoordinateTickMajorStepFunction } from \"./d-chart-coordinate-tick-major-step-function\";\nimport { DChartCoordinateTickMinorStepFunction } from \"./d-chart-coordinate-tick-minor-step-function\";\nimport { DChartPlotArea } from \"./d-chart-plot-area\";\nimport { DChartRegion } from \"./d-chart-region\";\nimport { DChartRegionImpl } from \"./d-chart-region-impl\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DChartAxisBaseTickContainerOptions {}\n\nexport class DChartAxisBaseTickContainer<\n\tCHART extends DBase = DBase,\n\tOPTIONS extends DChartAxisBaseTickContainerOptions = DChartAxisBaseTickContainerOptions\n> implements DChartAxisTickContainer<CHART>\n{\n\tprotected _parser: DChartAxisBaseOptionParser;\n\tprotected _container?: DChartAxisContainer<CHART>;\n\tprotected _index: number;\n\tprotected _major: DChartAxisTickMajor<CHART>;\n\tprotected _minor: DChartAxisTickMinor<CHART>;\n\tprotected _majorTicks: number[];\n\tprotected _minorTicks: number[];\n\tprotected _work: DChartRegion;\n\n\tconstructor(parser: DChartAxisBaseOptionParser, options?: OPTIONS) {\n\t\tthis._parser = parser;\n\t\tthis._index = 0;\n\t\tthis._major = this.newMajor(parser, options);\n\t\tthis._minor = this.newMinor(parser, options);\n\t\tthis._majorTicks = [];\n\t\tthis._minorTicks = [];\n\t\tthis._work = new DChartRegionImpl(0, 0);\n\t}\n\n\tget major(): DChartAxisTickMajor<CHART> {\n\t\treturn this._major;\n\t}\n\n\tprotected newMajor(\n\t\tparser: DChartAxisBaseOptionParser,\n\t\toptions?: OPTIONS\n\t): DChartAxisTickMajor<CHART> {\n\t\treturn new DChartAxisBaseTickMajor(parser);\n\t}\n\n\tget minor(): DChartAxisTickMinor<CHART> {\n\t\treturn this._minor;\n\t}\n\n\tprotected newMinor(\n\t\tparser: DChartAxisBaseOptionParser,\n\t\toptions?: OPTIONS\n\t): DChartAxisTickMinor<CHART> {\n\t\treturn new DChartAxisBaseTickMinor(parser);\n\t}\n\n\tbind(container: DChartAxisContainer<CHART>, index: number): void {\n\t\tthis._container = container;\n\t\tthis._index = index;\n\t\tthis._major.bind(container, index);\n\t\tthis._minor.bind(container, index);\n\t}\n\n\tunbind(): void {\n\t\tthis._minor.unbind();\n\t\tthis._major.unbind();\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n\n\tupdate(): boolean {\n\t\tconst container = this._container;\n\t\tconst majorShapes = this._major.shapes;\n\t\tconst minorShapes = this._minor.shapes;\n\t\tif (container != null && majorShapes && minorShapes) {\n\t\t\tconst plotArea = container.plotArea;\n\t\t\tconst transform = plotArea.container.transform.localTransform;\n\t\t\tconst gridlineShapes = this._major.gridline.shapes;\n\n\t\t\tconst parser = this._parser;\n\t\t\tconst offset = parser.padding * this._index;\n\t\t\tlet coordinate: DChartCoordinate<CHART> | null;\n\t\t\tswitch (parser.position) {\n\t\t\t\tcase DChartAxisPosition.TOP:\n\t\t\t\t\tcoordinate = plotArea.coordinate.x.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst domain = this.getDomain(plotArea, coordinate, this._work);\n\t\t\t\t\t\tconst plotAreaHeight = plotArea.height;\n\t\t\t\t\t\treturn this.updateX(\n\t\t\t\t\t\t\tdomain.from,\n\t\t\t\t\t\t\tdomain.to,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\t0 - offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaHeight\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.BOTTOM:\n\t\t\t\t\tcoordinate = plotArea.coordinate.x.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst domain = this.getDomain(plotArea, coordinate, this._work);\n\t\t\t\t\t\tconst plotAreaHeight = plotArea.height;\n\t\t\t\t\t\treturn this.updateX(\n\t\t\t\t\t\t\tdomain.from,\n\t\t\t\t\t\t\tdomain.to,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\tplotAreaHeight + offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaHeight\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.LEFT:\n\t\t\t\t\tcoordinate = plotArea.coordinate.y.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst range = this.getRange(plotArea, coordinate, this._work);\n\t\t\t\t\t\tconst plotAreaWidth = plotArea.width;\n\t\t\t\t\t\treturn this.updateY(\n\t\t\t\t\t\t\trange.from,\n\t\t\t\t\t\t\trange.to,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\t0 - offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaWidth\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.RIGHT:\n\t\t\t\t\tcoordinate = plotArea.coordinate.y.get(parser.coordinate);\n\t\t\t\t\tif (coordinate) {\n\t\t\t\t\t\tconst range = this.getRange(plotArea, coordinate, this._work);\n\t\t\t\t\t\tconst plotAreaWidth = plotArea.width;\n\t\t\t\t\t\treturn this.updateY(\n\t\t\t\t\t\t\trange.from,\n\t\t\t\t\t\t\trange.to,\n\t\t\t\t\t\t\tcoordinate,\n\t\t\t\t\t\t\tmajorShapes,\n\t\t\t\t\t\t\tminorShapes,\n\t\t\t\t\t\t\tgridlineShapes,\n\t\t\t\t\t\t\tplotAreaWidth + offset,\n\t\t\t\t\t\t\ttransform,\n\t\t\t\t\t\t\tplotAreaWidth\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected getDomain(\n\t\tplotArea: DChartPlotArea<CHART>,\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tresult: DChartRegion\n\t): DChartRegion {\n\t\tconst bounds = plotArea.getBoundsInContainer();\n\t\tconst transform = coordinate.transform;\n\t\treturn result.set(\n\t\t\tcoordinate.unmap(transform.unmap(bounds.x)),\n\t\t\tcoordinate.unmap(transform.unmap(bounds.x + bounds.width))\n\t\t);\n\t}\n\n\tprotected getRange(\n\t\tplotArea: DChartPlotArea<CHART>,\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tresult: DChartRegion\n\t): DChartRegion {\n\t\tconst bounds = plotArea.getBoundsInContainer();\n\t\tconst transform = coordinate.transform;\n\t\treturn result.set(\n\t\t\tcoordinate.unmap(transform.unmap(bounds.y)),\n\t\t\tcoordinate.unmap(transform.unmap(bounds.y + bounds.height))\n\t\t);\n\t}\n\n\tprotected updateX(\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tmajorShapes: EShape[],\n\t\tminorShapes: EShape[],\n\t\tgridlineShapes: EShape[],\n\t\tshapePositionY: number,\n\t\ttransform: Matrix,\n\t\tplotAreaHeight: number\n\t): boolean {\n\t\tconst tick = this._parser.tick;\n\t\tconst majorTick = tick.major;\n\t\tconst majorCount = majorTick.count;\n\t\tconst majorCapacity = majorTick.capacity;\n\t\tconst majorStep = majorTick.step;\n\t\tconst majorFormatter = majorTick.formatter;\n\t\tconst minorTick = tick.minor;\n\t\tconst minorCountPerMajor = minorTick.count;\n\t\tconst minorCount = (majorCapacity + 1) * minorCountPerMajor;\n\t\tconst minorStep = minorTick.step;\n\t\tconst minorFormatter = minorTick.formatter;\n\t\tconst majorTicks = this._majorTicks;\n\t\tconst minorTicks = this._minorTicks;\n\t\tthis.newTicks(\n\t\t\tcoordinate,\n\t\t\tdomainMin,\n\t\t\tdomainMax,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorTicks,\n\t\t\tminorTicks\n\t\t);\n\n\t\tconst a = transform.a;\n\t\tconst tx = transform.tx;\n\t\tfor (let i = 0; i < majorCapacity; ++i) {\n\t\t\tconst majorShape = majorShapes[i];\n\t\t\tconst imajorTick = i * 3;\n\t\t\tconst majorTickPosition = majorTicks[imajorTick + 0];\n\t\t\tif (!isNaN(majorTickPosition)) {\n\t\t\t\tconst majorTickProjectedPosition = majorTicks[imajorTick + 1];\n\t\t\t\tconst majotTickPositionX = a * majorTickProjectedPosition + tx;\n\t\t\t\tconst majorTickStep = majorTicks[imajorTick + 2];\n\t\t\t\tthis.showMajor(\n\t\t\t\t\tmajorShape,\n\t\t\t\t\tmajotTickPositionX,\n\t\t\t\t\tshapePositionY,\n\t\t\t\t\tmajorFormatter?.format(majorTickPosition, majorTickStep)\n\t\t\t\t);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.showMajorGridline(\n\t\t\t\t\t\tgridlineShapes[i],\n\t\t\t\t\t\tmajorTickPosition,\n\t\t\t\t\t\tmajotTickPositionX,\n\t\t\t\t\t\tplotAreaHeight * 0.5,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tplotAreaHeight\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hideMajor(majorShape);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.hideMajorGridline(gridlineShapes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < minorCount; ++i) {\n\t\t\tconst minorShape = minorShapes[i];\n\t\t\tconst iminorTick = i * 3;\n\t\t\tconst minorTickPosition = minorTicks[iminorTick + 0];\n\t\t\tif (!isNaN(minorTickPosition)) {\n\t\t\t\tconst minorTickProjectedPosition = minorTicks[iminorTick + 1];\n\t\t\t\tconst minorTickPositionX = a * minorTickProjectedPosition + tx;\n\t\t\t\tconst minorTickStep = minorTicks[iminorTick + 2];\n\t\t\t\tthis.showMinor(\n\t\t\t\t\tminorShape,\n\t\t\t\t\tminorTickPositionX,\n\t\t\t\t\tshapePositionY,\n\t\t\t\t\tminorFormatter?.format(minorTickPosition, minorTickStep)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.hideMinor(minorShape);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected updateY(\n\t\trangeMin: number,\n\t\trangeMax: number,\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tmajorShapes: EShape[],\n\t\tminorShapes: EShape[],\n\t\tgridlineShapes: EShape[],\n\t\tshapePositionX: number,\n\t\ttransform: Matrix,\n\t\tplotAreaWidth: number\n\t): boolean {\n\t\tconst tick = this._parser.tick;\n\t\tconst majorTick = tick.major;\n\t\tconst majorCount = majorTick.count;\n\t\tconst majorCapacity = majorTick.capacity;\n\t\tconst majorStep = majorTick.step;\n\t\tconst majorFormatter = majorTick.formatter;\n\t\tconst minorTick = tick.minor;\n\t\tconst minorCountPerMajor = minorTick.count;\n\t\tconst minorCount = (majorCapacity + 1) * minorCountPerMajor;\n\t\tconst minorStep = minorTick.step;\n\t\tconst minorFormatter = minorTick.formatter;\n\t\tconst majorTicks = this._majorTicks;\n\t\tconst minorTicks = this._minorTicks;\n\t\tthis.newTicks(\n\t\t\tcoordinate,\n\t\t\trangeMin,\n\t\t\trangeMax,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorTicks,\n\t\t\tminorTicks\n\t\t);\n\n\t\tconst d = transform.d;\n\t\tconst ty = transform.ty;\n\t\tfor (let i = 0; i < majorCapacity; ++i) {\n\t\t\tconst majorShape = majorShapes[i];\n\t\t\tconst imajorTick = i * 3;\n\t\t\tconst majorTickPosition = majorTicks[imajorTick + 0];\n\t\t\tif (!isNaN(majorTickPosition)) {\n\t\t\t\tconst majorTickProjectedPosition = majorTicks[imajorTick + 1];\n\t\t\t\tconst majotTickPositionY = d * majorTickProjectedPosition + ty;\n\t\t\t\tconst majorTickStep = majorTicks[imajorTick + 2];\n\t\t\t\tthis.showMajor(\n\t\t\t\t\tmajorShape,\n\t\t\t\t\tshapePositionX,\n\t\t\t\t\tmajotTickPositionY,\n\t\t\t\t\tmajorFormatter?.format(majorTickPosition, majorTickStep)\n\t\t\t\t);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.showMajorGridline(\n\t\t\t\t\t\tgridlineShapes[i],\n\t\t\t\t\t\tmajorTickPosition,\n\t\t\t\t\t\tplotAreaWidth * 0.5,\n\t\t\t\t\t\tmajotTickPositionY,\n\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\t0\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hideMajor(majorShape);\n\t\t\t\tif (i < gridlineShapes.length) {\n\t\t\t\t\tthis.hideMajorGridline(gridlineShapes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < minorCount; ++i) {\n\t\t\tconst minorShape = minorShapes[i];\n\t\t\tconst iminorTick = i * 3;\n\t\t\tconst minorTickPosition = minorTicks[iminorTick + 0];\n\t\t\tif (!isNaN(minorTickPosition)) {\n\t\t\t\tconst minorTickProjectedPosition = minorTicks[iminorTick + 1];\n\t\t\t\tconst minorTickPositionY = d * minorTickProjectedPosition + ty;\n\t\t\t\tconst minorTickStep = minorTicks[iminorTick + 2];\n\t\t\t\tthis.showMinor(\n\t\t\t\t\tminorShape,\n\t\t\t\t\tshapePositionX,\n\t\t\t\t\tminorTickPositionY,\n\t\t\t\t\tminorFormatter?.format(minorTickPosition, minorTickStep)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.hideMinor(minorShape);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected showMajor(shape: EShape, x: number, y: number, text?: string): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tshape.visible = true;\n\t\tshape.transform.position.set(x, y);\n\t\tshape.text.value = text != null ? text : \"\";\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tprotected showMajorGridline(\n\t\tshape: EShape,\n\t\tvalue: number,\n\t\tx: number,\n\t\ty: number,\n\t\tsx: number,\n\t\tsy: number\n\t): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tshape.visible = true;\n\t\tshape.transform.position.set(x, y);\n\t\tshape.size.set(sx, sy);\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tprotected hideMajor(shape: EShape): void {\n\t\tshape.visible = false;\n\t}\n\n\tprotected hideMajorGridline(shape: EShape): void {\n\t\tshape.visible = false;\n\t}\n\n\tprotected showMinor(shape: EShape, x: number, y: number, text?: string): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tshape.visible = true;\n\t\tshape.transform.position.set(x, y);\n\t\tshape.text.value = text != null ? text : \"\";\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tprotected hideMinor(shape: EShape): void {\n\t\tshape.visible = false;\n\t}\n\n\tprotected newTicks(\n\t\tcoordinate: DChartCoordinate<CHART>,\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tmajorCount: number,\n\t\tmajorCapacity: number,\n\t\tmajorStep: number | DChartCoordinateTickMajorStepFunction | undefined,\n\t\tminorCountPerMajor: number,\n\t\tminorCount: number,\n\t\tminorStep: number | DChartCoordinateTickMinorStepFunction | undefined,\n\t\tmajorResult: number[],\n\t\tminorResult: number[]\n\t): void {\n\t\tcoordinate.ticks(\n\t\t\tdomainMin,\n\t\t\tdomainMax,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorResult,\n\t\t\tminorResult\n\t\t);\n\t}\n\n\tdestroy(): void {\n\t\tthis._major.destroy();\n\t\tthis._minor.destroy();\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n}\n"]}
@@ -75,18 +75,27 @@ var DChartCoordinateBase = /** @class */ (function () {
75
75
  var container = this._container;
76
76
  if (container) {
77
77
  var plotArea = container.container.plotArea;
78
- var padding = plotArea.padding;
79
78
  var work = this._work;
80
79
  switch (this._direction) {
81
80
  case DChartCoordinateDirection.X:
82
- this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
81
+ this.getPixelDomain(plotArea, work);
82
+ this.doFit_(work.from, work.to, this.toFitDomain(from, to, plotArea, work), result);
83
83
  break;
84
84
  case DChartCoordinateDirection.Y:
85
- this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
85
+ this.getPixelRange(plotArea, work);
86
+ this.doFit_(work.from, work.to, this.toFitRange(from, to, plotArea, work), result);
86
87
  break;
87
88
  }
88
89
  }
89
90
  };
91
+ DChartCoordinateBase.prototype.getPixelDomain = function (plotArea, result) {
92
+ var padding = plotArea.padding;
93
+ return result.set(padding.getLeft(), plotArea.width - padding.getRight());
94
+ };
95
+ DChartCoordinateBase.prototype.getPixelRange = function (plotArea, result) {
96
+ var padding = plotArea.padding;
97
+ return result.set(plotArea.height - padding.getBottom(), padding.getTop());
98
+ };
90
99
  DChartCoordinateBase.prototype.toFitDomain = function (from, to, plotArea, result) {
91
100
  if (from == null) {
92
101
  from = this._from;
@@ -1 +1 @@
1
- {"version":3,"file":"d-chart-coordinate-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAQ3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAEN,iCAAiC,EACjC,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;IAcC,8BAAY,OAAiC;QAC5C,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,UAAU,GAAG,yBAAyB,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CA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AAC;IACd,CAAC;IAED,qCAAM,GAAN,UAAO,MAAgB,EAAE,KAAa,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QACnF,aAAa;IACd,CAAC;IAED,oCAAK,GAAL,UAAM,KAAa;QAClB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,uCAAQ,GAAR,UAAS,MAAgB,EAAE,KAAa,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QACrF,aAAa;IACd,CAAC;IAED,oCAAK,GAAL,UACC,UAAkB,EAClB,QAAgB,EAChB,UAAkB,EAClB,aAAqB,EACrB,SAAqE,EACrE,kBAA0B,EAC1B,UAAkB,EAClB,SAAqE,EACrE,WAAqB,EACrB,WAAqB;QAErB,IAAI,CAAC,KAAK,CAAC,SAAS,CACnB,UAAU,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,IAAI,CACJ,CAAC;IACH,CAAC;IAES,sCAAO,GAAjB,UAAkB,OAAiC;;QAClD,OAAO,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IACjD,CAAC;IAES,8CAAe,GAAzB;QACC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAES,sCAAO,GAAjB;QACC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IACF,2BAAC;AAAD,CAAC,AA5PD,IA4PC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport {\n\tDChartCoordinate,\n\tDChartCoordinateOptions,\n\tDThemeChartCoordinate\n} from \"./d-chart-coordinate\";\nimport { DChartCoordinateContainerSub } from \"./d-chart-coordinate-container-sub\";\nimport { DChartCoordinateDirection } from \"./d-chart-coordinate-direction\";\nimport { DChartCoordinateTick, DChartCoordinateTickOptions } from \"./d-chart-coordinate-tick\";\nimport { DChartCoordinateTickMajorStepFunction } from \"./d-chart-coordinate-tick-major-step-function\";\nimport { DChartCoordinateTickMinorStepFunction } from \"./d-chart-coordinate-tick-minor-step-function\";\nimport {\n\tDChartCoordinateTransform,\n\tDChartCoordinateTransformOptions\n} from \"./d-chart-coordinate-transform\";\nimport { DChartCoordinateTransformImpl } from \"./d-chart-coordinate-transform-impl\";\nimport {\n\tDChartCoordinateTransformMark,\n\tDChartCoordinateTransformMarkImpl\n} from \"./d-chart-coordinate-transform-mark\";\nimport { DChartPlotArea } from \"./d-chart-plot-area\";\nimport { DChartRegion } from \"./d-chart-region\";\nimport { DChartRegionImpl } from \"./d-chart-region-impl\";\nimport { DThemes } from \"./theme/d-themes\";\nimport { isNaN } from \"./util/is-nan\";\n\nexport abstract class DChartCoordinateBase<CHART extends DBase = DBase>\n\timplements DChartCoordinate<CHART>\n{\n\tprotected _id: number;\n\tprotected _transform: DChartCoordinateTransform<CHART>;\n\tprotected _container?: DChartCoordinateContainerSub<CHART>;\n\tprotected _direction: DChartCoordinateDirection;\n\tprotected _theme: DThemeChartCoordinate;\n\tprotected _work: DChartRegionImpl;\n\tprotected _tick: DChartCoordinateTick<CHART>;\n\tprotected _mark: DChartCoordinateTransformMark;\n\tprotected _from?: number;\n\tprotected _to?: number;\n\n\tconstructor(options?: DChartCoordinateOptions) {\n\t\tthis._id = 0;\n\t\tthis._direction = DChartCoordinateDirection.X;\n\t\tthis._theme = this.toTheme(options);\n\t\tthis._transform = this.newTransform(options?.transform);\n\t\tthis._tick = this.newTick(options?.tick);\n\t\tthis._work = this.newRegion();\n\t\tthis._mark = this.newMark();\n\t\tthis._from = options?.from;\n\t\tthis._to = options?.to;\n\t}\n\n\tprotected newTransform(\n\t\toptions?: DChartCoordinateTransformOptions\n\t): DChartCoordinateTransform<CHART> {\n\t\treturn new DChartCoordinateTransformImpl(options);\n\t}\n\n\tprotected abstract newTick(options?: DChartCoordinateTickOptions): DChartCoordinateTick<CHART>;\n\n\tprotected newRegion(): DChartRegion {\n\t\treturn new DChartRegionImpl(NaN, NaN);\n\t}\n\n\tprotected newMark(): DChartCoordinateTransformMark {\n\t\treturn new DChartCoordinateTransformMarkImpl();\n\t}\n\n\tget from(): number | undefined {\n\t\treturn this._from;\n\t}\n\n\tset from(from: number | undefined) {\n\t\tthis._from = from;\n\t}\n\n\tget to(): number | undefined {\n\t\treturn this._to;\n\t}\n\n\tset to(to: number | undefined) {\n\t\tthis._to = to;\n\t}\n\n\tbind(\n\t\tcontainer: DChartCoordinateContainerSub<CHART>,\n\t\tdirection: DChartCoordinateDirection\n\t): void {\n\t\tthis._container = container;\n\t\tthis._direction = direction;\n\t\tthis._transform.bind(container, direction);\n\t}\n\n\tunbind(): void {\n\t\tthis._container = undefined;\n\t\tthis._transform.unbind();\n\t}\n\n\tfit(from?: number, to?: number): void {\n\t\tthis.doFit(from, to, this._transform);\n\t}\n\n\tmark(from?: number, to?: number): void {\n\t\tconst mark = this._mark;\n\t\tconst transform = this._transform;\n\t\tmark.oldTranslate = transform.translate;\n\t\tmark.oldScale = transform.scale;\n\t\tthis.doFit(from, to, mark);\n\t}\n\n\tblend(ratio: number): void {\n\t\tthis._transform.blend(ratio, this._mark);\n\t}\n\n\tprotected doFit(\n\t\tfrom: number | undefined,\n\t\tto: number | undefined,\n\t\tresult: DChartCoordinateTransformMark | DChartCoordinateTransform<CHART>\n\t): void {\n\t\tconst container = this._container;\n\t\tif (container) {\n\t\t\tconst plotArea = container.container.plotArea;\n\t\t\tconst padding = plotArea.padding;\n\t\t\tconst work = this._work;\n\t\t\tswitch (this._direction) {\n\t\t\t\tcase DChartCoordinateDirection.X:\n\t\t\t\t\tthis.doFit_(\n\t\t\t\t\t\tpadding.getLeft(),\n\t\t\t\t\t\tplotArea.width - padding.getRight(),\n\t\t\t\t\t\tthis.toFitDomain(from, to, plotArea, work),\n\t\t\t\t\t\tresult\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartCoordinateDirection.Y:\n\t\t\t\t\tthis.doFit_(\n\t\t\t\t\t\tplotArea.height - padding.getBottom(),\n\t\t\t\t\t\tpadding.getTop(),\n\t\t\t\t\t\tthis.toFitRange(from, to, plotArea, work),\n\t\t\t\t\t\tresult\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toFitDomain(\n\t\tfrom: number | undefined,\n\t\tto: number | undefined,\n\t\tplotArea: DChartPlotArea<CHART>,\n\t\tresult: DChartRegion\n\t): DChartRegion {\n\t\tif (from == null) {\n\t\t\tfrom = this._from;\n\t\t}\n\t\tif (to == null) {\n\t\t\tto = this._to;\n\t\t}\n\t\tif (from != null && to != null) {\n\t\t\tresult.set(from, to);\n\t\t} else {\n\t\t\tplotArea.series.getDomain(this, result);\n\t\t\tresult.set(from, to);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toFitRange(\n\t\tfrom: number | undefined,\n\t\tto: number | undefined,\n\t\tplotArea: DChartPlotArea<CHART>,\n\t\tresult: DChartRegion\n\t): DChartRegion {\n\t\tif (from == null) {\n\t\t\tfrom = this._from;\n\t\t}\n\t\tif (to == null) {\n\t\t\tto = this._to;\n\t\t}\n\t\tif (from != null && to != null) {\n\t\t\tresult.set(from, to);\n\t\t} else {\n\t\t\tplotArea.series.getRange(this, result);\n\t\t\tresult.set(from, to);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected doFit_(\n\t\tpixelFrom: number,\n\t\tpixelTo: number,\n\t\tregion: DChartRegion,\n\t\tresult: DChartCoordinateTransformMark | DChartCoordinateTransform<CHART>\n\t): void {\n\t\tconst regionFrom = region.from;\n\t\tconst regionTo = region.to;\n\t\tif (!(isNaN(regionFrom) || isNaN(regionTo))) {\n\t\t\t// Scale\n\t\t\tlet newScale = 1;\n\t\t\tconst regionFromMapped = this.map(regionFrom);\n\t\t\tconst regionToMapped = this.map(regionTo);\n\t\t\tconst regionSizeMapped = regionToMapped - regionFromMapped;\n\t\t\tif (!this._theme.isZero(regionSizeMapped)) {\n\t\t\t\tconst pixelSize = pixelTo - pixelFrom;\n\t\t\t\tnewScale = pixelSize / regionSizeMapped;\n\t\t\t} else {\n\t\t\t\tnewScale = pixelTo < pixelFrom ? -1 : 1;\n\t\t\t}\n\n\t\t\t// Translation\n\t\t\tconst newTranslation = pixelFrom - regionFromMapped * newScale;\n\n\t\t\t// Done\n\t\t\tresult.set(newTranslation, newScale);\n\t\t}\n\t}\n\n\tget id(): number {\n\t\treturn this._id;\n\t}\n\n\tget transform(): DChartCoordinateTransform<CHART> {\n\t\treturn this._transform;\n\t}\n\n\tmap(value: number): number {\n\t\treturn value;\n\t}\n\n\tmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void {\n\t\t// DO NOTHING\n\t}\n\n\tunmap(value: number): number {\n\t\treturn value;\n\t}\n\n\tunmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void {\n\t\t// DO NOTHING\n\t}\n\n\tticks(\n\t\tdomainFrom: number,\n\t\tdomainTo: number,\n\t\tmajorCount: number,\n\t\tmajorCapacity: number,\n\t\tmajorStep: number | DChartCoordinateTickMajorStepFunction | undefined,\n\t\tminorCountPerMajor: number,\n\t\tminorCount: number,\n\t\tminorStep: number | DChartCoordinateTickMinorStepFunction | undefined,\n\t\tmajorResult: number[],\n\t\tminorResult: number[]\n\t): void {\n\t\tthis._tick.calculate(\n\t\t\tdomainFrom,\n\t\t\tdomainTo,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorResult,\n\t\t\tminorResult,\n\t\t\tthis\n\t\t);\n\t}\n\n\tprotected toTheme(options?: DChartCoordinateOptions): DThemeChartCoordinate {\n\t\treturn options?.theme ?? this.getThemeDefault();\n\t}\n\n\tprotected getThemeDefault(): DThemeChartCoordinate {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DChartCoordinate\";\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-chart-coordinate-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAQ3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAEN,iCAAiC,EACjC,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;IAcC,8BAAY,OAAiC;QAC5C,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,UAAU,GAAG,yBAAyB,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,C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-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport {\n\tDChartCoordinate,\n\tDChartCoordinateOptions,\n\tDThemeChartCoordinate\n} from \"./d-chart-coordinate\";\nimport { DChartCoordinateContainerSub } from \"./d-chart-coordinate-container-sub\";\nimport { DChartCoordinateDirection } from \"./d-chart-coordinate-direction\";\nimport { DChartCoordinateTick, DChartCoordinateTickOptions } from \"./d-chart-coordinate-tick\";\nimport { DChartCoordinateTickMajorStepFunction } from \"./d-chart-coordinate-tick-major-step-function\";\nimport { DChartCoordinateTickMinorStepFunction } from \"./d-chart-coordinate-tick-minor-step-function\";\nimport {\n\tDChartCoordinateTransform,\n\tDChartCoordinateTransformOptions\n} from \"./d-chart-coordinate-transform\";\nimport { DChartCoordinateTransformImpl } from \"./d-chart-coordinate-transform-impl\";\nimport {\n\tDChartCoordinateTransformMark,\n\tDChartCoordinateTransformMarkImpl\n} from \"./d-chart-coordinate-transform-mark\";\nimport { DChartPlotArea } from \"./d-chart-plot-area\";\nimport { DChartRegion } from \"./d-chart-region\";\nimport { DChartRegionImpl } from \"./d-chart-region-impl\";\nimport { DThemes } from \"./theme/d-themes\";\nimport { isNaN } from \"./util/is-nan\";\n\nexport abstract class DChartCoordinateBase<CHART extends DBase = DBase>\n\timplements DChartCoordinate<CHART>\n{\n\tprotected _id: number;\n\tprotected _transform: DChartCoordinateTransform<CHART>;\n\tprotected _container?: DChartCoordinateContainerSub<CHART>;\n\tprotected _direction: DChartCoordinateDirection;\n\tprotected _theme: DThemeChartCoordinate;\n\tprotected _work: DChartRegionImpl;\n\tprotected _tick: DChartCoordinateTick<CHART>;\n\tprotected _mark: DChartCoordinateTransformMark;\n\tprotected _from?: number;\n\tprotected _to?: number;\n\n\tconstructor(options?: DChartCoordinateOptions) {\n\t\tthis._id = 0;\n\t\tthis._direction = DChartCoordinateDirection.X;\n\t\tthis._theme = this.toTheme(options);\n\t\tthis._transform = this.newTransform(options?.transform);\n\t\tthis._tick = this.newTick(options?.tick);\n\t\tthis._work = this.newRegion();\n\t\tthis._mark = this.newMark();\n\t\tthis._from = options?.from;\n\t\tthis._to = options?.to;\n\t}\n\n\tprotected newTransform(\n\t\toptions?: DChartCoordinateTransformOptions\n\t): DChartCoordinateTransform<CHART> {\n\t\treturn new DChartCoordinateTransformImpl(options);\n\t}\n\n\tprotected abstract newTick(options?: DChartCoordinateTickOptions): DChartCoordinateTick<CHART>;\n\n\tprotected newRegion(): DChartRegion {\n\t\treturn new DChartRegionImpl(NaN, NaN);\n\t}\n\n\tprotected newMark(): DChartCoordinateTransformMark {\n\t\treturn new DChartCoordinateTransformMarkImpl();\n\t}\n\n\tget from(): number | undefined {\n\t\treturn this._from;\n\t}\n\n\tset from(from: number | undefined) {\n\t\tthis._from = from;\n\t}\n\n\tget to(): number | undefined {\n\t\treturn this._to;\n\t}\n\n\tset to(to: number | undefined) {\n\t\tthis._to = to;\n\t}\n\n\tbind(\n\t\tcontainer: DChartCoordinateContainerSub<CHART>,\n\t\tdirection: DChartCoordinateDirection\n\t): void {\n\t\tthis._container = container;\n\t\tthis._direction = direction;\n\t\tthis._transform.bind(container, direction);\n\t}\n\n\tunbind(): void {\n\t\tthis._container = undefined;\n\t\tthis._transform.unbind();\n\t}\n\n\tfit(from?: number, to?: number): void {\n\t\tthis.doFit(from, to, this._transform);\n\t}\n\n\tmark(from?: number, to?: number): void {\n\t\tconst mark = this._mark;\n\t\tconst transform = this._transform;\n\t\tmark.oldTranslate = transform.translate;\n\t\tmark.oldScale = transform.scale;\n\t\tthis.doFit(from, to, mark);\n\t}\n\n\tblend(ratio: number): void {\n\t\tthis._transform.blend(ratio, this._mark);\n\t}\n\n\tprotected doFit(\n\t\tfrom: number | undefined,\n\t\tto: number | undefined,\n\t\tresult: DChartCoordinateTransformMark | DChartCoordinateTransform<CHART>\n\t): void {\n\t\tconst container = this._container;\n\t\tif (container) {\n\t\t\tconst plotArea = container.container.plotArea;\n\t\t\tconst work = this._work;\n\t\t\tswitch (this._direction) {\n\t\t\t\tcase DChartCoordinateDirection.X:\n\t\t\t\t\tthis.getPixelDomain(plotArea, work);\n\t\t\t\t\tthis.doFit_(\n\t\t\t\t\t\twork.from,\n\t\t\t\t\t\twork.to,\n\t\t\t\t\t\tthis.toFitDomain(from, to, plotArea, work),\n\t\t\t\t\t\tresult\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartCoordinateDirection.Y:\n\t\t\t\t\tthis.getPixelRange(plotArea, work);\n\t\t\t\t\tthis.doFit_(\n\t\t\t\t\t\twork.from,\n\t\t\t\t\t\twork.to,\n\t\t\t\t\t\tthis.toFitRange(from, to, plotArea, work),\n\t\t\t\t\t\tresult\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getPixelDomain(plotArea: DChartPlotArea<CHART>, result: DChartRegion): DChartRegion {\n\t\tconst padding = plotArea.padding;\n\t\treturn result.set(padding.getLeft(), plotArea.width - padding.getRight());\n\t}\n\n\tprotected getPixelRange(plotArea: DChartPlotArea<CHART>, result: DChartRegion): DChartRegion {\n\t\tconst padding = plotArea.padding;\n\t\treturn result.set(plotArea.height - padding.getBottom(), padding.getTop());\n\t}\n\n\tprotected toFitDomain(\n\t\tfrom: number | undefined,\n\t\tto: number | undefined,\n\t\tplotArea: DChartPlotArea<CHART>,\n\t\tresult: DChartRegion\n\t): DChartRegion {\n\t\tif (from == null) {\n\t\t\tfrom = this._from;\n\t\t}\n\t\tif (to == null) {\n\t\t\tto = this._to;\n\t\t}\n\t\tif (from != null && to != null) {\n\t\t\tresult.set(from, to);\n\t\t} else {\n\t\t\tplotArea.series.getDomain(this, result);\n\t\t\tresult.set(from, to);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toFitRange(\n\t\tfrom: number | undefined,\n\t\tto: number | undefined,\n\t\tplotArea: DChartPlotArea<CHART>,\n\t\tresult: DChartRegion\n\t): DChartRegion {\n\t\tif (from == null) {\n\t\t\tfrom = this._from;\n\t\t}\n\t\tif (to == null) {\n\t\t\tto = this._to;\n\t\t}\n\t\tif (from != null && to != null) {\n\t\t\tresult.set(from, to);\n\t\t} else {\n\t\t\tplotArea.series.getRange(this, result);\n\t\t\tresult.set(from, to);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected doFit_(\n\t\tpixelFrom: number,\n\t\tpixelTo: number,\n\t\tregion: DChartRegion,\n\t\tresult: DChartCoordinateTransformMark | DChartCoordinateTransform<CHART>\n\t): void {\n\t\tconst regionFrom = region.from;\n\t\tconst regionTo = region.to;\n\t\tif (!(isNaN(regionFrom) || isNaN(regionTo))) {\n\t\t\t// Scale\n\t\t\tlet newScale = 1;\n\t\t\tconst regionFromMapped = this.map(regionFrom);\n\t\t\tconst regionToMapped = this.map(regionTo);\n\t\t\tconst regionSizeMapped = regionToMapped - regionFromMapped;\n\t\t\tif (!this._theme.isZero(regionSizeMapped)) {\n\t\t\t\tconst pixelSize = pixelTo - pixelFrom;\n\t\t\t\tnewScale = pixelSize / regionSizeMapped;\n\t\t\t} else {\n\t\t\t\tnewScale = pixelTo < pixelFrom ? -1 : 1;\n\t\t\t}\n\n\t\t\t// Translation\n\t\t\tconst newTranslation = pixelFrom - regionFromMapped * newScale;\n\n\t\t\t// Done\n\t\t\tresult.set(newTranslation, newScale);\n\t\t}\n\t}\n\n\tget id(): number {\n\t\treturn this._id;\n\t}\n\n\tget transform(): DChartCoordinateTransform<CHART> {\n\t\treturn this._transform;\n\t}\n\n\tmap(value: number): number {\n\t\treturn value;\n\t}\n\n\tmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void {\n\t\t// DO NOTHING\n\t}\n\n\tunmap(value: number): number {\n\t\treturn value;\n\t}\n\n\tunmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void {\n\t\t// DO NOTHING\n\t}\n\n\tticks(\n\t\tdomainFrom: number,\n\t\tdomainTo: number,\n\t\tmajorCount: number,\n\t\tmajorCapacity: number,\n\t\tmajorStep: number | DChartCoordinateTickMajorStepFunction | undefined,\n\t\tminorCountPerMajor: number,\n\t\tminorCount: number,\n\t\tminorStep: number | DChartCoordinateTickMinorStepFunction | undefined,\n\t\tmajorResult: number[],\n\t\tminorResult: number[]\n\t): void {\n\t\tthis._tick.calculate(\n\t\t\tdomainFrom,\n\t\t\tdomainTo,\n\t\t\tmajorCount,\n\t\t\tmajorCapacity,\n\t\t\tmajorStep,\n\t\t\tminorCountPerMajor,\n\t\t\tminorCount,\n\t\t\tminorStep,\n\t\t\tmajorResult,\n\t\t\tminorResult,\n\t\t\tthis\n\t\t);\n\t}\n\n\tprotected toTheme(options?: DChartCoordinateOptions): DThemeChartCoordinate {\n\t\treturn options?.theme ?? this.getThemeDefault();\n\t}\n\n\tprotected getThemeDefault(): DThemeChartCoordinate {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DChartCoordinate\";\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.295.0
2
+ Winter Cardinal UI v0.296.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.295.0
2
+ Winter Cardinal UI v0.296.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.295.0
2
+ Winter Cardinal UI v0.296.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.295.0
2
+ Winter Cardinal UI v0.296.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.295.0
2
+ Winter Cardinal UI v0.296.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -73263,6 +73263,41 @@ var DChartAxisBaseTickMinor = /** @class */ (function () {
73263
73263
  return DChartAxisBaseTickMinor;
73264
73264
  }());
73265
73265
 
73266
+ /*
73267
+ * Copyright (C) 2019 Toshiba Corporation
73268
+ * SPDX-License-Identifier: Apache-2.0
73269
+ */
73270
+ var DChartRegionImpl = /** @class */ (function () {
73271
+ function DChartRegionImpl(from, to) {
73272
+ this.from = from;
73273
+ this.to = to;
73274
+ }
73275
+ DChartRegionImpl.prototype.set = function (from, to) {
73276
+ if (from != null) {
73277
+ this.from = from;
73278
+ }
73279
+ if (to != null) {
73280
+ this.to = to;
73281
+ }
73282
+ return this;
73283
+ };
73284
+ DChartRegionImpl.prototype.add = function (from, to) {
73285
+ if (!isNaN$1(from)) {
73286
+ this.from = isNaN$1(this.from) ? from : Math.min(this.from, from);
73287
+ }
73288
+ if (!isNaN$1(to)) {
73289
+ this.to = isNaN$1(this.to) ? to : Math.max(this.to, to);
73290
+ }
73291
+ return this;
73292
+ };
73293
+ DChartRegionImpl.prototype.clear = function () {
73294
+ this.from = NaN;
73295
+ this.to = NaN;
73296
+ return this;
73297
+ };
73298
+ return DChartRegionImpl;
73299
+ }());
73300
+
73266
73301
  var DChartAxisBaseTickContainer = /** @class */ (function () {
73267
73302
  function DChartAxisBaseTickContainer(parser, options) {
73268
73303
  this._parser = parser;
@@ -73271,6 +73306,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73271
73306
  this._minor = this.newMinor(parser, options);
73272
73307
  this._majorTicks = [];
73273
73308
  this._minorTicks = [];
73309
+ this._work = new DChartRegionImpl(0, 0);
73274
73310
  }
73275
73311
  Object.defineProperty(DChartAxisBaseTickContainer.prototype, "major", {
73276
73312
  get: function () {
@@ -73310,7 +73346,6 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73310
73346
  var minorShapes = this._minor.shapes;
73311
73347
  if (container != null && majorShapes && minorShapes) {
73312
73348
  var plotArea = container.plotArea;
73313
- var bounds = plotArea.getBoundsInContainer();
73314
73349
  var transform = plotArea.container.transform.localTransform;
73315
73350
  var gridlineShapes = this._major.gridline.shapes;
73316
73351
  var parser = this._parser;
@@ -73320,43 +73355,49 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73320
73355
  case DChartAxisPosition.TOP:
73321
73356
  coordinate = plotArea.coordinate.x.get(parser.coordinate);
73322
73357
  if (coordinate) {
73323
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
73324
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
73358
+ var domain = this.getDomain(plotArea, coordinate, this._work);
73325
73359
  var plotAreaHeight = plotArea.height;
73326
- return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaHeight);
73360
+ return this.updateX(domain.from, domain.to, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaHeight);
73327
73361
  }
73328
73362
  break;
73329
73363
  case DChartAxisPosition.BOTTOM:
73330
73364
  coordinate = plotArea.coordinate.x.get(parser.coordinate);
73331
73365
  if (coordinate) {
73332
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
73333
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
73366
+ var domain = this.getDomain(plotArea, coordinate, this._work);
73334
73367
  var plotAreaHeight = plotArea.height;
73335
- return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + offset, transform, plotAreaHeight);
73368
+ return this.updateX(domain.from, domain.to, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + offset, transform, plotAreaHeight);
73336
73369
  }
73337
73370
  break;
73338
73371
  case DChartAxisPosition.LEFT:
73339
73372
  coordinate = plotArea.coordinate.y.get(parser.coordinate);
73340
73373
  if (coordinate) {
73341
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
73342
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
73374
+ var range = this.getRange(plotArea, coordinate, this._work);
73343
73375
  var plotAreaWidth = plotArea.width;
73344
- return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaWidth);
73376
+ return this.updateY(range.from, range.to, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaWidth);
73345
73377
  }
73346
73378
  break;
73347
73379
  case DChartAxisPosition.RIGHT:
73348
73380
  coordinate = plotArea.coordinate.y.get(parser.coordinate);
73349
73381
  if (coordinate) {
73350
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
73351
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
73382
+ var range = this.getRange(plotArea, coordinate, this._work);
73352
73383
  var plotAreaWidth = plotArea.width;
73353
- return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + offset, transform, plotAreaWidth);
73384
+ return this.updateY(range.from, range.to, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + offset, transform, plotAreaWidth);
73354
73385
  }
73355
73386
  break;
73356
73387
  }
73357
73388
  }
73358
73389
  return false;
73359
73390
  };
73391
+ DChartAxisBaseTickContainer.prototype.getDomain = function (plotArea, coordinate, result) {
73392
+ var bounds = plotArea.getBoundsInContainer();
73393
+ var transform = coordinate.transform;
73394
+ return result.set(coordinate.unmap(transform.unmap(bounds.x)), coordinate.unmap(transform.unmap(bounds.x + bounds.width)));
73395
+ };
73396
+ DChartAxisBaseTickContainer.prototype.getRange = function (plotArea, coordinate, result) {
73397
+ var bounds = plotArea.getBoundsInContainer();
73398
+ var transform = coordinate.transform;
73399
+ return result.set(coordinate.unmap(transform.unmap(bounds.y)), coordinate.unmap(transform.unmap(bounds.y + bounds.height)));
73400
+ };
73360
73401
  DChartAxisBaseTickContainer.prototype.updateX = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionY, transform, plotAreaHeight) {
73361
73402
  var tick = this._parser.tick;
73362
73403
  var majorTick = tick.major;
@@ -73410,7 +73451,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73410
73451
  }
73411
73452
  return true;
73412
73453
  };
73413
- DChartAxisBaseTickContainer.prototype.updateY = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionX, transform, plotAreaWidth) {
73454
+ DChartAxisBaseTickContainer.prototype.updateY = function (rangeMin, rangeMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionX, transform, plotAreaWidth) {
73414
73455
  var tick = this._parser.tick;
73415
73456
  var majorTick = tick.major;
73416
73457
  var majorCount = majorTick.count;
@@ -73424,7 +73465,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73424
73465
  var minorFormatter = minorTick.formatter;
73425
73466
  var majorTicks = this._majorTicks;
73426
73467
  var minorTicks = this._minorTicks;
73427
- this.newTicks(coordinate, domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73468
+ this.newTicks(coordinate, rangeMin, rangeMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73428
73469
  var d = transform.d;
73429
73470
  var ty = transform.ty;
73430
73471
  for (var i = 0; i < majorCapacity; ++i) {
@@ -73925,41 +73966,6 @@ var DChartCoordinateTransformMarkImpl = /** @class */ (function () {
73925
73966
  return DChartCoordinateTransformMarkImpl;
73926
73967
  }());
73927
73968
 
73928
- /*
73929
- * Copyright (C) 2019 Toshiba Corporation
73930
- * SPDX-License-Identifier: Apache-2.0
73931
- */
73932
- var DChartRegionImpl = /** @class */ (function () {
73933
- function DChartRegionImpl(from, to) {
73934
- this.from = from;
73935
- this.to = to;
73936
- }
73937
- DChartRegionImpl.prototype.set = function (from, to) {
73938
- if (from != null) {
73939
- this.from = from;
73940
- }
73941
- if (to != null) {
73942
- this.to = to;
73943
- }
73944
- return this;
73945
- };
73946
- DChartRegionImpl.prototype.add = function (from, to) {
73947
- if (!isNaN$1(from)) {
73948
- this.from = isNaN$1(this.from) ? from : Math.min(this.from, from);
73949
- }
73950
- if (!isNaN$1(to)) {
73951
- this.to = isNaN$1(this.to) ? to : Math.max(this.to, to);
73952
- }
73953
- return this;
73954
- };
73955
- DChartRegionImpl.prototype.clear = function () {
73956
- this.from = NaN;
73957
- this.to = NaN;
73958
- return this;
73959
- };
73960
- return DChartRegionImpl;
73961
- }());
73962
-
73963
73969
  /*
73964
73970
  * Copyright (C) 2019 Toshiba Corporation
73965
73971
  * SPDX-License-Identifier: Apache-2.0
@@ -74031,18 +74037,27 @@ var DChartCoordinateBase = /** @class */ (function () {
74031
74037
  var container = this._container;
74032
74038
  if (container) {
74033
74039
  var plotArea = container.container.plotArea;
74034
- var padding = plotArea.padding;
74035
74040
  var work = this._work;
74036
74041
  switch (this._direction) {
74037
74042
  case DChartCoordinateDirection.X:
74038
- this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
74043
+ this.getPixelDomain(plotArea, work);
74044
+ this.doFit_(work.from, work.to, this.toFitDomain(from, to, plotArea, work), result);
74039
74045
  break;
74040
74046
  case DChartCoordinateDirection.Y:
74041
- this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
74047
+ this.getPixelRange(plotArea, work);
74048
+ this.doFit_(work.from, work.to, this.toFitRange(from, to, plotArea, work), result);
74042
74049
  break;
74043
74050
  }
74044
74051
  }
74045
74052
  };
74053
+ DChartCoordinateBase.prototype.getPixelDomain = function (plotArea, result) {
74054
+ var padding = plotArea.padding;
74055
+ return result.set(padding.getLeft(), plotArea.width - padding.getRight());
74056
+ };
74057
+ DChartCoordinateBase.prototype.getPixelRange = function (plotArea, result) {
74058
+ var padding = plotArea.padding;
74059
+ return result.set(plotArea.height - padding.getBottom(), padding.getTop());
74060
+ };
74046
74061
  DChartCoordinateBase.prototype.toFitDomain = function (from, to, plotArea, result) {
74047
74062
  if (from == null) {
74048
74063
  from = this._from;