@vyr/echarts 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/build/actor/EchartActor.d.ts +5 -58
  2. package/build/actor/EchartActor.js +16 -125
  3. package/build/actor/EchartActor.js.map +1 -1
  4. package/build/descriptor/Echart.d.ts +18 -0
  5. package/build/descriptor/Echart.js +22 -0
  6. package/build/descriptor/Echart.js.map +1 -0
  7. package/build/descriptor/index.d.ts +1 -5
  8. package/build/descriptor/index.js +1 -5
  9. package/build/descriptor/index.js.map +1 -1
  10. package/build/interpreter/EchartInterpreter.d.ts +5 -6
  11. package/build/interpreter/EchartInterpreter.js +4 -6
  12. package/build/interpreter/EchartInterpreter.js.map +1 -1
  13. package/build/interpreter/index.d.ts +0 -4
  14. package/build/interpreter/index.js +0 -4
  15. package/build/interpreter/index.js.map +1 -1
  16. package/build/locale/Language.d.ts +1 -2
  17. package/build/locale/Language.js +1 -2
  18. package/build/locale/Language.js.map +1 -1
  19. package/build/locale/LanguageProvider.d.ts +2 -3
  20. package/build/locale/LanguageProvider.js +1 -2
  21. package/build/locale/LanguageProvider.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/actor/EchartActor.ts +45 -171
  24. package/src/descriptor/Echart.ts +31 -0
  25. package/src/descriptor/index.ts +1 -5
  26. package/src/interpreter/EchartInterpreter.ts +8 -13
  27. package/src/interpreter/index.ts +1 -5
  28. package/src/locale/Language.ts +1 -5
  29. package/src/locale/LanguageProvider.ts +2 -7
  30. package/build/descriptor/BarServiceEchartDescriptor.d.ts +0 -13
  31. package/build/descriptor/BarServiceEchartDescriptor.js +0 -23
  32. package/build/descriptor/BarServiceEchartDescriptor.js.map +0 -1
  33. package/build/descriptor/EchartDescriptor.d.ts +0 -60
  34. package/build/descriptor/EchartDescriptor.js +0 -56
  35. package/build/descriptor/EchartDescriptor.js.map +0 -1
  36. package/build/descriptor/LineServiceEchartDescriptor.d.ts +0 -15
  37. package/build/descriptor/LineServiceEchartDescriptor.js +0 -20
  38. package/build/descriptor/LineServiceEchartDescriptor.js.map +0 -1
  39. package/build/descriptor/PieServiceEchartDescriptor.d.ts +0 -25
  40. package/build/descriptor/PieServiceEchartDescriptor.js +0 -31
  41. package/build/descriptor/PieServiceEchartDescriptor.js.map +0 -1
  42. package/build/descriptor/ServiceEchartDescriptor.d.ts +0 -16
  43. package/build/descriptor/ServiceEchartDescriptor.js +0 -23
  44. package/build/descriptor/ServiceEchartDescriptor.js.map +0 -1
  45. package/build/interpreter/BarServiceEchartInterpreter.d.ts +0 -62
  46. package/build/interpreter/BarServiceEchartInterpreter.js +0 -28
  47. package/build/interpreter/BarServiceEchartInterpreter.js.map +0 -1
  48. package/build/interpreter/LineServiceEchartInterpreter.d.ts +0 -59
  49. package/build/interpreter/LineServiceEchartInterpreter.js +0 -25
  50. package/build/interpreter/LineServiceEchartInterpreter.js.map +0 -1
  51. package/build/interpreter/PieServiceEchartInterpreter.d.ts +0 -66
  52. package/build/interpreter/PieServiceEchartInterpreter.js +0 -32
  53. package/build/interpreter/PieServiceEchartInterpreter.js.map +0 -1
  54. package/build/interpreter/ServiceEchartInterpreter.d.ts +0 -39
  55. package/build/interpreter/ServiceEchartInterpreter.js +0 -79
  56. package/build/interpreter/ServiceEchartInterpreter.js.map +0 -1
  57. package/src/descriptor/BarServiceEchartDescriptor.ts +0 -31
  58. package/src/descriptor/EchartDescriptor.ts +0 -106
  59. package/src/descriptor/LineServiceEchartDescriptor.ts +0 -30
  60. package/src/descriptor/PieServiceEchartDescriptor.ts +0 -47
  61. package/src/descriptor/ServiceEchartDescriptor.ts +0 -39
  62. package/src/interpreter/BarServiceEchartInterpreter.ts +0 -33
  63. package/src/interpreter/LineServiceEchartInterpreter.ts +0 -30
  64. package/src/interpreter/PieServiceEchartInterpreter.ts +0 -37
  65. package/src/interpreter/ServiceEchartInterpreter.ts +0 -90
