@wcardinal/wcardinal-ui 0.294.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.
Files changed (26) hide show
  1. package/dist/types/wcardinal/ui/d-chart-axis-base-tick-container.d.ts +6 -1
  2. package/dist/types/wcardinal/ui/d-chart-coordinate-base.d.ts +2 -0
  3. package/dist/types/wcardinal/ui/d-table-data-tree-item-accessor.d.ts +9 -4
  4. package/dist/types/wcardinal/ui/d-table-data-tree-selection-impl.d.ts +2 -1
  5. package/dist/types/wcardinal/ui/d-table-data-tree.d.ts +2 -2
  6. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +22 -15
  7. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
  8. package/dist/wcardinal/ui/d-chart-coordinate-base.js +12 -3
  9. package/dist/wcardinal/ui/d-chart-coordinate-base.js.map +1 -1
  10. package/dist/wcardinal/ui/d-table-data-tree-filter.js +12 -8
  11. package/dist/wcardinal/ui/d-table-data-tree-filter.js.map +1 -1
  12. package/dist/wcardinal/ui/d-table-data-tree-item-accessor.js +13 -3
  13. package/dist/wcardinal/ui/d-table-data-tree-item-accessor.js.map +1 -1
  14. package/dist/wcardinal/ui/d-table-data-tree-selection-impl.js +7 -5
  15. package/dist/wcardinal/ui/d-table-data-tree-selection-impl.js.map +1 -1
  16. package/dist/wcardinal/ui/d-table-data-tree.js +5 -4
  17. package/dist/wcardinal/ui/d-table-data-tree.js.map +1 -1
  18. package/dist/wcardinal-ui-theme-dark.js +1 -1
  19. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  20. package/dist/wcardinal-ui-theme-white.js +1 -1
  21. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  22. package/dist/wcardinal-ui.cjs.js +106 -74
  23. package/dist/wcardinal-ui.js +106 -74
  24. package/dist/wcardinal-ui.min.js +2 -2
  25. package/dist/wcardinal-ui.min.js.map +1 -1
  26. package/package.json +1 -1
@@ -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,9 +1,14 @@
1
+ export declare type DTableDataTreeItemAccessorToParent<NODE> = (node: NODE) => NODE | null | undefined;
2
+ export declare type DTableDataTreeItemAccessorToChildren<NODE> = (node: NODE) => NODE[] | null | undefined;
3
+ export declare type DTableDataTreeItemAccessorHasChildren<NODE> = (node: NODE, children?: NODE[] | null) => children is NODE[];
1
4
  export interface DTableDataTreeItemAccessorOptions<NODE> {
2
- toParent?: (node: NODE) => NODE | null | undefined;
3
- toChildren?: (node: NODE) => NODE[] | null | undefined;
5
+ toParent?: DTableDataTreeItemAccessorToParent<NODE>;
6
+ toChildren?: DTableDataTreeItemAccessorToChildren<NODE>;
7
+ hasChildren?: DTableDataTreeItemAccessorHasChildren<NODE>;
4
8
  }
5
9
  export declare class DTableDataTreeItemAccessor<NODE> {
6
- toParent: (node: NODE) => NODE | null | undefined;
7
- toChildren: (node: NODE) => NODE[] | null | undefined;
10
+ toParent: DTableDataTreeItemAccessorToParent<NODE>;
11
+ toChildren: DTableDataTreeItemAccessorToChildren<NODE>;
12
+ hasChildren: DTableDataTreeItemAccessorHasChildren<NODE>;
8
13
  constructor(options?: DTableDataTreeItemAccessorOptions<NODE>);
9
14
  }
@@ -1,6 +1,7 @@
1
1
  import { utils } from "pixi.js";
2
2
  import { DTableData } from "./d-table-data";
3
3
  import { DTableDataSelectionEachIteratee, DTableDataSelectionOptions, DTableDataSelectionType } from "./d-table-data-selection";
4
+ import { DTableDataTreeItemAccessorHasChildren, DTableDataTreeItemAccessorToChildren } from "./d-table-data-tree-item-accessor";
4
5
  import { DTableDataTreeSelection, DTableDataTreeSelectionParent } from "./d-table-data-tree-selection";
