@wcardinal/wcardinal-ui 0.424.0 → 0.426.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-guide-simple.d.ts +8 -1
- package/dist/types/wcardinal/ui/d-dynamic-text-geometry.d.ts +14 -3
- package/dist/types/wcardinal/ui/d-pane.d.ts +4 -4
- package/dist/types/wcardinal/ui/shape/e-shape-text.d.ts +3 -1
- package/dist/types/wcardinal/ui/shape/variant/build-text.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-text-impl.d.ts +6 -1
- package/dist/types/wcardinal/ui/util/character.d.ts +8 -0
- package/dist/types/wcardinal/ui/util/dynamic-font-atlas-character.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/dynamic-font-atlas-characters.d.ts +1 -1
- package/dist/types/wcardinal/ui/util/dynamic-font-atlas.d.ts +5 -7
- package/dist/types/wcardinal/ui/util/dynamic-sdf-font-atlas.d.ts +2 -5
- package/dist/types/wcardinal/ui/util/dynamic-sdf-font-atlases.d.ts +2 -2
- package/dist/types/wcardinal/ui/util/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/util-character-iterator.d.ts +0 -8
- package/dist/wcardinal/ui/d-chart-axis-guide-simple.js +54 -26
- package/dist/wcardinal/ui/d-chart-axis-guide-simple.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-geometry.js +56 -49
- package/dist/wcardinal/ui/d-dynamic-text-geometry.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-measure.js +11 -11
- package/dist/wcardinal/ui/d-dynamic-text-measure.js.map +1 -1
- package/dist/wcardinal/ui/d-pane.js +9 -21
- package/dist/wcardinal/ui/d-pane.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-renderer.js +3 -3
- package/dist/wcardinal/ui/shape/e-shape-renderer.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-text.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-text.js +13 -14
- package/dist/wcardinal/ui/shape/variant/build-text.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/builder-text.js +1 -1
- package/dist/wcardinal/ui/shape/variant/builder-text.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-text-impl.js +88 -13
- package/dist/wcardinal/ui/shape/variant/e-shape-text-impl.js.map +1 -1
- package/dist/wcardinal/ui/util/character.js +13 -0
- package/dist/wcardinal/ui/util/character.js.map +1 -0
- package/dist/wcardinal/ui/util/dynamic-font-atlas-character.js +2 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-character.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-characters.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas.js +124 -108
- package/dist/wcardinal/ui/util/dynamic-font-atlas.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlases.js +2 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlases.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas.js +83 -114
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlases.js +18 -26
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlases.js.map +1 -1
- package/dist/wcardinal/ui/util/index.js +1 -0
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/util-character-iterator.js +0 -17
- package/dist/wcardinal/ui/util/util-character-iterator.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +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-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.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 +545 -478
- package/dist/wcardinal-ui.js +545 -478
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/util/ascii.d.ts +0 -1
- package/dist/wcardinal/ui/util/ascii.js +0 -6
- package/dist/wcardinal/ui/util/ascii.js.map +0 -1
|
@@ -4,17 +4,22 @@ import { DChartAxisContainer } from "./d-chart-axis-container";
|
|
|
4
4
|
import { DChartAxisGuide } from "./d-chart-axis-guide";
|
|
5
5
|
import { DChartAxis } from "./d-chart-axis";
|
|
6
6
|
import { DChartAxisGuideSimpleShape, DChartAxisGuideSimpleShapeOptions } from "./d-chart-axis-guide-simple-shape";
|
|
7
|
+
import { DChartPlotArea, DChartPlotAreaLike } from "./d-chart-plot-area";
|
|
8
|
+
import { DChartRegion } from "./d-chart-region";
|
|
7
9
|
export interface DChartAxisGuideSimpleOptions extends DChartAxisGuideSimpleShapeOptions {
|
|
8
10
|
position?: number;
|
|
11
|
+
fixed?: boolean;
|
|
9
12
|
}
|
|
10
13
|
export declare class DChartAxisGuideSimple<CHART extends DBase = DBase> implements DChartAxisGuide<CHART> {
|
|
14
|
+
protected static WORK_POINT?: Point;
|
|
15
|
+
protected static WORK_REGION?: DChartRegion;
|
|
11
16
|
protected _axis?: DChartAxis<CHART>;
|
|
12
17
|
protected _options?: DChartAxisGuideSimpleOptions;
|
|
13
18
|
protected _container?: DChartAxisContainer<CHART>;
|
|
14
19
|
protected _index: number;
|
|
15
20
|
protected _shape?: DChartAxisGuideSimpleShape;
|
|
16
21
|
protected _position: number;
|
|
17
|
-
protected
|
|
22
|
+
protected _fixed: boolean;
|
|
18
23
|
protected _isShown: boolean;
|
|
19
24
|
constructor(options?: DChartAxisGuideSimpleOptions);
|
|
20
25
|
get shape(): DChartAxisGuideSimpleShape;
|
|
@@ -28,5 +33,7 @@ export declare class DChartAxisGuideSimple<CHART extends DBase = DBase> implemen
|
|
|
28
33
|
bind(container: DChartAxisContainer<CHART>, index: number, axis: DChartAxis<CHART>): void;
|
|
29
34
|
unbind(): void;
|
|
30
35
|
update(): boolean;
|
|
36
|
+
protected getPositionX(axis: DChartAxis<CHART>, plotArea: DChartPlotArea<CHART> | DChartPlotAreaLike<CHART>, plotAreaX: number): number;
|
|
37
|
+
protected getPositionY(axis: DChartAxis<CHART>, plotArea: DChartPlotArea<CHART> | DChartPlotAreaLike<CHART>, plotAreaY: number): number;
|
|
31
38
|
destroy(): void;
|
|
32
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MeshGeometry } from "pixi.js";
|
|
1
|
+
import { Buffer, MeshGeometry } from "pixi.js";
|
|
2
2
|
import { DDynamicTextStyleWordWrap } from "./d-dynamic-text-style-word-wrap";
|
|
3
3
|
import { DynamicFontAtlas } from "./util/dynamic-font-atlas";
|
|
4
4
|
import { DynamicFontAtlasCharacter } from "./util/dynamic-font-atlas-character";
|
|
@@ -11,13 +11,24 @@ export interface DDynamicTextGeometryModifier {
|
|
|
11
11
|
lineHeight: number;
|
|
12
12
|
}
|
|
13
13
|
export declare class DDynamicTextGeometry extends MeshGeometry {
|
|
14
|
+
protected static VERTICES?: Float32Array;
|
|
15
|
+
protected static UVS?: Float32Array;
|
|
16
|
+
protected static INDICES?: Uint16Array;
|
|
14
17
|
width: number;
|
|
15
18
|
height: number;
|
|
16
19
|
scale: number;
|
|
17
20
|
scaled: boolean;
|
|
18
21
|
clipped: boolean;
|
|
22
|
+
nchars: number;
|
|
23
|
+
vertexBuffer: Buffer;
|
|
24
|
+
vertices: Float32Array;
|
|
25
|
+
uvBuffer: Buffer;
|
|
26
|
+
uvs: Float32Array;
|
|
27
|
+
indexBuffer: Buffer;
|
|
28
|
+
indices: Uint16Array;
|
|
19
29
|
constructor();
|
|
20
30
|
update(text: string, atlas: DynamicFontAtlas | null, modifier: DDynamicTextGeometryModifier): void;
|
|
21
|
-
protected
|
|
22
|
-
protected
|
|
31
|
+
protected fill(vertices: Float32Array, uvs: Float32Array, index: number, x: number, y: number, scale: number, character: DynamicFontAtlasCharacter, fw: number, fh: number): void;
|
|
32
|
+
protected fillBlank(vertices: Float32Array, uvs: Float32Array, index: number): void;
|
|
33
|
+
protected initIndices(indices: Uint16Array): void;
|
|
23
34
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { InteractionEvent, Point, Rectangle } from "pixi.js";
|
|
1
|
+
import { Graphics, InteractionEvent, Point, Rectangle } from "pixi.js";
|
|
2
2
|
import { DBase, DBaseOptions, DThemeBase } from "./d-base";
|
|
3
|
-
import { DBaseOverflowMask } from "./d-base-overflow-mask";
|
|
4
3
|
import { DContentOptions } from "./d-content";
|
|
5
4
|
import { UtilGestureMode } from "./util/util-gesture-mode";
|
|
6
5
|
import { UtilGesture } from "./util/util-gesture";
|
|
@@ -42,7 +41,7 @@ export declare class DPane<THEME extends DThemePane = DThemePane, CONTENT_OPTION
|
|
|
42
41
|
protected static WORK_POINT?: Point;
|
|
43
42
|
protected static WORK_RECTANGLE?: Rectangle;
|
|
44
43
|
protected _content?: DBase;
|
|
45
|
-
protected _overflowMask?:
|
|
44
|
+
protected _overflowMask?: Graphics | null;
|
|
46
45
|
protected _scrollbar?: DPaneScrollBar;
|
|
47
46
|
protected _gestureUtil?: UtilGesture<DPane>;
|
|
48
47
|
constructor(options?: OPTIONS);
|
|
@@ -59,7 +58,8 @@ export declare class DPane<THEME extends DThemePane = DThemePane, CONTENT_OPTION
|
|
|
59
58
|
protected toContent(options?: OPTIONS): DBase;
|
|
60
59
|
protected newContent(options?: CONTENT_OPTIONS): DBase;
|
|
61
60
|
protected initContent(content: DBase): void;
|
|
62
|
-
protected getOverflowMask():
|
|
61
|
+
protected getOverflowMask(): Graphics | null;
|
|
62
|
+
protected newOverflowMask(): Graphics | null;
|
|
63
63
|
protected onWheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point): boolean;
|
|
64
64
|
protected getWheelContentX(content: DBase, delta: number): number;
|
|
65
65
|
protected getWheelContentY(content: DBase, delta: number): number;
|
|
@@ -44,7 +44,7 @@ export interface EShapeTextAtlasCharacter {
|
|
|
44
44
|
y: number;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
export type EShapeTextAtlasCharacters =
|
|
47
|
+
export type EShapeTextAtlasCharacters = Map<string, EShapeTextAtlasCharacter>;
|
|
48
48
|
export interface EShapeTextAtlas {
|
|
49
49
|
width: number;
|
|
50
50
|
height: number;
|
|
@@ -62,6 +62,8 @@ export interface EShapeText extends EShapeTextLike {
|
|
|
62
62
|
padding: EShapeTextOffset;
|
|
63
63
|
texture?: Texture;
|
|
64
64
|
atlas?: EShapeTextAtlas;
|
|
65
|
+
characters: string[];
|
|
66
|
+
nacharacters: string[];
|
|
65
67
|
world?: number[];
|
|
66
68
|
readonly length: number;
|
|
67
69
|
/** Peak length */
|
|
@@ -12,4 +12,4 @@ export declare const TEXT_FMIN: number;
|
|
|
12
12
|
export declare const toTextBufferCount: (shape: EShape) => number;
|
|
13
13
|
export declare const buildTextIndex: (indices: Uint16Array | Uint32Array, voffset: number, ioffset: number, icount: number) => void;
|
|
14
14
|
export declare const buildTextStep: (steps: Float32Array, voffset: number, vcount: number, textAtlas: EShapeTextAtlas | undefined, textSize: number, textOutlineWidth: number, textWeight: EShapeTextWeight, scaleX: number, scaleY: number) => void;
|
|
15
|
-
export declare const buildTextVertex: (vertices: Float32Array, uvs: Float32Array, voffset: number, vcount: number, originX: number, originY: number, sizeX: number, sizeY: number, textAtlas: EShapeTextAtlas, textSize: number,
|
|
15
|
+
export declare const buildTextVertex: (vertices: Float32Array, uvs: Float32Array, voffset: number, vcount: number, originX: number, originY: number, sizeX: number, sizeY: number, textAtlas: EShapeTextAtlas, textSize: number, textCharacters: string[], textStyle: EShapeTextStyle, textAlignHorizontal: EShapeTextAlignHorizontal, textAlignVertical: EShapeTextAlignVertical, textOffsetHorizontal: number, textOffsetVertical: number, textSpacingHorizontal: number, textSpacingVertical: number, textDirection: EShapeTextDirection, textPaddingHorizontal: number, textPaddingVertical: number, textClipping: boolean, textFitting: boolean, textWorld: number[], textureUvs: TextureUvs, internalTransform: Matrix) => void;
|
|
@@ -30,13 +30,18 @@ export declare class EShapeTextImpl implements EShapeText {
|
|
|
30
30
|
protected _fitting: boolean;
|
|
31
31
|
texture?: Texture;
|
|
32
32
|
atlas?: EShapeTextAtlas;
|
|
33
|
+
protected _characters: string[];
|
|
34
|
+
protected _nacharacters: string[];
|
|
33
35
|
world?: number[];
|
|
34
36
|
constructor(parent: EShapeTextImplParent, value: string, color: number, alpha: number, family: string, size: number);
|
|
35
37
|
get enable(): boolean;
|
|
36
38
|
set enable(enable: boolean);
|
|
37
39
|
get value(): string;
|
|
38
40
|
set value(value: string);
|
|
39
|
-
|
|
41
|
+
get characters(): string[];
|
|
42
|
+
get nacharacters(): string[];
|
|
43
|
+
protected updateCharacters(value: string): void;
|
|
44
|
+
protected isCompatible(): boolean;
|
|
40
45
|
get length(): number;
|
|
41
46
|
get plength(): number;
|
|
42
47
|
get family(): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const Character: {
|
|
2
|
+
readonly ASCII: "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
|
|
3
|
+
readonly SPACE: " ";
|
|
4
|
+
readonly TAB: "\t";
|
|
5
|
+
readonly SOFT_TAB: " ";
|
|
6
|
+
readonly DOTS: "...";
|
|
7
|
+
readonly NEW_LINE: "\n";
|
|
8
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DynamicFontAtlasCharacterOrigin } from "./dynamic-font-atlas-chaaracter-origin";
|
|
2
2
|
import { DynamicFontAtlasCharacterType } from "./dynamic-font-atlas-character-type";
|
|
3
3
|
export declare class DynamicFontAtlasCharacter {
|
|
4
|
+
static LIFE: number;
|
|
4
5
|
ref: number;
|
|
5
6
|
life: number;
|
|
6
7
|
character: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DynamicFontAtlasCharacter } from "./dynamic-font-atlas-character";
|
|
2
|
-
export type DynamicFontAtlasCharacters =
|
|
2
|
+
export type DynamicFontAtlasCharacters = Map<string, DynamicFontAtlasCharacter>;
|
|
@@ -9,7 +9,7 @@ export declare class DynamicFontAtlas {
|
|
|
9
9
|
protected _context: CanvasRenderingContext2D | null;
|
|
10
10
|
protected _font: DynamicFontAtlasFont;
|
|
11
11
|
protected _characters: DynamicFontAtlasCharacters;
|
|
12
|
-
protected
|
|
12
|
+
protected _createds: DynamicFontAtlasCharacters;
|
|
13
13
|
protected _unrefCount: number;
|
|
14
14
|
protected _width: number;
|
|
15
15
|
protected _height: number;
|
|
@@ -26,12 +26,10 @@ export declare class DynamicFontAtlas {
|
|
|
26
26
|
get canvas(): HTMLCanvasElement | null;
|
|
27
27
|
get characters(): DynamicFontAtlasCharacters;
|
|
28
28
|
get texture(): Texture;
|
|
29
|
-
protected
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
protected
|
|
33
|
-
add(targets: string, type?: DynamicFontAtlasCharacterType): void;
|
|
34
|
-
remove(targets: string): void;
|
|
29
|
+
protected newChar(character: string, type: DynamicFontAtlasCharacterType): DynamicFontAtlasCharacter;
|
|
30
|
+
add(characters: string, type: DynamicFontAtlasCharacterType): void;
|
|
31
|
+
remove(characters: string): void;
|
|
32
|
+
protected cleanup(): void;
|
|
35
33
|
get(id: string): DynamicFontAtlasCharacter | undefined;
|
|
36
34
|
getAdvance(target: string): number;
|
|
37
35
|
getContext(): CanvasRenderingContext2D | null;
|
|
@@ -15,7 +15,6 @@ export declare class DynamicSDFFontAtlas {
|
|
|
15
15
|
protected _canvas: HTMLCanvasElement | null;
|
|
16
16
|
protected _font: DynamicSDFFontAtlasFont;
|
|
17
17
|
protected _characters: DynamicFontAtlasCharacters;
|
|
18
|
-
protected _length: number;
|
|
19
18
|
protected _width: number;
|
|
20
19
|
protected _height: number;
|
|
21
20
|
protected _isDirty: boolean;
|
|
@@ -30,10 +29,8 @@ export declare class DynamicSDFFontAtlas {
|
|
|
30
29
|
get characters(): DynamicFontAtlasCharacters;
|
|
31
30
|
begin(): void;
|
|
32
31
|
end(): void;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
protected isIgnored(character: string): boolean;
|
|
36
|
-
add(characters: string, type?: DynamicFontAtlasCharacterType): void;
|
|
32
|
+
protected newChar(character: string, type: DynamicFontAtlasCharacterType): DynamicFontAtlasCharacter;
|
|
33
|
+
add(characters: string[], nacharacters: string[]): void;
|
|
37
34
|
get(id: string): DynamicFontAtlasCharacter | undefined;
|
|
38
35
|
update(): boolean;
|
|
39
36
|
get length(): number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DynamicAtlas } from "./dynamic-atlas";
|
|
2
2
|
import { DynamicSDFFontAtlas } from "./dynamic-sdf-font-atlas";
|
|
3
3
|
export declare class DynamicSDFFontAtlases {
|
|
4
|
-
protected _atlases:
|
|
4
|
+
protected _atlases: Map<string, DynamicSDFFontAtlas>;
|
|
5
5
|
constructor();
|
|
6
6
|
begin(): void;
|
|
7
7
|
end(): void;
|
|
8
|
-
add(family: string,
|
|
8
|
+
add(family: string, characters: string[], nacharacters: string[]): void;
|
|
9
9
|
get(family: string): DynamicSDFFontAtlas | null;
|
|
10
10
|
update(baseAtlas: DynamicAtlas): void;
|
|
11
11
|
destroy(): void;
|
|
@@ -10,14 +10,6 @@ export declare class UtilCharacterIterator {
|
|
|
10
10
|
protected isLowSurrogate(code: number): boolean;
|
|
11
11
|
protected isVariationSelector(code: number): boolean;
|
|
12
12
|
next(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Advances the position if the next character is not equal to
|
|
15
|
-
* the given `except`.
|
|
16
|
-
*
|
|
17
|
-
* @param except
|
|
18
|
-
* @return true if the position is advanced
|
|
19
|
-
*/
|
|
20
|
-
advance(except?: string): boolean;
|
|
21
13
|
/**
|
|
22
14
|
* Closes this iterator.
|
|
23
15
|
*
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { Point } from "pixi.js";
|
|
2
2
|
import { DChartAxisPosition } from "./d-chart-axis-position";
|
|
3
3
|
import { DChartAxisGuideSimpleShapeImpl } from "./d-chart-axis-guide-simple-shape-impl";
|
|
4
|
+
import { DChartRegionImpl } from "./d-chart-region-impl";
|
|
4
5
|
var DChartAxisGuideSimple = /** @class */ (function () {
|
|
5
6
|
function DChartAxisGuideSimple(options) {
|
|
6
|
-
var _a;
|
|
7
|
+
var _a, _b;
|
|
7
8
|
this._options = options;
|
|
8
9
|
this._index = 0;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
if (options != null) {
|
|
11
|
+
this._position = (_a = options.position) !== null && _a !== void 0 ? _a : 0;
|
|
12
|
+
this._fixed = (_b = options.fixed) !== null && _b !== void 0 ? _b : false;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this._position = 0;
|
|
16
|
+
this._fixed = false;
|
|
17
|
+
}
|
|
11
18
|
this._isShown = true;
|
|
12
19
|
}
|
|
13
20
|
Object.defineProperty(DChartAxisGuideSimple.prototype, "shape", {
|
|
@@ -76,42 +83,63 @@ var DChartAxisGuideSimple = /** @class */ (function () {
|
|
|
76
83
|
var plotAreaY = plotAreaBounds.y;
|
|
77
84
|
var plotAreaWidth = plotAreaBounds.width;
|
|
78
85
|
var plotAreaHeight = plotAreaBounds.height;
|
|
79
|
-
var transform = plotArea.container.transform.localTransform;
|
|
80
86
|
var offset = axis.padding * index;
|
|
81
87
|
switch (axis.position) {
|
|
82
88
|
case DChartAxisPosition.TOP:
|
|
83
89
|
case DChartAxisPosition.BOTTOM:
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
var work = this._work;
|
|
87
|
-
work.set(coordinateX.transform.map(coordinateX.map(this._position)), 0);
|
|
88
|
-
transform.apply(work, work);
|
|
89
|
-
var x = work.x;
|
|
90
|
-
shape.update(axis.position, x, plotAreaY + plotAreaHeight * 0.5, this._isShown && plotAreaX <= x && x <= plotAreaX + plotAreaWidth, plotAreaWidth, plotAreaHeight, offset);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
shape.update(axis.position, plotAreaX, plotAreaY + plotAreaHeight * 0.5, false, plotAreaWidth, plotAreaHeight, offset);
|
|
94
|
-
}
|
|
90
|
+
var x = this.getPositionX(axis, plotArea, plotAreaX);
|
|
91
|
+
shape.update(axis.position, x, plotAreaY + plotAreaHeight * 0.5, this._isShown && plotAreaX <= x && x <= plotAreaX + plotAreaWidth, plotAreaWidth, plotAreaHeight, offset);
|
|
95
92
|
break;
|
|
96
93
|
case DChartAxisPosition.LEFT:
|
|
97
94
|
case DChartAxisPosition.RIGHT:
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
var work = this._work;
|
|
101
|
-
work.set(0, coordinateY.transform.map(coordinateY.map(this._position)));
|
|
102
|
-
transform.apply(work, work);
|
|
103
|
-
var y = work.y;
|
|
104
|
-
shape.update(axis.position, plotAreaX + plotAreaWidth * 0.5, y, this._isShown && plotAreaY <= y && y <= plotAreaY + plotAreaHeight, plotAreaWidth, plotAreaHeight, offset);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
shape.update(axis.position, plotAreaX + plotAreaWidth * 0.5, plotAreaY, false, plotAreaWidth, plotAreaHeight, offset);
|
|
108
|
-
}
|
|
95
|
+
var y = this.getPositionY(axis, plotArea, plotAreaY);
|
|
96
|
+
shape.update(axis.position, plotAreaX + plotAreaWidth * 0.5, y, this._isShown && plotAreaY <= y && y <= plotAreaY + plotAreaHeight, plotAreaWidth, plotAreaHeight, offset);
|
|
109
97
|
break;
|
|
110
98
|
}
|
|
111
99
|
return true;
|
|
112
100
|
}
|
|
113
101
|
return false;
|
|
114
102
|
};
|
|
103
|
+
DChartAxisGuideSimple.prototype.getPositionX = function (axis, plotArea, plotAreaX) {
|
|
104
|
+
var _a, _b;
|
|
105
|
+
if (this._fixed) {
|
|
106
|
+
var work = ((_a = DChartAxisGuideSimple.WORK_REGION) !== null && _a !== void 0 ? _a : (DChartAxisGuideSimple.WORK_REGION = new DChartRegionImpl(0, 0)));
|
|
107
|
+
plotArea.getPixelDomain(work);
|
|
108
|
+
return work.from + this._position * (work.to - work.from);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
var coordinateX = plotArea.coordinate.x.get(axis.coordinate);
|
|
112
|
+
if (coordinateX) {
|
|
113
|
+
var work = ((_b = DChartAxisGuideSimple.WORK_POINT) !== null && _b !== void 0 ? _b : (DChartAxisGuideSimple.WORK_POINT = new Point()));
|
|
114
|
+
work.set(coordinateX.transform.map(coordinateX.map(this._position)), 0);
|
|
115
|
+
plotArea.container.transform.localTransform.apply(work, work);
|
|
116
|
+
return work.x;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
return plotAreaX - 100;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
DChartAxisGuideSimple.prototype.getPositionY = function (axis, plotArea, plotAreaY) {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
if (this._fixed) {
|
|
126
|
+
var work = ((_a = DChartAxisGuideSimple.WORK_REGION) !== null && _a !== void 0 ? _a : (DChartAxisGuideSimple.WORK_REGION = new DChartRegionImpl(0, 0)));
|
|
127
|
+
plotArea.getPixelRange(work);
|
|
128
|
+
return work.to + (1 - this._position) * (work.from - work.to);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
var coordinateY = plotArea.coordinate.y.get(axis.coordinate);
|
|
132
|
+
if (coordinateY) {
|
|
133
|
+
var work = ((_b = DChartAxisGuideSimple.WORK_POINT) !== null && _b !== void 0 ? _b : (DChartAxisGuideSimple.WORK_POINT = new Point()));
|
|
134
|
+
work.set(0, coordinateY.transform.map(coordinateY.map(this._position)));
|
|
135
|
+
plotArea.container.transform.localTransform.apply(work, work);
|
|
136
|
+
return work.y;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return plotAreaY - 100;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
115
143
|
DChartAxisGuideSimple.prototype.destroy = function () {
|
|
116
144
|
var shape = this._shape;
|
|
117
145
|
if (shape != null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-chart-axis-guide-simple.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-guide-simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAM7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAMxF;IAUC,+BAAY,OAAsC;;QACjD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,sBAAI,wCAAK;aAAT;YACC,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YACzB,IAAI,MAAM,IAAI,IAAI,EAAE;gBACnB,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;aACrB;YACD,OAAO,MAAM,CAAC;QACf,CAAC;;;OAAA;IAES,wCAAQ,GAAlB;QACC,OAAO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EACL,aAAa,EACb,cAAc,EACd,MAAM,CACN,CAAC;qBACF;oBACD,MAAM;aACP;YACD,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,uCAAO,GAAP;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,KAAK,IAAI,IAAI,EAAE;YAClB,KAAK,CAAC,OAAO,EAAE,CAAC;SAChB;QACD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC7B,CAAC;IACF,4BAAC;AAAD,CAAC,AAjKD,IAiKC","sourcesContent":["import { Point } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { DChartAxisGuide } from \"./d-chart-axis-guide\";\nimport { DChartAxisPosition } from \"./d-chart-axis-position\";\nimport { DChartAxis } from \"./d-chart-axis\";\nimport {\n\tDChartAxisGuideSimpleShape,\n\tDChartAxisGuideSimpleShapeOptions\n} from \"./d-chart-axis-guide-simple-shape\";\nimport { DChartAxisGuideSimpleShapeImpl } from \"./d-chart-axis-guide-simple-shape-impl\";\n\nexport interface DChartAxisGuideSimpleOptions extends DChartAxisGuideSimpleShapeOptions {\n\tposition?: number;\n}\n\nexport class DChartAxisGuideSimple<CHART extends DBase = DBase> implements DChartAxisGuide<CHART> {\n\tprotected _axis?: DChartAxis<CHART>;\n\tprotected _options?: DChartAxisGuideSimpleOptions;\n\tprotected _container?: DChartAxisContainer<CHART>;\n\tprotected _index: number;\n\tprotected _shape?: DChartAxisGuideSimpleShape;\n\tprotected _position: number;\n\tprotected _work: Point;\n\tprotected _isShown: boolean;\n\n\tconstructor(options?: DChartAxisGuideSimpleOptions) {\n\t\tthis._options = options;\n\t\tthis._index = 0;\n\t\tthis._position = options?.position ?? 0;\n\t\tthis._work = new Point();\n\t\tthis._isShown = true;\n\t}\n\n\tget shape(): DChartAxisGuideSimpleShape {\n\t\tlet result = this._shape;\n\t\tif (result == null) {\n\t\t\tresult = this.newShape();\n\t\t\tthis._shape = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newShape(): DChartAxisGuideSimpleShape {\n\t\treturn new DChartAxisGuideSimpleShapeImpl(this._options);\n\t}\n\n\tget position(): number {\n\t\treturn this._position;\n\t}\n\n\tset position(position: number) {\n\t\tthis._position = position;\n\t}\n\n\tshow(): this {\n\t\tthis._isShown = true;\n\t\treturn this;\n\t}\n\n\tisShown(): boolean {\n\t\treturn this._isShown;\n\t}\n\n\thide(): this {\n\t\tthis._isShown = false;\n\t\treturn this;\n\t}\n\n\tisHidden(): boolean {\n\t\treturn !this._isShown;\n\t}\n\n\tbind(container: DChartAxisContainer<CHART>, index: number, axis: DChartAxis<CHART>): void {\n\t\tthis._container = container;\n\t\tthis._index = index;\n\t\tthis._axis = axis;\n\t\tthis.shape.bind(container, index, axis);\n\t}\n\n\tunbind(): void {\n\t\tconst shape = this._shape;\n\t\tif (shape != null) {\n\t\t\tshape.unbind();\n\t\t}\n\t\tthis._axis = undefined;\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n\n\tupdate(): boolean {\n\t\tconst container = this._container;\n\t\tconst index = this._index;\n\t\tconst shape = this._shape;\n\t\tconst axis = this._axis;\n\t\tif (shape != null && container != null && axis != null) {\n\t\t\tconst plotArea = container.plotArea;\n\t\t\tconst plotAreaBounds = plotArea.getAxisBounds(axis.position);\n\t\t\tconst plotAreaX = plotAreaBounds.x;\n\t\t\tconst plotAreaY = plotAreaBounds.y;\n\t\t\tconst plotAreaWidth = plotAreaBounds.width;\n\t\t\tconst plotAreaHeight = plotAreaBounds.height;\n\t\t\tconst transform = plotArea.container.transform.localTransform;\n\t\t\tconst offset = axis.padding * index;\n\t\t\tswitch (axis.position) {\n\t\t\t\tcase DChartAxisPosition.TOP:\n\t\t\t\tcase DChartAxisPosition.BOTTOM:\n\t\t\t\t\tconst coordinateX = plotArea.coordinate.x.get(axis.coordinate);\n\t\t\t\t\tif (coordinateX) {\n\t\t\t\t\t\tconst work = this._work;\n\t\t\t\t\t\twork.set(coordinateX.transform.map(coordinateX.map(this._position)), 0);\n\t\t\t\t\t\ttransform.apply(work, work);\n\t\t\t\t\t\tconst x = work.x;\n\t\t\t\t\t\tshape.update(\n\t\t\t\t\t\t\taxis.position,\n\t\t\t\t\t\t\tx,\n\t\t\t\t\t\t\tplotAreaY + plotAreaHeight * 0.5,\n\t\t\t\t\t\t\tthis._isShown && plotAreaX <= x && x <= plotAreaX + plotAreaWidth,\n\t\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\t\tplotAreaHeight,\n\t\t\t\t\t\t\toffset\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshape.update(\n\t\t\t\t\t\t\taxis.position,\n\t\t\t\t\t\t\tplotAreaX,\n\t\t\t\t\t\t\tplotAreaY + plotAreaHeight * 0.5,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\t\tplotAreaHeight,\n\t\t\t\t\t\t\toffset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.LEFT:\n\t\t\t\tcase DChartAxisPosition.RIGHT:\n\t\t\t\t\tconst coordinateY = plotArea.coordinate.y.get(axis.coordinate);\n\t\t\t\t\tif (coordinateY) {\n\t\t\t\t\t\tconst work = this._work;\n\t\t\t\t\t\twork.set(0, coordinateY.transform.map(coordinateY.map(this._position)));\n\t\t\t\t\t\ttransform.apply(work, work);\n\t\t\t\t\t\tconst y = work.y;\n\t\t\t\t\t\tshape.update(\n\t\t\t\t\t\t\taxis.position,\n\t\t\t\t\t\t\tplotAreaX + plotAreaWidth * 0.5,\n\t\t\t\t\t\t\ty,\n\t\t\t\t\t\t\tthis._isShown && plotAreaY <= y && y <= plotAreaY + plotAreaHeight,\n\t\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\t\tplotAreaHeight,\n\t\t\t\t\t\t\toffset\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshape.update(\n\t\t\t\t\t\t\taxis.position,\n\t\t\t\t\t\t\tplotAreaX + plotAreaWidth * 0.5,\n\t\t\t\t\t\t\tplotAreaY,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\t\tplotAreaHeight,\n\t\t\t\t\t\t\toffset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tdestroy(): void {\n\t\tconst shape = this._shape;\n\t\tif (shape != null) {\n\t\t\tshape.destroy();\n\t\t}\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-chart-axis-guide-simple.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-chart-axis-guide-simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAM7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD;IAaC,+BAAY,OAAsC;;QACjD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,KAAK,mCAAI,KAAK,CAAC;SACrC;aAAM;YACN,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC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AAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBACxE,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC9D,OAAO,IAAI,CAAC,CAAC,CAAC;aACd;iBAAM;gBACN,OAAO,SAAS,GAAG,GAAG,CAAC;aACvB;SACD;IACF,CAAC;IAED,uCAAO,GAAP;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,KAAK,IAAI,IAAI,EAAE;YAClB,KAAK,CAAC,OAAO,EAAE,CAAC;SAChB;QACD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC7B,CAAC;IACF,4BAAC;AAAD,CAAC,AApLD,IAoLC","sourcesContent":["import { Point } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { DChartAxisContainer } from \"./d-chart-axis-container\";\nimport { DChartAxisGuide } from \"./d-chart-axis-guide\";\nimport { DChartAxisPosition } from \"./d-chart-axis-position\";\nimport { DChartAxis } from \"./d-chart-axis\";\nimport {\n\tDChartAxisGuideSimpleShape,\n\tDChartAxisGuideSimpleShapeOptions\n} from \"./d-chart-axis-guide-simple-shape\";\nimport { DChartAxisGuideSimpleShapeImpl } from \"./d-chart-axis-guide-simple-shape-impl\";\nimport { DChartPlotArea, DChartPlotAreaLike } from \"./d-chart-plot-area\";\nimport { DChartRegionImpl } from \"./d-chart-region-impl\";\nimport { DChartRegion } from \"./d-chart-region\";\n\nexport interface DChartAxisGuideSimpleOptions extends DChartAxisGuideSimpleShapeOptions {\n\tposition?: number;\n\tfixed?: boolean;\n}\n\nexport class DChartAxisGuideSimple<CHART extends DBase = DBase> implements DChartAxisGuide<CHART> {\n\tprotected static WORK_POINT?: Point;\n\tprotected static WORK_REGION?: DChartRegion;\n\n\tprotected _axis?: DChartAxis<CHART>;\n\tprotected _options?: DChartAxisGuideSimpleOptions;\n\tprotected _container?: DChartAxisContainer<CHART>;\n\tprotected _index: number;\n\tprotected _shape?: DChartAxisGuideSimpleShape;\n\tprotected _position: number;\n\tprotected _fixed: boolean;\n\tprotected _isShown: boolean;\n\n\tconstructor(options?: DChartAxisGuideSimpleOptions) {\n\t\tthis._options = options;\n\t\tthis._index = 0;\n\t\tif (options != null) {\n\t\t\tthis._position = options.position ?? 0;\n\t\t\tthis._fixed = options.fixed ?? false;\n\t\t} else {\n\t\t\tthis._position = 0;\n\t\t\tthis._fixed = false;\n\t\t}\n\t\tthis._isShown = true;\n\t}\n\n\tget shape(): DChartAxisGuideSimpleShape {\n\t\tlet result = this._shape;\n\t\tif (result == null) {\n\t\t\tresult = this.newShape();\n\t\t\tthis._shape = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newShape(): DChartAxisGuideSimpleShape {\n\t\treturn new DChartAxisGuideSimpleShapeImpl(this._options);\n\t}\n\n\tget position(): number {\n\t\treturn this._position;\n\t}\n\n\tset position(position: number) {\n\t\tthis._position = position;\n\t}\n\n\tshow(): this {\n\t\tthis._isShown = true;\n\t\treturn this;\n\t}\n\n\tisShown(): boolean {\n\t\treturn this._isShown;\n\t}\n\n\thide(): this {\n\t\tthis._isShown = false;\n\t\treturn this;\n\t}\n\n\tisHidden(): boolean {\n\t\treturn !this._isShown;\n\t}\n\n\tbind(container: DChartAxisContainer<CHART>, index: number, axis: DChartAxis<CHART>): void {\n\t\tthis._container = container;\n\t\tthis._index = index;\n\t\tthis._axis = axis;\n\t\tthis.shape.bind(container, index, axis);\n\t}\n\n\tunbind(): void {\n\t\tconst shape = this._shape;\n\t\tif (shape != null) {\n\t\t\tshape.unbind();\n\t\t}\n\t\tthis._axis = undefined;\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n\n\tupdate(): boolean {\n\t\tconst container = this._container;\n\t\tconst index = this._index;\n\t\tconst shape = this._shape;\n\t\tconst axis = this._axis;\n\t\tif (shape != null && container != null && axis != null) {\n\t\t\tconst plotArea = container.plotArea;\n\t\t\tconst plotAreaBounds = plotArea.getAxisBounds(axis.position);\n\t\t\tconst plotAreaX = plotAreaBounds.x;\n\t\t\tconst plotAreaY = plotAreaBounds.y;\n\t\t\tconst plotAreaWidth = plotAreaBounds.width;\n\t\t\tconst plotAreaHeight = plotAreaBounds.height;\n\t\t\tconst offset = axis.padding * index;\n\t\t\tswitch (axis.position) {\n\t\t\t\tcase DChartAxisPosition.TOP:\n\t\t\t\tcase DChartAxisPosition.BOTTOM:\n\t\t\t\t\tconst x = this.getPositionX(axis, plotArea, plotAreaX);\n\t\t\t\t\tshape.update(\n\t\t\t\t\t\taxis.position,\n\t\t\t\t\t\tx,\n\t\t\t\t\t\tplotAreaY + plotAreaHeight * 0.5,\n\t\t\t\t\t\tthis._isShown && plotAreaX <= x && x <= plotAreaX + plotAreaWidth,\n\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\tplotAreaHeight,\n\t\t\t\t\t\toffset\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DChartAxisPosition.LEFT:\n\t\t\t\tcase DChartAxisPosition.RIGHT:\n\t\t\t\t\tconst y = this.getPositionY(axis, plotArea, plotAreaY);\n\t\t\t\t\tshape.update(\n\t\t\t\t\t\taxis.position,\n\t\t\t\t\t\tplotAreaX + plotAreaWidth * 0.5,\n\t\t\t\t\t\ty,\n\t\t\t\t\t\tthis._isShown && plotAreaY <= y && y <= plotAreaY + plotAreaHeight,\n\t\t\t\t\t\tplotAreaWidth,\n\t\t\t\t\t\tplotAreaHeight,\n\t\t\t\t\t\toffset\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected getPositionX(\n\t\taxis: DChartAxis<CHART>,\n\t\tplotArea: DChartPlotArea<CHART> | DChartPlotAreaLike<CHART>,\n\t\tplotAreaX: number\n\t): number {\n\t\tif (this._fixed) {\n\t\t\tconst work = (DChartAxisGuideSimple.WORK_REGION ??= new DChartRegionImpl(0, 0));\n\t\t\tplotArea.getPixelDomain(work);\n\t\t\treturn work.from + this._position * (work.to - work.from);\n\t\t} else {\n\t\t\tconst coordinateX = plotArea.coordinate.x.get(axis.coordinate);\n\t\t\tif (coordinateX) {\n\t\t\t\tconst work = (DChartAxisGuideSimple.WORK_POINT ??= new Point());\n\t\t\t\twork.set(coordinateX.transform.map(coordinateX.map(this._position)), 0);\n\t\t\t\tplotArea.container.transform.localTransform.apply(work, work);\n\t\t\t\treturn work.x;\n\t\t\t} else {\n\t\t\t\treturn plotAreaX - 100;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getPositionY(\n\t\taxis: DChartAxis<CHART>,\n\t\tplotArea: DChartPlotArea<CHART> | DChartPlotAreaLike<CHART>,\n\t\tplotAreaY: number\n\t): number {\n\t\tif (this._fixed) {\n\t\t\tconst work = (DChartAxisGuideSimple.WORK_REGION ??= new DChartRegionImpl(0, 0));\n\t\t\tplotArea.getPixelRange(work);\n\t\t\treturn work.to + (1 - this._position) * (work.from - work.to);\n\t\t} else {\n\t\t\tconst coordinateY = plotArea.coordinate.y.get(axis.coordinate);\n\t\t\tif (coordinateY) {\n\t\t\t\tconst work = (DChartAxisGuideSimple.WORK_POINT ??= new Point());\n\t\t\t\twork.set(0, coordinateY.transform.map(coordinateY.map(this._position)));\n\t\t\t\tplotArea.container.transform.localTransform.apply(work, work);\n\t\t\t\treturn work.y;\n\t\t\t} else {\n\t\t\t\treturn plotAreaY - 100;\n\t\t\t}\n\t\t}\n\t}\n\n\tdestroy(): void {\n\t\tconst shape = this._shape;\n\t\tif (shape != null) {\n\t\t\tshape.destroy();\n\t\t}\n\t\tthis._index = 0;\n\t\tthis._container = undefined;\n\t}\n}\n"]}
|
|
@@ -8,47 +8,61 @@ import { DDynamicTextMeasure } from "./d-dynamic-text-measure";
|
|
|
8
8
|
var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
9
9
|
__extends(DDynamicTextGeometry, _super);
|
|
10
10
|
function DDynamicTextGeometry() {
|
|
11
|
-
var
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
var _this = _super.call(this, ((_a = DDynamicTextGeometry.VERTICES) !== null && _a !== void 0 ? _a : (DDynamicTextGeometry.VERTICES = new Float32Array(0))), ((_b = DDynamicTextGeometry.UVS) !== null && _b !== void 0 ? _b : (DDynamicTextGeometry.UVS = new Float32Array(0))), ((_c = DDynamicTextGeometry.INDICES) !== null && _c !== void 0 ? _c : (DDynamicTextGeometry.INDICES = new Uint16Array(0)))) || this;
|
|
12
13
|
_this.width = 0;
|
|
13
14
|
_this.height = 0;
|
|
14
15
|
_this.scale = 1;
|
|
15
16
|
_this.scaled = false;
|
|
16
17
|
_this.clipped = false;
|
|
18
|
+
_this.vertexBuffer = _this.getBuffer("aVertexPosition");
|
|
19
|
+
_this.vertices = DDynamicTextGeometry.VERTICES;
|
|
20
|
+
_this.uvBuffer = _this.getBuffer("aTextureCoord");
|
|
21
|
+
_this.uvs = DDynamicTextGeometry.UVS;
|
|
22
|
+
_this.indexBuffer = _this.getIndex();
|
|
23
|
+
_this.indices = DDynamicTextGeometry.INDICES;
|
|
24
|
+
_this.nchars = 0;
|
|
17
25
|
return _this;
|
|
18
26
|
}
|
|
19
27
|
DDynamicTextGeometry.prototype.update = function (text, atlas, modifier) {
|
|
20
|
-
var vertexBuffer = this.getBuffer("aVertexPosition");
|
|
21
|
-
var uvBuffer = this.getBuffer("aTextureCoord");
|
|
22
|
-
var indexBuffer = this.getIndex();
|
|
23
28
|
var result = DDynamicTextMeasure.measure(text, atlas, modifier);
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
var resultCount = result.count;
|
|
30
|
+
var nchars = ((resultCount >> 3) + (resultCount & 0x7 ? 1 : 0)) << 3;
|
|
31
|
+
if (this.nchars < nchars) {
|
|
32
|
+
this.nchars = nchars;
|
|
33
|
+
var nvertex = nchars << 3;
|
|
34
|
+
this.vertices = new Float32Array(nvertex);
|
|
35
|
+
this.uvs = new Float32Array(nvertex);
|
|
36
|
+
this.vertexBuffer.data = this.vertices;
|
|
37
|
+
this.uvBuffer.data = this.uvs;
|
|
38
|
+
var nindex = (nchars << 2) + (nchars << 1);
|
|
39
|
+
this.indices = new Uint16Array(nindex);
|
|
40
|
+
this.indexBuffer.data = this.indices;
|
|
41
|
+
this.initIndices(this.indices);
|
|
42
|
+
this.indexBuffer.update();
|
|
29
43
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
else {
|
|
45
|
+
nchars = this.nchars;
|
|
46
|
+
}
|
|
47
|
+
if (nchars <= 0) {
|
|
48
|
+
return;
|
|
33
49
|
}
|
|
34
|
-
var vertices =
|
|
35
|
-
var uvs =
|
|
36
|
-
var indices = indexBuffer.data;
|
|
50
|
+
var vertices = this.vertices;
|
|
51
|
+
var uvs = this.uvs;
|
|
37
52
|
if (atlas != null) {
|
|
38
|
-
var count = result.count;
|
|
39
53
|
var characters = result.characters;
|
|
40
54
|
var scale = result.scale;
|
|
41
|
-
|
|
55
|
+
var fw = 1 / atlas.width;
|
|
56
|
+
var fh = 1 / atlas.height;
|
|
57
|
+
for (var i = 0; i < resultCount; ++i) {
|
|
42
58
|
var character = characters[i];
|
|
43
59
|
var cx = character.x;
|
|
44
60
|
var cy = character.y;
|
|
45
61
|
var cc = character.character;
|
|
46
|
-
|
|
47
|
-
var h = atlas.height;
|
|
48
|
-
this.writeCharacter(vertices, uvs, indices, i, cx, cy, scale, cc, w, h);
|
|
62
|
+
this.fill(vertices, uvs, i, cx, cy, scale, cc, fw, fh);
|
|
49
63
|
}
|
|
50
|
-
for (var i =
|
|
51
|
-
this.
|
|
64
|
+
for (var i = resultCount; i < nchars; ++i) {
|
|
65
|
+
this.fillBlank(vertices, uvs, i);
|
|
52
66
|
}
|
|
53
67
|
this.width = result.width * scale;
|
|
54
68
|
this.height = result.height * scale;
|
|
@@ -57,8 +71,8 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
57
71
|
this.clipped = result.clipped;
|
|
58
72
|
}
|
|
59
73
|
else {
|
|
60
|
-
for (var i = 0
|
|
61
|
-
this.
|
|
74
|
+
for (var i = 0; i < nchars; ++i) {
|
|
75
|
+
this.fillBlank(vertices, uvs, i);
|
|
62
76
|
}
|
|
63
77
|
this.width = 0;
|
|
64
78
|
this.height = 0;
|
|
@@ -66,11 +80,10 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
66
80
|
this.scaled = false;
|
|
67
81
|
this.clipped = false;
|
|
68
82
|
}
|
|
69
|
-
vertexBuffer.update();
|
|
70
|
-
uvBuffer.update();
|
|
71
|
-
indexBuffer.update();
|
|
83
|
+
this.vertexBuffer.update();
|
|
84
|
+
this.uvBuffer.update();
|
|
72
85
|
};
|
|
73
|
-
DDynamicTextGeometry.prototype.
|
|
86
|
+
DDynamicTextGeometry.prototype.fill = function (vertices, uvs, index, x, y, scale, character, fw, fh) {
|
|
74
87
|
var cx = character.x;
|
|
75
88
|
var cy = character.y;
|
|
76
89
|
var cw = character.width;
|
|
@@ -89,10 +102,10 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
89
102
|
vertices[iv + 5] = y1;
|
|
90
103
|
vertices[iv + 6] = x0;
|
|
91
104
|
vertices[iv + 7] = y1;
|
|
92
|
-
var u0 = cx
|
|
93
|
-
var v0 = cy
|
|
94
|
-
var u1 = (cx + cw)
|
|
95
|
-
var v1 = (cy + ch)
|
|
105
|
+
var u0 = cx * fw;
|
|
106
|
+
var v0 = cy * fh;
|
|
107
|
+
var u1 = (cx + cw) * fw;
|
|
108
|
+
var v1 = (cy + ch) * fh;
|
|
96
109
|
uvs[iv + 0] = u0;
|
|
97
110
|
uvs[iv + 1] = v0;
|
|
98
111
|
uvs[iv + 2] = u1;
|
|
@@ -101,16 +114,8 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
101
114
|
uvs[iv + 5] = v1;
|
|
102
115
|
uvs[iv + 6] = u0;
|
|
103
116
|
uvs[iv + 7] = v1;
|
|
104
|
-
var ii = index * 6;
|
|
105
|
-
var vo = index << 2;
|
|
106
|
-
indices[ii + 0] = vo + 0;
|
|
107
|
-
indices[ii + 1] = vo + 1;
|
|
108
|
-
indices[ii + 2] = vo + 3;
|
|
109
|
-
indices[ii + 3] = vo + 1;
|
|
110
|
-
indices[ii + 4] = vo + 2;
|
|
111
|
-
indices[ii + 5] = vo + 3;
|
|
112
117
|
};
|
|
113
|
-
DDynamicTextGeometry.prototype.
|
|
118
|
+
DDynamicTextGeometry.prototype.fillBlank = function (vertices, uvs, index) {
|
|
114
119
|
var iv = index << 3;
|
|
115
120
|
vertices[iv + 0] = 0;
|
|
116
121
|
vertices[iv + 1] = 0;
|
|
@@ -128,14 +133,16 @@ var DDynamicTextGeometry = /** @class */ (function (_super) {
|
|
|
128
133
|
uvs[iv + 5] = 0;
|
|
129
134
|
uvs[iv + 6] = 0;
|
|
130
135
|
uvs[iv + 7] = 0;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
};
|
|
137
|
+
DDynamicTextGeometry.prototype.initIndices = function (indices) {
|
|
138
|
+
for (var iv = 0, ivmax = this.nchars << 2, ii = 0; iv < ivmax; iv += 4, ii += 6) {
|
|
139
|
+
indices[ii] = iv;
|
|
140
|
+
indices[ii + 1] = iv + 1;
|
|
141
|
+
indices[ii + 2] = iv + 3;
|
|
142
|
+
indices[ii + 3] = iv + 1;
|
|
143
|
+
indices[ii + 4] = iv + 2;
|
|
144
|
+
indices[ii + 5] = iv + 3;
|
|
145
|
+
}
|
|
139
146
|
};
|
|
140
147
|
return DDynamicTextGeometry;
|
|
141
148
|
}(MeshGeometry));
|