@@ -1,23 +0,0 @@
1
- import { DefaultStyleColor, Descriptor } from '@vyr/engine';
2
- class ServiceEchartDescriptor extends Descriptor {
3
- static type = 'ServiceEchart';
4
- static getDefaultItemStyle() {
5
- const itemStyle = {
6
- color: new DefaultStyleColor({ value: '#5470c6' }),
7
- borderColor: new DefaultStyleColor({ opacity: 0 }),
8
- borderWidth: 0,
9
- borderType: 'solid',
10
- borderRadius: 0
11
- };
12
- return itemStyle;
13
- }
14
- echart;
15
- modelValue;
16
- constructor(descriptor = {}) {
17
- super(descriptor);
18
- this.echart = descriptor.echart ?? '';
19
- this.modelValue = descriptor.modelValue ?? '';
20
- }
21
- }
22
- export { ServiceEchartDescriptor };
23
- //# sourceMappingURL=ServiceEchartDescriptor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ServiceEchartDescriptor.js","sourceRoot":"","sources":["../../src/descriptor/ServiceEchartDescriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAqC,MAAM,aAAa,CAAA;AAU9F,MAAM,uBAAwB,SAAQ,UAAU;IAC5C,MAAM,CAAC,IAAI,GAAG,eAAe,CAAA;IAE7B,MAAM,CAAC,mBAAmB;QACtB,MAAM,SAAS,GAAoB;YAC/B,KAAK,EAAE,IAAI,iBAAiB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;YAClD,WAAW,EAAE,IAAI,iBAAiB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;YAClD,WAAW,EAAE,CAAC;YACd,UAAU,EAAE,OAAO;YACnB,YAAY,EAAE,CAAC;SAClB,CAAA;QAED,OAAO,SAAS,CAAA;IACpB,CAAC;IAED,MAAM,CAAQ;IACd,UAAU,CAAQ;IAElB,YAAY,aAAsE,EAAE;QAChF,KAAK,CAAC,UAAU,CAAC,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,EAAE,CAAA;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,EAAE,CAAA;IACjD,CAAC;;AAGL,OAAO,EAEH,uBAAuB,EAC1B,CAAA"}
@@ -1,62 +0,0 @@
1
- import { BarServiceEchartDescriptor } from "../descriptor";
2
- import { ServiceEchartInterpreter } from "./ServiceEchartInterpreter";
3
- declare class BarServiceEchartInterpreter extends ServiceEchartInterpreter {
4
- static type: string;
5
- getService(descriptor: BarServiceEchartDescriptor): {
6
- barWidth: string;
7
- barMaxWidth: string;
8
- label: {
9
- show: boolean;
10
- color: string;
11
- position: string;
12
- };
13
- itemStyle: {
14
- color: string | {
15
- type: "linear";
16
- x: number;
17
- y: number;
18
- x2: number;
19
- y2: number;
20
- colorStops: {
21
- offset: number;
22
- color: string;
23
- }[];
24
- } | {
25
- type: "radial";
26
- r: number;
27
- x: number;
28
- y: number;
29
- colorStops: {
30
- offset: number;
31
- color: string;
32
- }[];
33
- };
34
- borderType: string;
35
- borderWidth: number;
36
- borderColor: string | {
37
- type: "linear";
38
- x: number;
39
- y: number;
40
- x2: number;
41
- y2: number;
42
- colorStops: {
43
- offset: number;
44
- color: string;
45
- }[];
46
- } | {
47
- type: "radial";
48
- r: number;
49
- x: number;
50
- y: number;
51
- colorStops: {
52
- offset: number;
53
- color: string;
54
- }[];
55
- };
56
- borderRadius: number;
57
- };
58
- type: string;
59
- name: string;
60
- };
61
- }
62
- export { BarServiceEchartInterpreter };
@@ -1,28 +0,0 @@
1
- import { BarServiceEchartDescriptor } from "../descriptor";
2
- import { ServiceEchartInterpreter } from "./ServiceEchartInterpreter";
3
- class BarServiceEchartInterpreter extends ServiceEchartInterpreter {
4
- static type = BarServiceEchartDescriptor.type;
5
- getService(descriptor) {
6
- const service = super.getService(descriptor);
7
- return {
8
- ...service,
9
- barWidth: descriptor.barWidth,
10
- barMaxWidth: descriptor.barMaxWidth,
11
- label: {
12
- show: descriptor.labelShow,
13
- color: descriptor.labelColor,
14
- position: descriptor.labelPosition,
15
- },
16
- itemStyle: {
17
- color: this.getStyleColor(descriptor.itemStyle.color),
18
- borderType: descriptor.itemStyle.borderType,
19
- borderWidth: descriptor.itemStyle.borderWidth,
20
- borderColor: this.getStyleColor(descriptor.itemStyle.borderColor),
21
- borderRadius: descriptor.itemStyle.borderRadius,
22
- }
23
- };
24
- }
25
- }
26
- ServiceEchartInterpreter.register(BarServiceEchartInterpreter);
27
- export { BarServiceEchartInterpreter };
28
- //# sourceMappingURL=BarServiceEchartInterpreter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BarServiceEchartInterpreter.js","sourceRoot":"","sources":["../../src/interpreter/BarServiceEchartInterpreter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,2BAA4B,SAAQ,wBAAwB;IAC9D,MAAM,CAAC,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAA;IAE7C,UAAU,CAAC,UAAsC;QAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;QAE5C,OAAO;YACH,GAAG,OAAO;YACV,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,KAAK,EAAE;gBACH,IAAI,EAAE,UAAU,CAAC,SAAS;gBAC1B,KAAK,EAAE,UAAU,CAAC,UAAU;gBAC5B,QAAQ,EAAE,UAAU,CAAC,aAAa;aACrC;YACD,SAAS,EAAE;gBACP,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;gBACrD,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU;gBAC3C,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW;gBAC7C,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC;gBACjE,YAAY,EAAE,UAAU,CAAC,SAAS,CAAC,YAAY;aAClD;SACJ,CAAA;IACL,CAAC;;AAEL,wBAAwB,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAA;AAE9D,OAAO,EACH,2BAA2B,EAC9B,CAAA"}
@@ -1,59 +0,0 @@
1
- import { LineServiceEchartDescriptor } from "../descriptor";
2
- import { ServiceEchartInterpreter } from "./ServiceEchartInterpreter";
3
- declare class LineServiceEchartInterpreter extends ServiceEchartInterpreter {
4
- static type: string;
5
- getService(descriptor: LineServiceEchartDescriptor): {
6
- smooth: boolean;
7
- lineStyle: {
8
- type: string;
9
- width: number;
10
- };
11
- itemStyle: {
12
- color: string | {
13
- type: "linear";
14
- x: number;
15
- y: number;
16
- x2: number;
17
- y2: number;
18
- colorStops: {
19
- offset: number;
20
- color: string;
21
- }[];
22
- } | {
23
- type: "radial";
24
- r: number;
25
- x: number;
26
- y: number;
27
- colorStops: {
28
- offset: number;
29
- color: string;
30
- }[];
31
- };
32
- };
33
- areaStyle: {
34
- color: string | {
35
- type: "linear";
36
- x: number;
37
- y: number;
38
- x2: number;
39
- y2: number;
40
- colorStops: {
41
- offset: number;
42
- color: string;
43
- }[];
44
- } | {
45
- type: "radial";
46
- r: number;
47
- x: number;
48
- y: number;
49
- colorStops: {
50
- offset: number;
51
- color: string;
52
- }[];
53
- };
54
- };
55
- type: string;
56
- name: string;
57
- };
58
- }
59
- export { LineServiceEchartInterpreter };
@@ -1,25 +0,0 @@
1
- import { LineServiceEchartDescriptor } from "../descriptor";
2
- import { ServiceEchartInterpreter } from "./ServiceEchartInterpreter";
3
- class LineServiceEchartInterpreter extends ServiceEchartInterpreter {
4
- static type = LineServiceEchartDescriptor.type;
5
- getService(descriptor) {
6
- const service = super.getService(descriptor);
7
- return {
8
- ...service,
9
- smooth: descriptor.smooth,
10
- lineStyle: {
11
- type: descriptor.lineStyle.type,
12
- width: descriptor.lineStyle.width,
13
- },
14
- itemStyle: {
15
- color: this.getStyleColor(descriptor.itemStyleColor),
16
- },
17
- areaStyle: {
18
- color: this.getStyleColor(descriptor.areaStyleColor),
19
- }
20
- };
21
- }
22
- }
23
- ServiceEchartInterpreter.register(LineServiceEchartInterpreter);
24
- export { LineServiceEchartInterpreter };
25
- //# sourceMappingURL=LineServiceEchartInterpreter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LineServiceEchartInterpreter.js","sourceRoot":"","sources":["../../src/interpreter/LineServiceEchartInterpreter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,4BAA6B,SAAQ,wBAAwB;IAC/D,MAAM,CAAC,IAAI,GAAG,2BAA2B,CAAC,IAAI,CAAA;IAE9C,UAAU,CAAC,UAAuC;QAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;QAE5C,OAAO;YACH,GAAG,OAAO;YACV,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,SAAS,EAAE;gBACP,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI;gBAC/B,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK;aACpC;YACD,SAAS,EAAE;gBACP,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC;aACvD;YACD,SAAS,EAAE;gBACP,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC;aACvD;SACJ,CAAA;IACL,CAAC;;AAEL,wBAAwB,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAA;AAE/D,OAAO,EACH,4BAA4B,EAC/B,CAAA"}
@@ -1,66 +0,0 @@
1
- import { PieServiceEchartDescriptor } from "../descriptor";
2
- import { ServiceEchartInterpreter } from "./ServiceEchartInterpreter";
3
- declare class PieServiceEchartInterpreter extends ServiceEchartInterpreter {
4
- static type: string;
5
- getService(descriptor: PieServiceEchartDescriptor): {
6
- roseType: string;
7
- width: string;
8
- height: string;
9
- radius: string[];
10
- center: string[];
11
- padAngle: number;
12
- label: {
13
- show: boolean;
14
- color: string;
15
- position: string;
16
- };
17
- itemStyle: {
18
- color: string | {
19
- type: "linear";
20
- x: number;
21
- y: number;
22
- x2: number;
23
- y2: number;
24
- colorStops: {
25
- offset: number;
26
- color: string;
27
- }[];
28
- } | {
29
- type: "radial";
30
- r: number;
31
- x: number;
32
- y: number;
33
- colorStops: {
34
- offset: number;
35
- color: string;
36
- }[];
37
- };
38
- borderType: string;
39
- borderWidth: number;
40
- borderColor: string | {
41
- type: "linear";
42
- x: number;
43
- y: number;
44
- x2: number;
45
- y2: number;
46
- colorStops: {
47
- offset: number;
48
- color: string;
49
- }[];
50
- } | {
51
- type: "radial";
52
- r: number;
53
- x: number;
54
- y: number;
55
- colorStops: {
56
- offset: number;
57
- color: string;
58
- }[];
59
- };
60
- borderRadius: number;
61
- };
62
- type: string;
63
- name: string;
64
- };
65
- }
66
- export { PieServiceEchartInterpreter };
@@ -1,32 +0,0 @@
1
- import { PieServiceEchartDescriptor } from "../descriptor";
2
- import { ServiceEchartInterpreter } from "./ServiceEchartInterpreter";
3
- class PieServiceEchartInterpreter extends ServiceEchartInterpreter {
4
- static type = PieServiceEchartDescriptor.type;
5
- getService(descriptor) {
6
- const service = super.getService(descriptor);
7
- return {
8
- ...service,
9
- roseType: descriptor.roseType,
10
- width: descriptor.width,
11
- height: descriptor.height,
12
- radius: [descriptor.radius.x, descriptor.radius.y],
13
- center: [descriptor.center.x, descriptor.center.y],
14
- padAngle: descriptor.padAngle,
15
- label: {
16
- show: descriptor.labelShow,
17
- color: descriptor.labelColor,
18
- position: descriptor.labelPosition,
19
- },
20
- itemStyle: {
21
- color: this.getStyleColor(descriptor.itemStyle.color),
22
- borderType: descriptor.itemStyle.borderType,
23
- borderWidth: descriptor.itemStyle.borderWidth,
24
- borderColor: this.getStyleColor(descriptor.itemStyle.borderColor),
25
- borderRadius: descriptor.itemStyle.borderRadius,
26
- }
27
- };
28
- }
29
- }
30
- ServiceEchartInterpreter.register(PieServiceEchartInterpreter);
31
- export { PieServiceEchartInterpreter };
32
- //# sourceMappingURL=PieServiceEchartInterpreter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PieServiceEchartInterpreter.js","sourceRoot":"","sources":["../../src/interpreter/PieServiceEchartInterpreter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,2BAA4B,SAAQ,wBAAwB;IAC9D,MAAM,CAAC,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAA;IAE7C,UAAU,CAAC,UAAsC;QAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;QAE5C,OAAO;YACH,GAAG,OAAO;YACV,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;YAClD,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;YAClD,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,KAAK,EAAE;gBACH,IAAI,EAAE,UAAU,CAAC,SAAS;gBAC1B,KAAK,EAAE,UAAU,CAAC,UAAU;gBAC5B,QAAQ,EAAE,UAAU,CAAC,aAAa;aACrC;YACD,SAAS,EAAE;gBACP,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;gBACrD,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU;gBAC3C,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW;gBAC7C,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC;gBACjE,YAAY,EAAE,UAAU,CAAC,SAAS,CAAC,YAAY;aAClD;SACJ,CAAA;IACL,CAAC;;AAEL,wBAAwB,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAA;AAE9D,OAAO,EACH,2BAA2B,EAC9B,CAAA"}
@@ -1,39 +0,0 @@
1
- import { Descriptor, StyleColor, Interpreter } from "@vyr/engine";
2
- import { EchartDescriptor, ServiceEchartDescriptor } from "../descriptor";
3
- declare class ServiceEchartInterpreter extends Interpreter {
4
- static type: string;
5
- getLinearXYByAngle(angle: number): {
6
- x: number;
7
- y: number;
8
- x2: number;
9
- y2: number;
10
- };
11
- getStyleColor(color: StyleColor): string | {
12
- type: "linear";
13
- x: number;
14
- y: number;
15
- x2: number;
16
- y2: number;
17
- colorStops: {
18
- offset: number;
19
- color: string;
20
- }[];
21
- } | {
22
- type: "radial";
23
- r: number;
24
- x: number;
25
- y: number;
26
- colorStops: {
27
- offset: number;
28
- color: string;
29
- }[];
30
- };
31
- getService(descriptor: ServiceEchartDescriptor): {
32
- type: string;
33
- name: string;
34
- };
35
- update(descriptor: ServiceEchartDescriptor): void;
36
- mount(descriptor: EchartDescriptor, parentInterpreter: Interpreter, parentDescriptor: Descriptor): void;
37
- unmount(descriptor: Descriptor, parentInterpreter: Interpreter, parentDescriptor: Descriptor): void;
38
- }
39
- export { ServiceEchartInterpreter };
@@ -1,79 +0,0 @@
1
- import * as echarts from 'echarts';
2
- import { Descriptor, Interpreter, Queue } from "@vyr/engine";
3
- import { EchartDescriptor, ServiceEchartDescriptor } from "../descriptor";
4
- class ServiceEchartInterpreter extends Interpreter {
5
- static type = ServiceEchartDescriptor.type;
6
- getLinearXYByAngle(angle) {
7
- const radian = (angle * Math.PI) / 180;
8
- const x = Math.cos(radian);
9
- const y = Math.sin(radian);
10
- const x2 = Math.cos(radian + Math.PI);
11
- const y2 = Math.sin(radian + Math.PI);
12
- return { x, y, x2, y2 };
13
- }
14
- getStyleColor(color) {
15
- if (color.type == 'linear') {
16
- const { x, y, x2, y2 } = this.getLinearXYByAngle(color.angle);
17
- const colorStops = [];
18
- for (const item of color.value) {
19
- colorStops.push({ offset: item.ratio, color: echarts.color.modifyAlpha(item.value, item.opacity) });
20
- }
21
- const style = {
22
- type: color.type,
23
- x, y, x2, y2,
24
- colorStops
25
- };
26
- return style;
27
- }
28
- else if (color.type === 'radial') {
29
- const colorStops = [];
30
- for (const item of color.value) {
31
- colorStops.push({ offset: item.ratio, color: echarts.color.modifyAlpha(item.value, item.opacity) });
32
- }
33
- const style = {
34
- type: color.type,
35
- r: color.radius,
36
- x: color.center.x,
37
- y: color.center.y,
38
- colorStops
39
- };
40
- return style;
41
- }
42
- else {
43
- return echarts.color.modifyAlpha(color.value, color.opacity);
44
- }
45
- }
46
- getService(descriptor) {
47
- return { type: descriptor.echart, name: descriptor.name };
48
- }
49
- update(descriptor) {
50
- super.update(descriptor);
51
- const unit = this.graphics.getUnit(descriptor.uuid);
52
- const parentDescriptor = Descriptor.get(unit.parent);
53
- if (parentDescriptor instanceof EchartDescriptor) {
54
- const actor = this.graphics.getActor(parentDescriptor);
55
- if (actor === null)
56
- return;
57
- actor.setOptions(parentDescriptor);
58
- actor.instance.setOption(actor.options);
59
- }
60
- }
61
- mount(descriptor, parentInterpreter, parentDescriptor) {
62
- super.mount(descriptor, parentInterpreter, parentDescriptor);
63
- if (parentDescriptor instanceof EchartDescriptor) {
64
- const unit = this.graphics.getUnit(parentDescriptor.uuid);
65
- if (unit)
66
- unit.trigger(Queue.Update);
67
- }
68
- }
69
- unmount(descriptor, parentInterpreter, parentDescriptor) {
70
- if (parentDescriptor instanceof EchartDescriptor) {
71
- const unit = this.graphics.getUnit(parentDescriptor.uuid);
72
- if (unit)
73
- unit.trigger(Queue.Update);
74
- }
75
- super.unmount(descriptor, parentInterpreter, parentDescriptor);
76
- }
77
- }
78
- export { ServiceEchartInterpreter };
79
- //# sourceMappingURL=ServiceEchartInterpreter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ServiceEchartInterpreter.js","sourceRoot":"","sources":["../../src/interpreter/ServiceEchartInterpreter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,UAAU,EAAc,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG1E,MAAM,wBAAyB,SAAQ,WAAW;IAC9C,MAAM,CAAC,IAAI,GAAG,uBAAuB,CAAC,IAAI,CAAA;IAE1C,kBAAkB,CAAC,KAAa;QAC5B,MAAM,MAAM,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAA;QACtC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC1B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;QAErC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;IAC3B,CAAC;IAED,aAAa,CAAC,KAAiB;QAC3B,IAAI,KAAK,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC;YACzB,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAE7D,MAAM,UAAU,GAAG,EAAE,CAAA;YACrB,KAAK,MAAM,IAAI,IAAI,KAAK,C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AAC,MAAM,CAAC,CAAA;QACxC,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAA;IAClE,CAAC;;AAGL,OAAO,EACH,wBAAwB,EAC3B,CAAA"}
@@ -1,31 +0,0 @@
1
- import { DeserializationObject } from '@vyr/engine'
2
- import { EchartItemStyle, ServiceEchartDescriptor } from './ServiceEchartDescriptor'
3
-
4
- class BarServiceEchartDescriptor extends ServiceEchartDescriptor {
5
- static type = 'BarServiceEchart'
6
-
7
- barWidth: string
8
- barMaxWidth: string
9
- labelShow: boolean
10
- labelColor: string
11
- labelPosition: string
12
-
13
- itemStyle: EchartItemStyle
14
-
15
- constructor(descriptor: Partial<DeserializationObject<BarServiceEchartDescriptor>> = {}) {
16
- super(descriptor)
17
- this.echart = descriptor.echart ?? 'bar'
18
- this.barWidth = descriptor.barWidth ?? ''
19
- this.barMaxWidth = descriptor.barMaxWidth ?? ''
20
- this.labelShow = descriptor.labelShow ?? false
21
- this.labelColor = descriptor.labelColor ?? ''
22
- this.labelPosition = descriptor.labelPosition ?? 'inside'
23
-
24
- this.itemStyle = descriptor.itemStyle ? ServiceEchartDescriptor.deepClone(descriptor.itemStyle) : ServiceEchartDescriptor.getDefaultItemStyle()
25
- }
26
- }
27
- ServiceEchartDescriptor.register(BarServiceEchartDescriptor)
28
-
29
- export {
30
- BarServiceEchartDescriptor
31
- }
@@ -1,106 +0,0 @@
1
- import { DeserializationObject, HTMLDescriptor } from '@vyr/engine'
2
- import { ServiceEchartDescriptor } from './ServiceEchartDescriptor';
3
-
4
- interface EchartRect {
5
- left: string
6
- top: string
7
- width: string
8
- height: string
9
- }
10
- interface EchartGridRect extends EchartRect {
11
- right: string
12
- bottom: string
13
- }
14
- interface EchartAxisLine {
15
- show: boolean
16
- }
17
- interface EchartAxisTick {
18
- show: boolean
19
- }
20
- interface EchartAxisLabel {
21
- show: boolean
22
- color: string
23
- fontSize: number
24
- }
25
- interface EchartSplitLine {
26
- show: boolean
27
- }
28
- interface EchartTextStyle {
29
- color: string
30
- }
31
-
32
- interface EchartScroll {
33
- end: number
34
- }
35
-
36
- class EchartDescriptor extends HTMLDescriptor {
37
- static type = 'Echart'
38
-
39
- declare children: ServiceEchartDescriptor[];
40
-
41
- xAxisShow: boolean
42
- xAxisType: string
43
- xAxisModelValue: string
44
- xAxisLine: EchartAxisLine
45
- xAxisTick: EchartAxisTick
46
- xAxisLabel: EchartAxisLabel
47
- xAxisSplitLine: EchartSplitLine
48
-
49
- yAxisShow: boolean
50
- yAxisType: string
51
- yAxisLine: EchartAxisLine
52
- yAxisTick: EchartAxisTick
53
- yAxisLabel: EchartAxisLabel
54
- yAxisSplitLine: EchartSplitLine
55
-
56
- gridShow: boolean
57
- gridRect: EchartGridRect
58
-
59
- legendType: string
60
- legendShow: boolean
61
- legendRect: EchartRect
62
- legendTextStyle: EchartTextStyle
63
-
64
- tooltipShow: boolean
65
- tooltipTrigger: string
66
-
67
- scroll: EchartScroll
68
-
69
- constructor(descriptor: Partial<DeserializationObject<EchartDescriptor>> = {}) {
70
- super(descriptor)
71
- this.width = descriptor.width ?? 400
72
- this.height = descriptor.height ?? 400
73
- this.xAxisShow = descriptor.xAxisShow ?? true
74
- this.xAxisType = descriptor.xAxisType ?? 'category'
75
- this.xAxisModelValue = descriptor.xAxisModelValue ?? ''
76
- this.xAxisLine = descriptor.xAxisLine ? HTMLDescriptor.deepClone(descriptor.xAxisLine) : { show: true }
77
- this.xAxisTick = descriptor.xAxisTick ? HTMLDescriptor.deepClone(descriptor.xAxisTick) : { show: true }
78
- this.xAxisLabel = descriptor.xAxisLabel ? HTMLDescriptor.deepClone(descriptor.xAxisLabel) : { show: true, color: '', fontSize: 12 }
79
- this.xAxisSplitLine = descriptor.xAxisSplitLine ? HTMLDescriptor.deepClone(descriptor.xAxisSplitLine) : { show: false }
80
-
81
- this.yAxisType = descriptor.yAxisType ?? ''
82
- this.yAxisShow = descriptor.yAxisShow ?? true
83
- this.yAxisLine = descriptor.yAxisLine ? HTMLDescriptor.deepClone(descriptor.yAxisLine) : { show: true }
84
- this.yAxisTick = descriptor.yAxisTick ? HTMLDescriptor.deepClone(descriptor.yAxisTick) : { show: true, }
85
- this.yAxisLabel = descriptor.yAxisLabel ? HTMLDescriptor.deepClone(descriptor.yAxisLabel) : { show: true, color: '', fontSize: 12 }
86
- this.yAxisSplitLine = descriptor.yAxisSplitLine ? HTMLDescriptor.deepClone(descriptor.yAxisSplitLine) : { show: false }
87
-
88
- this.gridShow = descriptor.gridShow ?? false
89
- this.gridRect = descriptor.gridRect ? HTMLDescriptor.deepClone(descriptor.gridRect) : { top: '60', left: '10%', right: '10%', bottom: '60', width: 'auto', height: 'auto', }
90
-
91
- this.legendType = descriptor.legendType ?? 'plain'
92
- this.legendShow = descriptor.legendShow ?? true
93
- this.legendRect = descriptor.legendRect ? HTMLDescriptor.deepClone(descriptor.legendRect) : { top: 'top', left: 'center', width: '', height: '', }
94
- this.legendTextStyle = descriptor.legendTextStyle ? HTMLDescriptor.deepClone(descriptor.legendTextStyle) : { color: '#333' }
95
-
96
- this.tooltipShow = descriptor.tooltipShow ?? true
97
- this.tooltipTrigger = descriptor.tooltipTrigger ?? 'item'
98
-
99
- this.scroll = descriptor.scroll ? HTMLDescriptor.deepClone(descriptor.scroll) : { end: -1 }
100
- }
101
- }
102
- HTMLDescriptor.register(EchartDescriptor)
103
-
104
- export {
105
- EchartDescriptor
106
- }
@@ -1,30 +0,0 @@
1
- import { DefaultStyleColor, DeserializationObject, StyleColor } from '@vyr/engine'
2
- import { ServiceEchartDescriptor } from './ServiceEchartDescriptor'
3
-
4
- interface EchartLineStyle {
5
- width: number
6
- type: string
7
- }
8
-
9
- class LineServiceEchartDescriptor extends ServiceEchartDescriptor {
10
- static type = 'LineServiceEchart'
11
-
12
- smooth: boolean
13
- lineStyle: EchartLineStyle
14
- itemStyleColor: StyleColor
15
- areaStyleColor: StyleColor
16
-
17
- constructor(descriptor: Partial<DeserializationObject<LineServiceEchartDescriptor>> = {}) {
18
- super(descriptor)
19
- this.echart = descriptor.echart ?? 'line'
20
- this.smooth = descriptor.smooth ?? false
21
- this.lineStyle = descriptor.lineStyle ? ServiceEchartDescriptor.deepClone(descriptor.lineStyle) : { width: 0, type: 'solid', }
22
- this.itemStyleColor = descriptor.itemStyleColor ? DefaultStyleColor.create(descriptor.itemStyleColor) : new DefaultStyleColor({ value: '#5470c6' })
23
- this.areaStyleColor = descriptor.areaStyleColor ? DefaultStyleColor.create(descriptor.areaStyleColor) : new DefaultStyleColor({ value: '#849ae7' })
24
- }
25
- }
26
- ServiceEchartDescriptor.register(LineServiceEchartDescriptor)
27
-
28
- export {
29
- LineServiceEchartDescriptor
30
- }
@@ -1,47 +0,0 @@
1
- import { DeserializationObject } from '@vyr/engine'
2
- import { EchartItemStyle, ServiceEchartDescriptor } from './ServiceEchartDescriptor'
3
-
4
- interface EchartCenter {
5
- x: string
6
- y: string
7
- }
8
-
9
- interface EchartRadius {
10
- x: string
11
- y: string
12
- }
13
-
14
- class PieServiceEchartDescriptor extends ServiceEchartDescriptor {
15
- static type = 'PieServiceEchart'
16
-
17
- roseType: string
18
- width: string
19
- height: string
20
- radius: EchartRadius
21
- center: EchartCenter
22
- padAngle: number
23
- labelShow: boolean
24
- labelColor: string
25
- labelPosition: string
26
- itemStyle: EchartItemStyle
27
-
28
- constructor(descriptor: Partial<DeserializationObject<PieServiceEchartDescriptor>> = {}) {
29
- super(descriptor)
30
- this.echart = descriptor.echart ?? 'pie'
31
- this.roseType = descriptor.roseType ?? 'area'
32
- this.width = descriptor.width ?? 'auto'
33
- this.height = descriptor.height ?? 'auto'
34
- this.radius = descriptor.radius ? ServiceEchartDescriptor.deepClone(descriptor.radius) : { x: '0', y: '75%' }
35
- this.center = descriptor.center ? ServiceEchartDescriptor.deepClone(descriptor.center) : { x: '50%', y: '50%' }
36
- this.padAngle = descriptor.padAngle ?? 4
37
- this.labelShow = descriptor.labelShow ?? false
38
- this.labelColor = descriptor.labelColor ?? ''
39
- this.labelPosition = descriptor.labelPosition ?? 'outside'
40
- this.itemStyle = descriptor.itemStyle ? ServiceEchartDescriptor.deepClone(descriptor.itemStyle) : ServiceEchartDescriptor.getDefaultItemStyle()
41
- }
42
- }
43
- ServiceEchartDescriptor.register(PieServiceEchartDescriptor)
44
-
45
- export {
46
- PieServiceEchartDescriptor
47
- }