5
6
  export declare class DTableDataTreeSelectionImpl<NODE> extends utils.EventEmitter implements DTableDataTreeSelection<NODE> {
6
7
  protected _parent: DTableDataTreeSelectionParent<NODE>;
@@ -9,7 +10,7 @@ export declare class DTableDataTreeSelectionImpl<NODE> extends utils.EventEmitte
9
10
  constructor(parent: DTableDataTreeSelectionParent<NODE>, options?: DTableDataSelectionOptions);
10
11
  get parent(): DTableData<NODE>;
11
12
  onNodeChange(nodes?: NODE[]): void;
12
- protected newRows(nodes: NODE[], toChildren: (node: NODE) => NODE[] | null | undefined, rows: Set<NODE>, result: Set<NODE>): Set<NODE>;
13
+ protected newRows(nodes: NODE[], toChildren: DTableDataTreeItemAccessorToChildren<NODE>, hasChildren: DTableDataTreeItemAccessorHasChildren<NODE>, rows: Set<NODE>, result: Set<NODE>): Set<NODE>;
13
14
  get indices(): number[];
14
15
  get rows(): NODE[];
15
16
  get type(): DTableDataSelectionType;
@@ -6,7 +6,7 @@ import { DTableDataSelection } from "./d-table-data-selection";
6
6
  import { DTableDataComparator, DTableDataSorter } from "./d-table-data-sorter";
7
7
  import { DTableDataTreeSorter } from "./d-table-data-tree-sorter";
8
8
  import { DTableDataTreeNode } from "./d-table-data-tree-item";
9
- import { DTableDataTreeItemAccessor, DTableDataTreeItemAccessorOptions } from "./d-table-data-tree-item-accessor";
9
+ import { DTableDataTreeItemAccessor, DTableDataTreeItemAccessorHasChildren, DTableDataTreeItemAccessorOptions, DTableDataTreeItemAccessorToChildren } from "./d-table-data-tree-item-accessor";
10
10
  import { DTableDataTreeSelection, DTableDataTreeSelectionCreator, DTableDataTreeSelectionOptions } from "./d-table-data-tree-selection";
11
11
  import { DBaseEvents } from "./d-base";
12
12
  import { DOnOptions } from "./d-on-options";
@@ -88,7 +88,7 @@ export declare class DTableDataTree<NODE extends DTableDataTreeNode<NODE, NODE>>
88
88
  get accessor(): DTableDataTreeItemAccessor<NODE>;
89
89
  protected updateRows(nodes: NODE[] | undefined): void;
90
90
  protected toSupplimental(ilevel: number, hasChildren: boolean, isOpened: boolean): number;
91
- protected newRows(nodes: NODE[], irows: number, ilevel: number, rows: NODE[], supplimentals: number[], flags: WeakMap<NODE, number>, reverse: boolean, toChildren: (node: NODE) => NODE[] | null | undefined): number;
91
+ protected newRows(nodes: NODE[], irows: number, ilevel: number, rows: NODE[], supplimentals: number[], flags: WeakMap<NODE, number>, reverse: boolean, toChildren: DTableDataTreeItemAccessorToChildren<NODE>, hasChildren: DTableDataTreeItemAccessorHasChildren<NODE>): number;
92
92
  update(forcibly?: boolean): void;
93
93
  size(): number;
94
94
  get(index: number): NODE | null;
@@ -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,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;QACtB,IAAI,CAAC,MAAM,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,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,EAAE,CAAC;QACtB,IAAI,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,uBAA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Aa;QAChB,OAAO,KAAK,CAAC;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,aAA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 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 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"]}
@@ -48,43 +48,47 @@ var DTableDataTreeFilter = /** @class */ (function (_super) {
48
48
  }
49
49
  };
50
50
  DTableDataTreeFilter.prototype.hasFiltered = function (parent, nodes, filter) {
51
- var toChildren = this._parent.accessor.toChildren;
51
+ var accessor = this._parent.accessor;
52
+ var toChildren = accessor.toChildren;
53
+ var hasChildren = accessor.hasChildren;
52
54
  for (var i = 0, imax = nodes.length; i < imax; ++i) {
53
55
  var node = nodes[i];
54
56
  if (this.isFiltered(node, -1, filter)) {
55
57
  return true;
56
58
  }
57
59
  var children = toChildren(node);
58
- if (children != null &&
59
- 0 < children.length &&
60
- this.hasFiltered(parent, children, filter)) {
60
+ if (hasChildren(node, children) && this.hasFiltered(parent, children, filter)) {
61
61
  return true;
62
62
  }
63
63
  }
64
64
  return false;
65
65
  };
66
66
  DTableDataTreeFilter.prototype.addAllToFiltered = function (parent, nodes, filtered, cursor) {
67
- var toChildren = this._parent.accessor.toChildren;
67
+ var accessor = this._parent.accessor;
68
+ var toChildren = accessor.toChildren;
69
+ var hasChildren = accessor.hasChildren;
68
70
  for (var i = 0, imax = nodes.length; i < imax; ++i) {
69
71
  var node = nodes[i];
70
72
  filtered.push(cursor[0]);
71
73
  cursor[0] += 1;
72
74
  var children = toChildren(node);
73
- if (children != null && 0 < children.length && parent.isOpened(node)) {
75
+ if (hasChildren(node, children) && parent.isOpened(node)) {
74
76
  this.addAllToFiltered(parent, children, filtered, cursor);
75
77
  }
76
78
  }
77
79
  };
78
80
  DTableDataTreeFilter.prototype.newFilteredSub = function (parent, nodes, filter, filtered, cursor) {
79
81
  var result = false;
80
- var toChildren = this._parent.accessor.toChildren;
82
+ var accessor = this._parent.accessor;
83
+ var toChildren = accessor.toChildren;
84
+ var hasChildren = accessor.hasChildren;
81
85
  for (var i = 0, imax = nodes.length; i < imax; ++i) {
82
86
  var node = nodes[i];
83
87
  var index = cursor[0];
84
88
  cursor[0] += 1;
85
89
  var isFiltered = this.isFiltered(node, index, filter);
86
90
  var children = toChildren(node);
87
- if (children != null && 0 < children.length) {
91
+ if (hasChildren(node, children)) {
88
92
  if (parent.isOpened(node)) {
89
93
  if (isFiltered) {
90
94
  filtered.push(index);
@@ -1 +1 @@
1
- {"version":3,"file":"d-table-data-tree-filter.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-data-tree-filter.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAShD;IACS,wCAAkB;IAU1B,8BAAY,MAAwC;QAApD,YACC,iBAAO,SASP;QAPA,KAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,KAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACrB,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,KAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,KAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,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CAAC;gBACtB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;aAC1B;SACD;IACF,CAAC;IAED,sBAAI,yCAAO;aAAX;YACC,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,OAAO,IAAI,CAAC,SAAS,CAAC;QACvB,CAAC;;;OAAA;IAED,kCAAG,GAAH,UAAI,WAAmB;QACtB,IAAI,MAAM,GAAG,WAAW,CAAC;QAEzB,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,OAAO,EAAE;YACZ,IAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACtC,IAAI,CAAC,IAAI,KAAK,EAAE;gBACf,MAAM,GAAG,KAAK,CAAC;aACf;iBAAM;gBACN,OAAO,IAAI,CAAC;aACZ;SACD;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAED,oCAAK,GAAL,UAAM,KAAa;QAClB,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,OAAO,EAAE;YACZ,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;SACzB;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IACF,2BAAC;AAAD,CAAC,AA/MD,CACS,KAAK,CAAC,YAAY,GA8M1B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DTableDataFilter, DTableDataFilterer } from \"./d-table-data-filter\";\nimport { DTableDataTreeNode } from \"./d-table-data-tree-item\";\nimport { DTableDataTreeItemAccessor } from \"./d-table-data-tree-item-accessor\";\nimport { isFunction } from \"./util/is-function\";\n\nexport interface DTableDataTreeFilterParent<NODE> {\n\treadonly nodes: NODE[] | undefined;\n\treadonly accessor: DTableDataTreeItemAccessor<NODE>;\n\tisOpened(node: NODE): boolean;\n\tupdate(): void;\n}\n\nexport class DTableDataTreeFilter<NODE extends DTableDataTreeNode<NODE, NODE>>\n\textends utils.EventEmitter\n\timplements DTableDataFilter<NODE>\n{\n\tprotected _id: number;\n\tprotected _idUpdated: number;\n\tprotected _isApplied: boolean;\n\tprotected _parent: DTableDataTreeFilterParent<NODE>;\n\tprotected _filter: DTableDataFilterer<NODE> | null;\n\tprotected _filtered: number[] | null;\n\n\tconstructor(parent: DTableDataTreeFilterParent<NODE>) {\n\t\tsuper();\n\n\t\tthis._id = 0;\n\t\tthis._idUpdated = -1;\n\t\tthis._isApplied = false;\n\n\t\tthis._parent = parent;\n\t\tthis._filter = null;\n\t\tthis._filtered = null;\n\t}\n\n\tget id(): number {\n\t\treturn this._id;\n\t}\n\n\tapply(): void {\n\t\tthis._isApplied = true;\n\t\tthis._id += 1;\n\t\tthis._parent.update();\n\t}\n\n\tunapply(): void {\n\t\tif (this._isApplied) {\n\t\t\tthis._isApplied = false;\n\t\t\tthis._id += 1;\n\t\t\tthis._parent.update();\n\t\t}\n\t}\n\n\tisApplied(): boolean {\n\t\treturn this._isApplied;\n\t}\n\n\tprotected isFiltered(node: NODE, index: number, filter: DTableDataFilterer<NODE>): boolean {\n\t\tif (isFunction(filter)) {\n\t\t\treturn filter(node, index);\n\t\t} else {\n\t\t\treturn filter.test(node, index);\n\t\t}\n\t}\n\n\tprotected hasFiltered(\n\t\tparent: DTableDataTreeFilterParent<NODE>,\n\t\tnodes: NODE[],\n\t\tfilter: DTableDataFilterer<NODE>\n\t): boolean {\n\t\tconst toChildren = this._parent.accessor.toChildren;\n\t\tfor (let i = 0, imax = nodes.length; i < imax; ++i) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (this.isFiltered(node, -1, filter)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst children = toChildren(node);\n\t\t\tif (\n\t\t\t\tchildren != null &&\n\t\t\t\t0 < children.length &&\n\t\t\t\tthis.hasFiltered(parent, children, filter)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected addAllToFiltered(\n\t\tparent: DTableDataTreeFilterParent<NODE>,\n\t\tnodes: NODE[],\n\t\tfiltered: number[],\n\t\tcursor: [number]\n\t): void {\n\t\tconst toChildren = this._parent.accessor.toChildren;\n\t\tfor (let i = 0, imax = nodes.length; i < imax; ++i) {\n\t\t\tconst node = nodes[i];\n\t\t\tfiltered.push(cursor[0]);\n\t\t\tcursor[0] += 1;\n\t\t\tconst children = toChildren(node);\n\t\t\tif (children != null && 0 < children.length && parent.isOpened(node)) {\n\t\t\t\tthis.addAllToFiltered(parent, children, filtered, cursor);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected newFilteredSub(\n\t\tparent: DTableDataTreeFilterParent<NODE>,\n\t\tnodes: NODE[],\n\t\tfilter: DTableDataFilterer<NODE>,\n\t\tfiltered: number[],\n\t\tcursor: [number]\n\t): boolean {\n\t\tlet result = false;\n\t\tconst toChildren = this._parent.accessor.toChildren;\n\t\tfor (let i = 0, imax = nodes.length; i < imax; ++i) {\n\t\t\tconst node = nodes[i];\n\t\t\tconst index = cursor[0];\n\t\t\tcursor[0] += 1;\n\t\t\tconst isFiltered = this.isFiltered(node, index, filter);\n\t\t\tconst children = toChildren(node);\n\t\t\tif (children != null && 0 < children.length) {\n\t\t\t\tif (parent.isOpened(node)) {\n\t\t\t\t\tif (isFiltered) {\n\t\t\t\t\t\tfiltered.push(index);\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t\tthis.addAllToFiltered(parent, children, filtered, cursor);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst position = filtered.length;\n\t\t\t\t\t\tif (this.newFilteredSub(parent, children, filter, filtered, cursor)) {\n\t\t\t\t\t\t\tfiltered.splice(position, 0, index);\n\t\t\t\t\t\t\tresult = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (isFiltered || this.hasFiltered(parent, children, filter)) {\n\t\t\t\t\tfiltered.push(index);\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t} else if (isFiltered) {\n\t\t\t\tfiltered.push(index);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newFiltered(): number[] | null {\n\t\tconst filter = this._filter;\n\t\tif (filter != null) {\n\t\t\tconst filtered: number[] = [];\n\t\t\tconst parent = this._parent;\n\t\t\tconst nodes = parent.nodes;\n\t\t\tif (nodes) {\n\t\t\t\tconst cursor: [number] = [0];\n\t\t\t\tthis.newFilteredSub(parent, nodes, filter, filtered, cursor);\n\t\t\t}\n\t\t\treturn filtered;\n\t\t}\n\t\treturn null;\n\t}\n\n\tget(): DTableDataFilterer<NODE> | null {\n\t\treturn this._filter;\n\t}\n\n\tset(filter: DTableDataFilterer<NODE> | null): void {\n\t\tif (this._filter !== filter) {\n\t\t\tthis._filter = filter;\n\t\t}\n\t}\n\n\ttoDirty(): void {\n\t\tthis._id += 1;\n\t}\n\n\tupdate(): void {\n\t\tif (this._id !== this._idUpdated) {\n\t\t\tthis._idUpdated = this._id;\n\t\t\tif (this._isApplied) {\n\t\t\t\tthis._filtered = this.newFiltered();\n\t\t\t\tthis.emit(\"change\", this);\n\t\t\t} else if (this._filtered != null) {\n\t\t\t\tthis._filtered = null;\n\t\t\t\tthis.emit(\"change\", this);\n\t\t\t}\n\t\t}\n\t}\n\n\tget indices(): number[] | null {\n\t\tthis.update();\n\t\treturn this._filtered;\n\t}\n\n\tmap(sortedIndex: number): number | null {\n\t\tlet result = sortedIndex;\n\n\t\tconst indices = this.indices;\n\t\tif (indices) {\n\t\t\tconst index = indices.indexOf(result);\n\t\t\tif (0 <= index) {\n\t\t\t\tresult = index;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tunmap(index: number): number {\n\t\tlet result = index;\n\n\t\tconst indices = this.indices;\n\t\tif (indices) {\n\t\t\tresult = indices[result];\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-table-data-tree-filter.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-data-tree-filter.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAShD;IACS,wCAAkB;IAU1B,8BAAY,MAAwC;QAApD,YACC,iBAAO,SASP;QAPA,KAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,KAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACrB,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,KAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,KAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,KAAI,CAAC,SAAS,GAAG,IAAI,CAAC;;IACvB,CAAC;IAED,sBAAI,oCAAE;aAAN;YACC,OAAO,IAAI,CAAC,GAAG,CAAC;QACjB,CAAC;;;OAAA;IAED,oCAAK,GAAL;QACC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAED,sCAAO,GAAP;QACC,IAAI,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YACxB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YACd,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;SACtB;IACF,CAAC;IAED,wCAAS,GAAT;QACC,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAES,yCAAU,GAApB,UAAqB,IAAU,EAAE,KAAa,EAAE,MAAgC;QAC/E,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;YACvB,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,C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gBACN,OAAO,IAAI,CAAC;aACZ;SACD;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAED,oCAAK,GAAL,UAAM,KAAa;QAClB,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,OAAO,EAAE;YACZ,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;SACzB;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IACF,2BAAC;AAAD,CAAC,AAjND,CACS,KAAK,CAAC,YAAY,GAgN1B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DTableDataFilter, DTableDataFilterer } from \"./d-table-data-filter\";\nimport { DTableDataTreeNode } from \"./d-table-data-tree-item\";\nimport { DTableDataTreeItemAccessor } from \"./d-table-data-tree-item-accessor\";\nimport { isFunction } from \"./util/is-function\";\n\nexport interface DTableDataTreeFilterParent<NODE> {\n\treadonly nodes: NODE[] | undefined;\n\treadonly accessor: DTableDataTreeItemAccessor<NODE>;\n\tisOpened(node: NODE): boolean;\n\tupdate(): void;\n}\n\nexport class DTableDataTreeFilter<NODE extends DTableDataTreeNode<NODE, NODE>>\n\textends utils.EventEmitter\n\timplements DTableDataFilter<NODE>\n{\n\tprotected _id: number;\n\tprotected _idUpdated: number;\n\tprotected _isApplied: boolean;\n\tprotected _parent: DTableDataTreeFilterParent<NODE>;\n\tprotected _filter: DTableDataFilterer<NODE> | null;\n\tprotected _filtered: number[] | null;\n\n\tconstructor(parent: DTableDataTreeFilterParent<NODE>) {\n\t\tsuper();\n\n\t\tthis._id = 0;\n\t\tthis._idUpdated = -1;\n\t\tthis._isApplied = false;\n\n\t\tthis._parent = parent;\n\t\tthis._filter = null;\n\t\tthis._filtered = null;\n\t}\n\n\tget id(): number {\n\t\treturn this._id;\n\t}\n\n\tapply(): void {\n\t\tthis._isApplied = true;\n\t\tthis._id += 1;\n\t\tthis._parent.update();\n\t}\n\n\tunapply(): void {\n\t\tif (this._isApplied) {\n\t\t\tthis._isApplied = false;\n\t\t\tthis._id += 1;\n\t\t\tthis._parent.update();\n\t\t}\n\t}\n\n\tisApplied(): boolean {\n\t\treturn this._isApplied;\n\t}\n\n\tprotected isFiltered(node: NODE, index: number, filter: DTableDataFilterer<NODE>): boolean {\n\t\tif (isFunction(filter)) {\n\t\t\treturn filter(node, index);\n\t\t} else {\n\t\t\treturn filter.test(node, index);\n\t\t}\n\t}\n\n\tprotected hasFiltered(\n\t\tparent: DTableDataTreeFilterParent<NODE>,\n\t\tnodes: NODE[],\n\t\tfilter: DTableDataFilterer<NODE>\n\t): boolean {\n\t\tconst accessor = this._parent.accessor;\n\t\tconst toChildren = accessor.toChildren;\n\t\tconst hasChildren = accessor.hasChildren;\n\t\tfor (let i = 0, imax = nodes.length; i < imax; ++i) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (this.isFiltered(node, -1, filter)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst children = toChildren(node);\n\t\t\tif (hasChildren(node, children) && this.hasFiltered(parent, children, filter)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected addAllToFiltered(\n\t\tparent: DTableDataTreeFilterParent<NODE>,\n\t\tnodes: NODE[],\n\t\tfiltered: number[],\n\t\tcursor: [number]\n\t): void {\n\t\tconst accessor = this._parent.accessor;\n\t\tconst toChildren = accessor.toChildren;\n\t\tconst hasChildren = accessor.hasChildren;\n\t\tfor (let i = 0, imax = nodes.length; i < imax; ++i) {\n\t\t\tconst node = nodes[i];\n\t\t\tfiltered.push(cursor[0]);\n\t\t\tcursor[0] += 1;\n\t\t\tconst children = toChildren(node);\n\t\t\tif (hasChildren(node, children) && parent.isOpened(node)) {\n\t\t\t\tthis.addAllToFiltered(parent, children, filtered, cursor);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected newFilteredSub(\n\t\tparent: DTableDataTreeFilterParent<NODE>,\n\t\tnodes: NODE[],\n\t\tfilter: DTableDataFilterer<NODE>,\n\t\tfiltered: number[],\n\t\tcursor: [number]\n\t): boolean {\n\t\tlet result = false;\n\t\tconst accessor = this._parent.accessor;\n\t\tconst toChildren = accessor.toChildren;\n\t\tconst hasChildren = accessor.hasChildren;\n\t\tfor (let i = 0, imax = nodes.length; i < imax; ++i) {\n\t\t\tconst node = nodes[i];\n\t\t\tconst index = cursor[0];\n\t\t\tcursor[0] += 1;\n\t\t\tconst isFiltered = this.isFiltered(node, index, filter);\n\t\t\tconst children = toChildren(node);\n\t\t\tif (hasChildren(node, children)) {\n\t\t\t\tif (parent.isOpened(node)) {\n\t\t\t\t\tif (isFiltered) {\n\t\t\t\t\t\tfiltered.push(index);\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t\tthis.addAllToFiltered(parent, children, filtered, cursor);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst position = filtered.length;\n\t\t\t\t\t\tif (this.newFilteredSub(parent, children, filter, filtered, cursor)) {\n\t\t\t\t\t\t\tfiltered.splice(position, 0, index);\n\t\t\t\t\t\t\tresult = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (isFiltered || this.hasFiltered(parent, children, filter)) {\n\t\t\t\t\tfiltered.push(index);\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t} else if (isFiltered) {\n\t\t\t\tfiltered.push(index);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newFiltered(): number[] | null {\n\t\tconst filter = this._filter;\n\t\tif (filter != null) {\n\t\t\tconst filtered: number[] = [];\n\t\t\tconst parent = this._parent;\n\t\t\tconst nodes = parent.nodes;\n\t\t\tif (nodes) {\n\t\t\t\tconst cursor: [number] = [0];\n\t\t\t\tthis.newFilteredSub(parent, nodes, filter, filtered, cursor);\n\t\t\t}\n\t\t\treturn filtered;\n\t\t}\n\t\treturn null;\n\t}\n\n\tget(): DTableDataFilterer<NODE> | null {\n\t\treturn this._filter;\n\t}\n\n\tset(filter: DTableDataFilterer<NODE> | null): void {\n\t\tif (this._filter !== filter) {\n\t\t\tthis._filter = filter;\n\t\t}\n\t}\n\n\ttoDirty(): void {\n\t\tthis._id += 1;\n\t}\n\n\tupdate(): void {\n\t\tif (this._id !== this._idUpdated) {\n\t\t\tthis._idUpdated = this._id;\n\t\t\tif (this._isApplied) {\n\t\t\t\tthis._filtered = this.newFiltered();\n\t\t\t\tthis.emit(\"change\", this);\n\t\t\t} else if (this._filtered != null) {\n\t\t\t\tthis._filtered = null;\n\t\t\t\tthis.emit(\"change\", this);\n\t\t\t}\n\t\t}\n\t}\n\n\tget indices(): number[] | null {\n\t\tthis.update();\n\t\treturn this._filtered;\n\t}\n\n\tmap(sortedIndex: number): number | null {\n\t\tlet result = sortedIndex;\n\n\t\tconst indices = this.indices;\n\t\tif (indices) {\n\t\t\tconst index = indices.indexOf(result);\n\t\t\tif (0 <= index) {\n\t\t\t\tresult = index;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tunmap(index: number): number {\n\t\tlet result = index;\n\n\t\tconst indices = this.indices;\n\t\tif (indices) {\n\t\t\tresult = indices[result];\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"]}
@@ -8,11 +8,21 @@ var toParent = function (node) {
8
8
  var toChildren = function (node) {
9
9
  return node.children;
10
10
  };
11
+ var hasChildren = function (node, children) {
12
+ return children != null && 0 < children.length;
13
+ };
11
14
  var DTableDataTreeItemAccessor = /** @class */ (function () {
12
15
  function DTableDataTreeItemAccessor(options) {
13
- var _a, _b;
14
- this.toParent = (_a = options === null || options === void 0 ? void 0 : options.toParent) !== null && _a !== void 0 ? _a : toParent;
15
- this.toChildren = (_b = options === null || options === void 0 ? void 0 : options.toChildren) !== null && _b !== void 0 ? _b : toChildren;
16
+ if (options != null) {
17
+ this.toParent = options.toParent || toParent;
18
+ this.toChildren = options.toChildren || toChildren;
19
+ this.hasChildren = options.hasChildren || hasChildren;
20
+ }
21
+ else {
22
+ this.toParent = toParent;
23
+ this.toChildren = toChildren;
24
+ this.hasChildren = hasChildren;
25
+ }
16
26
  }
17
27
  return DTableDataTreeItemAccessor;
18
28
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"d-table-data-tree-item-accessor.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-data-tree-item-accessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,IAAM,QAAQ,GAAG,UAAO,IAAS;IAChC,OAAO,IAAI,CAAC,MAAM,CAAC;AACpB,CAAC,CAAC;AAEF,IAAM,UAAU,GAAG,UAAO,IAAS;IAClC,OAAO,IAAI,CAAC,QAAQ,CAAC;AACtB,CAAC,CAAC;AAEF;IAIC,oCAAY,OAAiD;;QAC5D,IAAI,CAAC,QAAQ,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,QAAQ,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,mCAAI,UAAU,CAAC;IACrD,CAAC;IACF,iCAAC;AAAD,CAAC,AARD,IAQC","sourcesContent":["/*\n * Copyright (C) 2021 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface DTableDataTreeItemAccessorOptions<NODE> {\n\ttoParent?: (node: NODE) => NODE | null | undefined;\n\ttoChildren?: (node: NODE) => NODE[] | null | undefined;\n}\n\nconst toParent = <NODE>(node: any): NODE | null | undefined => {\n\treturn node.parent;\n};\n\nconst toChildren = <NODE>(node: any): NODE | null | undefined => {\n\treturn node.children;\n};\n\nexport class DTableDataTreeItemAccessor<NODE> {\n\ttoParent: (node: NODE) => NODE | null | undefined;\n\ttoChildren: (node: NODE) => NODE[] | null | undefined;\n\n\tconstructor(options?: DTableDataTreeItemAccessorOptions<NODE>) {\n\t\tthis.toParent = options?.toParent ?? toParent;\n\t\tthis.toChildren = options?.toChildren ?? toChildren;\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-table-data-tree-item-accessor.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-data-tree-item-accessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,IAAM,QAAQ,GAAG,UAAO,IAAS;IAChC,OAAO,IAAI,CAAC,MAAM,CAAC;AACpB,CAAC,CAAC;AAEF,IAAM,UAAU,GAAG,UAAO,IAAS;IAClC,OAAO,IAAI,CAAC,QAAQ,CAAC;AACtB,CAAC,CAAC;AAEF,IAAM,WAAW,GAAG,UAAO,IAAS,EAAE,QAAmC;IACxE,OAAO,QAAQ,IAAI,IAAI,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC;AAChD,CAAC,CAAC;AAEF;IAKC,oCAAY,OAAiD;QAC5D,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;YAC7C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,UAAU,CAAC;YACnD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,WAAW,CAAC;SACtD;aAAM;YACN,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;SAC/B;IACF,CAAC;IACF,iCAAC;AAAD,CAAC,AAhBD,IAgBC","sourcesContent":["/*\n * Copyright (C) 2021 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type DTableDataTreeItemAccessorToParent<NODE> = (node: NODE) => NODE | null | undefined;\n\nexport type DTableDataTreeItemAccessorToChildren<NODE> = (node: NODE) => NODE[] | null | undefined;\n\nexport type DTableDataTreeItemAccessorHasChildren<NODE> = (\n\tnode: NODE,\n\tchildren?: NODE[] | null\n) => children is NODE[];\n\nexport interface DTableDataTreeItemAccessorOptions<NODE> {\n\ttoParent?: DTableDataTreeItemAccessorToParent<NODE>;\n\ttoChildren?: DTableDataTreeItemAccessorToChildren<NODE>;\n\thasChildren?: DTableDataTreeItemAccessorHasChildren<NODE>;\n}\n\nconst toParent = <NODE>(node: any): NODE | null | undefined => {\n\treturn node.parent;\n};\n\nconst toChildren = <NODE>(node: any): NODE | null | undefined => {\n\treturn node.children;\n};\n\nconst hasChildren = <NODE>(node: any, children: NODE[] | null | undefined): children is NODE[] => {\n\treturn children != null && 0 < children.length;\n};\n\nexport class DTableDataTreeItemAccessor<NODE> {\n\ttoParent: DTableDataTreeItemAccessorToParent<NODE>;\n\ttoChildren: DTableDataTreeItemAccessorToChildren<NODE>;\n\thasChildren: DTableDataTreeItemAccessorHasChildren<NODE>;\n\n\tconstructor(options?: DTableDataTreeItemAccessorOptions<NODE>) {\n\t\tif (options != null) {\n\t\t\tthis.toParent = options.toParent || toParent;\n\t\t\tthis.toChildren = options.toChildren || toChildren;\n\t\t\tthis.hasChildren = options.hasChildren || hasChildren;\n\t\t} else {\n\t\t\tthis.toParent = toParent;\n\t\t\tthis.toChildren = toChildren;\n\t\t\tthis.hasChildren = hasChildren;\n\t\t}\n\t}\n}\n"]}