@wcardinal/wcardinal-ui 0.290.0 → 0.292.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/wcardinal/ui/d-chart-axis-bar.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +69 -37
- package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +54 -20
- package/dist/types/wcardinal/ui/d-chart-axis-base-tick-container.d.ts +17 -6
- package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +10 -8
- package/dist/types/wcardinal/ui/d-chart-axis-tick-container.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-axis-tick-major.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-chart-axis-tick-minor.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-chart-axis-x-datetime.d.ts +3 -2
- package/dist/types/wcardinal/ui/d-chart-axis-x.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-chart-axis-y.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-chart-coordinate-base.d.ts +52 -0
- package/dist/types/wcardinal/ui/d-chart-coordinate-linear.d.ts +4 -46
- package/dist/types/wcardinal/ui/d-chart-coordinate-log.d.ts +4 -42
- package/dist/types/wcardinal/ui/d-table-body.d.ts +7 -0
- package/dist/types/wcardinal/ui/index.d.ts +11 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.d.ts +7 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.d.ts +7 -0
- package/dist/wcardinal/ui/d-chart-axis-bar.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +152 -34
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +64 -43
- package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js +21 -4
- package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-tick-container.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-tick-major.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-tick-minor.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-x-datetime.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-x.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-y.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-base.js +186 -0
- package/dist/wcardinal/ui/d-chart-coordinate-base.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js +2 -1
- package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-linear.js +9 -165
- package/dist/wcardinal/ui/d-chart-coordinate-linear.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js +2 -1
- package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-log.js +9 -153
- package/dist/wcardinal/ui/d-chart-coordinate-log.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-series-line-of-any.js +4 -2
- package/dist/wcardinal/ui/d-chart-series-line-of-any.js.map +1 -1
- package/dist/wcardinal/ui/d-scroll-bar-vertical.js +1 -0
- package/dist/wcardinal/ui/d-scroll-bar-vertical.js.map +1 -1
- package/dist/wcardinal/ui/d-table-body.js +39 -0
- package/dist/wcardinal/ui/d-table-body.js.map +1 -1
- package/dist/wcardinal/ui/d-table.js +3 -3
- package/dist/wcardinal/ui/d-table.js.map +1 -1
- package/dist/wcardinal/ui/index.js +11 -0
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js +21 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js +21 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +22 -1
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +22 -1
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +781 -652
- package/dist/wcardinal-ui.js +739 -652
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAIjF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;
|
|
1
|
+
{"version":3,"file":"d-chart-axis-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO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S,CAAC;IAC7B,CAAC;IAES,gCAAO,GAAjB,UAAkB,OAAsC;;QACvD,OAAO,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IACjD,CAAC;IAES,wCAAe,GAAzB;QACC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAES,gCAAO,GAAjB;QACC,OAAO,gBAAgB,CAAC;IACzB,CAAC;IACF,qBAAC;AAAD,CAAC,AA1GD,IA0GC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DApplications } from \"./d-applications\";\nimport { DBase } from \"./d-base\";\nimport { DChartAxis } from \"./d-chart-axis\";\nimport { DChartAxisBar } from \"./d-chart-axis-bar\";\nimport { DChartAxisBaseBar } from \"./d-chart-axis-base-bar\";\nimport { DChartAxisBaseOptions, DThemeChartAxisBase } from \"./d-chart-axis-base-options\";\nimport { DChartAxisBaseOptionParser } from \"./d-chart-axis-base-options-parser\";\nimport { DChartAxisBaseTickContainer } from \"./d-chart-axis-base-tick-container\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { DChartAxisPosition } from \"./d-chart-axis-position\";\nimport { DChartAxisTickContainer } from \"./d-chart-axis-tick-container\";\nimport { DThemes } from \"./theme/d-themes\";\n\nexport class DChartAxisBase<\n\tCHART extends DBase = DBase,\n\tTHEME extends DThemeChartAxisBase = DThemeChartAxisBase,\n\tOPTIONS extends DChartAxisBaseOptions<THEME> = DChartAxisBaseOptions<THEME>\n> implements DChartAxis<CHART>\n{\n\tprotected _theme: DThemeChartAxisBase;\n\tprotected _parser: DChartAxisBaseOptionParser<THEME>;\n\tprotected _container?: DChartAxisContainer<CHART>;\n\tprotected _index: number;\n\tprotected _bar: DChartAxisBar<CHART>;\n\tprotected _tick: DChartAxisTickContainer<CHART>;\n\n\tconstructor(options?: OPTIONS) {\n\t\tconst theme = this.toTheme(options);\n\t\tthis._theme = theme;\n\t\tconst parser = this.newParser(theme, options);\n\t\tthis._parser = parser;\n\t\tthis._index = 0;\n\t\tthis._bar = this.newBar(parser, theme, options);\n\t\tthis._tick = this.newTick(parser, theme, options);\n\t}\n\n\tget parser(): DChartAxisBaseOptionParser<THEME> {\n\t\treturn this._parser;\n\t}\n\n\tprotected newParser(theme: THEME, options?: OPTIONS): DChartAxisBaseOptionParser<THEME> {\n\t\treturn new DChartAxisBaseOptionParser(theme, options);\n\t}\n\n\tget position(): DChartAxisPosition {\n\t\treturn this._parser.position;\n\t}\n\n\tget bar(): DChartAxisBar<CHART> {\n\t\treturn this._bar;\n\t}\n\n\tprotected newBar(\n\t\tparser: DChartAxisBaseOptionParser<THEME>,\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DChartAxisBar<CHART> {\n\t\treturn new DChartAxisBaseBar(parser);\n\t}\n\n\tget tick(): DChartAxisTickContainer<CHART> {\n\t\treturn this._tick;\n\t}\n\n\tprotected newTick(\n\t\tparser: DChartAxisBaseOptionParser<THEME>,\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DChartAxisTickContainer<CHART> {\n\t\treturn new DChartAxisBaseTickContainer(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._bar.bind(container, index);\n\t\tthis._tick.bind(container, index);\n\t}\n\n\tunbind(): void {\n\t\tthis._tick.unbind();\n\t\tthis._bar.unbind();\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n\n\tupdate(): void {\n\t\tconst isBarUpdated = this._bar.update();\n\t\tconst isTicksUpdated = this._tick.update();\n\t\tif (isBarUpdated || isTicksUpdated) {\n\t\t\tconst container = this._container;\n\t\t\tif (container) {\n\t\t\t\tDApplications.update(container.plotArea);\n\t\t\t}\n\t\t}\n\t}\n\n\tonRender(): void {\n\t\tthis._bar.update();\n\t\tthis._tick.update();\n\t}\n\n\tdestroy(): void {\n\t\tthis._bar.destroy();\n\t\tthis._tick.destroy();\n\t\tthis._container = undefined;\n\t}\n\n\tprotected toTheme(options?: DChartAxisBaseOptions<THEME>): THEME {\n\t\treturn options?.theme ?? this.getThemeDefault();\n\t}\n\n\tprotected getThemeDefault(): THEME {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DChartAxisBase\";\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-tick-container.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-tick-container.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartAxisTickMajor } from \"./d-chart-axis-tick-major\";\nimport { DChartAxisTickMinor } from \"./d-chart-axis-tick-minor\";\n\nexport interface DChartAxisTickContainer<CHART extends DBase> {\n\treadonly major: DChartAxisTickMajor<CHART>;\n\treadonly minor: DChartAxisTickMinor<CHART>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-chart-axis-tick-container.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-tick-container.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { DChartAxisTickMajor } from \"./d-chart-axis-tick-major\";\nimport { DChartAxisTickMinor } from \"./d-chart-axis-tick-minor\";\n\nexport interface DChartAxisTickContainer<CHART extends DBase> {\n\treadonly major: DChartAxisTickMajor<CHART>;\n\treadonly minor: DChartAxisTickMinor<CHART>;\n\n\tbind(container: DChartAxisContainer<CHART>, index: number): void;\n\tunbind(): void;\n\tupdate(): boolean;\n\tdestroy(): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-tick-major.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-tick-major.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartAxisTickMajorGridline } from \"./d-chart-axis-tick-major-gridline\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DChartAxisTickMajor<CHART extends DBase> {\n\treadonly shapes: EShape[];\n\treadonly gridline: DChartAxisTickMajorGridline<CHART>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-chart-axis-tick-major.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-tick-major.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { DChartAxisTickMajorGridline } from \"./d-chart-axis-tick-major-gridline\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DChartAxisTickMajor<CHART extends DBase> {\n\treadonly shapes: EShape[];\n\treadonly gridline: DChartAxisTickMajorGridline<CHART>;\n\n\tbind(container: DChartAxisContainer<CHART>, index: number): void;\n\tunbind(): void;\n\tdestroy(): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-tick-minor.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-tick-minor.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DChartAxisTickMinor<CHART extends DBase> {\n\treadonly shapes: EShape[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-chart-axis-tick-minor.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-tick-minor.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DChartAxisTickMinor<CHART extends DBase> {\n\treadonly shapes: EShape[];\n\n\tbind(container: DChartAxisContainer<CHART>, index: number): void;\n\tunbind(): void;\n\tdestroy(): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-x-datetime.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-x-datetime.ts"],"names":[],"mappings":"AAAA;;;GAGG;;
|
|
1
|
+
{"version":3,"file":"d-chart-axis-x-datetime.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-x-datetime.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EAAE,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AAKnE;;GAEG;AACH;IAIU,uCAAkC;IAJ5C;;IAQA,CAAC;IAHU,qCAAO,GAAjB;QACC,OAAO,qBAAqB,CAAC;IAC9B,CAAC;IACF,0BAAC;AAAD,CAAC,AARD,CAIU,WAAW,GAIpB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DThemeChartAxisBase } from \"./d-chart-axis-base-options\";\nimport { DChartAxisX, DChartAxisXOptions } from \"./d-chart-axis-x\";\n\nexport interface DChartAxisXDatetimeOptions<THEME extends DThemeChartAxisBase>\n\textends DChartAxisXOptions<THEME> {}\n\n/**\n * An X axis for datetimes.\n */\nexport class DChartAxisXDatetime<\n\tCHART extends DBase = DBase,\n\tTHEME extends DThemeChartAxisBase = DThemeChartAxisBase,\n\tOPTIONS extends DChartAxisXDatetimeOptions<THEME> = DChartAxisXDatetimeOptions<THEME>\n> extends DChartAxisX<CHART, THEME, OPTIONS> {\n\tprotected getType(): string {\n\t\treturn \"DChartAxisXDatetime\";\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-x.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-x.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"d-chart-axis-x.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-x.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD;;GAEG;AACH;IAIU,+BAAqC;IAJ/C;;IAQA,CAAC;IAHU,6BAAO,GAAjB;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IACF,kBAAC;AAAD,CAAC,AARD,CAIU,cAAc,GAIvB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartAxisBase } from \"./d-chart-axis-base\";\nimport { DChartAxisBaseOptions, DThemeChartAxisBase } from \"./d-chart-axis-base-options\";\n\nexport interface DChartAxisXOptions<THEME extends DThemeChartAxisBase>\n\textends DChartAxisBaseOptions<THEME> {}\n\n/**\n * An X axis.\n */\nexport class DChartAxisX<\n\tCHART extends DBase = DBase,\n\tTHEME extends DThemeChartAxisBase = DThemeChartAxisBase,\n\tOPTIONS extends DChartAxisXOptions<THEME> = DChartAxisXOptions<THEME>\n> extends DChartAxisBase<CHART, THEME, OPTIONS> {\n\tprotected getType(): string {\n\t\treturn \"DChartAxisX\";\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-y.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-y.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"d-chart-axis-y.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-y.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD;;GAEG;AACH;IAIU,+BAAqC;IAJ/C;;IAQA,CAAC;IAHU,6BAAO,GAAjB;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IACF,kBAAC;AAAD,CAAC,AARD,CAIU,cAAc,GAIvB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartAxisBase } from \"./d-chart-axis-base\";\nimport { DChartAxisBaseOptions, DThemeChartAxisBase } from \"./d-chart-axis-base-options\";\n\nexport interface DChartAxisYOptions<THEME extends DThemeChartAxisBase>\n\textends DChartAxisBaseOptions<THEME> {}\n\n/**\n * An Y axis.\n */\nexport class DChartAxisY<\n\tCHART extends DBase = DBase,\n\tTHEME extends DThemeChartAxisBase = DThemeChartAxisBase,\n\tOPTIONS extends DChartAxisYOptions<THEME> = DChartAxisYOptions<THEME>\n> extends DChartAxisBase<CHART, THEME, OPTIONS> {\n\tprotected getType(): string {\n\t\treturn \"DChartAxisY\";\n\t}\n}\n"]}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { DChartCoordinateDirection } from "./d-chart-coordinate-direction";
|
|
6
|
+
import { DChartCoordinateTransformImpl } from "./d-chart-coordinate-transform-impl";
|
|
7
|
+
import { DChartCoordinateTransformMarkImpl } from "./d-chart-coordinate-transform-mark";
|
|
8
|
+
import { DChartRegionImpl } from "./d-chart-region-impl";
|
|
9
|
+
import { DThemes } from "./theme/d-themes";
|
|
10
|
+
import { isNaN } from "./util/is-nan";
|
|
11
|
+
var DChartCoordinateBase = /** @class */ (function () {
|
|
12
|
+
function DChartCoordinateBase(options) {
|
|
13
|
+
this._id = 0;
|
|
14
|
+
this._direction = DChartCoordinateDirection.X;
|
|
15
|
+
this._theme = this.toTheme(options);
|
|
16
|
+
this._transform = this.newTransform(options === null || options === void 0 ? void 0 : options.transform);
|
|
17
|
+
this._tick = this.newTick(options === null || options === void 0 ? void 0 : options.tick);
|
|
18
|
+
this._work = this.newRegion();
|
|
19
|
+
this._mark = this.newMark();
|
|
20
|
+
this._from = options === null || options === void 0 ? void 0 : options.from;
|
|
21
|
+
this._to = options === null || options === void 0 ? void 0 : options.to;
|
|
22
|
+
}
|
|
23
|
+
DChartCoordinateBase.prototype.newTransform = function (options) {
|
|
24
|
+
return new DChartCoordinateTransformImpl(options);
|
|
25
|
+
};
|
|
26
|
+
DChartCoordinateBase.prototype.newRegion = function () {
|
|
27
|
+
return new DChartRegionImpl(NaN, NaN);
|
|
28
|
+
};
|
|
29
|
+
DChartCoordinateBase.prototype.newMark = function () {
|
|
30
|
+
return new DChartCoordinateTransformMarkImpl();
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(DChartCoordinateBase.prototype, "from", {
|
|
33
|
+
get: function () {
|
|
34
|
+
return this._from;
|
|
35
|
+
},
|
|
36
|
+
set: function (from) {
|
|
37
|
+
this._from = from;
|
|
38
|
+
},
|
|
39
|
+
enumerable: false,
|
|
40
|
+
configurable: true
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(DChartCoordinateBase.prototype, "to", {
|
|
43
|
+
get: function () {
|
|
44
|
+
return this._to;
|
|
45
|
+
},
|
|
46
|
+
set: function (to) {
|
|
47
|
+
this._to = to;
|
|
48
|
+
},
|
|
49
|
+
enumerable: false,
|
|
50
|
+
configurable: true
|
|
51
|
+
});
|
|
52
|
+
DChartCoordinateBase.prototype.bind = function (container, direction) {
|
|
53
|
+
this._container = container;
|
|
54
|
+
this._direction = direction;
|
|
55
|
+
this._transform.bind(container, direction);
|
|
56
|
+
};
|
|
57
|
+
DChartCoordinateBase.prototype.unbind = function () {
|
|
58
|
+
this._container = undefined;
|
|
59
|
+
this._transform.unbind();
|
|
60
|
+
};
|
|
61
|
+
DChartCoordinateBase.prototype.fit = function (from, to) {
|
|
62
|
+
this.doFit(from, to, this._transform);
|
|
63
|
+
};
|
|
64
|
+
DChartCoordinateBase.prototype.mark = function (from, to) {
|
|
65
|
+
var mark = this._mark;
|
|
66
|
+
var transform = this._transform;
|
|
67
|
+
mark.oldTranslate = transform.translate;
|
|
68
|
+
mark.oldScale = transform.scale;
|
|
69
|
+
this.doFit(from, to, mark);
|
|
70
|
+
};
|
|
71
|
+
DChartCoordinateBase.prototype.blend = function (ratio) {
|
|
72
|
+
this._transform.blend(ratio, this._mark);
|
|
73
|
+
};
|
|
74
|
+
DChartCoordinateBase.prototype.doFit = function (from, to, result) {
|
|
75
|
+
var container = this._container;
|
|
76
|
+
if (container) {
|
|
77
|
+
var plotArea = container.container.plotArea;
|
|
78
|
+
var padding = plotArea.padding;
|
|
79
|
+
var work = this._work;
|
|
80
|
+
switch (this._direction) {
|
|
81
|
+
case DChartCoordinateDirection.X:
|
|
82
|
+
this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
|
|
83
|
+
break;
|
|
84
|
+
case DChartCoordinateDirection.Y:
|
|
85
|
+
this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
DChartCoordinateBase.prototype.toFitDomain = function (from, to, plotArea, result) {
|
|
91
|
+
if (from == null) {
|
|
92
|
+
from = this._from;
|
|
93
|
+
}
|
|
94
|
+
if (to == null) {
|
|
95
|
+
to = this._to;
|
|
96
|
+
}
|
|
97
|
+
if (from != null && to != null) {
|
|
98
|
+
result.set(from, to);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
plotArea.series.getDomain(this, result);
|
|
102
|
+
result.set(from, to);
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
};
|
|
106
|
+
DChartCoordinateBase.prototype.toFitRange = function (from, to, plotArea, result) {
|
|
107
|
+
if (from == null) {
|
|
108
|
+
from = this._from;
|
|
109
|
+
}
|
|
110
|
+
if (to == null) {
|
|
111
|
+
to = this._to;
|
|
112
|
+
}
|
|
113
|
+
if (from != null && to != null) {
|
|
114
|
+
result.set(from, to);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
plotArea.series.getRange(this, result);
|
|
118
|
+
result.set(from, to);
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
};
|
|
122
|
+
DChartCoordinateBase.prototype.doFit_ = function (pixelFrom, pixelTo, region, result) {
|
|
123
|
+
var regionFrom = region.from;
|
|
124
|
+
var regionTo = region.to;
|
|
125
|
+
if (!(isNaN(regionFrom) || isNaN(regionTo))) {
|
|
126
|
+
// Scale
|
|
127
|
+
var newScale = 1;
|
|
128
|
+
var regionFromMapped = this.map(regionFrom);
|
|
129
|
+
var regionToMapped = this.map(regionTo);
|
|
130
|
+
var regionSizeMapped = regionToMapped - regionFromMapped;
|
|
131
|
+
if (!this._theme.isZero(regionSizeMapped)) {
|
|
132
|
+
var pixelSize = pixelTo - pixelFrom;
|
|
133
|
+
newScale = pixelSize / regionSizeMapped;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
newScale = pixelTo < pixelFrom ? -1 : 1;
|
|
137
|
+
}
|
|
138
|
+
// Translation
|
|
139
|
+
var newTranslation = pixelFrom - regionFromMapped * newScale;
|
|
140
|
+
// Done
|
|
141
|
+
result.set(newTranslation, newScale);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
Object.defineProperty(DChartCoordinateBase.prototype, "id", {
|
|
145
|
+
get: function () {
|
|
146
|
+
return this._id;
|
|
147
|
+
},
|
|
148
|
+
enumerable: false,
|
|
149
|
+
configurable: true
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(DChartCoordinateBase.prototype, "transform", {
|
|
152
|
+
get: function () {
|
|
153
|
+
return this._transform;
|
|
154
|
+
},
|
|
155
|
+
enumerable: false,
|
|
156
|
+
configurable: true
|
|
157
|
+
});
|
|
158
|
+
DChartCoordinateBase.prototype.map = function (value) {
|
|
159
|
+
return value;
|
|
160
|
+
};
|
|
161
|
+
DChartCoordinateBase.prototype.mapAll = function (values, ifrom, iend, stride, offset) {
|
|
162
|
+
// DO NOTHING
|
|
163
|
+
};
|
|
164
|
+
DChartCoordinateBase.prototype.unmap = function (value) {
|
|
165
|
+
return value;
|
|
166
|
+
};
|
|
167
|
+
DChartCoordinateBase.prototype.unmapAll = function (values, ifrom, iend, stride, offset) {
|
|
168
|
+
// DO NOTHING
|
|
169
|
+
};
|
|
170
|
+
DChartCoordinateBase.prototype.ticks = function (domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult) {
|
|
171
|
+
this._tick.calculate(domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult, this);
|
|
172
|
+
};
|
|
173
|
+
DChartCoordinateBase.prototype.toTheme = function (options) {
|
|
174
|
+
var _a;
|
|
175
|
+
return (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : this.getThemeDefault();
|
|
176
|
+
};
|
|
177
|
+
DChartCoordinateBase.prototype.getThemeDefault = function () {
|
|
178
|
+
return DThemes.getInstance().get(this.getType());
|
|
179
|
+
};
|
|
180
|
+
DChartCoordinateBase.prototype.getType = function () {
|
|
181
|
+
return "DChartCoordinate";
|
|
182
|
+
};
|
|
183
|
+
return DChartCoordinateBase;
|
|
184
|
+
}());
|
|
185
|
+
export { DChartCoordinateBase };
|
|
186
|
+
//# sourceMappingURL=d-chart-coordinate-base.js.map
|
|
@@ -0,0 +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,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SA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AAa,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"]}
|
|
@@ -124,7 +124,8 @@ var DChartCoordinateLinearTick = /** @class */ (function () {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
DChartCoordinateLinearTick.prototype.toTheme = function (options) {
|
|
127
|
-
|
|
127
|
+
var _a;
|
|
128
|
+
return (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : this.getThemeDefault();
|
|
128
129
|
};
|
|
129
130
|
DChartCoordinateLinearTick.prototype.getThemeDefault = function () {
|
|
130
131
|
return DThemes.getInstance().get(this.getType());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-coordinate-linear-tick.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-linear-tick.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;IAKC,oCAAY,OAAqC;QAChD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAES,gDAAW,GAArB,UACC,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,SAA0D;QAE1D,IAAI,SAAS,IAAI,IAAI,EAAE;YACtB,IAAI,CAAC,GAAG,UAAU,EAAE;gBACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;aAC5D;YACD,OAAO,CAAC,CAAC,CAAC;SACV;aAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE;YAC/B,OAAO,SAAS,CAAC;SACjB;aAAM;YACN,OAAO,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;SACnD;IACF,CAAC;IAES,gDAAW,GAArB,UACC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,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACpC;IACF,CAAC;IAES,4CAAO,GAAjB,UAAkB,OAAqC;QACtD,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IAC7D,CAAC;IAES,oDAAe,GAAzB;QACC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAES,4CAAO,GAAjB;QACC,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IACF,iCAAC;AAAD,CAAC,AA3KD,IA2KC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartCoordinate } from \"./d-chart-coordinate\";\nimport {\n\tDChartCoordinateTick,\n\tDChartCoordinateTickOptions,\n\tDThemeChartCoordinateTick\n} 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 { DThemes } from \"./theme/d-themes\";\nimport { isNumber } from \"./util/is-number\";\n\nexport class DChartCoordinateLinearTick<CHART extends DBase = DBase>\n\timplements DChartCoordinateTick<CHART>\n{\n\tprotected _theme: DThemeChartCoordinateTick;\n\n\tconstructor(options?: DChartCoordinateTickOptions) {\n\t\tthis._theme = this.toTheme(options);\n\t}\n\n\tprotected toMajorStep(\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tmajorCount: number,\n\t\tmajorStep?: number | DChartCoordinateTickMajorStepFunction\n\t): number {\n\t\tif (majorStep == null) {\n\t\t\tif (0 < majorCount) {\n\t\t\t\treturn this._theme.toStep(domainMin, domainMax, majorCount);\n\t\t\t}\n\t\t\treturn -1;\n\t\t} else if (isNumber(majorStep)) {\n\t\t\treturn majorStep;\n\t\t} else {\n\t\t\treturn majorStep(domainMin, domainMax, majorCount);\n\t\t}\n\t}\n\n\tprotected toMinorStep(\n\t\tmajorStep: number,\n\t\tminorCount: number,\n\t\tminorStep?: number | DChartCoordinateTickMinorStepFunction\n\t): number {\n\t\tif (minorStep == null) {\n\t\t\tif (0 <= majorStep) {\n\t\t\t\treturn this.calcStepMinor(majorStep, minorCount);\n\t\t\t}\n\t\t\treturn -1;\n\t\t} else if (isNumber(minorStep)) {\n\t\t\treturn minorStep;\n\t\t} else {\n\t\t\treturn minorStep(majorStep, minorCount);\n\t\t}\n\t}\n\n\tprotected calcStepMinor(majorStep: number, minorCount: number): number {\n\t\treturn majorStep / (minorCount + 1);\n\t}\n\n\tprotected calcTickMinorPositions(\n\t\tstep: number,\n\t\tcount: number,\n\t\tmajorPosition: number,\n\t\trangeMin: number,\n\t\trangeMax: number,\n\t\tiresult: number,\n\t\tresult: Float64Array\n\t): void {\n\t\tfor (let i = 0; i < count; i += 1) {\n\t\t\tconst minorPosition = majorPosition + (i + 1) * step;\n\t\t\tif (rangeMin <= minorPosition && minorPosition <= rangeMax) {\n\t\t\t\tresult[iresult++] = minorPosition;\n\t\t\t}\n\t\t}\n\t}\n\n\tcalculate(\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\tcoordinate: DChartCoordinate<CHART>\n\t): void {\n\t\tif (majorCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst transform = coordinate.transform;\n\n\t\tconst domainMin = Math.min(domainFrom, domainTo);\n\t\tconst domainMax = Math.max(domainFrom, domainTo);\n\n\t\tconst majorStepMapped = this.toMajorStep(domainMin, domainMax, majorCount, majorStep);\n\t\tif (majorStepMapped <= 0) {\n\t\t\tmajorResult[0] = domainMin;\n\t\t\tmajorResult[1] = transform.map(coordinate.map(domainMin));\n\t\t\tmajorResult[2] = 0;\n\t\t\tfor (let i = 1; i < majorCapacity; ++i) {\n\t\t\t\tconst imajorResult = i * 3;\n\t\t\t\tmajorResult[imajorResult + 0] = NaN;\n\t\t\t\tmajorResult[imajorResult + 1] = NaN;\n\t\t\t\tmajorResult[imajorResult + 2] = NaN;\n\t\t\t}\n\t\t\tfor (let i = 0; i < minorCount; ++i) {\n\t\t\t\tconst iminorResult = i * 3;\n\t\t\t\tminorResult[iminorResult + 0] = NaN;\n\t\t\t\tminorResult[iminorResult + 1] = NaN;\n\t\t\t\tminorResult[iminorResult + 2] = NaN;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Major tick start position\n\t\tconst idomainStart = Math.floor(domainMin / majorStepMapped) - 1;\n\t\tconst idomainEnd = Math.ceil(domainMax / majorStepMapped) + 1;\n\t\tconst domainMinMapped = transform.map(coordinate.map(domainMin));\n\t\tconst domainMaxMapped = transform.map(coordinate.map(domainMax));\n\t\tconst from = Math.min(domainMinMapped, domainMaxMapped) - 0.5;\n\t\tconst to = Math.max(domainMinMapped, domainMaxMapped) + 0.5;\n\n\t\t// Major / minor tick positions\n\t\tconst minorStepMapped = this.toMinorStep(majorStepMapped, minorCountPerMajor, minorStep);\n\t\tlet imajor = 0;\n\t\tlet iminor = 0;\n\t\tfor (let i = idomainStart; i <= idomainEnd; ++i) {\n\t\t\tconst majorPosition = i * majorStepMapped;\n\t\t\tif (imajor < majorCapacity) {\n\t\t\t\tconst majorPositionMapped = transform.map(coordinate.map(majorPosition));\n\t\t\t\tif (from <= majorPositionMapped && majorPositionMapped <= to) {\n\t\t\t\t\tconst imajorResult = imajor * 3;\n\t\t\t\t\tmajorResult[imajorResult + 0] = majorPosition;\n\t\t\t\t\tmajorResult[imajorResult + 1] = majorPositionMapped;\n\t\t\t\t\tmajorResult[imajorResult + 2] = majorStepMapped;\n\t\t\t\t\timajor += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let j = 0; j < minorCountPerMajor; j += 1) {\n\t\t\t\tif (iminor < minorCount) {\n\t\t\t\t\tconst minorPosition = majorPosition + (j + 1) * minorStepMapped;\n\t\t\t\t\tconst minorPositionMapped = transform.map(coordinate.map(minorPosition));\n\t\t\t\t\tif (from <= minorPositionMapped && minorPositionMapped <= to) {\n\t\t\t\t\t\tconst iminorResult = iminor * 3;\n\t\t\t\t\t\tminorResult[iminorResult + 0] = minorPosition;\n\t\t\t\t\t\tminorResult[iminorResult + 1] = minorPositionMapped;\n\t\t\t\t\t\tminorResult[iminorResult + 2] = minorStepMapped;\n\t\t\t\t\t\timinor += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (let i = imajor; i < majorCapacity; ++i) {\n\t\t\tconst imajorResult = i * 3;\n\t\t\tmajorResult[imajorResult + 0] = NaN;\n\t\t\tmajorResult[imajorResult + 1] = NaN;\n\t\t\tmajorResult[imajorResult + 2] = NaN;\n\t\t}\n\t\tfor (let i = iminor; i < minorCount; ++i) {\n\t\t\tconst iminorResult = i * 3;\n\t\t\tminorResult[iminorResult + 0] = NaN;\n\t\t\tminorResult[iminorResult + 1] = NaN;\n\t\t\tminorResult[iminorResult + 2] = NaN;\n\t\t}\n\t}\n\n\tprotected toTheme(options?: DChartCoordinateTickOptions): DThemeChartCoordinateTick {\n\t\treturn (options && options.theme) || this.getThemeDefault();\n\t}\n\n\tprotected getThemeDefault(): DThemeChartCoordinateTick {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DChartCoordinateTick\";\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-chart-coordinate-linear-tick.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-ch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ation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartCoordinate } from \"./d-chart-coordinate\";\nimport {\n\tDChartCoordinateTick,\n\tDChartCoordinateTickOptions,\n\tDThemeChartCoordinateTick\n} 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 { DThemes } from \"./theme/d-themes\";\nimport { isNumber } from \"./util/is-number\";\n\nexport class DChartCoordinateLinearTick<CHART extends DBase = DBase>\n\timplements DChartCoordinateTick<CHART>\n{\n\tprotected _theme: DThemeChartCoordinateTick;\n\n\tconstructor(options?: DChartCoordinateTickOptions) {\n\t\tthis._theme = this.toTheme(options);\n\t}\n\n\tprotected toMajorStep(\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tmajorCount: number,\n\t\tmajorStep?: number | DChartCoordinateTickMajorStepFunction\n\t): number {\n\t\tif (majorStep == null) {\n\t\t\tif (0 < majorCount) {\n\t\t\t\treturn this._theme.toStep(domainMin, domainMax, majorCount);\n\t\t\t}\n\t\t\treturn -1;\n\t\t} else if (isNumber(majorStep)) {\n\t\t\treturn majorStep;\n\t\t} else {\n\t\t\treturn majorStep(domainMin, domainMax, majorCount);\n\t\t}\n\t}\n\n\tprotected toMinorStep(\n\t\tmajorStep: number,\n\t\tminorCount: number,\n\t\tminorStep?: number | DChartCoordinateTickMinorStepFunction\n\t): number {\n\t\tif (minorStep == null) {\n\t\t\tif (0 <= majorStep) {\n\t\t\t\treturn this.calcStepMinor(majorStep, minorCount);\n\t\t\t}\n\t\t\treturn -1;\n\t\t} else if (isNumber(minorStep)) {\n\t\t\treturn minorStep;\n\t\t} else {\n\t\t\treturn minorStep(majorStep, minorCount);\n\t\t}\n\t}\n\n\tprotected calcStepMinor(majorStep: number, minorCount: number): number {\n\t\treturn majorStep / (minorCount + 1);\n\t}\n\n\tprotected calcTickMinorPositions(\n\t\tstep: number,\n\t\tcount: number,\n\t\tmajorPosition: number,\n\t\trangeMin: number,\n\t\trangeMax: number,\n\t\tiresult: number,\n\t\tresult: Float64Array\n\t): void {\n\t\tfor (let i = 0; i < count; i += 1) {\n\t\t\tconst minorPosition = majorPosition + (i + 1) * step;\n\t\t\tif (rangeMin <= minorPosition && minorPosition <= rangeMax) {\n\t\t\t\tresult[iresult++] = minorPosition;\n\t\t\t}\n\t\t}\n\t}\n\n\tcalculate(\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\tcoordinate: DChartCoordinate<CHART>\n\t): void {\n\t\tif (majorCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst transform = coordinate.transform;\n\n\t\tconst domainMin = Math.min(domainFrom, domainTo);\n\t\tconst domainMax = Math.max(domainFrom, domainTo);\n\n\t\tconst majorStepMapped = this.toMajorStep(domainMin, domainMax, majorCount, majorStep);\n\t\tif (majorStepMapped <= 0) {\n\t\t\tmajorResult[0] = domainMin;\n\t\t\tmajorResult[1] = transform.map(coordinate.map(domainMin));\n\t\t\tmajorResult[2] = 0;\n\t\t\tfor (let i = 1; i < majorCapacity; ++i) {\n\t\t\t\tconst imajorResult = i * 3;\n\t\t\t\tmajorResult[imajorResult + 0] = NaN;\n\t\t\t\tmajorResult[imajorResult + 1] = NaN;\n\t\t\t\tmajorResult[imajorResult + 2] = NaN;\n\t\t\t}\n\t\t\tfor (let i = 0; i < minorCount; ++i) {\n\t\t\t\tconst iminorResult = i * 3;\n\t\t\t\tminorResult[iminorResult + 0] = NaN;\n\t\t\t\tminorResult[iminorResult + 1] = NaN;\n\t\t\t\tminorResult[iminorResult + 2] = NaN;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Major tick start position\n\t\tconst idomainStart = Math.floor(domainMin / majorStepMapped) - 1;\n\t\tconst idomainEnd = Math.ceil(domainMax / majorStepMapped) + 1;\n\t\tconst domainMinMapped = transform.map(coordinate.map(domainMin));\n\t\tconst domainMaxMapped = transform.map(coordinate.map(domainMax));\n\t\tconst from = Math.min(domainMinMapped, domainMaxMapped) - 0.5;\n\t\tconst to = Math.max(domainMinMapped, domainMaxMapped) + 0.5;\n\n\t\t// Major / minor tick positions\n\t\tconst minorStepMapped = this.toMinorStep(majorStepMapped, minorCountPerMajor, minorStep);\n\t\tlet imajor = 0;\n\t\tlet iminor = 0;\n\t\tfor (let i = idomainStart; i <= idomainEnd; ++i) {\n\t\t\tconst majorPosition = i * majorStepMapped;\n\t\t\tif (imajor < majorCapacity) {\n\t\t\t\tconst majorPositionMapped = transform.map(coordinate.map(majorPosition));\n\t\t\t\tif (from <= majorPositionMapped && majorPositionMapped <= to) {\n\t\t\t\t\tconst imajorResult = imajor * 3;\n\t\t\t\t\tmajorResult[imajorResult + 0] = majorPosition;\n\t\t\t\t\tmajorResult[imajorResult + 1] = majorPositionMapped;\n\t\t\t\t\tmajorResult[imajorResult + 2] = majorStepMapped;\n\t\t\t\t\timajor += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let j = 0; j < minorCountPerMajor; j += 1) {\n\t\t\t\tif (iminor < minorCount) {\n\t\t\t\t\tconst minorPosition = majorPosition + (j + 1) * minorStepMapped;\n\t\t\t\t\tconst minorPositionMapped = transform.map(coordinate.map(minorPosition));\n\t\t\t\t\tif (from <= minorPositionMapped && minorPositionMapped <= to) {\n\t\t\t\t\t\tconst iminorResult = iminor * 3;\n\t\t\t\t\t\tminorResult[iminorResult + 0] = minorPosition;\n\t\t\t\t\t\tminorResult[iminorResult + 1] = minorPositionMapped;\n\t\t\t\t\t\tminorResult[iminorResult + 2] = minorStepMapped;\n\t\t\t\t\t\timinor += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (let i = imajor; i < majorCapacity; ++i) {\n\t\t\tconst imajorResult = i * 3;\n\t\t\tmajorResult[imajorResult + 0] = NaN;\n\t\t\tmajorResult[imajorResult + 1] = NaN;\n\t\t\tmajorResult[imajorResult + 2] = NaN;\n\t\t}\n\t\tfor (let i = iminor; i < minorCount; ++i) {\n\t\t\tconst iminorResult = i * 3;\n\t\t\tminorResult[iminorResult + 0] = NaN;\n\t\t\tminorResult[iminorResult + 1] = NaN;\n\t\t\tminorResult[iminorResult + 2] = NaN;\n\t\t}\n\t}\n\n\tprotected toTheme(options?: DChartCoordinateTickOptions): DThemeChartCoordinateTick {\n\t\treturn options?.theme ?? this.getThemeDefault();\n\t}\n\n\tprotected getThemeDefault(): DThemeChartCoordinateTick {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DChartCoordinateTick\";\n\t}\n}\n"]}
|
|
@@ -2,174 +2,18 @@
|
|
|
2
2
|
* Copyright (C) 2019 Toshiba Corporation
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { __extends } from "tslib";
|
|
6
|
+
import { DChartCoordinateBase } from "./d-chart-coordinate-base";
|
|
6
7
|
import { DChartCoordinateLinearTick } from "./d-chart-coordinate-linear-tick";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { isNaN } from "./util/is-nan";
|
|
12
|
-
var DChartCoordinateLinear = /** @class */ (function () {
|
|
13
|
-
function DChartCoordinateLinear(options) {
|
|
14
|
-
this._id = 0;
|
|
15
|
-
this._direction = DChartCoordinateDirection.X;
|
|
16
|
-
this._theme = this.toTheme(options);
|
|
17
|
-
this._transform = new DChartCoordinateTransformImpl(options === null || options === void 0 ? void 0 : options.transform);
|
|
18
|
-
this._tick = new DChartCoordinateLinearTick(options === null || options === void 0 ? void 0 : options.tick);
|
|
19
|
-
this._work = new DChartRegionImpl(NaN, NaN);
|
|
20
|
-
this._mark = new DChartCoordinateTransformMarkImpl();
|
|
21
|
-
this._from = options === null || options === void 0 ? void 0 : options.from;
|
|
22
|
-
this._to = options === null || options === void 0 ? void 0 : options.to;
|
|
8
|
+
var DChartCoordinateLinear = /** @class */ (function (_super) {
|
|
9
|
+
__extends(DChartCoordinateLinear, _super);
|
|
10
|
+
function DChartCoordinateLinear() {
|
|
11
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
12
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return this._from;
|
|
27
|
-
},
|
|
28
|
-
set: function (from) {
|
|
29
|
-
this._from = from;
|
|
30
|
-
},
|
|
31
|
-
enumerable: false,
|
|
32
|
-
configurable: true
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(DChartCoordinateLinear.prototype, "to", {
|
|
35
|
-
get: function () {
|
|
36
|
-
return this._to;
|
|
37
|
-
},
|
|
38
|
-
set: function (to) {
|
|
39
|
-
this._to = to;
|
|
40
|
-
},
|
|
41
|
-
enumerable: false,
|
|
42
|
-
configurable: true
|
|
43
|
-
});
|
|
44
|
-
DChartCoordinateLinear.prototype.bind = function (container, direction) {
|
|
45
|
-
this._container = container;
|
|
46
|
-
this._direction = direction;
|
|
47
|
-
this._transform.bind(container, direction);
|
|
48
|
-
};
|
|
49
|
-
DChartCoordinateLinear.prototype.unbind = function () {
|
|
50
|
-
this._container = undefined;
|
|
51
|
-
this._transform.unbind();
|
|
52
|
-
};
|
|
53
|
-
DChartCoordinateLinear.prototype.fit = function (from, to) {
|
|
54
|
-
this.doFit(from, to, this._transform);
|
|
55
|
-
};
|
|
56
|
-
DChartCoordinateLinear.prototype.mark = function (from, to) {
|
|
57
|
-
var mark = this._mark;
|
|
58
|
-
var transform = this._transform;
|
|
59
|
-
mark.oldTranslate = transform.translate;
|
|
60
|
-
mark.oldScale = transform.scale;
|
|
61
|
-
this.doFit(from, to, mark);
|
|
62
|
-
};
|
|
63
|
-
DChartCoordinateLinear.prototype.blend = function (ratio) {
|
|
64
|
-
this._transform.blend(ratio, this._mark);
|
|
65
|
-
};
|
|
66
|
-
DChartCoordinateLinear.prototype.doFit = function (from, to, result) {
|
|
67
|
-
var container = this._container;
|
|
68
|
-
if (container) {
|
|
69
|
-
var plotArea = container.container.plotArea;
|
|
70
|
-
var padding = plotArea.padding;
|
|
71
|
-
var work = this._work;
|
|
72
|
-
switch (this._direction) {
|
|
73
|
-
case DChartCoordinateDirection.X:
|
|
74
|
-
this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
|
|
75
|
-
break;
|
|
76
|
-
case DChartCoordinateDirection.Y:
|
|
77
|
-
this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
DChartCoordinateLinear.prototype.toFitDomain = function (from, to, plotArea, result) {
|
|
83
|
-
if (from == null) {
|
|
84
|
-
from = this._from;
|
|
85
|
-
}
|
|
86
|
-
if (to == null) {
|
|
87
|
-
to = this._to;
|
|
88
|
-
}
|
|
89
|
-
if (from != null && to != null) {
|
|
90
|
-
result.set(from, to);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
plotArea.series.getDomain(this, result);
|
|
94
|
-
result.set(from, to);
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
97
|
-
};
|
|
98
|
-
DChartCoordinateLinear.prototype.toFitRange = function (from, to, plotArea, result) {
|
|
99
|
-
if (from == null) {
|
|
100
|
-
from = this._from;
|
|
101
|
-
}
|
|
102
|
-
if (to == null) {
|
|
103
|
-
to = this._to;
|
|
104
|
-
}
|
|
105
|
-
if (from != null && to != null) {
|
|
106
|
-
result.set(from, to);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
plotArea.series.getRange(this, result);
|
|
110
|
-
result.set(from, to);
|
|
111
|
-
}
|
|
112
|
-
return result;
|
|
113
|
-
};
|
|
114
|
-
DChartCoordinateLinear.prototype.doFit_ = function (pixelFrom, pixelTo, region, result) {
|
|
115
|
-
var regionFrom = region.from;
|
|
116
|
-
var regionTo = region.to;
|
|
117
|
-
if (!(isNaN(regionFrom) || isNaN(regionTo))) {
|
|
118
|
-
// Scale
|
|
119
|
-
var newScale = 1;
|
|
120
|
-
var regionSize = regionTo - regionFrom;
|
|
121
|
-
if (!this._theme.isZero(regionSize)) {
|
|
122
|
-
var pixelSize = pixelTo - pixelFrom;
|
|
123
|
-
newScale = pixelSize / regionSize;
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
newScale = pixelTo < pixelFrom ? -1 : 1;
|
|
127
|
-
}
|
|
128
|
-
// Translation
|
|
129
|
-
var newTranslation = pixelFrom - regionFrom * newScale;
|
|
130
|
-
// Done
|
|
131
|
-
result.set(newTranslation, newScale);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
Object.defineProperty(DChartCoordinateLinear.prototype, "id", {
|
|
135
|
-
get: function () {
|
|
136
|
-
return this._id;
|
|
137
|
-
},
|
|
138
|
-
enumerable: false,
|
|
139
|
-
configurable: true
|
|
140
|
-
});
|
|
141
|
-
Object.defineProperty(DChartCoordinateLinear.prototype, "transform", {
|
|
142
|
-
get: function () {
|
|
143
|
-
return this._transform;
|
|
144
|
-
},
|
|
145
|
-
enumerable: false,
|
|
146
|
-
configurable: true
|
|
147
|
-
});
|
|
148
|
-
DChartCoordinateLinear.prototype.map = function (value) {
|
|
149
|
-
return value;
|
|
150
|
-
};
|
|
151
|
-
DChartCoordinateLinear.prototype.mapAll = function (values, ifrom, iend, stride, offset) {
|
|
152
|
-
// DO NOTHING
|
|
153
|
-
};
|
|
154
|
-
DChartCoordinateLinear.prototype.unmap = function (value) {
|
|
155
|
-
return value;
|
|
156
|
-
};
|
|
157
|
-
DChartCoordinateLinear.prototype.unmapAll = function (values, ifrom, iend, stride, offset) {
|
|
158
|
-
// DO NOTHING
|
|
159
|
-
};
|
|
160
|
-
DChartCoordinateLinear.prototype.ticks = function (domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult) {
|
|
161
|
-
this._tick.calculate(domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult, this);
|
|
162
|
-
};
|
|
163
|
-
DChartCoordinateLinear.prototype.toTheme = function (options) {
|
|
164
|
-
return (options && options.theme) || this.getThemeDefault();
|
|
165
|
-
};
|
|
166
|
-
DChartCoordinateLinear.prototype.getThemeDefault = function () {
|
|
167
|
-
return DThemes.getInstance().get(this.getType());
|
|
168
|
-
};
|
|
169
|
-
DChartCoordinateLinear.prototype.getType = function () {
|
|
170
|
-
return "DChartCoordinate";
|
|
13
|
+
DChartCoordinateLinear.prototype.newTick = function (options) {
|
|
14
|
+
return new DChartCoordinateLinearTick(options);
|
|
171
15
|
};
|
|
172
16
|
return DChartCoordinateLinear;
|
|
173
|
-
}());
|
|
17
|
+
}(DChartCoordinateBase));
|
|
174
18
|
export { DChartCoordinateLinear };
|
|
175
19
|
//# sourceMappingURL=d-chart-coordinate-linear.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-coordinate-linear.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-linear.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAK9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAEN,iCAAiC,EACjC,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;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AAb;YACC,OAAO,IAAI,CAAC,UAAU,CAAC;QACxB,CAAC;;;OAAA;IAED,oCAAG,GAAH,UAAI,KAAa;QAChB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,uCAAM,GAAN,UAAO,MAAgB,EAAE,KAAa,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QACnF,aAAa;IACd,CAAC;IAED,sCAAK,GAAL,UAAM,KAAa;QAClB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,yCAAQ,GAAR,UAAS,MAAgB,EAAE,KAAa,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QACrF,aAAa;IACd,CAAC;IAED,sCAAK,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,wCAAO,GAAjB,UAAkB,OAAiC;QAClD,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IAC7D,CAAC;IAES,gDAAe,GAAzB;QACC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAES,wCAAO,GAAjB;QACC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IACF,6BAAC;AAAD,CAAC,AA1OD,IA0OC","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 { DChartCoordinateLinearTick } from \"./d-chart-coordinate-linear-tick\";\nimport { DChartCoordinateTick } 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 { DChartCoordinateTransform } 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 class DChartCoordinateLinear<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: DChartCoordinateTransformMarkImpl;\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 = new DChartCoordinateTransformImpl(options?.transform);\n\t\tthis._tick = new DChartCoordinateLinearTick<CHART>(options?.tick);\n\t\tthis._work = new DChartRegionImpl(NaN, NaN);\n\t\tthis._mark = new DChartCoordinateTransformMarkImpl();\n\t\tthis._from = options?.from;\n\t\tthis._to = options?.to;\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 regionSize = regionTo - regionFrom;\n\t\t\tif (!this._theme.isZero(regionSize)) {\n\t\t\t\tconst pixelSize = pixelTo - pixelFrom;\n\t\t\t\tnewScale = pixelSize / regionSize;\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 - regionFrom * 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 && 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-linear.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-linear.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAG9E;IAEU,0CAA2B;IAFrC;;IAMA,CAAC;IAHmB,wCAAO,GAA1B,UAA2B,OAAqC;QAC/D,OAAO,IAAI,0BAA0B,CAAQ,OAAO,CAAC,CAAC;IACvD,CAAC;IACF,6BAAC;AAAD,CAAC,AAND,CAEU,oBAAoB,GAI7B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DBase } from \"./d-base\";\nimport { DChartCoordinateBase } from \"./d-chart-coordinate-base\";\nimport { DChartCoordinateLinearTick } from \"./d-chart-coordinate-linear-tick\";\nimport { DChartCoordinateTick, DChartCoordinateTickOptions } from \"./d-chart-coordinate-tick\";\n\nexport class DChartCoordinateLinear<\n\tCHART extends DBase = DBase\n> extends DChartCoordinateBase<CHART> {\n\tprotected override newTick(options?: DChartCoordinateTickOptions): DChartCoordinateTick<CHART> {\n\t\treturn new DChartCoordinateLinearTick<CHART>(options);\n\t}\n}\n"]}
|
|
@@ -123,7 +123,8 @@ var DChartCoordinateLogTick = /** @class */ (function () {
|
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
DChartCoordinateLogTick.prototype.toTheme = function (options) {
|
|
126
|
-
|
|
126
|
+
var _a;
|
|
127
|
+
return (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : this.getThemeDefault();
|
|
127
128
|
};
|
|
128
129
|
DChartCoordinateLogTick.prototype.getThemeDefault = function () {
|
|
129
130
|
return DThemes.getInstance().get(this.getType());
|