@delon/chart 12.4.0 → 13.0.0-beta.2
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/chart-echarts/delon-chart-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 +5 -6
- package/chart.d.ts +1 -0
- package/core/delon-chart-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 +5 -6
- package/custom/custom.component.d.ts +4 -1
- package/custom/custom.module.d.ts +7 -0
- package/custom/delon-chart-custom.d.ts +5 -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/{esm2015/chart-echarts/delon-chart-chart-echarts.js → esm2020/chart-echarts/delon-chart-chart-echarts.mjs} +0 -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/{esm2015/core/delon-chart-core.js → esm2020/core/delon-chart-core.mjs} +0 -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.module.mjs +20 -0
- package/esm2020/custom/delon-chart-custom.mjs +5 -0
- package/{esm2015/custom/public_api.js → esm2020/custom/public_api.mjs} +0 -0
- package/{esm2015/mini-progress/mini-progress.js → esm2020/gauge/delon-chart-gauge.mjs} +1 -1
- package/esm2020/gauge/gauge.component.mjs +169 -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/delon-chart-mini-area.mjs +5 -0
- package/esm2020/mini-area/mini-area.component.mjs +133 -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/delon-chart-mini-bar.mjs +5 -0
- package/esm2020/mini-bar/mini-bar.component.mjs +100 -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/{esm2015/gauge/gauge.js → esm2020/mini-progress/delon-chart-mini-progress.mjs} +1 -1
- package/esm2020/mini-progress/mini-progress.component.mjs +46 -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/{esm2015/pie/pie.js → esm2020/number-info/delon-chart-number-info.mjs} +1 -1
- package/esm2020/number-info/number-info.component.mjs +45 -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/{esm2015/number-info/number-info.js → esm2020/pie/delon-chart-pie.mjs} +1 -1
- package/esm2020/pie/pie.component.mjs +215 -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/esm2020/radar/delon-chart-radar.mjs +5 -0
- package/{esm2015/radar/public_api.js → esm2020/radar/public_api.mjs} +0 -0
- package/esm2020/radar/radar.component.mjs +148 -0
- package/esm2020/radar/radar.module.mjs +22 -0
- package/esm2020/single-bar/delon-chart-single-bar.mjs +5 -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/esm2020/single-bar/single-bar.module.mjs +19 -0
- package/esm2020/tag-cloud/delon-chart-tag-cloud.mjs +5 -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/esm2020/tag-cloud/tag-cloud.module.mjs +20 -0
- package/esm2020/timeline/delon-chart-timeline.mjs +5 -0
- package/{esm2015/timeline/public_api.js → esm2020/timeline/public_api.mjs} +0 -0
- package/esm2020/timeline/timeline.component.mjs +204 -0
- package/esm2020/timeline/timeline.module.mjs +21 -0
- package/esm2020/trend/delon-chart-trend.mjs +5 -0
- package/{esm2015/trend/public_api.js → esm2020/trend/public_api.mjs} +0 -0
- package/esm2020/trend/trend.component.mjs +52 -0
- package/esm2020/trend/trend.module.mjs +20 -0
- package/esm2020/water-wave/delon-chart-water-wave.mjs +5 -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/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/{chart.js → chart.mjs} +1 -1
- package/fesm2015/chart.mjs.map +1 -0
- package/fesm2015/{delon-chart-chart-echarts.js → delon-chart-chart-echarts.mjs} +62 -53
- package/fesm2015/delon-chart-chart-echarts.mjs.map +1 -0
- package/fesm2015/{delon-chart-core.js → delon-chart-core.mjs} +23 -29
- package/fesm2015/delon-chart-core.mjs.map +1 -0
- package/fesm2015/delon-chart-custom.mjs +94 -0
- package/fesm2015/delon-chart-custom.mjs.map +1 -0
- package/fesm2015/{gauge.js → delon-chart-gauge.mjs} +46 -31
- package/fesm2015/delon-chart-gauge.mjs.map +1 -0
- package/fesm2015/delon-chart-mini-area.mjs +156 -0
- package/fesm2015/delon-chart-mini-area.mjs.map +1 -0
- package/fesm2015/delon-chart-mini-bar.mjs +123 -0
- package/fesm2015/delon-chart-mini-bar.mjs.map +1 -0
- package/fesm2015/delon-chart-mini-progress.mjs +71 -0
- package/fesm2015/delon-chart-mini-progress.mjs.map +1 -0
- package/fesm2015/delon-chart-number-info.mjs +70 -0
- package/fesm2015/delon-chart-number-info.mjs.map +1 -0
- package/fesm2015/delon-chart-pie.mjs +241 -0
- package/fesm2015/delon-chart-pie.mjs.map +1 -0
- package/fesm2015/{radar.js → delon-chart-radar.mjs} +43 -33
- package/fesm2015/delon-chart-radar.mjs.map +1 -0
- package/fesm2015/delon-chart-single-bar.mjs +147 -0
- package/fesm2015/delon-chart-single-bar.mjs.map +1 -0
- package/fesm2015/{tag-cloud.js → delon-chart-tag-cloud.mjs} +39 -26
- package/fesm2015/delon-chart-tag-cloud.mjs.map +1 -0
- package/fesm2015/{timeline.js → delon-chart-timeline.mjs} +64 -36
- package/fesm2015/delon-chart-timeline.mjs.map +1 -0
- package/fesm2015/delon-chart-trend.mjs +76 -0
- package/fesm2015/delon-chart-trend.mjs.map +1 -0
- package/fesm2015/{water-wave.js → delon-chart-water-wave.mjs} +38 -37
- package/fesm2015/delon-chart-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.mjs +7 -0
- package/fesm2020/chart.mjs.map +1 -0
- package/fesm2020/delon-chart-chart-echarts.mjs +242 -0
- package/fesm2020/delon-chart-chart-echarts.mjs.map +1 -0
- package/fesm2020/delon-chart-core.mjs +187 -0
- package/fesm2020/delon-chart-core.mjs.map +1 -0
- package/fesm2020/delon-chart-custom.mjs +94 -0
- package/fesm2020/delon-chart-custom.mjs.map +1 -0
- package/fesm2020/delon-chart-gauge.mjs +193 -0
- package/fesm2020/delon-chart-gauge.mjs.map +1 -0
- package/fesm2020/delon-chart-mini-area.mjs +156 -0
- package/fesm2020/delon-chart-mini-area.mjs.map +1 -0
- package/fesm2020/delon-chart-mini-bar.mjs +123 -0
- package/fesm2020/delon-chart-mini-bar.mjs.map +1 -0
- package/fesm2020/delon-chart-mini-progress.mjs +71 -0
- package/fesm2020/delon-chart-mini-progress.mjs.map +1 -0
- package/fesm2020/delon-chart-number-info.mjs +70 -0
- package/fesm2020/delon-chart-number-info.mjs.map +1 -0
- package/fesm2020/delon-chart-pie.mjs +241 -0
- package/fesm2020/delon-chart-pie.mjs.map +1 -0
- package/fesm2020/delon-chart-radar.mjs +174 -0
- package/fesm2020/delon-chart-radar.mjs.map +1 -0
- package/fesm2020/delon-chart-single-bar.mjs +149 -0
- package/fesm2020/delon-chart-single-bar.mjs.map +1 -0
- package/fesm2020/delon-chart-tag-cloud.mjs +185 -0
- package/fesm2020/delon-chart-tag-cloud.mjs.map +1 -0
- package/fesm2020/delon-chart-timeline.mjs +229 -0
- package/fesm2020/delon-chart-timeline.mjs.map +1 -0
- package/fesm2020/delon-chart-trend.mjs +76 -0
- package/fesm2020/delon-chart-trend.mjs.map +1 -0
- package/fesm2020/delon-chart-water-wave.mjs +245 -0
- package/fesm2020/delon-chart-water-wave.mjs.map +1 -0
- package/{mini-bar/mini-bar.d.ts → gauge/delon-chart-gauge.d.ts} +1 -0
- package/gauge/gauge.component.d.ts +8 -5
- package/gauge/gauge.module.d.ts +7 -0
- package/gauge/package.json +6 -7
- package/mini-area/delon-chart-mini-area.d.ts +5 -0
- package/mini-area/mini-area.component.d.ts +3 -0
- package/mini-area/mini-area.module.d.ts +6 -0
- package/mini-area/package.json +6 -7
- package/mini-bar/delon-chart-mini-bar.d.ts +5 -0
- package/mini-bar/mini-bar.component.d.ts +3 -0
- package/mini-bar/mini-bar.module.d.ts +6 -0
- package/mini-bar/package.json +6 -7
- package/mini-progress/delon-chart-mini-progress.d.ts +5 -0
- package/mini-progress/mini-progress.component.d.ts +6 -3
- package/mini-progress/mini-progress.module.d.ts +8 -0
- package/mini-progress/package.json +6 -7
- package/mini-progress/style/index.less +5 -0
- package/number-info/delon-chart-number-info.d.ts +5 -0
- package/number-info/number-info.component.d.ts +9 -6
- package/number-info/number-info.module.d.ts +8 -0
- package/number-info/package.json +6 -7
- package/number-info/style/index.less +12 -0
- package/package.json +160 -12
- package/{custom/g2Custom.d.ts → pie/delon-chart-pie.d.ts} +1 -0
- package/pie/package.json +6 -7
- package/pie/pie.component.d.ts +8 -5
- package/pie/pie.module.d.ts +9 -0
- package/pie/style/index.less +14 -0
- package/{gauge/gauge.d.ts → radar/delon-chart-radar.d.ts} +1 -0
- package/radar/package.json +6 -7
- package/radar/radar.component.d.ts +4 -1
- package/radar/radar.module.d.ts +9 -0
- package/radar/style/index.less +6 -0
- package/single-bar/delon-chart-single-bar.d.ts +5 -0
- package/single-bar/package.json +6 -7
- package/single-bar/single-bar.component.d.ts +4 -1
- package/single-bar/single-bar.module.d.ts +6 -0
- package/tag-cloud/delon-chart-tag-cloud.d.ts +5 -0
- package/tag-cloud/package.json +6 -7
- package/tag-cloud/tag-cloud.component.d.ts +3 -0
- package/tag-cloud/tag-cloud.module.d.ts +7 -0
- package/timeline/delon-chart-timeline.d.ts +5 -0
- package/timeline/package.json +6 -7
- package/timeline/timeline.component.d.ts +5 -2
- package/timeline/timeline.module.d.ts +8 -0
- package/{mini-area/mini-area.d.ts → trend/delon-chart-trend.d.ts} +1 -0
- package/trend/package.json +6 -7
- package/trend/style/index.less +6 -0
- package/trend/trend.component.d.ts +4 -1
- package/trend/trend.module.d.ts +7 -0
- package/water-wave/delon-chart-water-wave.d.ts +5 -0
- package/water-wave/package.json +6 -7
- package/water-wave/style/index.less +4 -0
- package/water-wave/water-wave.component.d.ts +5 -2
- 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/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/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.js +0 -5
- 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.js +0 -5
- 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.js +0 -5
- package/esm2015/radar/radar.module.js +0 -17
- package/esm2015/single-bar/single-bar.component.js +0 -111
- package/esm2015/single-bar/single-bar.js +0 -5
- 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.js +0 -5
- package/esm2015/tag-cloud/tag-cloud.module.js +0 -15
- package/esm2015/timeline/timeline.component.js +0 -178
- package/esm2015/timeline/timeline.js +0 -5
- package/esm2015/timeline/timeline.module.js +0 -16
- package/esm2015/trend/trend.component.js +0 -42
- package/esm2015/trend/trend.js +0 -5
- package/esm2015/trend/trend.module.js +0 -15
- package/esm2015/water-wave/water-wave.component.js +0 -224
- package/esm2015/water-wave/water-wave.js +0 -5
- 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.d.ts +0 -4
- package/mini-progress/mini-progress.metadata.json +0 -1
- package/number-info/number-info.d.ts +0 -4
- package/number-info/number-info.metadata.json +0 -1
- package/pie/pie.d.ts +0 -4
- package/pie/pie.metadata.json +0 -1
- package/radar/radar.d.ts +0 -4
- package/radar/radar.metadata.json +0 -1
- package/single-bar/single-bar.d.ts +0 -4
- package/single-bar/single-bar.metadata.json +0 -1
- package/tag-cloud/tag-cloud.d.ts +0 -4
- package/tag-cloud/tag-cloud.metadata.json +0 -1
- package/timeline/timeline.d.ts +0 -4
- package/timeline/timeline.metadata.json +0 -1
- package/trend/trend.d.ts +0 -4
- package/trend/trend.metadata.json +0 -1
- package/water-wave/water-wave.d.ts +0 -4
- package/water-wave/water-wave.metadata.json +0 -1
|
@@ -0,0 +1,147 @@
|
|
|
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, InputBoolean } from '@delon/util/decorator';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
|
|
8
|
+
class G2SingleBarComponent extends G2BaseComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
// #region fields
|
|
12
|
+
this.plusColor = '#40a9ff';
|
|
13
|
+
this.minusColor = '#ff4d4f';
|
|
14
|
+
this.height = 60;
|
|
15
|
+
this.barSize = 30;
|
|
16
|
+
this.min = 0;
|
|
17
|
+
this.max = 100;
|
|
18
|
+
this.value = 0;
|
|
19
|
+
this.line = false;
|
|
20
|
+
this.padding = 0;
|
|
21
|
+
this.textStyle = { fontSize: 12, color: '#595959' };
|
|
22
|
+
this.onlyChangeData = (changes) => {
|
|
23
|
+
return Object.keys(changes).length === 1 && !!changes.value;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
// #endregion
|
|
27
|
+
install() {
|
|
28
|
+
const { el, height, padding, textStyle, line, format, theme, min, max, plusColor, minusColor, barSize } = this;
|
|
29
|
+
const chart = (this._chart = new window.G2.Chart({
|
|
30
|
+
container: el.nativeElement,
|
|
31
|
+
autoFit: true,
|
|
32
|
+
height,
|
|
33
|
+
padding,
|
|
34
|
+
theme
|
|
35
|
+
}));
|
|
36
|
+
chart.legend(false);
|
|
37
|
+
chart.axis(false);
|
|
38
|
+
chart.scale({ value: { max, min } });
|
|
39
|
+
chart.tooltip(false);
|
|
40
|
+
chart.coordinate().transpose();
|
|
41
|
+
chart
|
|
42
|
+
.interval()
|
|
43
|
+
.position('1*value')
|
|
44
|
+
.color('value', (val) => (val > 0 ? plusColor : minusColor))
|
|
45
|
+
.size(barSize)
|
|
46
|
+
.label('value', () => ({
|
|
47
|
+
formatter: format,
|
|
48
|
+
style: Object.assign({}, textStyle)
|
|
49
|
+
}));
|
|
50
|
+
if (line) {
|
|
51
|
+
chart.annotation().line({
|
|
52
|
+
start: ['50%', '0%'],
|
|
53
|
+
end: ['50%', '100%'],
|
|
54
|
+
style: {
|
|
55
|
+
stroke: '#e8e8e8',
|
|
56
|
+
lineDash: [0, 0]
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
this.changeData();
|
|
61
|
+
chart.render();
|
|
62
|
+
}
|
|
63
|
+
changeData() {
|
|
64
|
+
const { _chart, value } = this;
|
|
65
|
+
if (!_chart)
|
|
66
|
+
return;
|
|
67
|
+
_chart.changeData([{ value }]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
G2SingleBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2SingleBarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
+
G2SingleBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: G2SingleBarComponent, selector: "g2-single-bar", inputs: { plusColor: "plusColor", minusColor: "minusColor", height: "height", barSize: "barSize", min: "min", max: "max", value: "value", line: "line", format: "format", padding: "padding", textStyle: "textStyle" }, host: { properties: { "style.height.px": "height" } }, exportAs: ["g2SingleBar"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
72
|
+
__decorate([
|
|
73
|
+
InputNumber()
|
|
74
|
+
], G2SingleBarComponent.prototype, "height", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
InputNumber()
|
|
77
|
+
], G2SingleBarComponent.prototype, "barSize", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
InputNumber()
|
|
80
|
+
], G2SingleBarComponent.prototype, "min", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
InputNumber()
|
|
83
|
+
], G2SingleBarComponent.prototype, "max", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
InputNumber()
|
|
86
|
+
], G2SingleBarComponent.prototype, "value", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
InputBoolean()
|
|
89
|
+
], G2SingleBarComponent.prototype, "line", void 0);
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2SingleBarComponent, decorators: [{
|
|
91
|
+
type: Component,
|
|
92
|
+
args: [{
|
|
93
|
+
selector: 'g2-single-bar',
|
|
94
|
+
exportAs: 'g2SingleBar',
|
|
95
|
+
template: ``,
|
|
96
|
+
host: {
|
|
97
|
+
'[style.height.px]': 'height'
|
|
98
|
+
},
|
|
99
|
+
preserveWhitespaces: false,
|
|
100
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
101
|
+
encapsulation: ViewEncapsulation.None
|
|
102
|
+
}]
|
|
103
|
+
}], propDecorators: { plusColor: [{
|
|
104
|
+
type: Input
|
|
105
|
+
}], minusColor: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], height: [{
|
|
108
|
+
type: Input
|
|
109
|
+
}], barSize: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}], min: [{
|
|
112
|
+
type: Input
|
|
113
|
+
}], max: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}], value: [{
|
|
116
|
+
type: Input
|
|
117
|
+
}], line: [{
|
|
118
|
+
type: Input
|
|
119
|
+
}], format: [{
|
|
120
|
+
type: Input
|
|
121
|
+
}], padding: [{
|
|
122
|
+
type: Input
|
|
123
|
+
}], textStyle: [{
|
|
124
|
+
type: Input
|
|
125
|
+
}] } });
|
|
126
|
+
|
|
127
|
+
const COMPONENTS = [G2SingleBarComponent];
|
|
128
|
+
class G2SingleBarModule {
|
|
129
|
+
}
|
|
130
|
+
G2SingleBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2SingleBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
131
|
+
G2SingleBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2SingleBarModule, declarations: [G2SingleBarComponent], imports: [CommonModule], exports: [G2SingleBarComponent] });
|
|
132
|
+
G2SingleBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2SingleBarModule, imports: [[CommonModule]] });
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2SingleBarModule, decorators: [{
|
|
134
|
+
type: NgModule,
|
|
135
|
+
args: [{
|
|
136
|
+
imports: [CommonModule],
|
|
137
|
+
declarations: COMPONENTS,
|
|
138
|
+
exports: COMPONENTS
|
|
139
|
+
}]
|
|
140
|
+
}] });
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Generated bundle index. Do not edit.
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
export { G2SingleBarComponent, G2SingleBarModule };
|
|
147
|
+
//# sourceMappingURL=delon-chart-single-bar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delon-chart-single-bar.mjs","sources":["../../../../packages/chart/single-bar/single-bar.component.ts","../../../../packages/chart/single-bar/single-bar.module.ts","../../../../packages/chart/single-bar/delon-chart-single-bar.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, SimpleChanges, ViewEncapsulation } from '@angular/core';\n\nimport type { Chart } from '@antv/g2';\n\nimport { G2BaseComponent } from '@delon/chart/core';\nimport { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n@Component({\n selector: 'g2-single-bar',\n exportAs: 'g2SingleBar',\n template: ``,\n host: {\n '[style.height.px]': 'height'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2SingleBarComponent extends G2BaseComponent {\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_barSize: NumberInput;\n static ngAcceptInputType_min: NumberInput;\n static ngAcceptInputType_max: NumberInput;\n static ngAcceptInputType_value: NumberInput;\n static ngAcceptInputType_line: BooleanInput;\n\n // #region fields\n\n @Input() plusColor = '#40a9ff';\n @Input() minusColor = '#ff4d4f';\n @Input() @InputNumber() height = 60;\n @Input() @InputNumber() barSize = 30;\n @Input() @InputNumber() min = 0;\n @Input() @InputNumber() max = 100;\n @Input() @InputNumber() value = 0;\n @Input() @InputBoolean() line = false;\n @Input() format?: (value: number, item: NzSafeAny, index: number) => string;\n @Input() padding: number | number[] | 'auto' = 0;\n @Input() textStyle: { [key: string]: NzSafeAny } = { fontSize: 12, color: '#595959' };\n\n // #endregion\n\n install(): void {\n const { el, height, padding, textStyle, line, format, theme, min, max, plusColor, minusColor, barSize } = 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.legend(false);\n chart.axis(false);\n chart.scale({ value: { max, min } });\n chart.tooltip(false);\n chart.coordinate().transpose();\n chart\n .interval()\n .position('1*value')\n .color('value', (val: number) => (val > 0 ? plusColor : minusColor))\n .size(barSize)\n .label('value', () => ({\n formatter: format,\n style: {\n ...textStyle\n }\n }));\n\n if (line) {\n chart.annotation().line({\n start: ['50%', '0%'],\n end: ['50%', '100%'],\n style: {\n stroke: '#e8e8e8',\n lineDash: [0, 0]\n }\n });\n }\n\n this.changeData();\n\n chart.render();\n }\n\n onlyChangeData = (changes: SimpleChanges): boolean => {\n return Object.keys(changes).length === 1 && !!changes.value;\n };\n\n changeData(): void {\n const { _chart, value } = this;\n if (!_chart) return;\n _chart.changeData([{ value }]);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { G2SingleBarComponent } from './single-bar.component';\n\nconst COMPONENTS = [G2SingleBarComponent];\n\n@NgModule({\n imports: [CommonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class G2SingleBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAmBa,6BAA6B,eAAe;IAXzD;;;QAqBW,cAAS,GAAG,SAAS,CAAC;QACtB,eAAU,GAAG,SAAS,CAAC;QACR,WAAM,GAAG,EAAE,CAAC;QACZ,YAAO,GAAG,EAAE,CAAC;QACb,QAAG,GAAG,CAAC,CAAC;QACR,QAAG,GAAG,GAAG,CAAC;QACV,UAAK,GAAG,CAAC,CAAC;QACT,SAAI,GAAG,KAAK,CAAC;QAE7B,YAAO,GAA+B,CAAC,CAAC;QACxC,cAAS,GAAiC,EAAE,QAAQ,EAAE,EAAE,EAAE,K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KAAK;gBACmB,IAAI;sBAA5B,KAAK;gBACG,MAAM;sBAAd,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,SAAS;sBAAjB,KAAK;;;AClCR,MAAM,UAAU,GAAG,CAAC,oBAAoB,CAAC,CAAC;MAO7B,iBAAiB;;8GAAjB,iBAAiB;+GAAjB,iBAAiB,iBAPV,oBAAoB,aAG5B,YAAY,aAHJ,oBAAoB;+GAO3B,iBAAiB,YAJnB,CAAC,YAAY,CAAC;2FAIZ,iBAAiB;kBAL7B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACXD;;;;;;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
2
3
|
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
|
|
3
4
|
import { fromEvent } from 'rxjs';
|
|
4
5
|
import { filter, debounceTime } from 'rxjs/operators';
|
|
5
6
|
import { G2BaseComponent } from '@delon/chart/core';
|
|
6
7
|
import { InputNumber } from '@delon/util/decorator';
|
|
7
|
-
import
|
|
8
|
+
import * as i1 from 'ng-zorro-antd/skeleton';
|
|
8
9
|
import { NzSkeletonModule } from 'ng-zorro-antd/skeleton';
|
|
10
|
+
import * as i2 from '@angular/common';
|
|
11
|
+
import { CommonModule } from '@angular/common';
|
|
9
12
|
|
|
10
13
|
class G2TagCloudComponent extends G2BaseComponent {
|
|
11
14
|
constructor() {
|
|
@@ -119,44 +122,54 @@ class G2TagCloudComponent extends G2BaseComponent {
|
|
|
119
122
|
this.installResizeEvent();
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
G2TagCloudComponent
|
|
123
|
-
|
|
124
|
-
selector: 'g2-tag-cloud',
|
|
125
|
-
exportAs: 'g2TagCloud',
|
|
126
|
-
template: `<nz-skeleton *ngIf="!loaded"></nz-skeleton>`,
|
|
127
|
-
preserveWhitespaces: false,
|
|
128
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
129
|
-
encapsulation: ViewEncapsulation.None
|
|
130
|
-
},] }
|
|
131
|
-
];
|
|
132
|
-
G2TagCloudComponent.propDecorators = {
|
|
133
|
-
width: [{ type: Input }],
|
|
134
|
-
height: [{ type: Input }],
|
|
135
|
-
padding: [{ type: Input }],
|
|
136
|
-
data: [{ type: Input }],
|
|
137
|
-
clickItem: [{ type: Output }]
|
|
138
|
-
};
|
|
125
|
+
G2TagCloudComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TagCloudComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
126
|
+
G2TagCloudComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: G2TagCloudComponent, selector: "g2-tag-cloud", inputs: { width: "width", height: "height", padding: "padding", data: "data" }, outputs: { clickItem: "clickItem" }, exportAs: ["g2TagCloud"], 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 });
|
|
139
127
|
__decorate([
|
|
140
128
|
InputNumber()
|
|
141
129
|
], G2TagCloudComponent.prototype, "width", void 0);
|
|
142
130
|
__decorate([
|
|
143
131
|
InputNumber()
|
|
144
132
|
], G2TagCloudComponent.prototype, "height", void 0);
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TagCloudComponent, decorators: [{
|
|
134
|
+
type: Component,
|
|
135
|
+
args: [{
|
|
136
|
+
selector: 'g2-tag-cloud',
|
|
137
|
+
exportAs: 'g2TagCloud',
|
|
138
|
+
template: `<nz-skeleton *ngIf="!loaded"></nz-skeleton>`,
|
|
139
|
+
preserveWhitespaces: false,
|
|
140
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
141
|
+
encapsulation: ViewEncapsulation.None
|
|
142
|
+
}]
|
|
143
|
+
}], propDecorators: { width: [{
|
|
144
|
+
type: Input
|
|
145
|
+
}], height: [{
|
|
146
|
+
type: Input
|
|
147
|
+
}], padding: [{
|
|
148
|
+
type: Input
|
|
149
|
+
}], data: [{
|
|
150
|
+
type: Input
|
|
151
|
+
}], clickItem: [{
|
|
152
|
+
type: Output
|
|
153
|
+
}] } });
|
|
145
154
|
|
|
146
155
|
const COMPONENTS = [G2TagCloudComponent];
|
|
147
156
|
class G2TagCloudModule {
|
|
148
157
|
}
|
|
149
|
-
G2TagCloudModule
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
]
|
|
158
|
+
G2TagCloudModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TagCloudModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
159
|
+
G2TagCloudModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TagCloudModule, declarations: [G2TagCloudComponent], imports: [CommonModule, NzSkeletonModule], exports: [G2TagCloudComponent] });
|
|
160
|
+
G2TagCloudModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TagCloudModule, imports: [[CommonModule, NzSkeletonModule]] });
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TagCloudModule, decorators: [{
|
|
162
|
+
type: NgModule,
|
|
163
|
+
args: [{
|
|
164
|
+
imports: [CommonModule, NzSkeletonModule],
|
|
165
|
+
declarations: COMPONENTS,
|
|
166
|
+
exports: COMPONENTS
|
|
167
|
+
}]
|
|
168
|
+
}] });
|
|
156
169
|
|
|
157
170
|
/**
|
|
158
171
|
* Generated bundle index. Do not edit.
|
|
159
172
|
*/
|
|
160
173
|
|
|
161
174
|
export { G2TagCloudComponent, G2TagCloudModule };
|
|
162
|
-
//# sourceMappingURL=tag-cloud.
|
|
175
|
+
//# sourceMappingURL=delon-chart-tag-cloud.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delon-chart-tag-cloud.mjs","sources":["../../../../packages/chart/tag-cloud/tag-cloud.component.ts","../../../../packages/chart/tag-cloud/tag-cloud.module.ts","../../../../packages/chart/tag-cloud/delon-chart-tag-cloud.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, filter } from 'rxjs/operators';\n\nimport type { Chart, Event } 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\nexport interface G2TagCloudData {\n value?: number;\n name?: string;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2TagCloudClickItem {\n item: G2TagCloudData;\n ev: Event;\n}\n\n@Component({\n selector: 'g2-tag-cloud',\n exportAs: 'g2TagCloud',\n template: `<nz-skeleton *ngIf=\"!loaded\"></nz-skeleton>`,\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2TagCloudComponent extends G2BaseComponent {\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_width: NumberInput;\n\n // #region fields\n\n @Input() @InputNumber() width = 0;\n @Input() @InputNumber() height = 200;\n @Input() padding: number | number[] | 'auto' = 0;\n @Input() data: G2TagCloudData[] = [];\n @Output() readonly clickItem = new EventEmitter<G2TagCloudClickItem>();\n\n // #endregion\n\n private initTagCloud(): void {\n (window as NzSafeAny).G2.registerShape('point', 'cloud', {\n draw(cfg: NzSafeAny, container: NzSafeAny) {\n const data = cfg.data as NzSafeAny;\n const textShape = container.addShape({\n type: 'text',\n name: 'tag-cloud-text',\n attrs: {\n ...cfg.style,\n fontSize: data.size,\n text: data.text,\n textAlign: 'center',\n fontFamily: data.font,\n fill: cfg.color,\n textBaseline: 'Alphabetic',\n x: cfg.x,\n y: cfg.y\n } as NzSafeAny\n });\n if (data.rotate) {\n (window as NzSafeAny).G2.Util.rotate(textShape, (data.rotate * Math.PI) / 180);\n }\n return textShape;\n }\n });\n }\n\n install(): void {\n this.initTagCloud();\n\n const { el, padding, theme } = this;\n if (this.height === 0) {\n this.height = this.el.nativeElement.clientHeight;\n }\n if (this.width === 0) {\n this.width = this.el.nativeElement.clientWidth;\n }\n\n const chart: Chart = (this._chart = new (window as NzSafeAny).G2.Chart({\n container: el.nativeElement,\n autoFit: false,\n padding,\n height: this.height,\n width: this.width,\n theme\n }));\n chart.scale({\n x: { nice: false },\n y: { nice: false }\n });\n chart.legend(false);\n chart.axis(false);\n chart.tooltip({\n showTitle: false,\n showMarkers: false\n });\n (chart.coordinate() as NzSafeAny).reflect();\n chart\n .point()\n .position('x*y')\n .color('text')\n .shape('cloud')\n .state({\n active: {\n style: {\n fillOpacity: 0.4\n }\n }\n });\n chart.interaction('element-active');\n\n chart.on('tag-cloud-text: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\n const dv = new (window as NzSafeAny).DataSet.View().source(data);\n const range = dv.range('value');\n const min = range[0];\n const max = range[1];\n\n dv.transform({\n type: 'tag-cloud',\n fields: ['name', 'value'],\n // imageMask,\n font: 'Verdana',\n size: [this.width, this.height], // 宽高设置最好根据 imageMask 做调整\n padding: 0,\n timeInterval: 5000, // max execute time\n rotate() {\n let random = ~~(Math.random() * 4) % 4;\n if (random === 2) {\n random = 0;\n }\n return random * 90; // 0, 90, 270\n },\n fontSize(d: NzSafeAny) {\n return ((d.value - min) / (max - min)) * (32 - 8) + 8;\n }\n } as NzSafeAny);\n\n _chart.changeData(dv.rows);\n }\n\n private installResizeEvent(): void {\n this.resize$ = fromEvent(window, 'resize')\n .pipe(\n filter(() => !!this._chart),\n debounceTime(200)\n )\n .subscribe(() => this.changeData());\n }\n\n onInit(): void {\n this.installResizeEvent();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzSkeletonModule } from 'ng-zorro-antd/skeleton';\n\nimport { G2TagCloudComponent } from './tag-cloud.component';\n\nconst COMPONENTS = [G2TagCloudComponent];\n\n@NgModule({\n imports: [CommonModule, NzSkeletonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class G2TagCloudModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;MA6Ba,4BAA4B,eAAe;IARxD;;;QAc0B,UAAK,GAAG,CAAC,CAAC;QACV,WAAM,GAAG,GAAG,CAAC;QAC5B,YAAO,GAA+B,CAAC,CAAC;QACxC,SAAI,GAAqB,EAAE,CAAC;QAClB,cAAS,GAAG,IAAI,YAAY,EAAuB,CAAC;KA+HxE;;IA3HS,YAAY;QACjB,MAAoB,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE;YACvD,IAAI,CAAC,GAAc,EAAE,SAAoB;gBACvC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAiB,CAAC;gBACnC,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC;oBACnC,IAAI,EAAE,MAAM;oBACZ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,MAAM;QACJ,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;;gHAxIU,mBAAmB;oGAAnB,mBAAmB,0NALpB,6CAA6C;AAW/B;IAAd,WAAW,EAAE;kDAAW;AACV;IAAd,WAAW,EAAE;mDAAc;2FAP1B,mBAAmB;kBAR/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;oBACxB,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,6CAA6C;oBACvD,mBAAmB,EAAE,KAAK;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8BAOyB,KAAK;sBAA5B,KAAK;gBACkB,MAAM;sBAA7B,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACa,SAAS;sBAA3B,MAAM;;;AChCT,MAAM,UAAU,GAAG,CAAC,mBAAmB,CAAC,CAAC;MAO5B,gBAAgB;;6GAAhB,gBAAgB;8GAAhB,gBAAgB,iBAPT,mBAAmB,aAG3B,YAAY,EAAE,gBAAgB,aAHtB,mBAAmB;8GAO1B,gBAAgB,YAJlB,CAAC,YAAY,EAAE,gBAAgB,CAAC;2FAI9B,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;oBACzC,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACbD;;;;;;"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
2
3
|
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
|
|
3
4
|
import { format } from 'date-fns';
|
|
4
5
|
import { G2BaseComponent } from '@delon/chart/core';
|
|
5
6
|
import { toDate } from '@delon/util/date-time';
|
|
6
7
|
import { InputNumber, InputBoolean } from '@delon/util/decorator';
|
|
7
|
-
import
|
|
8
|
-
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
|
|
8
|
+
import * as i1 from 'ng-zorro-antd/skeleton';
|
|
9
9
|
import { NzSkeletonModule } from 'ng-zorro-antd/skeleton';
|
|
10
|
+
import * as i2 from 'ng-zorro-antd/core/outlet';
|
|
11
|
+
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
|
|
12
|
+
import * as i3 from '@angular/common';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
10
14
|
|
|
11
15
|
class G2TimelineComponent extends G2BaseComponent {
|
|
12
16
|
constructor() {
|
|
@@ -136,37 +140,14 @@ class G2TimelineComponent extends G2BaseComponent {
|
|
|
136
140
|
_chart.changeData(filterData);
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
|
-
G2TimelineComponent
|
|
140
|
-
|
|
141
|
-
selector: 'g2-timeline',
|
|
142
|
-
exportAs: 'g2Timeline',
|
|
143
|
-
template: `
|
|
143
|
+
G2TimelineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TimelineComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
144
|
+
G2TimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: G2TimelineComponent, selector: "g2-timeline", inputs: { title: "title", maxAxis: "maxAxis", data: "data", titleMap: "titleMap", colorMap: "colorMap", mask: "mask", maskSlider: "maskSlider", position: "position", height: "height", padding: "padding", borderWidth: "borderWidth", slider: "slider" }, outputs: { clickItem: "clickItem" }, exportAs: ["g2Timeline"], usesInheritance: true, ngImport: i0, template: `
|
|
144
145
|
<ng-container *nzStringTemplateOutlet="title">
|
|
145
146
|
<h4>{{ title }}</h4>
|
|
146
147
|
</ng-container>
|
|
147
148
|
<nz-skeleton *ngIf="!loaded"></nz-skeleton>
|
|
148
149
|
<div #container></div>
|
|
149
|
-
`,
|
|
150
|
-
preserveWhitespaces: false,
|
|
151
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
152
|
-
encapsulation: ViewEncapsulation.None
|
|
153
|
-
},] }
|
|
154
|
-
];
|
|
155
|
-
G2TimelineComponent.propDecorators = {
|
|
156
|
-
title: [{ type: Input }],
|
|
157
|
-
maxAxis: [{ type: Input }],
|
|
158
|
-
data: [{ type: Input }],
|
|
159
|
-
titleMap: [{ type: Input }],
|
|
160
|
-
colorMap: [{ type: Input }],
|
|
161
|
-
mask: [{ type: Input }],
|
|
162
|
-
maskSlider: [{ type: Input }],
|
|
163
|
-
position: [{ type: Input }],
|
|
164
|
-
height: [{ type: Input }],
|
|
165
|
-
padding: [{ type: Input }],
|
|
166
|
-
borderWidth: [{ type: Input }],
|
|
167
|
-
slider: [{ type: Input }],
|
|
168
|
-
clickItem: [{ type: Output }]
|
|
169
|
-
};
|
|
150
|
+
`, isInline: true, components: [{ type: i1.NzSkeletonComponent, selector: "nz-skeleton", inputs: ["nzActive", "nzLoading", "nzRound", "nzTitle", "nzAvatar", "nzParagraph"], exportAs: ["nzSkeleton"] }], directives: [{ type: i2.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
170
151
|
__decorate([
|
|
171
152
|
InputNumber()
|
|
172
153
|
], G2TimelineComponent.prototype, "maxAxis", void 0);
|
|
@@ -179,21 +160,68 @@ __decorate([
|
|
|
179
160
|
__decorate([
|
|
180
161
|
InputBoolean()
|
|
181
162
|
], G2TimelineComponent.prototype, "slider", void 0);
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TimelineComponent, decorators: [{
|
|
164
|
+
type: Component,
|
|
165
|
+
args: [{
|
|
166
|
+
selector: 'g2-timeline',
|
|
167
|
+
exportAs: 'g2Timeline',
|
|
168
|
+
template: `
|
|
169
|
+
<ng-container *nzStringTemplateOutlet="title">
|
|
170
|
+
<h4>{{ title }}</h4>
|
|
171
|
+
</ng-container>
|
|
172
|
+
<nz-skeleton *ngIf="!loaded"></nz-skeleton>
|
|
173
|
+
<div #container></div>
|
|
174
|
+
`,
|
|
175
|
+
preserveWhitespaces: false,
|
|
176
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
177
|
+
encapsulation: ViewEncapsulation.None
|
|
178
|
+
}]
|
|
179
|
+
}], propDecorators: { title: [{
|
|
180
|
+
type: Input
|
|
181
|
+
}], maxAxis: [{
|
|
182
|
+
type: Input
|
|
183
|
+
}], data: [{
|
|
184
|
+
type: Input
|
|
185
|
+
}], titleMap: [{
|
|
186
|
+
type: Input
|
|
187
|
+
}], colorMap: [{
|
|
188
|
+
type: Input
|
|
189
|
+
}], mask: [{
|
|
190
|
+
type: Input
|
|
191
|
+
}], maskSlider: [{
|
|
192
|
+
type: Input
|
|
193
|
+
}], position: [{
|
|
194
|
+
type: Input
|
|
195
|
+
}], height: [{
|
|
196
|
+
type: Input
|
|
197
|
+
}], padding: [{
|
|
198
|
+
type: Input
|
|
199
|
+
}], borderWidth: [{
|
|
200
|
+
type: Input
|
|
201
|
+
}], slider: [{
|
|
202
|
+
type: Input
|
|
203
|
+
}], clickItem: [{
|
|
204
|
+
type: Output
|
|
205
|
+
}] } });
|
|
182
206
|
|
|
183
207
|
const COMPONENTS = [G2TimelineComponent];
|
|
184
208
|
class G2TimelineModule {
|
|
185
209
|
}
|
|
186
|
-
G2TimelineModule
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
]
|
|
210
|
+
G2TimelineModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TimelineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
211
|
+
G2TimelineModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TimelineModule, declarations: [G2TimelineComponent], imports: [CommonModule, NzOutletModule, NzSkeletonModule], exports: [G2TimelineComponent] });
|
|
212
|
+
G2TimelineModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TimelineModule, imports: [[CommonModule, NzOutletModule, NzSkeletonModule]] });
|
|
213
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: G2TimelineModule, decorators: [{
|
|
214
|
+
type: NgModule,
|
|
215
|
+
args: [{
|
|
216
|
+
imports: [CommonModule, NzOutletModule, NzSkeletonModule],
|
|
217
|
+
declarations: COMPONENTS,
|
|
218
|
+
exports: COMPONENTS
|
|
219
|
+
}]
|
|
220
|
+
}] });
|
|
193
221
|
|
|
194
222
|
/**
|
|
195
223
|
* Generated bundle index. Do not edit.
|
|
196
224
|
*/
|
|
197
225
|
|
|
198
226
|
export { G2TimelineComponent, G2TimelineModule };
|
|
199
|
-
//# sourceMappingURL=timeline.
|
|
227
|
+
//# sourceMappingURL=delon-chart-timeline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delon-chart-timeline.mjs","sources":["../../../../packages/chart/timeline/timeline.component.ts","../../../../packages/chart/timeline/timeline.module.ts","../../../../packages/chart/timeline/delon-chart-timeline.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\n\nimport type { Chart, Event, Types } from '@antv/g2';\nimport { format } from 'date-fns';\n\nimport { G2BaseComponent, G2Time } from '@delon/chart/core';\nimport { toDate } from '@delon/util/date-time';\nimport { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport interface G2TimelineData {\n /**\n * 时间值\n */\n time?: G2Time;\n /** 指标1数据 */\n y1: number;\n /** 指标2数据 */\n y2: number;\n /** 指标3数据 */\n y3?: number;\n /** 指标4数据 */\n y4?: number;\n /** 指标5数据 */\n y5?: number;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2TimelineMap {\n /** 指标1 */\n y1: string;\n /** 指标 */\n y2: string;\n /** 指标3 */\n y3?: string;\n /** 指标4 */\n y4?: string;\n /** 指标5 */\n y5?: string;\n\n [key: string]: string | undefined;\n}\n\nexport interface G2TimelineClickItem {\n item: G2TimelineData;\n ev: Event;\n}\n\n@Component({\n selector: 'g2-timeline',\n exportAs: 'g2Timeline',\n template: `\n <ng-container *nzStringTemplateOutlet=\"title\">\n <h4>{{ title }}</h4>\n </ng-container>\n <nz-skeleton *ngIf=\"!loaded\"></nz-skeleton>\n <div #container></div>\n `,\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2TimelineComponent extends G2BaseComponent {\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_maxAxis: NumberInput;\n static ngAcceptInputType_borderWidth: NumberInput;\n static ngAcceptInputType_slider: BooleanInput;\n\n // #region fields\n\n @Input() title?: string | TemplateRef<void> | null;\n @Input() @InputNumber() maxAxis = 2;\n @Input() data: G2TimelineData[] = [];\n @Input() titleMap?: G2TimelineMap | null;\n @Input() colorMap: G2TimelineMap = { y1: '#5B8FF9', y2: '#5AD8A6', y3: '#5D7092', y4: '#F6BD16', y5: '#E86452' };\n @Input() mask: string = 'HH:mm';\n @Input() maskSlider: string = 'HH:mm';\n @Input() position: 'top' | 'right' | 'bottom' | 'left' = 'top';\n @Input() @InputNumber() height = 450;\n @Input() padding: number[] = [40, 8, 64, 40];\n @Input() @InputNumber() borderWidth = 2;\n @Input() @InputBoolean() slider = true;\n @Output() readonly clickItem = new EventEmitter<G2TimelineClickItem>();\n\n // #endregion\n\n onlyChangeData = (changes: SimpleChanges): boolean => {\n const tm = changes.titleMap;\n return !(tm && !tm.firstChange && tm.currentValue !== tm.previousValue);\n };\n\n install(): void {\n const { node, height, padding, slider, maxAxis, theme, maskSlider } = this;\n const chart: Chart = (this._chart = new (window as NzSafeAny).G2.Chart({\n container: node.nativeElement,\n autoFit: true,\n height,\n padding,\n theme\n }));\n chart.axis('time', { title: null });\n chart.axis('y1', { title: null });\n for (let i = 2; i <= maxAxis; i++) {\n chart.axis(`y${i}`, false);\n }\n\n chart.line().position('time*y1');\n for (let i = 2; i <= maxAxis; i++) {\n chart.line().position(`time*y${i}`);\n }\n\n chart.tooltip({\n showCrosshairs: true,\n shared: true\n });\n\n const sliderPadding = { ...[], ...padding };\n sliderPadding[0] = 0;\n if (slider) {\n chart.option('slider', {\n height: 26,\n start: 0,\n end: 1,\n trendCfg: {\n isArea: false\n },\n minLimit: 2,\n formatter: (val: Date) => format(val, maskSlider)\n });\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 chart.on(`legend-item:click`, (ev: Event) => {\n const item = ev?.target?.get('delegateObject').item;\n const id = item?.id;\n const line = chart.geometries.find(w => w.getAttribute('position').getFields()[1] === id);\n if (line) {\n line.changeVisible(!item.unchecked);\n }\n });\n\n this.changeData();\n\n chart.render();\n }\n\n changeData(): void {\n const { _chart, height, padding, mask, titleMap, position, colorMap, borderWidth, maxAxis } = this;\n let data = [...this.data];\n if (!_chart || data.length <= 0) return;\n\n const arrAxis = [...Array(maxAxis)].map((_, index) => index + 1);\n\n _chart.legend({\n position,\n custom: true,\n items: arrAxis.map(id => {\n const key = `y${id}`;\n return {\n id: key,\n name: titleMap![key],\n value: key,\n marker: { style: { fill: colorMap[key] } }\n } as Types.LegendItem;\n })\n });\n\n // border\n _chart.geometries.forEach((v, idx: number) => {\n v.color((colorMap as NzSafeAny)[`y${idx + 1}`]).size(borderWidth);\n });\n _chart.height = height;\n _chart.padding = padding;\n\n // 转换成日期类型\n data = data\n .map(item => {\n item.time = toDate(item.time!);\n item._time = +item.time;\n return item;\n })\n .sort((a, b) => a._time - b._time);\n\n const max = Math.max(...arrAxis.map(id => [...data].sort((a, b) => b[`y${id}`] - a[`y${id}`])[0][`y${id}`]));\n const scaleOptions: Record<string, Types.ScaleOption> = {};\n arrAxis.forEach(id => {\n const key = `y${id}`;\n scaleOptions[key] = {\n alias: titleMap![key],\n max,\n min: 0\n };\n });\n _chart.scale({\n time: {\n type: 'time',\n mask,\n range: [0, 1]\n },\n ...scaleOptions\n });\n\n const initialRange = {\n start: data[0]._time,\n end: data[data.length - 1]._time\n };\n const filterData = data.filter(val => val._time >= initialRange.start && val._time <= initialRange.end);\n _chart.changeData(filterData);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzSkeletonModule } from 'ng-zorro-antd/skeleton';\n\nimport { G2TimelineComponent } from './timeline.component';\n\nconst COMPONENTS = [G2TimelineComponent];\n\n@NgModule({\n imports: [CommonModule, NzOutletModule, NzSkeletonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class G2TimelineModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAuEa,4BAA4B,eAAe;IAdxD;;QAuB0B,YAAO,GAAG,CAAC,CAAC;QAC3B,SAAI,GAAqB,EAAE,CAAC;QAE5B,aAAQ,GAAkB,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;QACxG,SAAI,GAAW,OAAO,CAAC;QACvB,eAAU,GA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AO;sBAAf,KAAK;gBACkB,WAAW;sBAAlC,KAAK;gBACmB,MAAM;sBAA9B,KAAK;gBACa,SAAS;sBAA3B,MAAM;;;ACnFT,MAAM,UAAU,GAAG,CAAC,mBAAmB,CAAC,CAAC;MAO5B,gBAAgB;;6GAAhB,gBAAgB;8GAAhB,gBAAgB,iBAPT,mBAAmB,aAG3B,YAAY,EAAE,cAAc,EAAE,gBAAgB,aAHtC,mBAAmB;8GAO1B,gBAAgB,YAJlB,CAAC,YAAY,EAAE,cAAc,EAAE,gBAAgB,CAAC;2FAI9C,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,gBAAgB,CAAC;oBACzD,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACdD;;;;;;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
4
|
+
import { InputBoolean } from '@delon/util/decorator';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i2 from 'ng-zorro-antd/icon';
|
|
8
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
9
|
+
|
|
10
|
+
class TrendComponent {
|
|
11
|
+
constructor() {
|
|
12
|
+
/** 是否彩色标记 */
|
|
13
|
+
this.colorful = true;
|
|
14
|
+
/** 颜色反转 */
|
|
15
|
+
this.reverseColor = false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
TrendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TrendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
+
TrendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: TrendComponent, selector: "trend", inputs: { flag: "flag", colorful: "colorful", reverseColor: "reverseColor" }, host: { properties: { "class.trend": "true", "class.trend__grey": "!colorful", "class.trend__reverse": "colorful && reverseColor", "attr.data-flag": "flag" } }, exportAs: ["trend"], ngImport: i0, template: `
|
|
20
|
+
<ng-content></ng-content>
|
|
21
|
+
<span *ngIf="flag" class="trend__{{ flag }}"><i nz-icon nzType="caret-{{ flag }}"></i></span>
|
|
22
|
+
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
23
|
+
__decorate([
|
|
24
|
+
InputBoolean()
|
|
25
|
+
], TrendComponent.prototype, "colorful", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
InputBoolean()
|
|
28
|
+
], TrendComponent.prototype, "reverseColor", void 0);
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TrendComponent, decorators: [{
|
|
30
|
+
type: Component,
|
|
31
|
+
args: [{
|
|
32
|
+
selector: 'trend',
|
|
33
|
+
exportAs: 'trend',
|
|
34
|
+
template: `
|
|
35
|
+
<ng-content></ng-content>
|
|
36
|
+
<span *ngIf="flag" class="trend__{{ flag }}"><i nz-icon nzType="caret-{{ flag }}"></i></span>
|
|
37
|
+
`,
|
|
38
|
+
host: {
|
|
39
|
+
'[class.trend]': 'true',
|
|
40
|
+
'[class.trend__grey]': '!colorful',
|
|
41
|
+
'[class.trend__reverse]': 'colorful && reverseColor',
|
|
42
|
+
'[attr.data-flag]': `flag`
|
|
43
|
+
},
|
|
44
|
+
preserveWhitespaces: false,
|
|
45
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
46
|
+
encapsulation: ViewEncapsulation.None
|
|
47
|
+
}]
|
|
48
|
+
}], propDecorators: { flag: [{
|
|
49
|
+
type: Input
|
|
50
|
+
}], colorful: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}], reverseColor: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}] } });
|
|
55
|
+
|
|
56
|
+
const COMPONENTS = [TrendComponent];
|
|
57
|
+
class TrendModule {
|
|
58
|
+
}
|
|
59
|
+
TrendModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TrendModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
60
|
+
TrendModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TrendModule, declarations: [TrendComponent], imports: [CommonModule, NzIconModule], exports: [TrendComponent] });
|
|
61
|
+
TrendModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TrendModule, imports: [[CommonModule, NzIconModule]] });
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TrendModule, decorators: [{
|
|
63
|
+
type: NgModule,
|
|
64
|
+
args: [{
|
|
65
|
+
imports: [CommonModule, NzIconModule],
|
|
66
|
+
declarations: COMPONENTS,
|
|
67
|
+
exports: COMPONENTS
|
|
68
|
+
}]
|
|
69
|
+
}] });
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Generated bundle index. Do not edit.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
export { TrendComponent, TrendModule };
|
|
76
|
+
//# sourceMappingURL=delon-chart-trend.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delon-chart-trend.mjs","sources":["../../../../packages/chart/trend/trend.component.ts","../../../../packages/chart/trend/trend.module.ts","../../../../packages/chart/trend/delon-chart-trend.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';\n\nimport { BooleanInput, InputBoolean } from '@delon/util/decorator';\n\n@Component({\n selector: 'trend',\n exportAs: 'trend',\n template: `\n <ng-content></ng-content>\n <span *ngIf=\"flag\" class=\"trend__{{ flag }}\"><i nz-icon nzType=\"caret-{{ flag }}\"></i></span>\n `,\n host: {\n '[class.trend]': 'true',\n '[class.trend__grey]': '!colorful',\n '[class.trend__reverse]': 'colorful && reverseColor',\n '[attr.data-flag]': `flag`\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class TrendComponent {\n static ngAcceptInputType_colorful: BooleanInput;\n static ngAcceptInputType_reverseColor: BooleanInput;\n\n /** 上升下降标识 */\n @Input() flag?: 'up' | 'down';\n /** 是否彩色标记 */\n @Input() @InputBoolean() colorful = true;\n /** 颜色反转 */\n @Input() @InputBoolean() reverseColor = false;\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport { TrendComponent } from './trend.component';\n\nconst COMPONENTS = [TrendComponent];\n\n@NgModule({\n imports: [CommonModule, NzIconModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class TrendModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAqBa,cAAc;IAjB3B;;QAwB2B,aAAQ,GAAG,IAAI,CAAC;;QAEhB,iBAAY,GAAG,KAAK,CAAC;KAC/C;;2GAVY,cAAc;+FAAd,cAAc,iTAdf;;;GAGT;AAkBwB;IAAf,YAAY,EAAE;gDAAiB;AAEhB;IAAf,YAAY,EAAE;oDAAsB;2FATnC,cAAc;kBAjB1B,SAAS;mBAAC;oBACT,QAAQ,EAAE,OAAO;oBACjB,QAAQ,EAAE,OAAO;oBACjB,QAAQ,EAAE;;;GAGT;oBACD,IAAI,EAAE;wBACJ,eAAe,EAAE,MAAM;wBACvB,qBAAqB,EAAE,WAAW;wBAClC,wBAAwB,EAAE,0BAA0B;wBACpD,kBAAkB,EAAE,MAAM;qBAC3B;oBACD,mBAAmB,EAAE,KAAK;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8BAMU,IAAI;sBAAZ,KAAK;gBAEmB,QAAQ;sBAAhC,KAAK;gBAEmB,YAAY;sBAApC,KAAK;;;ACvBR,MAAM,UAAU,GAAG,CAAC,cAAc,CAAC,CAAC;MAOvB,WAAW;;wGAAX,WAAW;yGAAX,WAAW,iBAPJ,cAAc,aAGtB,YAAY,EAAE,YAAY,aAHlB,cAAc;yGAOrB,WAAW,YAJb,CAAC,YAAY,EAAE,YAAY,CAAC;2FAI1B,WAAW;kBALvB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;oBACrC,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACbD;;;;;;"}
|