@wcardinal/wcardinal-ui 0.296.0 → 0.297.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-base-tick-container.d.ts +5 -3
- package/dist/types/wcardinal/ui/d-chart-coordinate-base.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-chart-coordinate-linear-tick.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-chart-coordinate-log-tick.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-chart-coordinate-tick.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-chart-coordinate.d.ts +5 -3
- package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +41 -14
- package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-base.js +2 -2
- package/dist/wcardinal/ui/d-chart-coordinate-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js +47 -49
- package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js +48 -49
- package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate-tick.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-coordinate.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +141 -117
- package/dist/wcardinal-ui.js +141 -117
- 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-coordinate-linear-tick.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/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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?.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-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;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EAAE,CAAC,EAAE;YACzC,IAAM,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC;YAC3B,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,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,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IACjD,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,AAlLD,IAkLC","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\tdomainVisibleFrom: number,\n\t\tdomainVisibleTo: 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\t\tconst domainVisibleMin = Math.min(domainVisibleFrom, domainVisibleTo);\n\t\tconst domainVisibleMax = Math.max(domainVisibleFrom, domainVisibleTo);\n\t\tconst domainVisibleMinMapped = coordinate.map(domainVisibleMin);\n\t\tconst domainVisibleMaxMapped = coordinate.map(domainVisibleMax);\n\t\tconst from0 = Math.min(domainVisibleMinMapped, domainVisibleMaxMapped);\n\t\tconst to0 = Math.max(domainVisibleMinMapped, domainVisibleMaxMapped);\n\t\tconst domainMinMapped = coordinate.map(domainMin);\n\t\tconst domainMaxMapped = coordinate.map(domainMax);\n\t\tconst from1 = Math.min(domainMinMapped, domainMaxMapped);\n\t\tconst to1 = Math.max(domainMinMapped, domainMaxMapped);\n\t\tconst from = Math.max(from0, from1);\n\t\tconst to = Math.min(to0, to1);\n\n\t\tlet imajor = 0;\n\t\tlet iminor = 0;\n\t\tconst majorStepMapped = this.toMajorStep(\n\t\t\tdomainMinMapped,\n\t\t\tdomainMaxMapped,\n\t\t\tmajorCount,\n\t\t\tmajorStep\n\t\t);\n\t\tif (majorStepMapped <= 0) {\n\t\t\tif (from <= domainMinMapped && domainMinMapped <= to) {\n\t\t\t\tmajorResult[0] = domainMin;\n\t\t\t\tmajorResult[1] = transform.map(domainMinMapped);\n\t\t\t\tmajorResult[2] = 0;\n\t\t\t\timajor += 1;\n\t\t\t}\n\t\t} else {\n\t\t\t// Major tick start position\n\t\t\tconst idomainStartMapped = Math.floor(domainMinMapped / majorStepMapped) - 1;\n\t\t\tconst idomainEndMapped = Math.ceil(domainMaxMapped / majorStepMapped) + 1;\n\n\t\t\t// Major / minor tick positions\n\t\t\tconst minorStepMapped = this.toMinorStep(\n\t\t\t\tmajorStepMapped,\n\t\t\t\tminorCountPerMajor,\n\t\t\t\tminorStep\n\t\t\t);\n\t\t\tfor (let i = idomainStartMapped; i <= idomainEndMapped; ++i) {\n\t\t\t\tconst majorPositionMapped = i * majorStepMapped;\n\t\t\t\tif (imajor < majorCapacity) {\n\t\t\t\t\tif (from <= majorPositionMapped && majorPositionMapped <= to) {\n\t\t\t\t\t\tconst imajorResult = imajor * 3;\n\t\t\t\t\t\tmajorResult[imajorResult + 0] = coordinate.unmap(majorPositionMapped);\n\t\t\t\t\t\tmajorResult[imajorResult + 1] = transform.map(majorPositionMapped);\n\t\t\t\t\t\tmajorResult[imajorResult + 2] = majorStepMapped;\n\t\t\t\t\t\timajor += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (let j = 0; j < minorCountPerMajor; j += 1) {\n\t\t\t\t\tif (iminor < minorCount) {\n\t\t\t\t\t\tconst minorPositionMapped = majorPositionMapped + (j + 1) * minorStepMapped;\n\t\t\t\t\t\tif (from <= minorPositionMapped && minorPositionMapped <= to) {\n\t\t\t\t\t\t\tconst iminorResult = iminor * 3;\n\t\t\t\t\t\t\tminorResult[iminorResult + 0] = coordinate.unmap(minorPositionMapped);\n\t\t\t\t\t\t\tminorResult[iminorResult + 1] = transform.map(minorPositionMapped);\n\t\t\t\t\t\t\tminorResult[iminorResult + 2] = minorStepMapped;\n\t\t\t\t\t\t\timinor += 1;\n\t\t\t\t\t\t}\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"]}
|
|
@@ -47,64 +47,63 @@ var DChartCoordinateLogTick = /** @class */ (function () {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
DChartCoordinateLogTick.prototype.calculate = function (domainFrom, domainTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult, coordinate) {
|
|
50
|
+
DChartCoordinateLogTick.prototype.calculate = function (domainFrom, domainTo, domainVisibleFrom, domainVisibleTo, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorResult, minorResult, coordinate) {
|
|
51
51
|
if (majorCount <= 0) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
var transform = coordinate.transform;
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
55
|
+
var domainMin = Math.min(domainFrom, domainTo);
|
|
56
|
+
var domainMax = Math.max(domainFrom, domainTo);
|
|
57
|
+
var domainVisibleMin = Math.min(domainVisibleFrom, domainVisibleTo);
|
|
58
|
+
var domainVisibleMax = Math.max(domainVisibleFrom, domainVisibleTo);
|
|
59
|
+
var domainVisibleMinMapped = coordinate.map(domainVisibleMin);
|
|
60
|
+
var domainVisibleMaxMapped = coordinate.map(domainVisibleMax);
|
|
61
|
+
var from0 = Math.min(domainVisibleMinMapped, domainVisibleMaxMapped);
|
|
62
|
+
var to0 = Math.max(domainVisibleMinMapped, domainVisibleMaxMapped);
|
|
63
|
+
var domainMinMapped = coordinate.map(domainMin);
|
|
64
|
+
var domainMaxMapped = coordinate.map(domainMax);
|
|
65
|
+
var from1 = Math.min(domainMinMapped, domainMaxMapped);
|
|
66
|
+
var to1 = Math.max(domainMinMapped, domainMaxMapped);
|
|
67
|
+
var from = Math.max(from0, from1);
|
|
68
|
+
var to = Math.min(to0, to1);
|
|
69
|
+
var imajor = 0;
|
|
70
|
+
var iminor = 0;
|
|
59
71
|
var majorStepMapped = this.toMajorStep(domainMinMapped, domainMaxMapped, majorCount, majorStep);
|
|
60
72
|
if (majorStepMapped <= 0) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var imajorResult = i * 3;
|
|
67
|
-
majorResult[imajorResult + 0] = NaN;
|
|
68
|
-
majorResult[imajorResult + 1] = NaN;
|
|
69
|
-
majorResult[imajorResult + 2] = NaN;
|
|
70
|
-
}
|
|
71
|
-
for (var i = 0; i < minorCount; ++i) {
|
|
72
|
-
var iminorResult = i * 3;
|
|
73
|
-
minorResult[iminorResult + 0] = NaN;
|
|
74
|
-
minorResult[iminorResult + 1] = NaN;
|
|
75
|
-
minorResult[iminorResult + 2] = NaN;
|
|
73
|
+
if (from <= domainMinMapped && domainMinMapped <= to) {
|
|
74
|
+
majorResult[0] = domainMin;
|
|
75
|
+
majorResult[1] = transform.map(domainMinMapped);
|
|
76
|
+
majorResult[2] = 0;
|
|
77
|
+
imajor += 1;
|
|
76
78
|
}
|
|
77
|
-
return;
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
imajor += 1;
|
|
80
|
+
else {
|
|
81
|
+
// Major tick start position
|
|
82
|
+
var idomainStartMapped = Math.floor(domainMinMapped / majorStepMapped) - 1;
|
|
83
|
+
var idomainEndMapped = Math.ceil(domainMaxMapped / majorStepMapped) + 1;
|
|
84
|
+
// Major / minor tick positions
|
|
85
|
+
var minorStepMapped = this.toMinorStep(majorStepMapped, minorCountPerMajor, minorStep);
|
|
86
|
+
for (var i = idomainStartMapped; i <= idomainEndMapped; ++i) {
|
|
87
|
+
var majorPositionMapped = i * majorStepMapped;
|
|
88
|
+
if (imajor < majorCapacity) {
|
|
89
|
+
if (from <= majorPositionMapped && majorPositionMapped <= to) {
|
|
90
|
+
var imajorResult = imajor * 3;
|
|
91
|
+
majorResult[imajorResult + 0] = coordinate.unmap(majorPositionMapped);
|
|
92
|
+
majorResult[imajorResult + 1] = transform.map(majorPositionMapped);
|
|
93
|
+
majorResult[imajorResult + 2] = coordinate.unmap(majorPositionMapped - 1);
|
|
94
|
+
imajor += 1;
|
|
95
|
+
}
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
iminor += 1;
|
|
97
|
+
for (var j = 0; j < minorCountPerMajor; j += 1) {
|
|
98
|
+
if (iminor < minorCount) {
|
|
99
|
+
var minorPositionMapped = majorPositionMapped + (j + 1) * minorStepMapped;
|
|
100
|
+
if (from <= minorPositionMapped && minorPositionMapped <= to) {
|
|
101
|
+
var iminorResult = iminor * 3;
|
|
102
|
+
minorResult[iminorResult + 0] = coordinate.unmap(minorPositionMapped);
|
|
103
|
+
minorResult[iminorResult + 1] = transform.map(minorPositionMapped);
|
|
104
|
+
minorResult[iminorResult + 2] = coordinate.unmap(minorPositionMapped - 1);
|
|
105
|
+
iminor += 1;
|
|
106
|
+
}
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-coordinate-log-tick.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d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E,MAAM,IAAI,CAAC,CAAC;qBACZ;iBACD;aACD;SACD;QACD,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,aAAa,EAAE,EAAE,CAAC,EAAE;YAC5C,IAAM,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC;YAC3B,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACpC;QACD,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;YACzC,IAAM,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC;YAC3B,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACpC;IACF,CAAC;IAES,yCAAO,GAAjB,UAAkB,OAAqC;;QACtD,OAAO,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IACjD,CAAC;IAES,iDAAe,GAAzB;QACC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAES,yCAAO,GAAjB;QACC,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IACF,8BAAC;AAAD,CAAC,AApLD,IAoLC","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 interface DThemeChartCoordinateLogTick extends DThemeChartCoordinateTick {}\n\nexport class DChartCoordinateLogTick<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 domainFromMapped = coordinate.map(domainFrom);\n\t\tconst domainToMapped = coordinate.map(domainTo);\n\n\t\tconst domainMinMapped = Math.min(domainFromMapped, domainToMapped);\n\t\tconst domainMaxMapped = Math.max(domainFromMapped, domainToMapped);\n\n\t\tconst majorStepMapped = this.toMajorStep(\n\t\t\tdomainMinMapped,\n\t\t\tdomainMaxMapped,\n\t\t\tmajorCount,\n\t\t\tmajorStep\n\t\t);\n\t\tif (majorStepMapped <= 0) {\n\t\t\tconst domainMin = Math.min(domainFrom, domainTo);\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 < majorCount; ++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 idomainStartMapped = Math.floor(domainMinMapped / majorStepMapped) - 1;\n\t\tconst idomainEndMapped = Math.ceil(domainMaxMapped / majorStepMapped) + 1;\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 = idomainStartMapped; i <= idomainEndMapped; ++i) {\n\t\t\tconst majorPositionMapped = i * majorStepMapped;\n\t\t\tif (imajor < majorCapacity) {\n\t\t\t\tif (\n\t\t\t\t\tdomainMinMapped <= majorPositionMapped &&\n\t\t\t\t\tmajorPositionMapped <= domainMaxMapped\n\t\t\t\t) {\n\t\t\t\t\tconst imajorResult = imajor * 3;\n\t\t\t\t\tmajorResult[imajorResult + 0] = coordinate.unmap(majorPositionMapped);\n\t\t\t\t\tmajorResult[imajorResult + 1] = transform.map(majorPositionMapped);\n\t\t\t\t\tmajorResult[imajorResult + 2] = coordinate.unmap(majorPositionMapped - 1);\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 minorPositionMapped = majorPositionMapped + (j + 1) * minorStepMapped;\n\t\t\t\t\tif (\n\t\t\t\t\t\tdomainMinMapped <= minorPositionMapped &&\n\t\t\t\t\t\tminorPositionMapped <= domainMaxMapped\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst iminorResult = iminor * 3;\n\t\t\t\t\t\tminorResult[iminorResult + 0] = coordinate.unmap(minorPositionMapped);\n\t\t\t\t\t\tminorResult[iminorResult + 1] = transform.map(minorPositionMapped);\n\t\t\t\t\t\tminorResult[iminorResult + 2] = coordinate.unmap(minorPositionMapped - 1);\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"]}
|
|
1
|
+
{"version":3,"file":"d-chart-coordinate-log-tick.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-log-tick.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C;IAKC,iCAAY,OAAqC;QAChD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAES,6CAAW,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,MAA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AG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACpC;QACD,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;YACzC,IAAM,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC;YAC3B,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YACpC,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACpC;IACF,CAAC;IAES,yCAAO,GAAjB,UAAkB,OAAqC;;QACtD,OAAO,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IACjD,CAAC;IAES,iDAAe,GAAzB;QACC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAES,yCAAO,GAAjB;QACC,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IACF,8BAAC;AAAD,CAAC,AApLD,IAoLC","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 interface DThemeChartCoordinateLogTick extends DThemeChartCoordinateTick {}\n\nexport class DChartCoordinateLogTick<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\tdomainVisibleFrom: number,\n\t\tdomainVisibleTo: 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\t\tconst domainVisibleMin = Math.min(domainVisibleFrom, domainVisibleTo);\n\t\tconst domainVisibleMax = Math.max(domainVisibleFrom, domainVisibleTo);\n\t\tconst domainVisibleMinMapped = coordinate.map(domainVisibleMin);\n\t\tconst domainVisibleMaxMapped = coordinate.map(domainVisibleMax);\n\t\tconst from0 = Math.min(domainVisibleMinMapped, domainVisibleMaxMapped);\n\t\tconst to0 = Math.max(domainVisibleMinMapped, domainVisibleMaxMapped);\n\t\tconst domainMinMapped = coordinate.map(domainMin);\n\t\tconst domainMaxMapped = coordinate.map(domainMax);\n\t\tconst from1 = Math.min(domainMinMapped, domainMaxMapped);\n\t\tconst to1 = Math.max(domainMinMapped, domainMaxMapped);\n\t\tconst from = Math.max(from0, from1);\n\t\tconst to = Math.min(to0, to1);\n\n\t\tlet imajor = 0;\n\t\tlet iminor = 0;\n\t\tconst majorStepMapped = this.toMajorStep(\n\t\t\tdomainMinMapped,\n\t\t\tdomainMaxMapped,\n\t\t\tmajorCount,\n\t\t\tmajorStep\n\t\t);\n\t\tif (majorStepMapped <= 0) {\n\t\t\tif (from <= domainMinMapped && domainMinMapped <= to) {\n\t\t\t\tmajorResult[0] = domainMin;\n\t\t\t\tmajorResult[1] = transform.map(domainMinMapped);\n\t\t\t\tmajorResult[2] = 0;\n\t\t\t\timajor += 1;\n\t\t\t}\n\t\t} else {\n\t\t\t// Major tick start position\n\t\t\tconst idomainStartMapped = Math.floor(domainMinMapped / majorStepMapped) - 1;\n\t\t\tconst idomainEndMapped = Math.ceil(domainMaxMapped / majorStepMapped) + 1;\n\n\t\t\t// Major / minor tick positions\n\t\t\tconst minorStepMapped = this.toMinorStep(\n\t\t\t\tmajorStepMapped,\n\t\t\t\tminorCountPerMajor,\n\t\t\t\tminorStep\n\t\t\t);\n\t\t\tfor (let i = idomainStartMapped; i <= idomainEndMapped; ++i) {\n\t\t\t\tconst majorPositionMapped = i * majorStepMapped;\n\t\t\t\tif (imajor < majorCapacity) {\n\t\t\t\t\tif (from <= majorPositionMapped && majorPositionMapped <= to) {\n\t\t\t\t\t\tconst imajorResult = imajor * 3;\n\t\t\t\t\t\tmajorResult[imajorResult + 0] = coordinate.unmap(majorPositionMapped);\n\t\t\t\t\t\tmajorResult[imajorResult + 1] = transform.map(majorPositionMapped);\n\t\t\t\t\t\tmajorResult[imajorResult + 2] = coordinate.unmap(majorPositionMapped - 1);\n\t\t\t\t\t\timajor += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (let j = 0; j < minorCountPerMajor; j += 1) {\n\t\t\t\t\tif (iminor < minorCount) {\n\t\t\t\t\t\tconst minorPositionMapped = majorPositionMapped + (j + 1) * minorStepMapped;\n\t\t\t\t\t\tif (from <= minorPositionMapped && minorPositionMapped <= to) {\n\t\t\t\t\t\t\tconst iminorResult = iminor * 3;\n\t\t\t\t\t\t\tminorResult[iminorResult + 0] = coordinate.unmap(minorPositionMapped);\n\t\t\t\t\t\t\tminorResult[iminorResult + 1] = transform.map(minorPositionMapped);\n\t\t\t\t\t\t\tminorResult[iminorResult + 2] = coordinate.unmap(\n\t\t\t\t\t\t\t\tminorPositionMapped - 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\timinor += 1;\n\t\t\t\t\t\t}\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-coordinate-tick.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-tick.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 { 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\";\n\nexport interface DThemeChartCoordinateTick {\n\ttoStep(domainMin: number, domainMax: number, majorCount: number): number;\n}\n\nexport interface DChartCoordinateTickOptions {\n\ttheme?: DThemeChartCoordinateTick;\n}\n\nexport interface DChartCoordinateTick<CHART extends DBase = DBase> {\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}\n"]}
|
|
1
|
+
{"version":3,"file":"d-chart-coordinate-tick.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate-tick.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 { 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\";\n\nexport interface DThemeChartCoordinateTick {\n\ttoStep(domainMin: number, domainMax: number, majorCount: number): number;\n}\n\nexport interface DChartCoordinateTickOptions {\n\ttheme?: DThemeChartCoordinateTick;\n}\n\nexport interface DChartCoordinateTick<CHART extends DBase = DBase> {\n\tcalculate(\n\t\tdomainFrom: number,\n\t\tdomainTo: number,\n\t\tdomainVisibleFrom: number,\n\t\tdomainVisibleTo: 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}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-coordinate.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate.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 { DChartCoordinateContainerSub } from \"./d-chart-coordinate-container-sub\";\nimport { DChartCoordinateDirection } from \"./d-chart-coordinate-direction\";\nimport { 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\";\n\nexport interface DThemeChartCoordinate {\n\tisZero(value: number): boolean;\n}\n\nexport interface DChartCoordinateOptions {\n\ttransform?: DChartCoordinateTransformOptions;\n\ttick?: DChartCoordinateTickOptions;\n\tfrom?: number;\n\tto?: number;\n\ttheme?: DThemeChartCoordinate;\n}\n\nexport interface DChartCoordinate<CHART extends DBase = DBase> {\n\t/**\n\t * Monotonic increasing ID for change detection.\n\t */\n\treadonly id: number;\n\treadonly transform: DChartCoordinateTransform<CHART>;\n\n\tfrom: number | undefined;\n\tto: number | undefined;\n\n\tbind(\n\t\tcontainer: DChartCoordinateContainerSub<CHART>,\n\t\tdirection: DChartCoordinateDirection\n\t): void;\n\tunbind(): void;\n\n\t/**\n\t * Adjusts the transform so that mapped points of the given range fit into the plot area\n\t * if the plot area container's localTransform is an identity matrix.\n\t *\n\t * @param from a lower end of the range\n\t * @param to an upper end of the range\n\t */\n\tfit(from?: number, to?: number): void;\n\n\tmark(from?: number, to?: number): void;\n\n\tblend(ratio: number): void;\n\n\t/**\n\t * Transforms the given raw value to the untransformed value.\n\t *\n\t * @param value a raw value\n\t */\n\tmap(value: number): number;\n\n\t/**\n\t * Transforms the given raw values to untransformed values.\n\t * Numbers whose indices are ifrom + i * stride + offset and less than iend will be transformed.\n\t * Here, i is a non-negative integer.\n\t *\n\t * @param values raw values to be transformed\n\t * @param ifrom an index on raw values at which to begin a transformation\n\t * @param iend an index on raw values before which to end a transformation\n\t * @param stride a stride of indices\n\t * @param offset an offset of indices\n\t */\n\tmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void;\n\n\t/**\n\t * Transforms the given untransformed value to the raw value.\n\t *\n\t * @param value an untransformed value\n\t */\n\tunmap(value: number): number;\n\n\t/**\n\t * Transforms the given untransformed values to raw values.\n\t * Numbers whose indices are ifrom + i * stride + offset and less than iend will be transformed.\n\t * Here, i is a non-negative integer.\n\t *\n\t * @param values untrasformed values to be transformed\n\t * @param ifrom an index on raw values at which to begin a transformation\n\t * @param iend an index on raw values at which to begin a transformation\n\t * @param stride a stride of indices\n\t * @param offset an offset of indices\n\t */\n\tunmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void;\n\n\t/**\n\t * Returns major / minor tick positions.\n\t *\n\t * @param domainMin
|
|
1
|
+
{"version":3,"file":"d-chart-coordinate.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-coordinate.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 { DChartCoordinateContainerSub } from \"./d-chart-coordinate-container-sub\";\nimport { DChartCoordinateDirection } from \"./d-chart-coordinate-direction\";\nimport { 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\";\n\nexport interface DThemeChartCoordinate {\n\tisZero(value: number): boolean;\n}\n\nexport interface DChartCoordinateOptions {\n\ttransform?: DChartCoordinateTransformOptions;\n\ttick?: DChartCoordinateTickOptions;\n\tfrom?: number;\n\tto?: number;\n\ttheme?: DThemeChartCoordinate;\n}\n\nexport interface DChartCoordinate<CHART extends DBase = DBase> {\n\t/**\n\t * Monotonic increasing ID for change detection.\n\t */\n\treadonly id: number;\n\treadonly transform: DChartCoordinateTransform<CHART>;\n\n\tfrom: number | undefined;\n\tto: number | undefined;\n\n\tbind(\n\t\tcontainer: DChartCoordinateContainerSub<CHART>,\n\t\tdirection: DChartCoordinateDirection\n\t): void;\n\tunbind(): void;\n\n\t/**\n\t * Adjusts the transform so that mapped points of the given range fit into the plot area\n\t * if the plot area container's localTransform is an identity matrix.\n\t *\n\t * @param from a lower end of the range\n\t * @param to an upper end of the range\n\t */\n\tfit(from?: number, to?: number): void;\n\n\tmark(from?: number, to?: number): void;\n\n\tblend(ratio: number): void;\n\n\t/**\n\t * Transforms the given raw value to the untransformed value.\n\t *\n\t * @param value a raw value\n\t */\n\tmap(value: number): number;\n\n\t/**\n\t * Transforms the given raw values to untransformed values.\n\t * Numbers whose indices are ifrom + i * stride + offset and less than iend will be transformed.\n\t * Here, i is a non-negative integer.\n\t *\n\t * @param values raw values to be transformed\n\t * @param ifrom an index on raw values at which to begin a transformation\n\t * @param iend an index on raw values before which to end a transformation\n\t * @param stride a stride of indices\n\t * @param offset an offset of indices\n\t */\n\tmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void;\n\n\t/**\n\t * Transforms the given untransformed value to the raw value.\n\t *\n\t * @param value an untransformed value\n\t */\n\tunmap(value: number): number;\n\n\t/**\n\t * Transforms the given untransformed values to raw values.\n\t * Numbers whose indices are ifrom + i * stride + offset and less than iend will be transformed.\n\t * Here, i is a non-negative integer.\n\t *\n\t * @param values untrasformed values to be transformed\n\t * @param ifrom an index on raw values at which to begin a transformation\n\t * @param iend an index on raw values at which to begin a transformation\n\t * @param stride a stride of indices\n\t * @param offset an offset of indices\n\t */\n\tunmapAll(values: number[], ifrom: number, iend: number, stride: number, offset: number): void;\n\n\t/**\n\t * Returns major / minor tick positions.\n\t *\n\t * @param domainMin domain lower bound\n\t * @param domainMax domain upper bound\n\t * @param domainVisibleMin visible domain lower bound\n\t * @param domainVisibleMax visible domain upper bound\n\t * @param majorCount Expected major tick count\n\t * @param minorCountPerMajor Expected minor tick count per major ticks\n\t * @param minorCount Expected total minor tick count\n\t * @param majorResult `majorResult.length` must be larger than `majorCount * 3`.\n\t * @param minorResult `minorResult.length` must be larger than `minorCount * 3`.\n\t */\n\tticks(\n\t\tdomainMin: number,\n\t\tdomainMax: number,\n\t\tdomainVisibleMin: number,\n\t\tdomainVisibleMax: 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}\n"]}
|