@delon/chart 12.4.1 → 13.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/bar/bar.component.d.ts +4 -1
- package/bar/bar.d.ts +1 -0
- package/bar/bar.module.d.ts +8 -0
- package/bar/package.json +5 -6
- package/card/card.component.d.ts +7 -4
- package/card/card.d.ts +1 -0
- package/card/card.module.d.ts +9 -0
- package/card/package.json +5 -6
- package/card/style/index.less +11 -0
- package/{custom/g2Custom.d.ts → chart-echarts/chart-echarts.d.ts} +1 -0
- package/chart-echarts/echarts.component.d.ts +3 -0
- package/chart-echarts/echarts.module.d.ts +7 -0
- package/chart-echarts/echarts.service.d.ts +3 -0
- package/chart-echarts/package.json +6 -7
- package/chart.d.ts +1 -0
- package/{chart-echarts/delon-chart-chart-echarts.d.ts → core/core.d.ts} +1 -0
- package/core/g2.base.component.d.ts +4 -1
- package/core/g2.servicce.d.ts +3 -0
- package/core/package.json +6 -7
- package/custom/custom.component.d.ts +4 -1
- package/{core/delon-chart-core.d.ts → custom/custom.d.ts} +1 -0
- package/custom/custom.module.d.ts +7 -0
- package/custom/package.json +6 -7
- package/esm2020/bar/bar.component.mjs +143 -0
- package/{esm2015/bar/bar.js → esm2020/bar/bar.mjs} +0 -0
- package/esm2020/bar/bar.module.mjs +21 -0
- package/{esm2015/bar/public_api.js → esm2020/bar/public_api.mjs} +0 -0
- package/esm2020/card/card.component.mjs +55 -0
- package/{esm2015/card/card.js → esm2020/card/card.mjs} +0 -0
- package/esm2020/card/card.module.mjs +22 -0
- package/{esm2015/card/public_api.js → esm2020/card/public_api.mjs} +0 -0
- package/esm2020/chart-echarts/chart-echarts.mjs +5 -0
- package/esm2020/chart-echarts/echarts.component.mjs +162 -0
- package/esm2020/chart-echarts/echarts.module.mjs +20 -0
- package/esm2020/chart-echarts/echarts.service.mjs +60 -0
- package/{esm2015/chart-echarts/echarts.types.js → esm2020/chart-echarts/echarts.types.mjs} +0 -0
- package/{esm2015/chart-echarts/public_api.js → esm2020/chart-echarts/public_api.mjs} +0 -0
- package/{esm2015/chart.js → esm2020/chart.mjs} +0 -0
- package/esm2020/core/core.mjs +5 -0
- package/esm2020/core/g2.base.component.mjs +109 -0
- package/esm2020/core/g2.servicce.mjs +54 -0
- package/{esm2015/core/public_api.js → esm2020/core/public_api.mjs} +0 -0
- package/{esm2015/core/types/interaction.js → esm2020/core/types/interaction.mjs} +0 -0
- package/{esm2015/core/types/time.js → esm2020/core/types/time.mjs} +0 -0
- package/esm2020/core/utils.mjs +21 -0
- package/esm2020/custom/custom.component.mjs +70 -0
- package/esm2020/custom/custom.mjs +5 -0
- package/esm2020/custom/custom.module.mjs +20 -0
- package/{esm2015/custom/public_api.js → esm2020/custom/public_api.mjs} +0 -0
- package/esm2020/gauge/gauge.component.mjs +169 -0
- package/{esm2015/gauge/gauge.js → esm2020/gauge/gauge.mjs} +0 -0
- package/esm2020/gauge/gauge.module.mjs +20 -0
- package/{esm2015/gauge/public_api.js → esm2020/gauge/public_api.mjs} +0 -0
- package/esm2020/mini-area/mini-area.component.mjs +133 -0
- package/{esm2015/mini-area/mini-area.js → esm2020/mini-area/mini-area.mjs} +0 -0
- package/esm2020/mini-area/mini-area.module.mjs +19 -0
- package/{esm2015/mini-area/public_api.js → esm2020/mini-area/public_api.mjs} +0 -0
- package/esm2020/mini-bar/mini-bar.component.mjs +100 -0
- package/{esm2015/mini-bar/mini-bar.js → esm2020/mini-bar/mini-bar.mjs} +0 -0
- package/esm2020/mini-bar/mini-bar.module.mjs +19 -0
- package/{esm2015/mini-bar/public_api.js → esm2020/mini-bar/public_api.mjs} +0 -0
- package/esm2020/mini-progress/mini-progress.component.mjs +46 -0
- package/{esm2015/mini-progress/mini-progress.js → esm2020/mini-progress/mini-progress.mjs} +0 -0
- package/esm2020/mini-progress/mini-progress.module.mjs +21 -0
- package/{esm2015/mini-progress/public_api.js → esm2020/mini-progress/public_api.mjs} +0 -0
- package/esm2020/number-info/number-info.component.mjs +45 -0
- package/{esm2015/number-info/number-info.js → esm2020/number-info/number-info.mjs} +0 -0
- package/esm2020/number-info/number-info.module.mjs +21 -0
- package/{esm2015/number-info/public_api.js → esm2020/number-info/public_api.mjs} +0 -0
- package/esm2020/pie/pie.component.mjs +215 -0
- package/{esm2015/pie/pie.js → esm2020/pie/pie.mjs} +0 -0
- package/esm2020/pie/pie.module.mjs +22 -0
- package/{esm2015/pie/public_api.js → esm2020/pie/public_api.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/{esm2015/radar/public_api.js → esm2020/radar/public_api.mjs} +0 -0
- package/esm2020/radar/radar.component.mjs +148 -0
- package/{esm2015/radar/radar.js → esm2020/radar/radar.mjs} +0 -0
- package/esm2020/radar/radar.module.mjs +22 -0
- package/{esm2015/single-bar/public_api.js → esm2020/single-bar/public_api.mjs} +0 -0
- package/esm2020/single-bar/single-bar.component.mjs +126 -0
- package/{esm2015/single-bar/single-bar.js → esm2020/single-bar/single-bar.mjs} +0 -0
- package/esm2020/single-bar/single-bar.module.mjs +19 -0
- package/{esm2015/tag-cloud/public_api.js → esm2020/tag-cloud/public_api.mjs} +0 -0
- package/esm2020/tag-cloud/tag-cloud.component.mjs +161 -0
- package/{esm2015/tag-cloud/tag-cloud.js → esm2020/tag-cloud/tag-cloud.mjs} +0 -0
- package/esm2020/tag-cloud/tag-cloud.module.mjs +20 -0
- package/{esm2015/timeline/public_api.js → esm2020/timeline/public_api.mjs} +0 -0
- package/esm2020/timeline/timeline.component.mjs +204 -0
- package/{esm2015/timeline/timeline.js → esm2020/timeline/timeline.mjs} +0 -0
- package/esm2020/timeline/timeline.module.mjs +21 -0
- package/{esm2015/trend/public_api.js → esm2020/trend/public_api.mjs} +0 -0
- package/esm2020/trend/trend.component.mjs +52 -0
- package/{esm2015/trend/trend.js → esm2020/trend/trend.mjs} +0 -0
- package/esm2020/trend/trend.module.mjs +20 -0
- package/{esm2015/water-wave/public_api.js → esm2020/water-wave/public_api.mjs} +0 -0
- package/esm2020/water-wave/water-wave.component.mjs +221 -0
- package/{esm2015/water-wave/water-wave.js → esm2020/water-wave/water-wave.mjs} +0 -0
- package/esm2020/water-wave/water-wave.module.mjs +20 -0
- package/fesm2015/{bar.js → bar.mjs} +57 -34
- package/fesm2015/bar.mjs.map +1 -0
- package/fesm2015/card.mjs +81 -0
- package/fesm2015/card.mjs.map +1 -0
- package/fesm2015/{delon-chart-chart-echarts.js → chart-echarts.mjs} +62 -53
- package/fesm2015/chart-echarts.mjs.map +1 -0
- package/fesm2015/{chart.js → chart.mjs} +1 -1
- package/fesm2015/chart.mjs.map +1 -0
- package/fesm2015/{delon-chart-core.js → core.mjs} +23 -29
- package/fesm2015/core.mjs.map +1 -0
- package/fesm2015/custom.mjs +94 -0
- package/fesm2015/custom.mjs.map +1 -0
- package/fesm2015/{gauge.js → gauge.mjs} +46 -31
- package/fesm2015/gauge.mjs.map +1 -0
- package/fesm2015/mini-area.mjs +156 -0
- package/fesm2015/mini-area.mjs.map +1 -0
- package/fesm2015/mini-bar.mjs +123 -0
- package/fesm2015/mini-bar.mjs.map +1 -0
- package/fesm2015/mini-progress.mjs +71 -0
- package/fesm2015/mini-progress.mjs.map +1 -0
- package/fesm2015/number-info.mjs +70 -0
- package/fesm2015/number-info.mjs.map +1 -0
- package/fesm2015/pie.mjs +241 -0
- package/fesm2015/pie.mjs.map +1 -0
- package/fesm2015/{radar.js → radar.mjs} +43 -33
- package/fesm2015/radar.mjs.map +1 -0
- package/fesm2015/single-bar.mjs +147 -0
- package/fesm2015/single-bar.mjs.map +1 -0
- package/fesm2015/{tag-cloud.js → tag-cloud.mjs} +39 -26
- package/fesm2015/tag-cloud.mjs.map +1 -0
- package/fesm2015/{timeline.js → timeline.mjs} +64 -36
- package/fesm2015/timeline.mjs.map +1 -0
- package/fesm2015/trend.mjs +76 -0
- package/fesm2015/trend.mjs.map +1 -0
- package/fesm2015/{water-wave.js → water-wave.mjs} +38 -37
- package/fesm2015/water-wave.mjs.map +1 -0
- package/fesm2020/bar.mjs +168 -0
- package/fesm2020/bar.mjs.map +1 -0
- package/fesm2020/card.mjs +81 -0
- package/fesm2020/card.mjs.map +1 -0
- package/fesm2020/chart-echarts.mjs +242 -0
- package/fesm2020/chart-echarts.mjs.map +1 -0
- package/fesm2020/chart.mjs +7 -0
- package/fesm2020/chart.mjs.map +1 -0
- package/fesm2020/core.mjs +187 -0
- package/fesm2020/core.mjs.map +1 -0
- package/fesm2020/custom.mjs +94 -0
- package/fesm2020/custom.mjs.map +1 -0
- package/fesm2020/gauge.mjs +193 -0
- package/fesm2020/gauge.mjs.map +1 -0
- package/fesm2020/mini-area.mjs +156 -0
- package/fesm2020/mini-area.mjs.map +1 -0
- package/fesm2020/mini-bar.mjs +123 -0
- package/fesm2020/mini-bar.mjs.map +1 -0
- package/fesm2020/mini-progress.mjs +71 -0
- package/fesm2020/mini-progress.mjs.map +1 -0
- package/fesm2020/number-info.mjs +70 -0
- package/fesm2020/number-info.mjs.map +1 -0
- package/fesm2020/pie.mjs +241 -0
- package/fesm2020/pie.mjs.map +1 -0
- package/fesm2020/radar.mjs +174 -0
- package/fesm2020/radar.mjs.map +1 -0
- package/fesm2020/single-bar.mjs +149 -0
- package/fesm2020/single-bar.mjs.map +1 -0
- package/fesm2020/tag-cloud.mjs +185 -0
- package/fesm2020/tag-cloud.mjs.map +1 -0
- package/fesm2020/timeline.mjs +229 -0
- package/fesm2020/timeline.mjs.map +1 -0
- package/fesm2020/trend.mjs +76 -0
- package/fesm2020/trend.mjs.map +1 -0
- package/fesm2020/water-wave.mjs +245 -0
- package/fesm2020/water-wave.mjs.map +1 -0
- package/gauge/gauge.component.d.ts +8 -5
- package/gauge/gauge.d.ts +1 -0
- package/gauge/gauge.module.d.ts +7 -0
- package/gauge/package.json +5 -6
- package/mini-area/mini-area.component.d.ts +3 -0
- package/mini-area/mini-area.d.ts +1 -0
- package/mini-area/mini-area.module.d.ts +6 -0
- package/mini-area/package.json +5 -6
- package/mini-bar/mini-bar.component.d.ts +3 -0
- package/mini-bar/mini-bar.d.ts +1 -0
- package/mini-bar/mini-bar.module.d.ts +6 -0
- package/mini-bar/package.json +5 -6
- package/mini-progress/mini-progress.component.d.ts +6 -3
- package/mini-progress/mini-progress.d.ts +1 -0
- package/mini-progress/mini-progress.module.d.ts +8 -0
- package/mini-progress/package.json +5 -6
- package/mini-progress/style/index.less +5 -0
- package/number-info/number-info.component.d.ts +9 -6
- package/number-info/number-info.d.ts +1 -0
- package/number-info/number-info.module.d.ts +8 -0
- package/number-info/package.json +5 -6
- package/number-info/style/index.less +12 -0
- package/package.json +160 -12
- package/pie/package.json +5 -6
- package/pie/pie.component.d.ts +8 -5
- package/pie/pie.d.ts +1 -0
- package/pie/pie.module.d.ts +9 -0
- package/pie/style/index.less +14 -0
- package/radar/package.json +5 -6
- package/radar/radar.component.d.ts +4 -1
- package/radar/radar.d.ts +1 -0
- package/radar/radar.module.d.ts +9 -0
- package/radar/style/index.less +6 -0
- package/single-bar/package.json +5 -6
- package/single-bar/single-bar.component.d.ts +4 -1
- package/single-bar/single-bar.d.ts +1 -0
- package/single-bar/single-bar.module.d.ts +6 -0
- package/tag-cloud/package.json +5 -6
- package/tag-cloud/tag-cloud.component.d.ts +3 -0
- package/tag-cloud/tag-cloud.d.ts +1 -0
- package/tag-cloud/tag-cloud.module.d.ts +7 -0
- package/timeline/package.json +5 -6
- package/timeline/timeline.component.d.ts +5 -2
- package/timeline/timeline.d.ts +1 -0
- package/timeline/timeline.module.d.ts +8 -0
- package/trend/package.json +5 -6
- package/trend/style/index.less +6 -0
- package/trend/trend.component.d.ts +4 -1
- package/trend/trend.d.ts +1 -0
- package/trend/trend.module.d.ts +7 -0
- package/water-wave/package.json +5 -6
- package/water-wave/style/index.less +4 -0
- package/water-wave/water-wave.component.d.ts +5 -2
- package/water-wave/water-wave.d.ts +1 -0
- package/water-wave/water-wave.module.d.ts +7 -0
- package/bar/bar.metadata.json +0 -1
- package/bundles/bar.umd.js +0 -471
- package/bundles/bar.umd.js.map +0 -1
- package/bundles/card.umd.js +0 -408
- package/bundles/card.umd.js.map +0 -1
- package/bundles/chart.umd.js +0 -19
- package/bundles/chart.umd.js.map +0 -1
- package/bundles/delon-chart-chart-echarts.umd.js +0 -617
- package/bundles/delon-chart-chart-echarts.umd.js.map +0 -1
- package/bundles/delon-chart-core.umd.js +0 -550
- package/bundles/delon-chart-core.umd.js.map +0 -1
- package/bundles/g2Custom.umd.js +0 -407
- package/bundles/g2Custom.umd.js.map +0 -1
- package/bundles/gauge.umd.js +0 -511
- package/bundles/gauge.umd.js.map +0 -1
- package/bundles/mini-area.umd.js +0 -471
- package/bundles/mini-area.umd.js.map +0 -1
- package/bundles/mini-bar.umd.js +0 -444
- package/bundles/mini-bar.umd.js.map +0 -1
- package/bundles/mini-progress.umd.js +0 -401
- package/bundles/mini-progress.umd.js.map +0 -1
- package/bundles/number-info.umd.js +0 -392
- package/bundles/number-info.umd.js.map +0 -1
- package/bundles/pie.umd.js +0 -567
- package/bundles/pie.umd.js.map +0 -1
- package/bundles/radar.umd.js +0 -497
- package/bundles/radar.umd.js.map +0 -1
- package/bundles/single-bar.umd.js +0 -464
- package/bundles/single-bar.umd.js.map +0 -1
- package/bundles/tag-cloud.umd.js +0 -495
- package/bundles/tag-cloud.umd.js.map +0 -1
- package/bundles/timeline.umd.js +0 -524
- package/bundles/timeline.umd.js.map +0 -1
- package/bundles/trend.umd.js +0 -391
- package/bundles/trend.umd.js.map +0 -1
- package/bundles/water-wave.umd.js +0 -587
- package/bundles/water-wave.umd.js.map +0 -1
- package/card/card.metadata.json +0 -1
- package/chart-echarts/delon-chart-chart-echarts.metadata.json +0 -1
- package/chart.metadata.json +0 -1
- package/core/delon-chart-core.metadata.json +0 -1
- package/custom/g2Custom.metadata.json +0 -1
- package/esm2015/bar/bar.component.js +0 -124
- package/esm2015/bar/bar.module.js +0 -16
- package/esm2015/card/card.component.js +0 -52
- package/esm2015/card/card.module.js +0 -17
- package/esm2015/chart-echarts/delon-chart-chart-echarts.js +0 -5
- package/esm2015/chart-echarts/echarts.component.js +0 -152
- package/esm2015/chart-echarts/echarts.module.js +0 -15
- package/esm2015/chart-echarts/echarts.service.js +0 -64
- package/esm2015/core/delon-chart-core.js +0 -5
- package/esm2015/core/g2.base.component.js +0 -110
- package/esm2015/core/g2.servicce.js +0 -58
- package/esm2015/core/utils.js +0 -15
- package/esm2015/custom/custom.component.js +0 -58
- package/esm2015/custom/custom.module.js +0 -15
- package/esm2015/custom/g2Custom.js +0 -5
- package/esm2015/gauge/gauge.component.js +0 -158
- package/esm2015/gauge/gauge.module.js +0 -15
- package/esm2015/mini-area/mini-area.component.js +0 -117
- package/esm2015/mini-area/mini-area.module.js +0 -14
- package/esm2015/mini-bar/mini-bar.component.js +0 -90
- package/esm2015/mini-bar/mini-bar.module.js +0 -14
- package/esm2015/mini-progress/mini-progress.component.js +0 -50
- package/esm2015/mini-progress/mini-progress.module.js +0 -16
- package/esm2015/number-info/number-info.component.js +0 -40
- package/esm2015/number-info/number-info.module.js +0 -16
- package/esm2015/pie/pie.component.js +0 -197
- package/esm2015/pie/pie.module.js +0 -17
- package/esm2015/radar/radar.component.js +0 -142
- package/esm2015/radar/radar.module.js +0 -17
- package/esm2015/single-bar/single-bar.component.js +0 -111
- package/esm2015/single-bar/single-bar.module.js +0 -14
- package/esm2015/tag-cloud/tag-cloud.component.js +0 -142
- package/esm2015/tag-cloud/tag-cloud.module.js +0 -15
- package/esm2015/timeline/timeline.component.js +0 -178
- package/esm2015/timeline/timeline.module.js +0 -16
- package/esm2015/trend/trend.component.js +0 -42
- package/esm2015/trend/trend.module.js +0 -15
- package/esm2015/water-wave/water-wave.component.js +0 -224
- package/esm2015/water-wave/water-wave.module.js +0 -15
- package/fesm2015/bar.js.map +0 -1
- package/fesm2015/card.js +0 -74
- package/fesm2015/card.js.map +0 -1
- package/fesm2015/chart.js.map +0 -1
- package/fesm2015/delon-chart-chart-echarts.js.map +0 -1
- package/fesm2015/delon-chart-core.js.map +0 -1
- package/fesm2015/g2Custom.js +0 -78
- package/fesm2015/g2Custom.js.map +0 -1
- package/fesm2015/gauge.js.map +0 -1
- package/fesm2015/mini-area.js +0 -136
- package/fesm2015/mini-area.js.map +0 -1
- package/fesm2015/mini-bar.js +0 -109
- package/fesm2015/mini-bar.js.map +0 -1
- package/fesm2015/mini-progress.js +0 -70
- package/fesm2015/mini-progress.js.map +0 -1
- package/fesm2015/number-info.js +0 -61
- package/fesm2015/number-info.js.map +0 -1
- package/fesm2015/pie.js +0 -219
- package/fesm2015/pie.js.map +0 -1
- package/fesm2015/radar.js.map +0 -1
- package/fesm2015/single-bar.js +0 -130
- package/fesm2015/single-bar.js.map +0 -1
- package/fesm2015/tag-cloud.js.map +0 -1
- package/fesm2015/timeline.js.map +0 -1
- package/fesm2015/trend.js +0 -62
- package/fesm2015/trend.js.map +0 -1
- package/fesm2015/water-wave.js.map +0 -1
- package/gauge/gauge.metadata.json +0 -1
- package/mini-area/mini-area.metadata.json +0 -1
- package/mini-bar/mini-bar.metadata.json +0 -1
- package/mini-progress/mini-progress.metadata.json +0 -1
- package/number-info/number-info.metadata.json +0 -1
- package/pie/pie.metadata.json +0 -1
- package/radar/radar.metadata.json +0 -1
- package/single-bar/single-bar.metadata.json +0 -1
- package/tag-cloud/tag-cloud.metadata.json +0 -1
- package/timeline/timeline.metadata.json +0 -1
- package/trend/trend.metadata.json +0 -1
- package/water-wave/water-wave.metadata.json +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
4
|
+
import { G2BaseComponent } from '@delon/chart/core';
|
|
5
|
+
import { InputNumber } from '@delon/util/decorator';
|
|
6
|
+
import * as i1 from 'ng-zorro-antd/skeleton';
|
|
7
|
+
import { NzSkeletonModule } from 'ng-zorro-antd/skeleton';
|
|
8
|
+
import * as i2 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
|
+
|
|
11
|
+
class G2GaugeComponent extends G2BaseComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.color = '#2f9cff';
|
|
15
|
+
this.padding = [10, 10, 30, 10];
|
|
16
|
+
}
|
|
17
|
+
// #endregion
|
|
18
|
+
install() {
|
|
19
|
+
// 自定义Shape 部分
|
|
20
|
+
window.G2.registerShape('point', 'pointer', {
|
|
21
|
+
draw(cfg, container) {
|
|
22
|
+
const group = container.addGroup({});
|
|
23
|
+
// 获取极坐标系下画布中心点
|
|
24
|
+
const center = this.parsePoint({ x: 0, y: 0 });
|
|
25
|
+
// 绘制指针
|
|
26
|
+
group.addShape('line', {
|
|
27
|
+
attrs: {
|
|
28
|
+
x1: center.x,
|
|
29
|
+
y1: center.y,
|
|
30
|
+
x2: cfg.x,
|
|
31
|
+
y2: cfg.y,
|
|
32
|
+
stroke: cfg.color,
|
|
33
|
+
lineWidth: 2.5,
|
|
34
|
+
lineCap: 'round'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
group.addShape('circle', {
|
|
38
|
+
attrs: {
|
|
39
|
+
x: center.x,
|
|
40
|
+
y: center.y,
|
|
41
|
+
r: 5.75,
|
|
42
|
+
stroke: cfg.color,
|
|
43
|
+
lineWidth: 2,
|
|
44
|
+
fill: '#fff'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return group;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const { el, height, padding, format, theme } = this;
|
|
51
|
+
const chart = (this._chart = new window.G2.Chart({
|
|
52
|
+
container: el.nativeElement,
|
|
53
|
+
autoFit: true,
|
|
54
|
+
height,
|
|
55
|
+
padding,
|
|
56
|
+
theme
|
|
57
|
+
}));
|
|
58
|
+
chart.legend(false);
|
|
59
|
+
chart.animate(false);
|
|
60
|
+
chart.tooltip(false);
|
|
61
|
+
chart.coordinate('polar', {
|
|
62
|
+
startAngle: (-9 / 8) * Math.PI,
|
|
63
|
+
endAngle: (1 / 8) * Math.PI,
|
|
64
|
+
radius: 0.75
|
|
65
|
+
});
|
|
66
|
+
chart.scale('value', {
|
|
67
|
+
min: 0,
|
|
68
|
+
max: 100,
|
|
69
|
+
nice: true,
|
|
70
|
+
tickCount: 6
|
|
71
|
+
});
|
|
72
|
+
chart.axis('1', false);
|
|
73
|
+
chart.axis('value', {
|
|
74
|
+
line: null,
|
|
75
|
+
label: {
|
|
76
|
+
offset: -14,
|
|
77
|
+
formatter: format
|
|
78
|
+
},
|
|
79
|
+
tickLine: null,
|
|
80
|
+
grid: null
|
|
81
|
+
});
|
|
82
|
+
chart.point().position('value*1').shape('pointer');
|
|
83
|
+
this.changeData();
|
|
84
|
+
chart.render();
|
|
85
|
+
}
|
|
86
|
+
changeData() {
|
|
87
|
+
const { _chart, percent, color, bgColor, title } = this;
|
|
88
|
+
if (!_chart)
|
|
89
|
+
return;
|
|
90
|
+
const data = [{ name: title, value: percent }];
|
|
91
|
+
const val = data[0].value;
|
|
92
|
+
_chart.annotation().clear(true);
|
|
93
|
+
_chart.geometries[0].color(color);
|
|
94
|
+
// 绘制仪表盘背景
|
|
95
|
+
_chart.annotation().arc({
|
|
96
|
+
top: false,
|
|
97
|
+
start: [0, 0.95],
|
|
98
|
+
end: [100, 0.95],
|
|
99
|
+
style: {
|
|
100
|
+
stroke: bgColor,
|
|
101
|
+
lineWidth: 12,
|
|
102
|
+
lineDash: null
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
_chart.annotation().arc({
|
|
106
|
+
start: [0, 0.95],
|
|
107
|
+
end: [data[0].value, 0.95],
|
|
108
|
+
style: {
|
|
109
|
+
stroke: color,
|
|
110
|
+
lineWidth: 12,
|
|
111
|
+
lineDash: null
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
_chart.annotation().text({
|
|
115
|
+
position: ['50%', '85%'],
|
|
116
|
+
content: title,
|
|
117
|
+
style: {
|
|
118
|
+
fontSize: 12,
|
|
119
|
+
fill: 'rgba(0, 0, 0, 0.43)',
|
|
120
|
+
textAlign: 'center'
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
_chart.annotation().text({
|
|
124
|
+
position: ['50%', '90%'],
|
|
125
|
+
content: `${val} %`,
|
|
126
|
+
style: {
|
|
127
|
+
fontSize: 20,
|
|
128
|
+
fill: 'rgba(0, 0, 0, 0.85)',
|
|
129
|
+
textAlign: 'center'
|
|
130
|
+
},
|
|
131
|
+
offsetY: 15
|
|
132
|
+
});
|
|
133
|
+
_chart.changeData(data);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
G2GaugeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2GaugeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
137
|
+
G2GaugeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: G2GaugeComponent, selector: "g2-gauge", inputs: { title: "title", height: "height", color: "color", bgColor: "bgColor", format: "format", percent: "percent", padding: "padding" }, host: { properties: { "class.g2-gauge": "true" } }, exportAs: ["g2Gauge"], usesInheritance: true, ngImport: i0, template: `<nz-skeleton *ngIf="!loaded"></nz-skeleton>`, isInline: true, components: [{ type: i1.NzSkeletonComponent, selector: "nz-skeleton", inputs: ["nzActive", "nzLoading", "nzRound", "nzTitle", "nzAvatar", "nzParagraph"], exportAs: ["nzSkeleton"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
138
|
+
__decorate([
|
|
139
|
+
InputNumber()
|
|
140
|
+
], G2GaugeComponent.prototype, "height", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
InputNumber()
|
|
143
|
+
], G2GaugeComponent.prototype, "percent", void 0);
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2GaugeComponent, decorators: [{
|
|
145
|
+
type: Component,
|
|
146
|
+
args: [{
|
|
147
|
+
selector: 'g2-gauge',
|
|
148
|
+
exportAs: 'g2Gauge',
|
|
149
|
+
template: `<nz-skeleton *ngIf="!loaded"></nz-skeleton>`,
|
|
150
|
+
host: {
|
|
151
|
+
'[class.g2-gauge]': 'true'
|
|
152
|
+
},
|
|
153
|
+
preserveWhitespaces: false,
|
|
154
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
155
|
+
encapsulation: ViewEncapsulation.None
|
|
156
|
+
}]
|
|
157
|
+
}], propDecorators: { title: [{
|
|
158
|
+
type: Input
|
|
159
|
+
}], height: [{
|
|
160
|
+
type: Input
|
|
161
|
+
}], color: [{
|
|
162
|
+
type: Input
|
|
163
|
+
}], bgColor: [{
|
|
164
|
+
type: Input
|
|
165
|
+
}], format: [{
|
|
166
|
+
type: Input
|
|
167
|
+
}], percent: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}], padding: [{
|
|
170
|
+
type: Input
|
|
171
|
+
}] } });
|
|
172
|
+
|
|
173
|
+
const COMPONENTS = [G2GaugeComponent];
|
|
174
|
+
class G2GaugeModule {
|
|
175
|
+
}
|
|
176
|
+
G2GaugeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2GaugeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
177
|
+
G2GaugeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2GaugeModule, declarations: [G2GaugeComponent], imports: [CommonModule, NzSkeletonModule], exports: [G2GaugeComponent] });
|
|
178
|
+
G2GaugeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2GaugeModule, imports: [[CommonModule, NzSkeletonModule]] });
|
|
179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2GaugeModule, decorators: [{
|
|
180
|
+
type: NgModule,
|
|
181
|
+
args: [{
|
|
182
|
+
imports: [CommonModule, NzSkeletonModule],
|
|
183
|
+
declarations: COMPONENTS,
|
|
184
|
+
exports: COMPONENTS
|
|
185
|
+
}]
|
|
186
|
+
}] });
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Generated bundle index. Do not edit.
|
|
190
|
+
*/
|
|
191
|
+
|
|
192
|
+
export { G2GaugeComponent, G2GaugeModule };
|
|
193
|
+
//# sourceMappingURL=gauge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gauge.mjs","sources":["../../../../packages/chart/gauge/gauge.component.ts","../../../../packages/chart/gauge/gauge.module.ts","../../../../packages/chart/gauge/gauge.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';\n\nimport type { Chart } from '@antv/g2';\n\nimport { G2BaseComponent } from '@delon/chart/core';\nimport { InputNumber, NumberInput } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n@Component({\n selector: 'g2-gauge',\n exportAs: 'g2Gauge',\n template: `<nz-skeleton *ngIf=\"!loaded\"></nz-skeleton>`,\n host: {\n '[class.g2-gauge]': 'true'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2GaugeComponent extends G2BaseComponent {\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_percent: NumberInput;\n\n // #region fields\n\n @Input() title?: string;\n @Input() @InputNumber() height?: number;\n @Input() color = '#2f9cff';\n @Input() bgColor?: string; // = '#f0f2f5';\n @Input() format?: (text: string, item: NzSafeAny, index: number) => string;\n @Input() @InputNumber() percent?: number;\n @Input() padding: number | number[] | 'auto' = [10, 10, 30, 10];\n\n // #endregion\n\n install(): void {\n // 自定义Shape 部分\n (window as NzSafeAny).G2.registerShape('point', 'pointer', {\n draw(cfg: NzSafeAny, container: NzSafeAny) {\n const group = container.addGroup({});\n // 获取极坐标系下画布中心点\n const center = (this as NzSafeAny).parsePoint({ x: 0, y: 0 });\n // 绘制指针\n group.addShape('line', {\n attrs: {\n x1: center.x,\n y1: center.y,\n x2: cfg.x,\n y2: cfg.y,\n stroke: cfg.color,\n lineWidth: 2.5,\n lineCap: 'round'\n }\n });\n group.addShape('circle', {\n attrs: {\n x: center.x,\n y: center.y,\n r: 5.75,\n stroke: cfg.color,\n lineWidth: 2,\n fill: '#fff'\n }\n });\n return group;\n }\n });\n\n const { el, height, padding, format, theme } = this;\n\n const chart: Chart = (this._chart = new (window as NzSafeAny).G2.Chart({\n container: el.nativeElement,\n autoFit: true,\n height,\n padding,\n theme\n }));\n chart.legend(false);\n chart.animate(false);\n chart.tooltip(false);\n chart.coordinate('polar', {\n startAngle: (-9 / 8) * Math.PI,\n endAngle: (1 / 8) * Math.PI,\n radius: 0.75\n });\n chart.scale('value', {\n min: 0,\n max: 100,\n nice: true,\n tickCount: 6\n });\n chart.axis('1', false);\n chart.axis('value', {\n line: null,\n label: {\n offset: -14,\n formatter: format\n },\n tickLine: null,\n grid: null\n });\n chart.point().position('value*1').shape('pointer');\n\n this.changeData();\n\n chart.render();\n }\n\n changeData(): void {\n const { _chart, percent, color, bgColor, title } = this;\n if (!_chart) return;\n\n const data = [{ name: title, value: percent }];\n const val = data[0].value;\n _chart.annotation().clear(true);\n _chart.geometries[0].color(color);\n // 绘制仪表盘背景\n _chart.annotation().arc({\n top: false,\n start: [0, 0.95],\n end: [100, 0.95],\n style: {\n stroke: bgColor,\n lineWidth: 12,\n lineDash: null\n }\n });\n _chart.annotation().arc({\n start: [0, 0.95],\n end: [data[0].value!, 0.95],\n style: {\n stroke: color,\n lineWidth: 12,\n lineDash: null\n }\n });\n\n _chart.annotation().text({\n position: ['50%', '85%'],\n content: title,\n style: {\n fontSize: 12,\n fill: 'rgba(0, 0, 0, 0.43)',\n textAlign: 'center'\n }\n });\n _chart.annotation().text({\n position: ['50%', '90%'],\n content: `${val} %`,\n style: {\n fontSize: 20,\n fill: 'rgba(0, 0, 0, 0.85)',\n textAlign: 'center'\n },\n offsetY: 15\n });\n\n _chart.changeData(data);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzSkeletonModule } from 'ng-zorro-antd/skeleton';\n\nimport { G2GaugeComponent } from './gauge.component';\n\nconst COMPONENTS = [G2GaugeComponent];\n\n@NgModule({\n imports: [CommonModule, NzSkeletonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class G2GaugeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAmBa,gBAAiB,SAAQ,eAAe;IAXrD;;QAmBW,UAAK,GAAG,SAAS,CAAC;QAIlB,YAAO,GAA+B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;KAgIjE;;IA5HC,OAAO;;QAEJ,MAAoB,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE;YACzD,IAAI,CAAC,GAAc,EAAE,SAAoB;gBACvC,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;;gBAErC,MAAM,MAAM,GAAI,IAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;gBAE9D,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;oBACrB,KAAK,EAAE;wBACL,EAAE,EAAE,MAAM,CAAC,CAAC;wBACZ,EAAE,EAAE,MAAM,CAAC,CAAC;wBACZ,EAAE,EAAE,GAAG,CAAC,CAAC;wBACT,EAAE,EAAE,GAAG,CAAC,CAAC;wBACT,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U,KAAK;sBAAb,KAAK;gBACkB,MAAM;sBAA7B,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,MAAM;sBAAd,KAAK;gBACkB,OAAO;sBAA9B,KAAK;gBACG,OAAO;sBAAf,KAAK;;;ACxBR,MAAM,UAAU,GAAG,CAAC,gBAAgB,CAAC,CAAC;MAOzB,aAAa;;0GAAb,aAAa;2GAAb,aAAa,iBAPN,gBAAgB,aAGxB,YAAY,EAAE,gBAAgB,aAHtB,gBAAgB;2GAOvB,aAAa,YAJf,CAAC,YAAY,EAAE,gBAAgB,CAAC;2FAI9B,aAAa;kBALzB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;oBACzC,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACbD;;;;;;"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
|
|
4
|
+
import { G2BaseComponent, genMiniTooltipOptions } from '@delon/chart/core';
|
|
5
|
+
import { InputNumber, InputBoolean } from '@delon/util/decorator';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
|
|
8
|
+
class G2MiniAreaComponent extends G2BaseComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
// #region fields
|
|
12
|
+
this.color = 'rgba(24, 144, 255, 0.2)';
|
|
13
|
+
this.borderColor = '#1890FF';
|
|
14
|
+
this.borderWidth = 2;
|
|
15
|
+
this.height = 56;
|
|
16
|
+
this.fit = true;
|
|
17
|
+
this.line = false;
|
|
18
|
+
this.animate = true;
|
|
19
|
+
this.padding = [8, 8, 8, 8];
|
|
20
|
+
this.data = [];
|
|
21
|
+
this.yTooltipSuffix = '';
|
|
22
|
+
this.tooltipType = 'default';
|
|
23
|
+
this.clickItem = new EventEmitter();
|
|
24
|
+
}
|
|
25
|
+
// #endregion
|
|
26
|
+
install() {
|
|
27
|
+
const { el, fit, height, padding, xAxis, yAxis, yTooltipSuffix, tooltipType, line, theme, animate, color, borderColor, borderWidth } = this;
|
|
28
|
+
const chart = (this._chart = new window.G2.Chart({
|
|
29
|
+
container: el.nativeElement,
|
|
30
|
+
autoFit: fit,
|
|
31
|
+
height,
|
|
32
|
+
padding,
|
|
33
|
+
theme
|
|
34
|
+
}));
|
|
35
|
+
chart.animate(animate);
|
|
36
|
+
if (!xAxis && !yAxis) {
|
|
37
|
+
chart.axis(false);
|
|
38
|
+
}
|
|
39
|
+
if (xAxis) {
|
|
40
|
+
chart.axis('x', xAxis);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
chart.axis('x', false);
|
|
44
|
+
}
|
|
45
|
+
if (yAxis) {
|
|
46
|
+
chart.axis('y', yAxis);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
chart.axis('y', false);
|
|
50
|
+
}
|
|
51
|
+
chart.legend(false);
|
|
52
|
+
chart.tooltip(genMiniTooltipOptions(tooltipType));
|
|
53
|
+
chart
|
|
54
|
+
.area()
|
|
55
|
+
.position('x*y')
|
|
56
|
+
.color(color)
|
|
57
|
+
.tooltip('x*y', (x, y) => ({ name: x, value: y + yTooltipSuffix }))
|
|
58
|
+
.shape('smooth');
|
|
59
|
+
if (line) {
|
|
60
|
+
chart.line().position('x*y').shape('smooth').color(borderColor).size(borderWidth).tooltip(false);
|
|
61
|
+
}
|
|
62
|
+
chart.on(`plot:click`, (ev) => {
|
|
63
|
+
const records = this._chart.getSnapRecords({ x: ev.x, y: ev.y });
|
|
64
|
+
this.ngZone.run(() => this.clickItem.emit({ item: records[0]._origin, ev }));
|
|
65
|
+
});
|
|
66
|
+
this.changeData();
|
|
67
|
+
chart.render();
|
|
68
|
+
}
|
|
69
|
+
changeData() {
|
|
70
|
+
const { _chart, data } = this;
|
|
71
|
+
if (!_chart || !Array.isArray(data) || data.length <= 0)
|
|
72
|
+
return;
|
|
73
|
+
_chart.changeData(data);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
G2MiniAreaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniAreaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
+
G2MiniAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: G2MiniAreaComponent, selector: "g2-mini-area", inputs: { color: "color", borderColor: "borderColor", borderWidth: "borderWidth", height: "height", fit: "fit", line: "line", animate: "animate", xAxis: "xAxis", yAxis: "yAxis", padding: "padding", data: "data", yTooltipSuffix: "yTooltipSuffix", tooltipType: "tooltipType" }, outputs: { clickItem: "clickItem" }, host: { properties: { "style.height.px": "height" } }, exportAs: ["g2MiniArea"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
78
|
+
__decorate([
|
|
79
|
+
InputNumber()
|
|
80
|
+
], G2MiniAreaComponent.prototype, "borderWidth", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
InputNumber()
|
|
83
|
+
], G2MiniAreaComponent.prototype, "height", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
InputBoolean()
|
|
86
|
+
], G2MiniAreaComponent.prototype, "fit", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
InputBoolean()
|
|
89
|
+
], G2MiniAreaComponent.prototype, "line", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
InputBoolean()
|
|
92
|
+
], G2MiniAreaComponent.prototype, "animate", void 0);
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniAreaComponent, decorators: [{
|
|
94
|
+
type: Component,
|
|
95
|
+
args: [{
|
|
96
|
+
selector: 'g2-mini-area',
|
|
97
|
+
exportAs: 'g2MiniArea',
|
|
98
|
+
template: ``,
|
|
99
|
+
host: {
|
|
100
|
+
'[style.height.px]': 'height'
|
|
101
|
+
},
|
|
102
|
+
preserveWhitespaces: false,
|
|
103
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
104
|
+
encapsulation: ViewEncapsulation.None
|
|
105
|
+
}]
|
|
106
|
+
}], propDecorators: { color: [{
|
|
107
|
+
type: Input
|
|
108
|
+
}], borderColor: [{
|
|
109
|
+
type: Input
|
|
110
|
+
}], borderWidth: [{
|
|
111
|
+
type: Input
|
|
112
|
+
}], height: [{
|
|
113
|
+
type: Input
|
|
114
|
+
}], fit: [{
|
|
115
|
+
type: Input
|
|
116
|
+
}], line: [{
|
|
117
|
+
type: Input
|
|
118
|
+
}], animate: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}], xAxis: [{
|
|
121
|
+
type: Input
|
|
122
|
+
}], yAxis: [{
|
|
123
|
+
type: Input
|
|
124
|
+
}], padding: [{
|
|
125
|
+
type: Input
|
|
126
|
+
}], data: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}], yTooltipSuffix: [{
|
|
129
|
+
type: Input
|
|
130
|
+
}], tooltipType: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], clickItem: [{
|
|
133
|
+
type: Output
|
|
134
|
+
}] } });
|
|
135
|
+
|
|
136
|
+
const COMPONENTS = [G2MiniAreaComponent];
|
|
137
|
+
class G2MiniAreaModule {
|
|
138
|
+
}
|
|
139
|
+
G2MiniAreaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniAreaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
140
|
+
G2MiniAreaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniAreaModule, declarations: [G2MiniAreaComponent], imports: [CommonModule], exports: [G2MiniAreaComponent] });
|
|
141
|
+
G2MiniAreaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniAreaModule, imports: [[CommonModule]] });
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniAreaModule, decorators: [{
|
|
143
|
+
type: NgModule,
|
|
144
|
+
args: [{
|
|
145
|
+
imports: [CommonModule],
|
|
146
|
+
declarations: COMPONENTS,
|
|
147
|
+
exports: COMPONENTS
|
|
148
|
+
}]
|
|
149
|
+
}] });
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Generated bundle index. Do not edit.
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
export { G2MiniAreaComponent, G2MiniAreaModule };
|
|
156
|
+
//# sourceMappingURL=mini-area.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mini-area.mjs","sources":["../../../../packages/chart/mini-area/mini-area.component.ts","../../../../packages/chart/mini-area/mini-area.module.ts","../../../../packages/chart/mini-area/mini-area.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\n\nimport type { Chart, Event } from '@antv/g2';\n\nimport { G2BaseComponent, genMiniTooltipOptions } from '@delon/chart/core';\nimport { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport interface G2MiniAreaData {\n x: NzSafeAny;\n y: NzSafeAny;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2MiniAreaClickItem {\n item: G2MiniAreaData;\n ev: Event;\n}\n\n@Component({\n selector: 'g2-mini-area',\n exportAs: 'g2MiniArea',\n template: ``,\n host: {\n '[style.height.px]': 'height'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2MiniAreaComponent extends G2BaseComponent {\n static ngAcceptInputType_borderWidth: NumberInput;\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_fit: BooleanInput;\n static ngAcceptInputType_line: BooleanInput;\n static ngAcceptInputType_animate: BooleanInput;\n\n // #region fields\n\n @Input() color = 'rgba(24, 144, 255, 0.2)';\n @Input() borderColor = '#1890FF';\n @Input() @InputNumber() borderWidth = 2;\n @Input() @InputNumber() height = 56;\n @Input() @InputBoolean() fit = true;\n @Input() @InputBoolean() line = false;\n @Input() @InputBoolean() animate = true;\n @Input() xAxis: NzSafeAny;\n @Input() yAxis: NzSafeAny;\n @Input() padding: number | number[] | 'auto' = [8, 8, 8, 8];\n @Input() data: G2MiniAreaData[] = [];\n @Input() yTooltipSuffix = '';\n @Input() tooltipType: 'mini' | 'default' = 'default';\n @Output() readonly clickItem = new EventEmitter<G2MiniAreaClickItem>();\n\n // #endregion\n\n install(): void {\n const {\n el,\n fit,\n height,\n padding,\n xAxis,\n yAxis,\n yTooltipSuffix,\n tooltipType,\n line,\n theme,\n animate,\n color,\n borderColor,\n borderWidth\n } = this;\n const chart: Chart = (this._chart = new (window as NzSafeAny).G2.Chart({\n container: el.nativeElement,\n autoFit: fit,\n height,\n padding,\n theme\n }));\n chart.animate(animate);\n\n if (!xAxis && !yAxis) {\n chart.axis(false);\n }\n\n if (xAxis) {\n chart.axis('x', xAxis);\n } else {\n chart.axis('x', false);\n }\n\n if (yAxis) {\n chart.axis('y', yAxis);\n } else {\n chart.axis('y', false);\n }\n\n chart.legend(false);\n chart.tooltip(genMiniTooltipOptions(tooltipType));\n\n chart\n .area()\n .position('x*y')\n .color(color)\n .tooltip('x*y', (x, y) => ({ name: x, value: y + yTooltipSuffix }))\n .shape('smooth');\n\n if (line) {\n chart.line().position('x*y').shape('smooth').color(borderColor).size(borderWidth).tooltip(false);\n }\n\n chart.on(`plot:click`, (ev: Event) => {\n const records = this._chart.getSnapRecords({ x: ev.x, y: ev.y });\n this.ngZone.run(() => this.clickItem.emit({ item: records[0]._origin, ev }));\n });\n\n this.changeData();\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 _chart.changeData(data);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { G2MiniAreaComponent } from './mini-area.component';\n\nconst COMPONENTS = [G2MiniAreaComponent];\n\n@NgModule({\n imports: [CommonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class G2MiniAreaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MA8Ba,mBAAoB,SAAQ,eAAe;IAXxD;;;QAoBW,UAAK,GAAG,yBAAyB,CAAC;QAClC,gBAAW,GAAG,SAAS,CAAC;QACT,gBAAW,GAAG,CAAC,CAAC;QAChB,WAAM,GAAG,EAAE,CAAC;QACX,QAAG,GAAG,IAAI,CAAC;QACX,SAAI,GAAG,KAAK,CAAC;QACb,YAAO,GAAG,IAAI,CAAC;QAG/B,YAAO,GAA+B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD,SAAI,GAAqB,EAAE,CAAC;QAC5B,mBAAc,GAAG,EAAE,CAAC;QACpB,gBAAW,GAAuB,SAAS,CAAC;QAClC,cAAS,GAAG,IAAI,YAAY,EAAuB,CAAC;KA2ExE;;IAvEC,OAAO;QACL,MAAM,EACJ,EAAE,EACF,GAAG,EACH,MAAM,EACN,OAAO,EACP,KAAK,EACL,KAAK,EACL,cAAc,EACd,WAAW,EACX,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,WAAW,EACX,WAAW,EACZ,GAAG,IAAI,CAAC;QACT,MAAM,KAAK,IAAW,IAAI,CAAC,MAAM,GAAG,IAAK,MAAoB,CAAC,EAAE,CAAC,KAAK,CAAC;YACrE,SAAS,EAA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K;gBACkB,MAAM;sBAA7B,KAAK;gBACmB,GAAG;sBAA3B,KAAK;gBACmB,IAAI;sBAA5B,KAAK;gBACmB,OAAO;sBAA/B,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,cAAc;sBAAtB,KAAK;gBACG,WAAW;sBAAnB,KAAK;gBACa,SAAS;sBAA3B,MAAM;;;AC/CT,MAAM,UAAU,GAAG,CAAC,mBAAmB,CAAC,CAAC;MAO5B,gBAAgB;;6GAAhB,gBAAgB;8GAAhB,gBAAgB,iBAPT,mBAAmB,aAG3B,YAAY,aAHJ,mBAAmB;8GAO1B,gBAAgB,YAJlB,CAAC,YAAY,CAAC;2FAIZ,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACXD;;;;;;"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
|
|
4
|
+
import { G2BaseComponent, genMiniTooltipOptions } from '@delon/chart/core';
|
|
5
|
+
import { InputNumber } from '@delon/util/decorator';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
|
|
8
|
+
class G2MiniBarComponent extends G2BaseComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
// #region fields
|
|
12
|
+
this.color = '#1890FF';
|
|
13
|
+
this.height = 0;
|
|
14
|
+
this.borderWidth = 5;
|
|
15
|
+
this.padding = [8, 8, 8, 8];
|
|
16
|
+
this.data = [];
|
|
17
|
+
this.yTooltipSuffix = '';
|
|
18
|
+
this.tooltipType = 'default';
|
|
19
|
+
this.clickItem = new EventEmitter();
|
|
20
|
+
}
|
|
21
|
+
// #endregion
|
|
22
|
+
install() {
|
|
23
|
+
const { el, height, padding, yTooltipSuffix, tooltipType, theme, color, borderWidth } = this;
|
|
24
|
+
const chart = (this._chart = new window.G2.Chart({
|
|
25
|
+
container: el.nativeElement,
|
|
26
|
+
autoFit: true,
|
|
27
|
+
height,
|
|
28
|
+
padding,
|
|
29
|
+
theme
|
|
30
|
+
}));
|
|
31
|
+
chart.scale({
|
|
32
|
+
x: {
|
|
33
|
+
type: 'cat'
|
|
34
|
+
},
|
|
35
|
+
y: {
|
|
36
|
+
min: 0
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
chart.legend(false);
|
|
40
|
+
chart.axis(false);
|
|
41
|
+
chart.tooltip(genMiniTooltipOptions(tooltipType, { showCrosshairs: false }));
|
|
42
|
+
chart
|
|
43
|
+
.interval()
|
|
44
|
+
.position('x*y')
|
|
45
|
+
.color('x*y', (x, y) => {
|
|
46
|
+
const colorItem = this.data.find(w => w.x === x && w.y === y);
|
|
47
|
+
return colorItem && colorItem.color ? colorItem.color : color;
|
|
48
|
+
})
|
|
49
|
+
.size(borderWidth)
|
|
50
|
+
.tooltip('x*y', (x, y) => ({ name: x, value: y + yTooltipSuffix }));
|
|
51
|
+
chart.on(`interval:click`, (ev) => {
|
|
52
|
+
this.ngZone.run(() => this.clickItem.emit({ item: ev.data?.data, ev }));
|
|
53
|
+
});
|
|
54
|
+
this.changeData();
|
|
55
|
+
chart.render();
|
|
56
|
+
}
|
|
57
|
+
changeData() {
|
|
58
|
+
const { _chart, data } = this;
|
|
59
|
+
if (!_chart || !Array.isArray(data) || data.length <= 0)
|
|
60
|
+
return;
|
|
61
|
+
_chart.changeData(data);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
G2MiniBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniBarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
65
|
+
G2MiniBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: G2MiniBarComponent, selector: "g2-mini-bar", inputs: { color: "color", height: "height", borderWidth: "borderWidth", padding: "padding", data: "data", yTooltipSuffix: "yTooltipSuffix", tooltipType: "tooltipType" }, outputs: { clickItem: "clickItem" }, host: { properties: { "style.height.px": "height" } }, exportAs: ["g2MiniBar"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
66
|
+
__decorate([
|
|
67
|
+
InputNumber()
|
|
68
|
+
], G2MiniBarComponent.prototype, "height", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
InputNumber()
|
|
71
|
+
], G2MiniBarComponent.prototype, "borderWidth", void 0);
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniBarComponent, decorators: [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{
|
|
75
|
+
selector: 'g2-mini-bar',
|
|
76
|
+
exportAs: 'g2MiniBar',
|
|
77
|
+
template: ``,
|
|
78
|
+
host: {
|
|
79
|
+
'[style.height.px]': 'height'
|
|
80
|
+
},
|
|
81
|
+
preserveWhitespaces: false,
|
|
82
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
83
|
+
encapsulation: ViewEncapsulation.None
|
|
84
|
+
}]
|
|
85
|
+
}], propDecorators: { color: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], height: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], borderWidth: [{
|
|
90
|
+
type: Input
|
|
91
|
+
}], padding: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}], data: [{
|
|
94
|
+
type: Input
|
|
95
|
+
}], yTooltipSuffix: [{
|
|
96
|
+
type: Input
|
|
97
|
+
}], tooltipType: [{
|
|
98
|
+
type: Input
|
|
99
|
+
}], clickItem: [{
|
|
100
|
+
type: Output
|
|
101
|
+
}] } });
|
|
102
|
+
|
|
103
|
+
const COMPONENTS = [G2MiniBarComponent];
|
|
104
|
+
class G2MiniBarModule {
|
|
105
|
+
}
|
|
106
|
+
G2MiniBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
107
|
+
G2MiniBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniBarModule, declarations: [G2MiniBarComponent], imports: [CommonModule], exports: [G2MiniBarComponent] });
|
|
108
|
+
G2MiniBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniBarModule, imports: [[CommonModule]] });
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniBarModule, decorators: [{
|
|
110
|
+
type: NgModule,
|
|
111
|
+
args: [{
|
|
112
|
+
imports: [CommonModule],
|
|
113
|
+
declarations: COMPONENTS,
|
|
114
|
+
exports: COMPONENTS
|
|
115
|
+
}]
|
|
116
|
+
}] });
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generated bundle index. Do not edit.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
export { G2MiniBarComponent, G2MiniBarModule };
|
|
123
|
+
//# sourceMappingURL=mini-bar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mini-bar.mjs","sources":["../../../../packages/chart/mini-bar/mini-bar.component.ts","../../../../packages/chart/mini-bar/mini-bar.module.ts","../../../../packages/chart/mini-bar/mini-bar.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\n\nimport type { Chart, Event } from '@antv/g2';\n\nimport { G2BaseComponent, genMiniTooltipOptions } from '@delon/chart/core';\nimport { InputNumber, NumberInput } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport interface G2MiniBarData {\n x: NzSafeAny;\n y: NzSafeAny;\n color?: string | null;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2MiniBarClickItem {\n item: G2MiniBarData;\n ev: Event;\n}\n\n@Component({\n selector: 'g2-mini-bar',\n exportAs: 'g2MiniBar',\n template: ``,\n host: {\n '[style.height.px]': 'height'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2MiniBarComponent extends G2BaseComponent {\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_borderWidth: NumberInput;\n\n // #region fields\n\n @Input() color = '#1890FF';\n @Input() @InputNumber() height = 0;\n @Input() @InputNumber() borderWidth = 5;\n @Input() padding: number | number[] | 'auto' = [8, 8, 8, 8];\n @Input() data: G2MiniBarData[] = [];\n @Input() yTooltipSuffix = '';\n @Input() tooltipType: 'mini' | 'default' = 'default';\n @Output() readonly clickItem = new EventEmitter<G2MiniBarClickItem>();\n\n // #endregion\n\n install(): void {\n const { el, height, padding, yTooltipSuffix, tooltipType, theme, color, borderWidth } = this;\n const chart: Chart = (this._chart = new (window as NzSafeAny).G2.Chart({\n container: el.nativeElement,\n autoFit: true,\n height,\n padding,\n theme\n }));\n chart.scale({\n x: {\n type: 'cat'\n },\n y: {\n min: 0\n }\n });\n chart.legend(false);\n chart.axis(false);\n chart.tooltip(genMiniTooltipOptions(tooltipType, { showCrosshairs: false }));\n chart\n .interval()\n .position('x*y')\n .color('x*y', (x, y) => {\n const colorItem = this.data.find(w => w.x === x && w.y === y);\n return colorItem && colorItem.color ? colorItem.color : color;\n })\n .size(borderWidth)\n .tooltip('x*y', (x: NzSafeAny, y: NzSafeAny) => ({ name: x, value: y + yTooltipSuffix }));\n\n chart.on(`interval:click`, (ev: Event) => {\n this.ngZone.run(() => this.clickItem.emit({ item: ev.data?.data, ev }));\n });\n\n this.changeData();\n chart.render();\n }\n\n changeData(): void {\n const { _chart, data } = this;\n if (!_chart || !Array.isArray(data) || data.length <= 0) return;\n _chart.changeData(data);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { G2MiniBarComponent } from './mini-bar.component';\n\nconst COMPONENTS = [G2MiniBarComponent];\n\n@NgModule({\n imports: [CommonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class G2MiniBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MA+Ba,kBAAmB,SAAQ,eAAe;IAXvD;;;QAiBW,UAAK,GAAG,SAAS,CAAC;QACH,WAAM,GAAG,CAAC,CAAC;QACX,gBAAW,GAAG,CAAC,CAAC;QAC/B,YAAO,GAA+B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD,SAAI,GAAoB,EAAE,CAAC;QAC3B,mBAAc,GAAG,EAAE,CAAC;QACpB,gBAAW,GAAuB,SAAS,CAAC;QAClC,cAAS,GAAG,IAAI,YAAY,EAAsB,CAAC;KA+CvE;;IA3CC,OAAO;QACL,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC7F,MAAM,KAAK,IAAW,IAAI,CAAC,MAAM,GAAG,IAAK,MAAoB,CAAC,EAAE,CAAC,KAAK,CAAC;YACrE,SAAS,EAAE,EAAE,CAAC,aAAa;YAC3B,OAAO,EAAE,IAAI;YACb,MAAM;YACN,OAAO;YACP,KAAK;SACN,CAAC,CAAC,CAAC;QACJ,KAAK,CAAC,KAAK,CAAC;YACV,CAAC,EAAE;gBACD,IAAI,EAAE,KAAK;aACZ;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K,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QAChE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KACzB;;+GA3DU,kBAAkB;mGAAlB,kBAAkB,yWARnB,EAAE;AAeY;IAAd,WAAW,EAAE;kDAAY;AACX;IAAd,WAAW,EAAE;uDAAiB;2FAR7B,kBAAkB;kBAX9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,aAAa;oBACvB,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,EAAE;oBACZ,IAAI,EAAE;wBACJ,mBAAmB,EAAE,QAAQ;qBAC9B;oBACD,mBAAmB,EAAE,KAAK;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8BAOU,KAAK;sBAAb,KAAK;gBACkB,MAAM;sBAA7B,KAAK;gBACkB,WAAW;sBAAlC,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,cAAc;sBAAtB,KAAK;gBACG,WAAW;sBAAnB,KAAK;gBACa,SAAS;sBAA3B,MAAM;;;ACvCT,MAAM,UAAU,GAAG,CAAC,kBAAkB,CAAC,CAAC;MAO3B,eAAe;;4GAAf,eAAe;6GAAf,eAAe,iBAPR,kBAAkB,aAG1B,YAAY,aAHJ,kBAAkB;6GAOzB,eAAe,YAJjB,CAAC,YAAY,CAAC;2FAIZ,eAAe;kBAL3B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACXD;;;;;;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
4
|
+
import { toNumber, InputNumber } from '@delon/util/decorator';
|
|
5
|
+
import * as i1 from '@delon/theme';
|
|
6
|
+
import { DelonLocaleModule } from '@delon/theme';
|
|
7
|
+
import * as i2 from 'ng-zorro-antd/tooltip';
|
|
8
|
+
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
|
9
|
+
import * as i3 from '@angular/common';
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
11
|
+
|
|
12
|
+
class G2MiniProgressComponent {
|
|
13
|
+
constructor(i18n, cdr) {
|
|
14
|
+
this.i18n = i18n;
|
|
15
|
+
this.cdr = cdr;
|
|
16
|
+
this.color = '#1890FF';
|
|
17
|
+
}
|
|
18
|
+
fixNum(value) {
|
|
19
|
+
return Math.min(Math.max(toNumber(value), 0), 100);
|
|
20
|
+
}
|
|
21
|
+
ngOnChanges() {
|
|
22
|
+
this.target = this.fixNum(this.target);
|
|
23
|
+
this.percent = this.fixNum(this.percent);
|
|
24
|
+
this.cdr.detectChanges();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
G2MiniProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniProgressComponent, deps: [{ token: i1.DelonLocaleService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
+
G2MiniProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: G2MiniProgressComponent, selector: "g2-mini-progress", inputs: { color: "color", target: "target", percent: "percent", strokeWidth: "strokeWidth" }, host: { properties: { "class.g2-mini-progress": "true" } }, exportAs: ["g2MiniProgress"], usesOnChanges: true, ngImport: i0, template: "<div\n nz-tooltip\n [nzTooltipTitle]=\"i18n.getData('miniProgress').target + target + '%'\"\n class=\"g2-mini-progress__target\"\n [ngStyle]=\"{ 'left.%': target }\"\n>\n <span class=\"g2-mini-progress__target-item\" [ngStyle]=\"{ 'background-color': color }\"></span>\n <span class=\"g2-mini-progress__target-item\" [ngStyle]=\"{ 'background-color': color }\"></span>\n</div>\n<div class=\"g2-mini-progress__wrap\">\n <div\n class=\"g2-mini-progress__value\"\n [ngStyle]=\"{ 'background-color': color, 'width.%': percent, 'height.px': strokeWidth }\"\n ></div>\n</div>\n", directives: [{ type: i2.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
29
|
+
__decorate([
|
|
30
|
+
InputNumber()
|
|
31
|
+
], G2MiniProgressComponent.prototype, "target", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
InputNumber()
|
|
34
|
+
], G2MiniProgressComponent.prototype, "percent", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
InputNumber()
|
|
37
|
+
], G2MiniProgressComponent.prototype, "strokeWidth", void 0);
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniProgressComponent, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'g2-mini-progress', exportAs: 'g2MiniProgress', host: { '[class.g2-mini-progress]': 'true' }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n nz-tooltip\n [nzTooltipTitle]=\"i18n.getData('miniProgress').target + target + '%'\"\n class=\"g2-mini-progress__target\"\n [ngStyle]=\"{ 'left.%': target }\"\n>\n <span class=\"g2-mini-progress__target-item\" [ngStyle]=\"{ 'background-color': color }\"></span>\n <span class=\"g2-mini-progress__target-item\" [ngStyle]=\"{ 'background-color': color }\"></span>\n</div>\n<div class=\"g2-mini-progress__wrap\">\n <div\n class=\"g2-mini-progress__value\"\n [ngStyle]=\"{ 'background-color': color, 'width.%': percent, 'height.px': strokeWidth }\"\n ></div>\n</div>\n" }]
|
|
41
|
+
}], ctorParameters: function () { return [{ type: i1.DelonLocaleService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { color: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}], target: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}], percent: [{
|
|
46
|
+
type: Input
|
|
47
|
+
}], strokeWidth: [{
|
|
48
|
+
type: Input
|
|
49
|
+
}] } });
|
|
50
|
+
|
|
51
|
+
const COMPONENTS = [G2MiniProgressComponent];
|
|
52
|
+
class G2MiniProgressModule {
|
|
53
|
+
}
|
|
54
|
+
G2MiniProgressModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
55
|
+
G2MiniProgressModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniProgressModule, declarations: [G2MiniProgressComponent], imports: [CommonModule, DelonLocaleModule, NzToolTipModule], exports: [G2MiniProgressComponent] });
|
|
56
|
+
G2MiniProgressModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniProgressModule, imports: [[CommonModule, DelonLocaleModule, NzToolTipModule]] });
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2MiniProgressModule, decorators: [{
|
|
58
|
+
type: NgModule,
|
|
59
|
+
args: [{
|
|
60
|
+
imports: [CommonModule, DelonLocaleModule, NzToolTipModule],
|
|
61
|
+
declarations: COMPONENTS,
|
|
62
|
+
exports: COMPONENTS
|
|
63
|
+
}]
|
|
64
|
+
}] });
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Generated bundle index. Do not edit.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
export { G2MiniProgressComponent, G2MiniProgressModule };
|
|
71
|
+
//# sourceMappingURL=mini-progress.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mini-progress.mjs","sources":["../../../../packages/chart/mini-progress/mini-progress.component.ts","../../../../packages/chart/mini-progress/mini-progress.component.html","../../../../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} from '@angular/core';\n\nimport { DelonLocaleService } from '@delon/theme';\nimport { InputNumber, NumberInput, toNumber } from '@delon/util/decorator';\n\n@Component({\n selector: 'g2-mini-progress',\n exportAs: 'g2MiniProgress',\n templateUrl: './mini-progress.component.html',\n host: { '[class.g2-mini-progress]': 'true' },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2MiniProgressComponent implements OnChanges {\n static ngAcceptInputType_target: NumberInput;\n static ngAcceptInputType_percent: NumberInput;\n static ngAcceptInputType_strokeWidth: NumberInput;\n\n @Input() color = '#1890FF';\n @Input() @InputNumber() target?: number | null;\n @Input() @InputNumber() percent?: number | null;\n @Input() @InputNumber() strokeWidth?: number | null;\n\n constructor(public i18n: DelonLocaleService, private cdr: ChangeDetectorRef) {}\n\n private fixNum(value: number | undefined | null): number {\n return Math.min(Math.max(toNumber(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","<div\n nz-tooltip\n [nzTooltipTitle]=\"i18n.getData('miniProgress').target + target + '%'\"\n class=\"g2-mini-progress__target\"\n [ngStyle]=\"{ 'left.%': target }\"\n>\n <span class=\"g2-mini-progress__target-item\" [ngStyle]=\"{ 'background-color': color }\"></span>\n <span class=\"g2-mini-progress__target-item\" [ngStyle]=\"{ 'background-color': color }\"></span>\n</div>\n<div class=\"g2-mini-progress__wrap\">\n <div\n class=\"g2-mini-progress__value\"\n [ngStyle]=\"{ 'background-color': color, 'width.%': percent, 'height.px': strokeWidth }\"\n ></div>\n</div>\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],\n declarations: 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":";;;;;;;;;;;MAqBa,uBAAuB;IAUlC,YAAmB,IAAwB,EAAU,GAAsB;QAAxD,SAAI,GAAJ,IAAI,CAAoB;QAAU,QAAG,GAAH,GAAG,CAAmB;QALlE,UAAK,GAAG,SAAS,CAAC;KAKoD;IAEvE,MAAM,CAAC,KAAgC;QAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;KACpD;IAED,WAAW;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC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