@delon/chart 18.3.0 → 19.0.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/core/g2.base.component.d.ts +1 -1
- package/fesm2022/bar.mjs +17 -19
- package/fesm2022/bar.mjs.map +1 -1
- package/fesm2022/card.mjs +20 -17
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/chart-echarts.mjs +34 -28
- package/fesm2022/chart-echarts.mjs.map +1 -1
- package/fesm2022/core.mjs +28 -21
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/custom.mjs +14 -16
- package/fesm2022/custom.mjs.map +1 -1
- package/fesm2022/gauge.mjs +16 -14
- package/fesm2022/gauge.mjs.map +1 -1
- package/fesm2022/mini-area.mjs +23 -25
- package/fesm2022/mini-area.mjs.map +1 -1
- package/fesm2022/mini-bar.mjs +17 -21
- package/fesm2022/mini-bar.mjs.map +1 -1
- package/fesm2022/mini-progress.mjs +56 -14
- package/fesm2022/mini-progress.mjs.map +1 -1
- package/fesm2022/number-info.mjs +24 -14
- package/fesm2022/number-info.mjs.map +1 -1
- package/fesm2022/pie.mjs +39 -36
- package/fesm2022/pie.mjs.map +1 -1
- package/fesm2022/radar.mjs +19 -20
- package/fesm2022/radar.mjs.map +1 -1
- package/fesm2022/single-bar.mjs +23 -26
- package/fesm2022/single-bar.mjs.map +1 -1
- package/fesm2022/tag-cloud.mjs +14 -18
- package/fesm2022/tag-cloud.mjs.map +1 -1
- package/fesm2022/timeline.mjs +27 -28
- package/fesm2022/timeline.mjs.map +1 -1
- package/fesm2022/trend.mjs +16 -17
- package/fesm2022/trend.mjs.map +1 -1
- package/fesm2022/water-wave.mjs +24 -22
- package/fesm2022/water-wave.mjs.map +1 -1
- package/mini-progress/mini-progress.component.d.ts +1 -2
- package/package.json +4 -40
- package/esm2022/bar/bar.component.mjs +0 -142
- package/esm2022/bar/bar.mjs +0 -5
- package/esm2022/bar/bar.module.mjs +0 -20
- package/esm2022/bar/public_api.mjs +0 -3
- package/esm2022/card/card.component.mjs +0 -48
- package/esm2022/card/card.mjs +0 -5
- package/esm2022/card/card.module.mjs +0 -21
- package/esm2022/card/public_api.mjs +0 -3
- package/esm2022/chart-echarts/chart-echarts.mjs +0 -5
- package/esm2022/chart-echarts/echarts.component.mjs +0 -165
- package/esm2022/chart-echarts/echarts.module.mjs +0 -19
- package/esm2022/chart-echarts/echarts.service.mjs +0 -60
- package/esm2022/chart-echarts/echarts.types.mjs +0 -2
- package/esm2022/chart-echarts/public_api.mjs +0 -5
- package/esm2022/chart.mjs +0 -5
- package/esm2022/core/core.mjs +0 -5
- package/esm2022/core/g2.base.component.mjs +0 -110
- package/esm2022/core/g2.servicce.mjs +0 -54
- package/esm2022/core/public_api.mjs +0 -6
- package/esm2022/core/types/interaction.mjs +0 -2
- package/esm2022/core/types/time.mjs +0 -2
- package/esm2022/core/utils.mjs +0 -21
- package/esm2022/custom/custom.component.mjs +0 -68
- package/esm2022/custom/custom.mjs +0 -5
- package/esm2022/custom/custom.module.mjs +0 -19
- package/esm2022/custom/public_api.mjs +0 -3
- package/esm2022/gauge/gauge.component.mjs +0 -169
- package/esm2022/gauge/gauge.mjs +0 -5
- package/esm2022/gauge/gauge.module.mjs +0 -19
- package/esm2022/gauge/public_api.mjs +0 -3
- package/esm2022/mini-area/mini-area.component.mjs +0 -123
- package/esm2022/mini-area/mini-area.mjs +0 -5
- package/esm2022/mini-area/mini-area.module.mjs +0 -18
- package/esm2022/mini-area/public_api.mjs +0 -3
- package/esm2022/mini-bar/mini-bar.component.mjs +0 -96
- package/esm2022/mini-bar/mini-bar.mjs +0 -5
- package/esm2022/mini-bar/mini-bar.module.mjs +0 -18
- package/esm2022/mini-bar/public_api.mjs +0 -3
- package/esm2022/mini-progress/mini-progress.component.mjs +0 -38
- package/esm2022/mini-progress/mini-progress.mjs +0 -5
- package/esm2022/mini-progress/mini-progress.module.mjs +0 -20
- package/esm2022/mini-progress/public_api.mjs +0 -3
- package/esm2022/number-info/number-info.component.mjs +0 -40
- package/esm2022/number-info/number-info.mjs +0 -5
- package/esm2022/number-info/number-info.module.mjs +0 -20
- package/esm2022/number-info/public_api.mjs +0 -3
- package/esm2022/pie/pie.component.mjs +0 -204
- package/esm2022/pie/pie.mjs +0 -5
- package/esm2022/pie/pie.module.mjs +0 -21
- package/esm2022/pie/public_api.mjs +0 -3
- package/esm2022/public_api.mjs +0 -3
- package/esm2022/radar/public_api.mjs +0 -3
- package/esm2022/radar/radar.component.mjs +0 -141
- package/esm2022/radar/radar.mjs +0 -5
- package/esm2022/radar/radar.module.mjs +0 -21
- package/esm2022/single-bar/public_api.mjs +0 -3
- package/esm2022/single-bar/single-bar.component.mjs +0 -114
- package/esm2022/single-bar/single-bar.mjs +0 -5
- package/esm2022/single-bar/single-bar.module.mjs +0 -18
- package/esm2022/tag-cloud/public_api.mjs +0 -3
- package/esm2022/tag-cloud/tag-cloud.component.mjs +0 -161
- package/esm2022/tag-cloud/tag-cloud.mjs +0 -5
- package/esm2022/tag-cloud/tag-cloud.module.mjs +0 -19
- package/esm2022/timeline/public_api.mjs +0 -3
- package/esm2022/timeline/timeline.component.mjs +0 -200
- package/esm2022/timeline/timeline.mjs +0 -5
- package/esm2022/timeline/timeline.module.mjs +0 -20
- package/esm2022/trend/public_api.mjs +0 -3
- package/esm2022/trend/trend.component.mjs +0 -51
- package/esm2022/trend/trend.mjs +0 -5
- package/esm2022/trend/trend.module.mjs +0 -19
- package/esm2022/water-wave/public_api.mjs +0 -3
- package/esm2022/water-wave/water-wave.component.mjs +0 -210
- package/esm2022/water-wave/water-wave.mjs +0 -5
- package/esm2022/water-wave/water-wave.module.mjs +0 -19
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { NgStyle, CommonModule } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
2
|
import { inject, ChangeDetectorRef, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
4
3
|
import { DelonLocaleService, DelonLocaleModule } from '@delon/theme';
|
|
5
4
|
import { NzTooltipDirective, NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
6
|
|
|
7
7
|
class G2MiniProgressComponent {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
targetSuffix = inject(DelonLocaleService).getData('miniProgress').target;
|
|
9
|
+
cdr = inject(ChangeDetectorRef);
|
|
10
|
+
color = '#1890FF';
|
|
11
|
+
target;
|
|
12
|
+
percent;
|
|
13
|
+
strokeWidth;
|
|
13
14
|
fixNum(value) {
|
|
14
15
|
return Math.min(Math.max(numberAttribute(value), 0), 100);
|
|
15
16
|
}
|
|
@@ -18,12 +19,53 @@ class G2MiniProgressComponent {
|
|
|
18
19
|
this.percent = this.fixNum(this.percent);
|
|
19
20
|
this.cdr.detectChanges();
|
|
20
21
|
}
|
|
21
|
-
static
|
|
22
|
-
static
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2MiniProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.1.1", type: G2MiniProgressComponent, isStandalone: true, selector: "g2-mini-progress", inputs: { color: "color", target: ["target", "target", numberAttribute], percent: ["percent", "percent", numberAttribute], strokeWidth: ["strokeWidth", "strokeWidth", numberAttribute] }, host: { properties: { "class.g2-mini-progress": "true" } }, exportAs: ["g2MiniProgress"], usesOnChanges: true, ngImport: i0, template: `
|
|
24
|
+
<div
|
|
25
|
+
nz-tooltip
|
|
26
|
+
[nzTooltipTitle]="targetSuffix + target + '%'"
|
|
27
|
+
class="g2-mini-progress__target"
|
|
28
|
+
[style]="{ left: target + '%' }"
|
|
29
|
+
>
|
|
30
|
+
<span class="g2-mini-progress__target-item" [style]="{ 'background-color': color }"></span>
|
|
31
|
+
<span class="g2-mini-progress__target-item" [style]="{ 'background-color': color }"></span>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="g2-mini-progress__wrap">
|
|
34
|
+
<div
|
|
35
|
+
class="g2-mini-progress__value"
|
|
36
|
+
[style]="{ 'background-color': color, width: percent + '%', height: strokeWidth + 'px' }"
|
|
37
|
+
></div>
|
|
38
|
+
</div>
|
|
39
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
23
40
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2MiniProgressComponent, decorators: [{
|
|
25
42
|
type: Component,
|
|
26
|
-
args: [{
|
|
43
|
+
args: [{
|
|
44
|
+
selector: 'g2-mini-progress',
|
|
45
|
+
exportAs: 'g2MiniProgress',
|
|
46
|
+
template: `
|
|
47
|
+
<div
|
|
48
|
+
nz-tooltip
|
|
49
|
+
[nzTooltipTitle]="targetSuffix + target + '%'"
|
|
50
|
+
class="g2-mini-progress__target"
|
|
51
|
+
[style]="{ left: target + '%' }"
|
|
52
|
+
>
|
|
53
|
+
<span class="g2-mini-progress__target-item" [style]="{ 'background-color': color }"></span>
|
|
54
|
+
<span class="g2-mini-progress__target-item" [style]="{ 'background-color': color }"></span>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="g2-mini-progress__wrap">
|
|
57
|
+
<div
|
|
58
|
+
class="g2-mini-progress__value"
|
|
59
|
+
[style]="{ 'background-color': color, width: percent + '%', height: strokeWidth + 'px' }"
|
|
60
|
+
></div>
|
|
61
|
+
</div>
|
|
62
|
+
`,
|
|
63
|
+
host: { '[class.g2-mini-progress]': 'true' },
|
|
64
|
+
preserveWhitespaces: false,
|
|
65
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
66
|
+
encapsulation: ViewEncapsulation.None,
|
|
67
|
+
imports: [NzTooltipDirective]
|
|
68
|
+
}]
|
|
27
69
|
}], propDecorators: { color: [{
|
|
28
70
|
type: Input
|
|
29
71
|
}], target: [{
|
|
@@ -39,11 +81,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
39
81
|
|
|
40
82
|
const COMPONENTS = [G2MiniProgressComponent];
|
|
41
83
|
class G2MiniProgressModule {
|
|
42
|
-
static
|
|
43
|
-
static
|
|
44
|
-
static
|
|
84
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2MiniProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
85
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: G2MiniProgressModule, imports: [CommonModule, DelonLocaleModule, NzToolTipModule, G2MiniProgressComponent], exports: [G2MiniProgressComponent] });
|
|
86
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2MiniProgressModule, imports: [CommonModule, DelonLocaleModule, NzToolTipModule] });
|
|
45
87
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2MiniProgressModule, decorators: [{
|
|
47
89
|
type: NgModule,
|
|
48
90
|
args: [{
|
|
49
91
|
imports: [CommonModule, DelonLocaleModule, NzToolTipModule, ...COMPONENTS],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mini-progress.mjs","sources":["../../../../packages/chart/mini-progress/mini-progress.component.ts","../../../../packages/chart/mini-progress/mini-progress.
|
|
1
|
+
{"version":3,"file":"mini-progress.mjs","sources":["../../../../packages/chart/mini-progress/mini-progress.component.ts","../../../../packages/chart/mini-progress/mini-progress.module.ts","../../../../packages/chart/mini-progress/mini-progress.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnChanges,\n ViewEncapsulation,\n inject,\n numberAttribute\n} from '@angular/core';\n\nimport { DelonLocaleService } from '@delon/theme';\nimport { NzTooltipDirective } from 'ng-zorro-antd/tooltip';\n\n@Component({\n selector: 'g2-mini-progress',\n exportAs: 'g2MiniProgress',\n template: `\n <div\n nz-tooltip\n [nzTooltipTitle]=\"targetSuffix + target + '%'\"\n class=\"g2-mini-progress__target\"\n [style]=\"{ left: target + '%' }\"\n >\n <span class=\"g2-mini-progress__target-item\" [style]=\"{ 'background-color': color }\"></span>\n <span class=\"g2-mini-progress__target-item\" [style]=\"{ 'background-color': color }\"></span>\n </div>\n <div class=\"g2-mini-progress__wrap\">\n <div\n class=\"g2-mini-progress__value\"\n [style]=\"{ 'background-color': color, width: percent + '%', height: strokeWidth + 'px' }\"\n ></div>\n </div>\n `,\n host: { '[class.g2-mini-progress]': 'true' },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NzTooltipDirective]\n})\nexport class G2MiniProgressComponent implements OnChanges {\n readonly targetSuffix = inject(DelonLocaleService).getData('miniProgress').target;\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() color = '#1890FF';\n @Input({ transform: numberAttribute }) target?: number | null;\n @Input({ transform: numberAttribute }) percent?: number | null;\n @Input({ transform: numberAttribute }) strokeWidth?: number | null;\n\n private fixNum(value: number | undefined | null): number {\n return Math.min(Math.max(numberAttribute(value), 0), 100);\n }\n\n ngOnChanges(): void {\n this.target = this.fixNum(this.target);\n this.percent = this.fixNum(this.percent);\n this.cdr.detectChanges();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DelonLocaleModule } from '@delon/theme';\nimport { NzToolTipModule } from 'ng-zorro-antd/tooltip';\n\nimport { G2MiniProgressComponent } from './mini-progress.component';\n\nconst COMPONENTS = [G2MiniProgressComponent];\n\n@NgModule({\n imports: [CommonModule, DelonLocaleModule, NzToolTipModule, ...COMPONENTS],\n exports: COMPONENTS\n})\nexport class G2MiniProgressModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAwCa,uBAAuB,CAAA;AACzB,IAAA,YAAY,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM;AAChE,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAEvC,KAAK,GAAG,SAAS;AACa,IAAA,MAAM;AACN,IAAA,OAAO;AACP,IAAA,WAAW;AAE1C,IAAA,MAAM,CAAC,KAAgC,EAAA;AAC7C,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;;IAG3D,WAAW,GAAA;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AACxC,QAAA,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE;;uGAhBf,uBAAuB,EAAA,IAAA,EAAA,EAAA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,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC;AAC1E,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACbD;;AAEG;;;;"}
|
package/fesm2022/number-info.mjs
CHANGED
|
@@ -5,22 +5,32 @@ import { NzIconDirective, NzIconModule } from 'ng-zorro-antd/icon';
|
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
6
|
|
|
7
7
|
class NumberInfoComponent {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
/** 标题 */
|
|
9
|
+
title;
|
|
10
|
+
/** 子标题 */
|
|
11
|
+
subTitle;
|
|
12
|
+
/** 总量 */
|
|
13
|
+
total;
|
|
14
|
+
/** 总量后缀 */
|
|
15
|
+
subTotal;
|
|
16
|
+
/** 子总量 */
|
|
17
|
+
suffix;
|
|
18
|
+
/** 增加状态 */
|
|
19
|
+
status;
|
|
20
|
+
/** 状态样式 */
|
|
21
|
+
theme = 'light';
|
|
22
|
+
/** 设置数字和描述直接的间距(像素) */
|
|
23
|
+
gap = 8;
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: NumberInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.1", type: NumberInfoComponent, isStandalone: true, selector: "number-info", inputs: { title: "title", subTitle: "subTitle", total: "total", subTotal: "subTotal", suffix: "suffix", status: "status", theme: "theme", gap: ["gap", "gap", numberAttribute] }, host: { properties: { "class.number-info": "true", "class.number-info__light": "theme === 'light'", "class.number-info__default": "theme === 'default'" } }, exportAs: ["numberInfo"], ngImport: i0, template: "@if (title) {\n <div class=\"number-info__title\">\n <ng-container *nzStringTemplateOutlet=\"title\">{{ title }}</ng-container>\n </div>\n}\n@if (subTitle) {\n <div class=\"number-info__title-sub\">\n <ng-container *nzStringTemplateOutlet=\"subTitle\">{{ subTitle }}</ng-container>\n </div>\n}\n<div class=\"number-info__value\" [style.margin-top.px]=\"gap\">\n <span class=\"number-info__value-text\">\n <ng-container *nzStringTemplateOutlet=\"total\">{{ total }}</ng-container>\n @if (suffix) {\n <em class=\"number-info__value-suffix\">{{ suffix }}</em>\n }\n </span>\n @if (status || subTotal) {\n <span class=\"number-info__value-text number-info__value-sub\">\n <ng-container *nzStringTemplateOutlet=\"subTotal\">{{ subTotal }}</ng-container>\n @if (status) {\n <nz-icon nzType=\"caret-{{ status }}\" />\n }\n </span>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
16
26
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: NumberInfoComponent, decorators: [{
|
|
18
28
|
type: Component,
|
|
19
29
|
args: [{ selector: 'number-info', exportAs: 'numberInfo', host: {
|
|
20
30
|
'[class.number-info]': `true`,
|
|
21
31
|
'[class.number-info__light]': `theme === 'light'`,
|
|
22
32
|
'[class.number-info__default]': `theme === 'default'`
|
|
23
|
-
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None,
|
|
33
|
+
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NzStringTemplateOutletDirective, NzIconDirective], template: "@if (title) {\n <div class=\"number-info__title\">\n <ng-container *nzStringTemplateOutlet=\"title\">{{ title }}</ng-container>\n </div>\n}\n@if (subTitle) {\n <div class=\"number-info__title-sub\">\n <ng-container *nzStringTemplateOutlet=\"subTitle\">{{ subTitle }}</ng-container>\n </div>\n}\n<div class=\"number-info__value\" [style.margin-top.px]=\"gap\">\n <span class=\"number-info__value-text\">\n <ng-container *nzStringTemplateOutlet=\"total\">{{ total }}</ng-container>\n @if (suffix) {\n <em class=\"number-info__value-suffix\">{{ suffix }}</em>\n }\n </span>\n @if (status || subTotal) {\n <span class=\"number-info__value-text number-info__value-sub\">\n <ng-container *nzStringTemplateOutlet=\"subTotal\">{{ subTotal }}</ng-container>\n @if (status) {\n <nz-icon nzType=\"caret-{{ status }}\" />\n }\n </span>\n }\n</div>\n" }]
|
|
24
34
|
}], propDecorators: { title: [{
|
|
25
35
|
type: Input
|
|
26
36
|
}], subTitle: [{
|
|
@@ -42,11 +52,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
42
52
|
|
|
43
53
|
const COMPONENTS = [NumberInfoComponent];
|
|
44
54
|
class NumberInfoModule {
|
|
45
|
-
static
|
|
46
|
-
static
|
|
47
|
-
static
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: NumberInfoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
56
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: NumberInfoModule, imports: [CommonModule, NzIconModule, NzOutletModule, NumberInfoComponent], exports: [NumberInfoComponent] });
|
|
57
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: NumberInfoModule, imports: [CommonModule, NzIconModule, NzOutletModule] });
|
|
48
58
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: NumberInfoModule, decorators: [{
|
|
50
60
|
type: NgModule,
|
|
51
61
|
args: [{
|
|
52
62
|
imports: [CommonModule, NzIconModule, NzOutletModule, ...COMPONENTS],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-info.mjs","sources":["../../../../packages/chart/number-info/number-info.component.ts","../../../../packages/chart/number-info/number-info.component.html","../../../../packages/chart/number-info/number-info.module.ts","../../../../packages/chart/number-info/number-info.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n TemplateRef,\n ViewEncapsulation,\n numberAttribute\n} from '@angular/core';\n\nimport { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';\nimport { NzIconDirective } from 'ng-zorro-antd/icon';\n\n@Component({\n selector: 'number-info',\n exportAs: 'numberInfo',\n templateUrl: './number-info.component.html',\n host: {\n '[class.number-info]': `true`,\n '[class.number-info__light]': `theme === 'light'`,\n '[class.number-info__default]': `theme === 'default'`\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n
|
|
1
|
+
{"version":3,"file":"number-info.mjs","sources":["../../../../packages/chart/number-info/number-info.component.ts","../../../../packages/chart/number-info/number-info.component.html","../../../../packages/chart/number-info/number-info.module.ts","../../../../packages/chart/number-info/number-info.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n TemplateRef,\n ViewEncapsulation,\n numberAttribute\n} from '@angular/core';\n\nimport { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';\nimport { NzIconDirective } from 'ng-zorro-antd/icon';\n\n@Component({\n selector: 'number-info',\n exportAs: 'numberInfo',\n templateUrl: './number-info.component.html',\n host: {\n '[class.number-info]': `true`,\n '[class.number-info__light]': `theme === 'light'`,\n '[class.number-info__default]': `theme === 'default'`\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NzStringTemplateOutletDirective, NzIconDirective]\n})\nexport class NumberInfoComponent {\n /** 标题 */\n @Input() title?: string | TemplateRef<void> | null;\n /** 子标题 */\n @Input() subTitle?: string | TemplateRef<void> | null;\n /** 总量 */\n @Input() total?: string | number | TemplateRef<void> | null;\n /** 总量后缀 */\n @Input() subTotal?: string | number | TemplateRef<void> | null;\n /** 子总量 */\n @Input() suffix?: string | null;\n /** 增加状态 */\n @Input() status?: 'up' | 'down';\n /** 状态样式 */\n @Input() theme: 'light' | 'default' = 'light';\n /** 设置数字和描述直接的间距(像素) */\n @Input({ transform: numberAttribute }) gap = 8;\n}\n","@if (title) {\n <div class=\"number-info__title\">\n <ng-container *nzStringTemplateOutlet=\"title\">{{ title }}</ng-container>\n </div>\n}\n@if (subTitle) {\n <div class=\"number-info__title-sub\">\n <ng-container *nzStringTemplateOutlet=\"subTitle\">{{ subTitle }}</ng-container>\n </div>\n}\n<div class=\"number-info__value\" [style.margin-top.px]=\"gap\">\n <span class=\"number-info__value-text\">\n <ng-container *nzStringTemplateOutlet=\"total\">{{ total }}</ng-container>\n @if (suffix) {\n <em class=\"number-info__value-suffix\">{{ suffix }}</em>\n }\n </span>\n @if (status || subTotal) {\n <span class=\"number-info__value-text number-info__value-sub\">\n <ng-container *nzStringTemplateOutlet=\"subTotal\">{{ subTotal }}</ng-container>\n @if (status) {\n <nz-icon nzType=\"caret-{{ status }}\" />\n }\n </span>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport { NumberInfoComponent } from './number-info.component';\n\nconst COMPONENTS = [NumberInfoComponent];\n\n@NgModule({\n imports: [CommonModule, NzIconModule, NzOutletModule, ...COMPONENTS],\n exports: COMPONEN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UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;AACpE,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACbD;;AAEG;;;;"}
|
package/fesm2022/pie.mjs
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import { NgStyle, CommonModule } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
2
|
import { EventEmitter, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
|
|
4
3
|
import { G2BaseComponent } from '@delon/chart/core';
|
|
5
4
|
import { NzStringTemplateOutletDirective, NzOutletModule } from 'ng-zorro-antd/core/outlet';
|
|
6
5
|
import { NzDividerComponent, NzDividerModule } from 'ng-zorro-antd/divider';
|
|
7
6
|
import { NzSkeletonComponent, NzSkeletonModule } from 'ng-zorro-antd/skeleton';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
8
|
|
|
9
9
|
class G2PieComponent extends G2BaseComponent {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
10
|
+
percentColor;
|
|
11
|
+
legendData = [];
|
|
12
|
+
isPercent = false;
|
|
13
|
+
// #region fields
|
|
14
|
+
animate = true;
|
|
15
|
+
color = 'rgba(24, 144, 255, 0.85)';
|
|
16
|
+
subTitle;
|
|
17
|
+
total;
|
|
18
|
+
height = 0;
|
|
19
|
+
hasLegend = false;
|
|
20
|
+
inner = 0.75;
|
|
21
|
+
padding = [12, 0, 12, 0];
|
|
22
|
+
percent;
|
|
23
|
+
tooltip = true;
|
|
24
|
+
lineWidth = 0;
|
|
25
|
+
blockMaxWidth = 380;
|
|
26
|
+
select = true;
|
|
27
|
+
valueFormat;
|
|
28
|
+
data = [];
|
|
29
|
+
colors;
|
|
30
|
+
interaction = 'none';
|
|
31
|
+
ratio = {
|
|
32
|
+
text: '占比',
|
|
33
|
+
inverse: '反比',
|
|
34
|
+
color: '',
|
|
35
|
+
inverseColor: '#F0F2F5'
|
|
36
|
+
};
|
|
37
|
+
clickItem = new EventEmitter();
|
|
38
|
+
// #endregion
|
|
39
|
+
block = false;
|
|
37
40
|
fixData() {
|
|
38
41
|
const { percent, color } = this;
|
|
39
42
|
this.isPercent = percent != null;
|
|
@@ -144,17 +147,17 @@ class G2PieComponent extends G2BaseComponent {
|
|
|
144
147
|
onChanges() {
|
|
145
148
|
this.fixData();
|
|
146
149
|
}
|
|
147
|
-
static
|
|
148
|
-
static
|
|
150
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2PieComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
151
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.1", type: G2PieComponent, isStandalone: true, selector: "g2-pie", inputs: { animate: ["animate", "animate", booleanAttribute], color: "color", subTitle: "subTitle", total: "total", height: ["height", "height", numberAttribute], hasLegend: ["hasLegend", "hasLegend", booleanAttribute], inner: "inner", padding: "padding", percent: ["percent", "percent", numberAttribute], tooltip: ["tooltip", "tooltip", booleanAttribute], lineWidth: ["lineWidth", "lineWidth", numberAttribute], blockMaxWidth: ["blockMaxWidth", "blockMaxWidth", numberAttribute], select: ["select", "select", booleanAttribute], valueFormat: "valueFormat", data: "data", colors: "colors", interaction: "interaction", ratio: "ratio" }, outputs: { clickItem: "clickItem" }, host: { properties: { "class.g2-pie": "true", "class.g2-pie__legend-has": "hasLegend", "class.g2-pie__legend-block": "block", "class.g2-pie__mini": "isPercent" } }, exportAs: ["g2Pie"], usesInheritance: true, ngImport: i0, template: "@if (!loaded) {\n <nz-skeleton />\n}\n<div class=\"g2-pie__chart\">\n <div #container></div>\n @if (subTitle || total) {\n <div class=\"g2-pie__total\">\n @if (subTitle) {\n <h4 class=\"g2-pie__total-title\">\n <ng-container *nzStringTemplateOutlet=\"subTitle\">\n <div [innerHTML]=\"subTitle\"></div>\n </ng-container>\n </h4>\n }\n @if (total) {\n <div class=\"g2-pie__total-stat\">\n <ng-container *nzStringTemplateOutlet=\"total\">\n <div [innerHTML]=\"total\"></div>\n </ng-container>\n </div>\n }\n </div>\n }\n</div>\n@if (hasLegend && legendData.length > 0) {\n <ul class=\"g2-pie__legend\">\n @for (item of legendData; track $index) {\n <li (click)=\"_click($index)\" class=\"g2-pie__legend-item\">\n <span class=\"g2-pie__legend-dot\" [style]=\"{ 'background-color': !item.checked ? '#aaa' : item.color }\"></span>\n <span class=\"g2-pie__legend-title\">{{ item.x }}</span>\n <nz-divider nzType=\"vertical\" />\n <span class=\"g2-pie__legend-percent\">{{ item.percent }}%</span>\n <span class=\"g2-pie__legend-value\" [innerHTML]=\"valueFormat ? valueFormat(item.y) : item.y\"></span>\n </li>\n }\n </ul>\n}\n", dependencies: [{ kind: "component", type: NzSkeletonComponent, selector: "nz-skeleton", inputs: ["nzActive", "nzLoading", "nzRound", "nzTitle", "nzAvatar", "nzParagraph"], exportAs: ["nzSkeleton"] }, { kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "component", type: NzDividerComponent, selector: "nz-divider", inputs: ["nzText", "nzType", "nzOrientation", "nzVariant", "nzDashed", "nzPlain"], exportAs: ["nzDivider"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
149
152
|
}
|
|
150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2PieComponent, decorators: [{
|
|
151
154
|
type: Component,
|
|
152
155
|
args: [{ selector: 'g2-pie', exportAs: 'g2Pie', host: {
|
|
153
156
|
'[class.g2-pie]': 'true',
|
|
154
157
|
'[class.g2-pie__legend-has]': 'hasLegend',
|
|
155
158
|
'[class.g2-pie__legend-block]': 'block',
|
|
156
159
|
'[class.g2-pie__mini]': 'isPercent'
|
|
157
|
-
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None,
|
|
160
|
+
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NzSkeletonComponent, NzStringTemplateOutletDirective, NzDividerComponent], template: "@if (!loaded) {\n <nz-skeleton />\n}\n<div class=\"g2-pie__chart\">\n <div #container></div>\n @if (subTitle || total) {\n <div class=\"g2-pie__total\">\n @if (subTitle) {\n <h4 class=\"g2-pie__total-title\">\n <ng-container *nzStringTemplateOutlet=\"subTitle\">\n <div [innerHTML]=\"subTitle\"></div>\n </ng-container>\n </h4>\n }\n @if (total) {\n <div class=\"g2-pie__total-stat\">\n <ng-container *nzStringTemplateOutlet=\"total\">\n <div [innerHTML]=\"total\"></div>\n </ng-container>\n </div>\n }\n </div>\n }\n</div>\n@if (hasLegend && legendData.length > 0) {\n <ul class=\"g2-pie__legend\">\n @for (item of legendData; track $index) {\n <li (click)=\"_click($index)\" class=\"g2-pie__legend-item\">\n <span class=\"g2-pie__legend-dot\" [style]=\"{ 'background-color': !item.checked ? '#aaa' : item.color }\"></span>\n <span class=\"g2-pie__legend-title\">{{ item.x }}</span>\n <nz-divider nzType=\"vertical\" />\n <span class=\"g2-pie__legend-percent\">{{ item.percent }}%</span>\n <span class=\"g2-pie__legend-value\" [innerHTML]=\"valueFormat ? valueFormat(item.y) : item.y\"></span>\n </li>\n }\n </ul>\n}\n" }]
|
|
158
161
|
}], propDecorators: { animate: [{
|
|
159
162
|
type: Input,
|
|
160
163
|
args: [{ transform: booleanAttribute }]
|
|
@@ -205,11 +208,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
205
208
|
|
|
206
209
|
const COMPONENTS = [G2PieComponent];
|
|
207
210
|
class G2PieModule {
|
|
208
|
-
static
|
|
209
|
-
static
|
|
210
|
-
static
|
|
211
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2PieModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
212
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: G2PieModule, imports: [CommonModule, NzDividerModule, NzOutletModule, NzSkeletonModule, G2PieComponent], exports: [G2PieComponent] });
|
|
213
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2PieModule, imports: [CommonModule, NzDividerModule, NzOutletModule, NzSkeletonModule, COMPONENTS] });
|
|
211
214
|
}
|
|
212
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2PieModule, decorators: [{
|
|
213
216
|
type: NgModule,
|
|
214
217
|
args: [{
|
|
215
218
|
imports: [CommonModule, NzDividerModule, NzOutletModule, NzSkeletonModule, ...COMPONENTS],
|
package/fesm2022/pie.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie.mjs","sources":["../../../../packages/chart/pie/pie.component.ts","../../../../packages/chart/pie/pie.component.html","../../../../packages/chart/pie/pie.module.ts","../../../../packages/chart/pie/pie.ts"],"sourcesContent":["import { NgStyle } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n numberAttribute\n} from '@angular/core';\n\nimport type { Chart, Event } from '@antv/g2';\n\nimport { G2BaseComponent, G2InteractionType } from '@delon/chart/core';\nimport { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { NzDividerComponent } from 'ng-zorro-antd/divider';\nimport { NzSkeletonComponent } from 'ng-zorro-antd/skeleton';\n\nexport interface G2PieData {\n x: NzSafeAny;\n y: number;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2PieClickItem {\n item: G2PieData;\n ev: Event;\n}\n\nexport interface G2PieRatio {\n /** 占比文本,默认:`占比` */\n text: string;\n /** 反比文本,默认:`反比` */\n inverse: string;\n /** 正比颜色,默认使用 `color` 值 */\n color: string;\n /** 反比颜色,默认:`#F0F2F5` */\n inverseColor: string;\n}\n\n@Component({\n selector: 'g2-pie',\n exportAs: 'g2Pie',\n templateUrl: './pie.component.html',\n host: {\n '[class.g2-pie]': 'true',\n '[class.g2-pie__legend-has]': 'hasLegend',\n '[class.g2-pie__legend-block]': 'block',\n '[class.g2-pie__mini]': 'isPercent'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n imports: [NzSkeletonComponent, NzStringTemplateOutletDirective, NzDividerComponent, NgStyle]\n})\nexport class G2PieComponent extends G2BaseComponent {\n private percentColor!: (value: string) => string;\n legendData: NzSafeAny[] = [];\n isPercent = false;\n\n // #region fields\n\n @Input({ transform: booleanAttribute }) animate = true;\n @Input() color = 'rgba(24, 144, 255, 0.85)';\n @Input() subTitle?: string | TemplateRef<void> | null;\n @Input() total?: string | number | TemplateRef<void> | null;\n @Input({ transform: numberAttribute }) height = 0;\n @Input({ transform: booleanAttribute }) hasLegend = false;\n @Input() inner = 0.75;\n @Input() padding: number | number[] | 'auto' = [12, 0, 12, 0];\n @Input({ transform: numberAttribute }) percent?: number;\n @Input({ transform: booleanAttribute }) tooltip = true;\n @Input({ transform: numberAttribute }) lineWidth = 0;\n @Input({ transform: numberAttribute }) blockMaxWidth = 380;\n @Input({ transform: booleanAttribute }) select = true;\n @Input() valueFormat?: (y: number) => string;\n @Input() data: G2PieData[] = [];\n @Input() colors?: string[];\n @Input() interaction: G2InteractionType = 'none';\n @Input() ratio: G2PieRatio = {\n text: '占比',\n inverse: '反比',\n color: '',\n inverseColor: '#F0F2F5'\n };\n @Output() readonly clickItem = new EventEmitter<G2PieClickItem>();\n\n // #endregion\n\n block: boolean = false;\n\n private fixData(): void {\n const { percent, color } = this;\n this.isPercent = percent != null;\n if (!this.isPercent) {\n return;\n }\n\n this.select = false;\n this.tooltip = false;\n const { text, inverse, color: textColor, inverseColor } = this.ratio;\n this.percentColor = (value: string) => (value === text ? textColor || color : inverseColor);\n this.data = [\n {\n x: text,\n y: percent!\n },\n {\n x: inverse,\n y: 100 - percent!\n }\n ];\n }\n\n private updateBlock(): void {\n this.block = this._chart && this.hasLegend && this.el.nativeElement.clientWidth <= this.blockMaxWidth;\n this.cdr.detectChanges();\n }\n\n install(): void {\n const {\n node,\n height,\n padding,\n tooltip,\n inner,\n hasLegend,\n interaction,\n theme,\n animate,\n lineWidth,\n isPercent,\n percentColor,\n colors\n } = this;\n const chart: Chart = (this._chart = new this.winG2.Chart({\n container: node.nativeElement,\n autoFit: true,\n height,\n padding,\n theme\n }));\n chart.animate(animate);\n\n if (!tooltip) {\n chart.tooltip(false);\n } else {\n chart.tooltip({\n showTitle: false,\n showMarkers: false\n });\n }\n if (interaction !== 'none') {\n chart.interaction(interaction);\n }\n chart.axis(false).legend(false).coordinate('theta', { innerRadius: inner });\n chart.filter('x', (_val: NzSafeAny, item: NzSafeAny) => item.checked !== false);\n chart\n .interval()\n .adjust('stack')\n .position('y')\n .style({ lineWidth, stroke: '#fff' })\n .color('x', isPercent ? percentColor : colors)\n .tooltip('x*percent', (name: string, p: number) => ({\n name,\n value: `${hasLegend ? p : (p * 100).toFixed(2)} %`\n }))\n .state({});\n chart.scale({\n x: {\n type: 'cat',\n range: [0, 1]\n }\n });\n\n chart\n .on(`interval:click`, (ev: Event) => {\n this.ngZone.run(() => this.clickItem.emit({ item: ev.data?.data, ev }));\n })\n .on('afterrender', () => {\n this.ngZone.run(() => this.updateBlock());\n });\n\n this.ready.next(chart);\n\n this.changeData();\n\n chart.render();\n }\n\n changeData(): void {\n const { _chart, data } = this;\n if (!_chart || !Array.isArray(data) || data.length <= 0) return;\n\n // 转化 percent\n const totalSum = data.reduce((cur, item) => cur + item.y, 0);\n for (const item of data) {\n item.percent = totalSum === 0 ? 0 : item.y / totalSum;\n }\n _chart.changeData(data);\n\n this.ngZone.run(() => this.genLegend());\n }\n\n private genLegend(): void {\n const { hasLegend, isPercent, cdr, _chart } = this;\n if (!hasLegend || isPercent) return;\n\n this.legendData = _chart.geometries[0].dataArray.map((item: NzSafeAny) => {\n const origin = item[0]._origin;\n origin.color = item[0].color;\n origin.checked = true;\n origin.percent = (origin.percent * 100).toFixed(2);\n return origin;\n });\n\n cdr.detectChanges();\n }\n\n _click(i: number): void {\n const { legendData, _chart } = this;\n legendData[i].checked = !legendData[i].checked;\n _chart.render(true);\n }\n\n onChanges(): void {\n this.fixData();\n }\n}\n","@if (!loaded) {\n <nz-skeleton />\n}\n<div class=\"g2-pie__chart\">\n <div #container></div>\n @if (subTitle || total) {\n <div class=\"g2-pie__total\">\n @if (subTitle) {\n <h4 class=\"g2-pie__total-title\">\n <ng-container *nzStringTemplateOutlet=\"subTitle\">\n <div [innerHTML]=\"subTitle\"></div>\n </ng-container>\n </h4>\n }\n @if (total) {\n <div class=\"g2-pie__total-stat\">\n <ng-container *nzStringTemplateOutlet=\"total\">\n <div [innerHTML]=\"total\"></div>\n </ng-container>\n </div>\n }\n </div>\n }\n</div>\n@if (hasLegend && legendData.length > 0) {\n <ul class=\"g2-pie__legend\">\n @for (item of legendData; track $index) {\n <li (click)=\"_click($index)\" class=\"g2-pie__legend-item\">\n <span class=\"g2-pie__legend-dot\" [ngStyle]=\"{ 'background-color': !item.checked ? '#aaa' : item.color }\"></span>\n <span class=\"g2-pie__legend-title\">{{ item.x }}</span>\n <nz-divider nzType=\"vertical\" />\n <span class=\"g2-pie__legend-percent\">{{ item.percent }}%</span>\n <span class=\"g2-pie__legend-value\" [innerHTML]=\"valueFormat ? valueFormat(item.y) : item.y\"></span>\n </li>\n }\n </ul>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzDividerModule } from 'ng-zorro-antd/divider';\nimport { NzSkeletonModule } from 'ng-zorro-antd/skeleton';\n\nimport { G2PieComponent } from './pie.component';\n\nconst COMPONENTS = [G2PieComponent];\n\n@NgModule({\n imports: [CommonModule, NzDividerModule, NzOutletModule, NzSkeletonModule, ...COMPONENTS],\n exports: COMPONENTS\n})\nexport class G2PieModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AA2DM,MAAO,cAAe,SAAQ,eAAe,CAAA;AAhBnD,IAAA,WAAA,GAAA;;QAkBE,IAAU,CAAA,UAAA,GAAgB,EAAE,CAAC;QAC7B,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAIsB,IAAO,CAAA,OAAA,GAAG,IAAI,CAAC;QAC9C,IAAK,CAAA,KAAA,GAAG,0BAA0B,CAAC;QAGL,IAAM,CAAA,MAAA,GAAG,CAAC,CAAC;QACV,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;QACjD,IAAK,CAAA,KAAA,GAAG,IAAI,CAAC;QACb,IAAO,CAAA,OAAA,GAA+B,CAAC,EAAE,EAAE,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;;;;"}
|
|
1
|
+
{"version":3,"file":"pie.mjs","sources":["../../../../packages/chart/pie/pie.component.ts","../../../../packages/chart/pie/pie.component.html","../../../../packages/chart/pie/pie.module.ts","../../../../packages/chart/pie/pie.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n numberAttribute\n} from '@angular/core';\n\nimport type { Chart, Event } from '@antv/g2';\n\nimport { G2BaseComponent, G2InteractionType } from '@delon/chart/core';\nimport { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { NzDividerComponent } from 'ng-zorro-antd/divider';\nimport { NzSkeletonComponent } from 'ng-zorro-antd/skeleton';\n\nexport interface G2PieData {\n x: NzSafeAny;\n y: number;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2PieClickItem {\n item: G2PieData;\n ev: Event;\n}\n\nexport interface G2PieRatio {\n /** 占比文本,默认:`占比` */\n text: string;\n /** 反比文本,默认:`反比` */\n inverse: string;\n /** 正比颜色,默认使用 `color` 值 */\n color: string;\n /** 反比颜色,默认:`#F0F2F5` */\n inverseColor: string;\n}\n\n@Component({\n selector: 'g2-pie',\n exportAs: 'g2Pie',\n templateUrl: './pie.component.html',\n host: {\n '[class.g2-pie]': 'true',\n '[class.g2-pie__legend-has]': 'hasLegend',\n '[class.g2-pie__legend-block]': 'block',\n '[class.g2-pie__mini]': 'isPercent'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NzSkeletonComponent, NzStringTemplateOutletDirective, NzDividerComponent]\n})\nexport class G2PieComponent extends G2BaseComponent {\n private percentColor!: (value: string) => string;\n legendData: NzSafeAny[] = [];\n isPercent = false;\n\n // #region fields\n\n @Input({ transform: booleanAttribute }) animate = true;\n @Input() color = 'rgba(24, 144, 255, 0.85)';\n @Input() subTitle?: string | TemplateRef<void> | null;\n @Input() total?: string | number | TemplateRef<void> | null;\n @Input({ transform: numberAttribute }) height = 0;\n @Input({ transform: booleanAttribute }) hasLegend = false;\n @Input() inner = 0.75;\n @Input() padding: number | number[] | 'auto' = [12, 0, 12, 0];\n @Input({ transform: numberAttribute }) percent?: number;\n @Input({ transform: booleanAttribute }) tooltip = true;\n @Input({ transform: numberAttribute }) lineWidth = 0;\n @Input({ transform: numberAttribute }) blockMaxWidth = 380;\n @Input({ transform: booleanAttribute }) select = true;\n @Input() valueFormat?: (y: number) => string;\n @Input() data: G2PieData[] = [];\n @Input() colors?: string[];\n @Input() interaction: G2InteractionType = 'none';\n @Input() ratio: G2PieRatio = {\n text: '占比',\n inverse: '反比',\n color: '',\n inverseColor: '#F0F2F5'\n };\n @Output() readonly clickItem = new EventEmitter<G2PieClickItem>();\n\n // #endregion\n\n block: boolean = false;\n\n private fixData(): void {\n const { percent, color } = this;\n this.isPercent = percent != null;\n if (!this.isPercent) {\n return;\n }\n\n this.select = false;\n this.tooltip = false;\n const { text, inverse, color: textColor, inverseColor } = this.ratio;\n this.percentColor = (value: string) => (value === text ? textColor || color : inverseColor);\n this.data = [\n {\n x: text,\n y: percent!\n },\n {\n x: inverse,\n y: 100 - percent!\n }\n ];\n }\n\n private updateBlock(): void {\n this.block = this._chart && this.hasLegend && this.el.nativeElement.clientWidth <= this.blockMaxWidth;\n this.cdr.detectChanges();\n }\n\n install(): void {\n const {\n node,\n height,\n padding,\n tooltip,\n inner,\n hasLegend,\n interaction,\n theme,\n animate,\n lineWidth,\n isPercent,\n percentColor,\n colors\n } = this;\n const chart: Chart = (this._chart = new this.winG2.Chart({\n container: node.nativeElement,\n autoFit: true,\n height,\n padding,\n theme\n }));\n chart.animate(animate);\n\n if (!tooltip) {\n chart.tooltip(false);\n } else {\n chart.tooltip({\n showTitle: false,\n showMarkers: false\n });\n }\n if (interaction !== 'none') {\n chart.interaction(interaction);\n }\n chart.axis(false).legend(false).coordinate('theta', { innerRadius: inner });\n chart.filter('x', (_val: NzSafeAny, item: NzSafeAny) => item.checked !== false);\n chart\n .interval()\n .adjust('stack')\n .position('y')\n .style({ lineWidth, stroke: '#fff' })\n .color('x', isPercent ? percentColor : colors)\n .tooltip('x*percent', (name: string, p: number) => ({\n name,\n value: `${hasLegend ? p : (p * 100).toFixed(2)} %`\n }))\n .state({});\n chart.scale({\n x: {\n type: 'cat',\n range: [0, 1]\n }\n });\n\n chart\n .on(`interval:click`, (ev: Event) => {\n this.ngZone.run(() => this.clickItem.emit({ item: ev.data?.data, ev }));\n })\n .on('afterrender', () => {\n this.ngZone.run(() => this.updateBlock());\n });\n\n this.ready.next(chart);\n\n this.changeData();\n\n chart.render();\n }\n\n changeData(): void {\n const { _chart, data } = this;\n if (!_chart || !Array.isArray(data) || data.length <= 0) return;\n\n // 转化 percent\n const totalSum = data.reduce((cur, item) => cur + item.y, 0);\n for (const item of data) {\n item.percent = totalSum === 0 ? 0 : item.y / totalSum;\n }\n _chart.changeData(data);\n\n this.ngZone.run(() => this.genLegend());\n }\n\n private genLegend(): void {\n const { hasLegend, isPercent, cdr, _chart } = this;\n if (!hasLegend || isPercent) return;\n\n this.legendData = _chart.geometries[0].dataArray.map((item: NzSafeAny) => {\n const origin = item[0]._origin;\n origin.color = item[0].color;\n origin.checked = true;\n origin.percent = (origin.percent * 100).toFixed(2);\n return origin;\n });\n\n cdr.detectChanges();\n }\n\n _click(i: number): void {\n const { legendData, _chart } = this;\n legendData[i].checked = !legendData[i].checked;\n _chart.render(true);\n }\n\n onChanges(): void {\n this.fixData();\n }\n}\n","@if (!loaded) {\n <nz-skeleton />\n}\n<div class=\"g2-pie__chart\">\n <div #container></div>\n @if (subTitle || total) {\n <div class=\"g2-pie__total\">\n @if (subTitle) {\n <h4 class=\"g2-pie__total-title\">\n <ng-container *nzStringTemplateOutlet=\"subTitle\">\n <div [innerHTML]=\"subTitle\"></div>\n </ng-container>\n </h4>\n }\n @if (total) {\n <div class=\"g2-pie__total-stat\">\n <ng-container *nzStringTemplateOutlet=\"total\">\n <div [innerHTML]=\"total\"></div>\n </ng-container>\n </div>\n }\n </div>\n }\n</div>\n@if (hasLegend && legendData.length > 0) {\n <ul class=\"g2-pie__legend\">\n @for (item of legendData; track $index) {\n <li (click)=\"_click($index)\" class=\"g2-pie__legend-item\">\n <span class=\"g2-pie__legend-dot\" [style]=\"{ 'background-color': !item.checked ? '#aaa' : item.color }\"></span>\n <span class=\"g2-pie__legend-title\">{{ item.x }}</span>\n <nz-divider nzType=\"vertical\" />\n <span class=\"g2-pie__legend-percent\">{{ item.percent }}%</span>\n <span class=\"g2-pie__legend-value\" [innerHTML]=\"valueFormat ? valueFormat(item.y) : item.y\"></span>\n </li>\n }\n </ul>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzDividerModule } from 'ng-zorro-antd/divider';\nimport { NzSkeletonModule } from 'ng-zorro-antd/skeleton';\n\nimport { G2PieComponent } from './pie.component';\n\nconst COMPONENTS = [G2PieComponent];\n\n@NgModule({\n imports: [CommonModule, NzDividerModule, NzOutletModule, NzSkeletonModule, ...COMPONENTS],\n exports: COMPONENTS\n})\nexport class G2PieModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAyDM,MAAO,cAAe,SAAQ,eAAe,CAAA;AACzC,IAAA,YAAY;IACpB,UAAU,GAAgB,EAAE;IAC5B,SAAS,GAAG,KAAK;;IAIuB,OAAO,GAAG,IAAI;IAC7C,KAAK,GAAG,0BAA0B;AAClC,IAAA,QAAQ;AACR,IAAA,KAAK;IACyB,MAAM,GAAG,CAAC;IACT,SAAS,GAAG,KAAK;IAChD,KAAK,GAAG,IAAI;IACZ,OAAO,GAA+B,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACtB,IAAA,OAAO;IACN,OAAO,GAAG,IA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AA,EAAA,CAAA;kBAJvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC;AACzF,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACdD;;AAEG;;;;"}
|
package/fesm2022/radar.mjs
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { NgStyle, CommonModule } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
2
|
import { EventEmitter, numberAttribute, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
|
|
4
3
|
import { G2BaseComponent } from '@delon/chart/core';
|
|
5
4
|
import { NzStringTemplateOutletDirective, NzOutletModule } from 'ng-zorro-antd/core/outlet';
|
|
6
5
|
import { NzRowDirective, NzColDirective, NzGridModule } from 'ng-zorro-antd/grid';
|
|
7
6
|
import { NzSkeletonComponent, NzSkeletonModule } from 'ng-zorro-antd/skeleton';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
8
|
|
|
9
9
|
class G2RadarComponent extends G2BaseComponent {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
10
|
+
legendData = [];
|
|
11
|
+
// #region fields
|
|
12
|
+
title;
|
|
13
|
+
height = 0;
|
|
14
|
+
padding = [44, 30, 16, 30];
|
|
15
|
+
hasLegend = true;
|
|
16
|
+
tickCount = 4;
|
|
17
|
+
data = [];
|
|
18
|
+
colors = ['#1890FF', '#FACC14', '#2FC25B', '#8543E0', '#F04864', '#13C2C2', '#fa8c16', '#a0d911'];
|
|
19
|
+
clickItem = new EventEmitter();
|
|
21
20
|
// #endregion
|
|
22
21
|
getHeight() {
|
|
23
22
|
return this.height - (this.hasLegend ? 80 : 22);
|
|
@@ -110,15 +109,15 @@ class G2RadarComponent extends G2BaseComponent {
|
|
|
110
109
|
onChanges() {
|
|
111
110
|
this.legendData.forEach(i => (i.checked = true));
|
|
112
111
|
}
|
|
113
|
-
static
|
|
114
|
-
static
|
|
112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2RadarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
113
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.1", type: G2RadarComponent, isStandalone: true, selector: "g2-radar", inputs: { title: "title", height: ["height", "height", numberAttribute], padding: "padding", hasLegend: ["hasLegend", "hasLegend", booleanAttribute], tickCount: ["tickCount", "tickCount", numberAttribute], data: "data", colors: "colors" }, outputs: { clickItem: "clickItem" }, host: { properties: { "style.height.px": "height", "class.g2-radar": "true" } }, exportAs: ["g2Radar"], usesInheritance: true, ngImport: i0, template: "@if (!loaded) {\n <nz-skeleton />\n}\n<ng-container *nzStringTemplateOutlet=\"title\">\n <h4>{{ title }}</h4>\n</ng-container>\n<div #container></div>\n@if (hasLegend) {\n <div nz-row class=\"g2-radar__legend\">\n @for (i of legendData; track $index) {\n <div nz-col [nzSpan]=\"24 / legendData.length\" (click)=\"_click($index)\" class=\"g2-radar__legend-item\">\n <i class=\"g2-radar__legend-dot\" [style]=\"{ 'background-color': !i.checked ? '#aaa' : i.color }\"></i>\n {{ i.name }}\n <h6 class=\"g2-radar__legend-title\">{{ i.value }}</h6>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: NzSkeletonComponent, selector: "nz-skeleton", inputs: ["nzActive", "nzLoading", "nzRound", "nzTitle", "nzAvatar", "nzParagraph"], exportAs: ["nzSkeleton"] }, { kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "directive", type: NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
115
114
|
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2RadarComponent, decorators: [{
|
|
117
116
|
type: Component,
|
|
118
117
|
args: [{ selector: 'g2-radar', exportAs: 'g2Radar', host: {
|
|
119
118
|
'[style.height.px]': 'height',
|
|
120
119
|
'[class.g2-radar]': 'true'
|
|
121
|
-
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None,
|
|
120
|
+
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NzSkeletonComponent, NzStringTemplateOutletDirective, NzRowDirective, NzColDirective], template: "@if (!loaded) {\n <nz-skeleton />\n}\n<ng-container *nzStringTemplateOutlet=\"title\">\n <h4>{{ title }}</h4>\n</ng-container>\n<div #container></div>\n@if (hasLegend) {\n <div nz-row class=\"g2-radar__legend\">\n @for (i of legendData; track $index) {\n <div nz-col [nzSpan]=\"24 / legendData.length\" (click)=\"_click($index)\" class=\"g2-radar__legend-item\">\n <i class=\"g2-radar__legend-dot\" [style]=\"{ 'background-color': !i.checked ? '#aaa' : i.color }\"></i>\n {{ i.name }}\n <h6 class=\"g2-radar__legend-title\">{{ i.value }}</h6>\n </div>\n }\n </div>\n}\n" }]
|
|
122
121
|
}], propDecorators: { title: [{
|
|
123
122
|
type: Input
|
|
124
123
|
}], height: [{
|
|
@@ -142,11 +141,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
142
141
|
|
|
143
142
|
const COMPONENTS = [G2RadarComponent];
|
|
144
143
|
class G2RadarModule {
|
|
145
|
-
static
|
|
146
|
-
static
|
|
147
|
-
static
|
|
144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2RadarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
145
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: G2RadarModule, imports: [CommonModule, NzGridModule, NzOutletModule, NzSkeletonModule, G2RadarComponent], exports: [G2RadarComponent] });
|
|
146
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2RadarModule, imports: [CommonModule, NzGridModule, NzOutletModule, NzSkeletonModule, COMPONENTS] });
|
|
148
147
|
}
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: G2RadarModule, decorators: [{
|
|
150
149
|
type: NgModule,
|
|
151
150
|
args: [{
|
|
152
151
|
imports: [CommonModule, NzGridModule, NzOutletModule, NzSkeletonModule, ...COMPONENTS],
|