@delon/chart 13.0.0 → 13.2.1
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/README.md +1 -1
- package/core/g2.base.component.d.ts +5 -2
- package/esm2020/bar/bar.component.mjs +6 -5
- package/esm2020/bar/bar.module.mjs +4 -4
- package/esm2020/card/card.component.mjs +3 -3
- package/esm2020/card/card.module.mjs +4 -4
- package/esm2020/chart-echarts/echarts.component.mjs +3 -3
- package/esm2020/chart-echarts/echarts.module.mjs +4 -4
- package/esm2020/chart-echarts/echarts.service.mjs +3 -3
- package/esm2020/core/g2.base.component.mjs +12 -6
- package/esm2020/core/g2.servicce.mjs +5 -5
- package/esm2020/custom/custom.component.mjs +3 -3
- package/esm2020/custom/custom.module.mjs +4 -4
- package/esm2020/gauge/gauge.component.mjs +9 -8
- package/esm2020/gauge/gauge.module.mjs +4 -4
- package/esm2020/mini-area/mini-area.component.mjs +6 -5
- package/esm2020/mini-area/mini-area.module.mjs +4 -4
- package/esm2020/mini-bar/mini-bar.component.mjs +6 -5
- package/esm2020/mini-bar/mini-bar.module.mjs +4 -4
- package/esm2020/mini-progress/mini-progress.component.mjs +3 -3
- package/esm2020/mini-progress/mini-progress.module.mjs +4 -4
- package/esm2020/number-info/number-info.component.mjs +3 -3
- package/esm2020/number-info/number-info.module.mjs +4 -4
- package/esm2020/pie/pie.component.mjs +17 -10
- package/esm2020/pie/pie.module.mjs +4 -4
- package/esm2020/radar/radar.component.mjs +6 -5
- package/esm2020/radar/radar.module.mjs +4 -4
- package/esm2020/single-bar/single-bar.component.mjs +6 -5
- package/esm2020/single-bar/single-bar.module.mjs +4 -4
- package/esm2020/tag-cloud/tag-cloud.component.mjs +9 -7
- package/esm2020/tag-cloud/tag-cloud.module.mjs +4 -4
- package/esm2020/timeline/timeline.component.mjs +6 -5
- package/esm2020/timeline/timeline.module.mjs +4 -4
- package/esm2020/trend/trend.component.mjs +3 -3
- package/esm2020/trend/trend.module.mjs +4 -4
- package/esm2020/water-wave/water-wave.component.mjs +3 -3
- package/esm2020/water-wave/water-wave.module.mjs +4 -4
- package/fesm2015/bar.mjs +9 -8
- package/fesm2015/bar.mjs.map +1 -1
- package/fesm2015/card.mjs +7 -7
- package/fesm2015/chart-echarts.mjs +10 -10
- package/fesm2015/core.mjs +15 -9
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/custom.mjs +7 -7
- package/fesm2015/gauge.mjs +12 -11
- package/fesm2015/gauge.mjs.map +1 -1
- package/fesm2015/mini-area.mjs +9 -8
- package/fesm2015/mini-area.mjs.map +1 -1
- package/fesm2015/mini-bar.mjs +9 -8
- package/fesm2015/mini-bar.mjs.map +1 -1
- package/fesm2015/mini-progress.mjs +7 -7
- package/fesm2015/number-info.mjs +7 -7
- package/fesm2015/pie.mjs +20 -13
- package/fesm2015/pie.mjs.map +1 -1
- package/fesm2015/radar.mjs +9 -8
- package/fesm2015/radar.mjs.map +1 -1
- package/fesm2015/single-bar.mjs +9 -8
- package/fesm2015/single-bar.mjs.map +1 -1
- package/fesm2015/tag-cloud.mjs +12 -10
- package/fesm2015/tag-cloud.mjs.map +1 -1
- package/fesm2015/timeline.mjs +9 -8
- package/fesm2015/timeline.mjs.map +1 -1
- package/fesm2015/trend.mjs +7 -7
- package/fesm2015/water-wave.mjs +7 -7
- package/fesm2020/bar.mjs +9 -8
- package/fesm2020/bar.mjs.map +1 -1
- package/fesm2020/card.mjs +7 -7
- package/fesm2020/chart-echarts.mjs +10 -10
- package/fesm2020/core.mjs +15 -9
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/custom.mjs +7 -7
- package/fesm2020/gauge.mjs +12 -11
- package/fesm2020/gauge.mjs.map +1 -1
- package/fesm2020/mini-area.mjs +9 -8
- package/fesm2020/mini-area.mjs.map +1 -1
- package/fesm2020/mini-bar.mjs +9 -8
- package/fesm2020/mini-bar.mjs.map +1 -1
- package/fesm2020/mini-progress.mjs +7 -7
- package/fesm2020/number-info.mjs +7 -7
- package/fesm2020/pie.mjs +20 -13
- package/fesm2020/pie.mjs.map +1 -1
- package/fesm2020/radar.mjs +9 -8
- package/fesm2020/radar.mjs.map +1 -1
- package/fesm2020/single-bar.mjs +9 -8
- package/fesm2020/single-bar.mjs.map +1 -1
- package/fesm2020/tag-cloud.mjs +12 -10
- package/fesm2020/tag-cloud.mjs.map +1 -1
- package/fesm2020/timeline.mjs +9 -8
- package/fesm2020/timeline.mjs.map +1 -1
- package/fesm2020/trend.mjs +7 -7
- package/fesm2020/water-wave.mjs +7 -7
- package/package.json +3 -3
- package/pie/pie.component.d.ts +2 -1
package/fesm2015/timeline.mjs
CHANGED
|
@@ -34,7 +34,7 @@ class G2TimelineComponent extends G2BaseComponent {
|
|
|
34
34
|
}
|
|
35
35
|
install() {
|
|
36
36
|
const { node, height, padding, slider, maxAxis, theme, maskSlider } = this;
|
|
37
|
-
const chart = (this._chart = new
|
|
37
|
+
const chart = (this._chart = new this.winG2.Chart({
|
|
38
38
|
container: node.nativeElement,
|
|
39
39
|
autoFit: true,
|
|
40
40
|
height,
|
|
@@ -81,6 +81,7 @@ class G2TimelineComponent extends G2BaseComponent {
|
|
|
81
81
|
line.changeVisible(!item.unchecked);
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
this.ready.next(chart);
|
|
84
85
|
this.changeData();
|
|
85
86
|
chart.render();
|
|
86
87
|
}
|
|
@@ -140,8 +141,8 @@ class G2TimelineComponent extends G2BaseComponent {
|
|
|
140
141
|
_chart.changeData(filterData);
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
G2TimelineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
144
|
-
G2TimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
144
|
+
G2TimelineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2TimelineComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
145
|
+
G2TimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", 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: `
|
|
145
146
|
<ng-container *nzStringTemplateOutlet="title">
|
|
146
147
|
<h4>{{ title }}</h4>
|
|
147
148
|
</ng-container>
|
|
@@ -160,7 +161,7 @@ __decorate([
|
|
|
160
161
|
__decorate([
|
|
161
162
|
InputBoolean()
|
|
162
163
|
], G2TimelineComponent.prototype, "slider", void 0);
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2TimelineComponent, decorators: [{
|
|
164
165
|
type: Component,
|
|
165
166
|
args: [{
|
|
166
167
|
selector: 'g2-timeline',
|
|
@@ -207,10 +208,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
207
208
|
const COMPONENTS = [G2TimelineComponent];
|
|
208
209
|
class G2TimelineModule {
|
|
209
210
|
}
|
|
210
|
-
G2TimelineModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
211
|
-
G2TimelineModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
212
|
-
G2TimelineModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
211
|
+
G2TimelineModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2TimelineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
212
|
+
G2TimelineModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2TimelineModule, declarations: [G2TimelineComponent], imports: [CommonModule, NzOutletModule, NzSkeletonModule], exports: [G2TimelineComponent] });
|
|
213
|
+
G2TimelineModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2TimelineModule, imports: [[CommonModule, NzOutletModule, NzSkeletonModule]] });
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2TimelineModule, decorators: [{
|
|
214
215
|
type: NgModule,
|
|
215
216
|
args: [{
|
|
216
217
|
imports: [CommonModule, NzOutletModule, NzSkeletonModule],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.mjs","sources":["../../../../packages/chart/timeline/timeline.component.ts","../../../../packages/chart/timeline/timeline.module.ts","../../../../packages/chart/timeline/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,GAAW,OAAO,CAAC;QAC7B,aAAQ,GAAwC,KAAK,CAAC;QACvC,WAAM,GAAG,GAAG,CAAC;QAC5B,YAAO,GAAa,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACrB,gBAAW,GAAG,CAAC,CAAC;QACf,WAAM,GAAG,IAAI,CAAC;QACpB,cAAS,GAAG,IAAI,YAAY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E,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;;;;;;"}
|
|
1
|
+
{"version":3,"file":"timeline.mjs","sources":["../../../../packages/chart/timeline/timeline.component.ts","../../../../packages/chart/timeline/timeline.module.ts","../../../../packages/chart/timeline/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 this.winG2.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.ready.next(chart);\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,GAAW,OAAO,CAAC;QAC7B,aAAQ,GAAwC,KAAK,CAAC;QACvC,WAAM,GAAG,GAAG,CAAC;QAC5B,YAAO,GAAa,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACrB,gBAAW,GAAG,CAAC,CAAC;QACf,WAAM,GAAG,IAAI,CAAC;QACpB,cAAS,GAAG,IAAI,YAAY,EAAuB,CAAC;;QAIvE,mBAAc,GAAG,CAAC,OAAsB;YACtC,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;YAC5B,OAAO,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,YAAY,KAAK,EAAE,CAAC,aAAa,CAAC,CAAC;SACzE,CAAC;KA8HH;IA5HC,OAAO;QACL,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAA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D;;;;;;"}
|
package/fesm2015/trend.mjs
CHANGED
|
@@ -15,8 +15,8 @@ class TrendComponent {
|
|
|
15
15
|
this.reverseColor = false;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
TrendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
19
|
-
TrendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
18
|
+
TrendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: TrendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
+
TrendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", 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
20
|
<ng-content></ng-content>
|
|
21
21
|
<span *ngIf="flag" class="trend__{{ flag }}"><i nz-icon nzType="caret-{{ flag }}"></i></span>
|
|
22
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 });
|
|
@@ -26,7 +26,7 @@ __decorate([
|
|
|
26
26
|
__decorate([
|
|
27
27
|
InputBoolean()
|
|
28
28
|
], TrendComponent.prototype, "reverseColor", void 0);
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: TrendComponent, decorators: [{
|
|
30
30
|
type: Component,
|
|
31
31
|
args: [{
|
|
32
32
|
selector: 'trend',
|
|
@@ -56,10 +56,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
56
56
|
const COMPONENTS = [TrendComponent];
|
|
57
57
|
class TrendModule {
|
|
58
58
|
}
|
|
59
|
-
TrendModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
60
|
-
TrendModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
61
|
-
TrendModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
59
|
+
TrendModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: TrendModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
60
|
+
TrendModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: TrendModule, declarations: [TrendComponent], imports: [CommonModule, NzIconModule], exports: [TrendComponent] });
|
|
61
|
+
TrendModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: TrendModule, imports: [[CommonModule, NzIconModule]] });
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: TrendModule, decorators: [{
|
|
63
63
|
type: NgModule,
|
|
64
64
|
args: [{
|
|
65
65
|
imports: [CommonModule, NzIconModule],
|
package/fesm2015/water-wave.mjs
CHANGED
|
@@ -188,8 +188,8 @@ class G2WaterWaveComponent {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
G2WaterWaveComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
192
|
-
G2WaterWaveComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
191
|
+
G2WaterWaveComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2WaterWaveComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1.Platform }], target: i0.ɵɵFactoryTarget.Component });
|
|
192
|
+
G2WaterWaveComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: G2WaterWaveComponent, selector: "g2-water-wave", inputs: { animate: "animate", delay: "delay", title: "title", color: "color", height: "height", percent: "percent" }, host: { properties: { "class.g2-water-wave": "true" } }, viewQueries: [{ propertyName: "node", first: true, predicate: ["container"], descendants: true, static: true }], exportAs: ["g2WaterWave"], usesOnChanges: true, ngImport: i0, template: "<div [ngStyle]=\"{ 'height.px': height, 'width.px': height, overflow: 'hidden' }\">\n <canvas #container class=\"g2-water-wave__canvas\" width=\"{{ height * 2 }}\" height=\"{{ height * 2 }}\"></canvas>\n</div>\n<div class=\"g2-water-wave__desc\" [ngStyle]=\"{ 'width.px': height }\">\n <span *ngIf=\"title\" class=\"g2-water-wave__desc-title\">\n <ng-container *nzStringTemplateOutlet=\"title\">{{ title }}</ng-container>\n </span>\n <h4 class=\"g2-water-wave__desc-percent\">{{ percent }}%</h4>\n</div>\n", directives: [{ type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
193
193
|
__decorate([
|
|
194
194
|
InputBoolean()
|
|
195
195
|
], G2WaterWaveComponent.prototype, "animate", void 0);
|
|
@@ -202,7 +202,7 @@ __decorate([
|
|
|
202
202
|
__decorate([
|
|
203
203
|
InputNumber()
|
|
204
204
|
], G2WaterWaveComponent.prototype, "percent", void 0);
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2WaterWaveComponent, decorators: [{
|
|
206
206
|
type: Component,
|
|
207
207
|
args: [{ selector: 'g2-water-wave', exportAs: 'g2WaterWave', host: { '[class.g2-water-wave]': 'true' }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div [ngStyle]=\"{ 'height.px': height, 'width.px': height, overflow: 'hidden' }\">\n <canvas #container class=\"g2-water-wave__canvas\" width=\"{{ height * 2 }}\" height=\"{{ height * 2 }}\"></canvas>\n</div>\n<div class=\"g2-water-wave__desc\" [ngStyle]=\"{ 'width.px': height }\">\n <span *ngIf=\"title\" class=\"g2-water-wave__desc-title\">\n <ng-container *nzStringTemplateOutlet=\"title\">{{ title }}</ng-container>\n </span>\n <h4 class=\"g2-water-wave__desc-percent\">{{ percent }}%</h4>\n</div>\n" }]
|
|
208
208
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i1.Platform }]; }, propDecorators: { node: [{
|
|
@@ -225,10 +225,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
225
225
|
const COMPONENTS = [G2WaterWaveComponent];
|
|
226
226
|
class G2WaterWaveModule {
|
|
227
227
|
}
|
|
228
|
-
G2WaterWaveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
229
|
-
G2WaterWaveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
230
|
-
G2WaterWaveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
228
|
+
G2WaterWaveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2WaterWaveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
229
|
+
G2WaterWaveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2WaterWaveModule, declarations: [G2WaterWaveComponent], imports: [CommonModule, NzOutletModule], exports: [G2WaterWaveComponent] });
|
|
230
|
+
G2WaterWaveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2WaterWaveModule, imports: [[CommonModule, NzOutletModule]] });
|
|
231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2WaterWaveModule, decorators: [{
|
|
232
232
|
type: NgModule,
|
|
233
233
|
args: [{
|
|
234
234
|
imports: [CommonModule, NzOutletModule],
|
package/fesm2020/bar.mjs
CHANGED
|
@@ -31,7 +31,7 @@ class G2BarComponent extends G2BaseComponent {
|
|
|
31
31
|
install() {
|
|
32
32
|
const { node, padding, interaction, theme } = this;
|
|
33
33
|
const container = node.nativeElement;
|
|
34
|
-
const chart = (this._chart = new
|
|
34
|
+
const chart = (this._chart = new this.winG2.Chart({
|
|
35
35
|
container,
|
|
36
36
|
autoFit: true,
|
|
37
37
|
height: this.getHeight(),
|
|
@@ -70,6 +70,7 @@ class G2BarComponent extends G2BaseComponent {
|
|
|
70
70
|
chart.on(`interval:click`, (ev) => {
|
|
71
71
|
this.ngZone.run(() => this.clickItem.emit({ item: ev.data?.data, ev }));
|
|
72
72
|
});
|
|
73
|
+
this.ready.next(chart);
|
|
73
74
|
this.changeData();
|
|
74
75
|
chart.render();
|
|
75
76
|
this.installResizeEvent();
|
|
@@ -94,8 +95,8 @@ class G2BarComponent extends G2BaseComponent {
|
|
|
94
95
|
.subscribe(() => this.ngZone.runOutsideAngular(() => this.updatelabel()));
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
|
-
G2BarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
98
|
-
G2BarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
98
|
+
G2BarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
+
G2BarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: G2BarComponent, selector: "g2-bar", inputs: { title: "title", color: "color", height: "height", padding: "padding", data: "data", autoLabel: "autoLabel", interaction: "interaction" }, outputs: { clickItem: "clickItem" }, host: { properties: { "style.height.px": "height" } }, exportAs: ["g2Bar"], usesInheritance: true, ngImport: i0, template: `
|
|
99
100
|
<ng-container *nzStringTemplateOutlet="title">
|
|
100
101
|
<h4 style="margin-bottom: 20px;">{{ title }}</h4>
|
|
101
102
|
</ng-container>
|
|
@@ -108,7 +109,7 @@ __decorate([
|
|
|
108
109
|
__decorate([
|
|
109
110
|
InputBoolean()
|
|
110
111
|
], G2BarComponent.prototype, "autoLabel", void 0);
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BarComponent, decorators: [{
|
|
112
113
|
type: Component,
|
|
113
114
|
args: [{
|
|
114
115
|
selector: 'g2-bar',
|
|
@@ -148,10 +149,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
148
149
|
const COMPONENTS = [G2BarComponent];
|
|
149
150
|
class G2BarModule {
|
|
150
151
|
}
|
|
151
|
-
G2BarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
152
|
-
G2BarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
153
|
-
G2BarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
152
|
+
G2BarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
153
|
+
G2BarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BarModule, declarations: [G2BarComponent], imports: [CommonModule, NzOutletModule, NzSkeletonModule], exports: [G2BarComponent] });
|
|
154
|
+
G2BarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BarModule, imports: [[CommonModule, NzOutletModule, NzSkeletonModule]] });
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BarModule, decorators: [{
|
|
155
156
|
type: NgModule,
|
|
156
157
|
args: [{
|
|
157
158
|
imports: [CommonModule, NzOutletModule, NzSkeletonModule],
|
package/fesm2020/bar.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.mjs","sources":["../../../../packages/chart/bar/bar.component.ts","../../../../packages/chart/bar/bar.module.ts","../../../../packages/chart/bar/bar.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, filter, takeUntil } from 'rxjs/operators';\n\nimport type { Chart, Event } from '@antv/g2';\n\nimport { G2BaseComponent, G2InteractionType } from '@delon/chart/core';\nimport { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nconst TITLE_HEIGHT = 41;\n\nexport interface G2BarData {\n x: NzSafeAny;\n y: NzSafeAny;\n color?: string | null;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2BarClickItem {\n item: G2BarData;\n ev: Event;\n}\n\n@Component({\n selector: 'g2-bar',\n exportAs: 'g2Bar',\n template: `\n <ng-container *nzStringTemplateOutlet=\"title\">\n <h4 style=\"margin-bottom: 20px;\">{{ title }}</h4>\n </ng-container>\n <nz-skeleton *ngIf=\"!loaded\"></nz-skeleton>\n <div #container></div>\n `,\n host: {\n '[style.height.px]': 'height'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2BarComponent extends G2BaseComponent {\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_autoLabel: BooleanInput;\n\n // #region fields\n\n @Input() title?: string | TemplateRef<void>;\n @Input() color = 'rgba(24, 144, 255, 0.85)';\n @Input() @InputNumber() height = 0;\n @Input() padding: number | number[] | 'auto' = 'auto';\n @Input() data: G2BarData[] = [];\n @Input() @InputBoolean() autoLabel = true;\n @Input() interaction: G2InteractionType = 'none';\n @Output() readonly clickItem = new EventEmitter<G2BarClickItem>();\n\n // #endregion\n\n private getHeight(): number {\n return this.title ? this.height - TITLE_HEIGHT : this.height;\n }\n\n install(): void {\n const { node, padding, interaction, theme } = this;\n\n const container = node.nativeElement as HTMLElement;\n const chart: Chart = (this._chart = new
|
|
1
|
+
{"version":3,"file":"bar.mjs","sources":["../../../../packages/chart/bar/bar.component.ts","../../../../packages/chart/bar/bar.module.ts","../../../../packages/chart/bar/bar.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, filter, takeUntil } from 'rxjs/operators';\n\nimport type { Chart, Event } from '@antv/g2';\n\nimport { G2BaseComponent, G2InteractionType } from '@delon/chart/core';\nimport { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nconst TITLE_HEIGHT = 41;\n\nexport interface G2BarData {\n x: NzSafeAny;\n y: NzSafeAny;\n color?: string | null;\n [key: string]: NzSafeAny;\n}\n\nexport interface G2BarClickItem {\n item: G2BarData;\n ev: Event;\n}\n\n@Component({\n selector: 'g2-bar',\n exportAs: 'g2Bar',\n template: `\n <ng-container *nzStringTemplateOutlet=\"title\">\n <h4 style=\"margin-bottom: 20px;\">{{ title }}</h4>\n </ng-container>\n <nz-skeleton *ngIf=\"!loaded\"></nz-skeleton>\n <div #container></div>\n `,\n host: {\n '[style.height.px]': 'height'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class G2BarComponent extends G2BaseComponent {\n static ngAcceptInputType_height: NumberInput;\n static ngAcceptInputType_autoLabel: BooleanInput;\n\n // #region fields\n\n @Input() title?: string | TemplateRef<void>;\n @Input() color = 'rgba(24, 144, 255, 0.85)';\n @Input() @InputNumber() height = 0;\n @Input() padding: number | number[] | 'auto' = 'auto';\n @Input() data: G2BarData[] = [];\n @Input() @InputBoolean() autoLabel = true;\n @Input() interaction: G2InteractionType = 'none';\n @Output() readonly clickItem = new EventEmitter<G2BarClickItem>();\n\n // #endregion\n\n private getHeight(): number {\n return this.title ? this.height - TITLE_HEIGHT : this.height;\n }\n\n install(): void {\n const { node, padding, interaction, theme } = this;\n\n const container = node.nativeElement as HTMLElement;\n const chart: Chart = (this._chart = new this.winG2.Chart({\n container,\n autoFit: true,\n height: this.getHeight(),\n padding,\n theme\n }));\n this.updatelabel();\n chart.axis('y', {\n title: null,\n line: null,\n tickLine: null\n });\n chart.scale({\n x: {\n type: 'cat'\n },\n y: {\n min: 0\n }\n });\n chart.tooltip({\n showTitle: false\n });\n if (interaction !== 'none') {\n chart.interaction(interaction);\n }\n chart.legend(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 : this.color;\n })\n .tooltip('x*y', (x, y) => ({ name: x, value: y }));\n\n chart.on(`interval:click`, (ev: Event) => {\n this.ngZone.run(() => this.clickItem.emit({ item: ev.data?.data, ev }));\n });\n\n this.ready.next(chart);\n\n this.changeData();\n chart.render();\n this.installResizeEvent();\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 private updatelabel(): void {\n const { node, data, _chart } = this;\n const canvasWidth = node.nativeElement.clientWidth;\n const minWidth = data.length * 30;\n _chart.axis('x', canvasWidth > minWidth).render();\n }\n\n private installResizeEvent(): void {\n if (!this.autoLabel || this.resize$) return;\n\n this.resize$ = fromEvent(window, 'resize')\n .pipe(\n takeUntil(this.destroy$),\n filter(() => !!this._chart),\n debounceTime(200)\n )\n .subscribe(() => this.ngZone.runOutsideAngular(() => this.updatelabel()));\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 { G2BarComponent } from './bar.component';\n\nconst COMPONENTS = [G2BarComponent];\n\n@NgModule({\n imports: [CommonModule, NzOutletModule, NzSkeletonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class G2B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OU,KAAK;sBAAb,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACkB,MAAM;sBAA7B,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACmB,SAAS;sBAAjC,KAAK;gBACG,WAAW;sBAAnB,KAAK;gBACa,SAAS;sBAA3B,MAAM;;;ACtDT,MAAM,UAAU,GAAG,CAAC,cAAc,CAAC,CAAC;MAOvB,WAAW;;wGAAX,WAAW;yGAAX,WAAW,iBAPJ,cAAc,aAGtB,YAAY,EAAE,cAAc,EAAE,gBAAgB,aAHtC,cAAc;yGAOrB,WAAW,YAJb,CAAC,YAAY,EAAE,cAAc,EAAE,gBAAgB,CAAC;2FAI9C,WAAW;kBALvB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,gBAAgB,CAAC;oBACzD,YAAY,EAAE,UAAU;oBACxB,OAAO,EAAE,UAAU;iBACpB;;;ACdD;;;;;;"}
|
package/fesm2020/card.mjs
CHANGED
|
@@ -29,15 +29,15 @@ class G2CardComponent {
|
|
|
29
29
|
this.cdr.detectChanges();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
G2CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
33
|
-
G2CardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
32
|
+
G2CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CardComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
33
|
+
G2CardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: G2CardComponent, selector: "g2-card", inputs: { bordered: "bordered", avatar: "avatar", title: "title", action: "action", total: "total", contentHeight: "contentHeight", footer: "footer", loading: "loading" }, host: { properties: { "class.g2-card": "true" } }, exportAs: ["g2Card"], usesOnChanges: true, ngImport: i0, template: "<nz-card [nzBodyStyle]=\"{ padding: '20px 24px 8px 24px' }\" [nzBordered]=\"bordered\">\n <nz-spin [nzSpinning]=\"loading\">\n <div class=\"g2-card__top\">\n <div class=\"g2-card__avatar\">\n <ng-container *nzStringTemplateOutlet=\"avatar\">{{ avatar }}</ng-container>\n </div>\n <div class=\"g2-card__meta-wrap\">\n <div class=\"g2-card__meta\">\n <span class=\"g2-card__meta-title\" *ngIf=\"title\">\n <ng-container *nzStringTemplateOutlet=\"title\">{{ title }}</ng-container>\n </span>\n <span class=\"g2-card__meta-action\" *ngIf=\"action\">\n <ng-container *nzStringTemplateOutlet=\"action\">{{ action }}</ng-container>\n </span>\n </div>\n <p *ngIf=\"total\" class=\"g2-card__total\">{{ total }}</p>\n </div>\n </div>\n <div class=\"g2-card__desc\" [ngStyle]=\"{ height: _height }\">\n <div [ngClass]=\"{ 'g2-card__fixed': !!_orgHeight }\">\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"g2-card__footer\" *ngIf=\"footer\">\n <ng-container *nzStringTemplateOutlet=\"footer\">{{ footer }}</ng-container>\n </div>\n </nz-spin>\n</nz-card>\n", components: [{ type: i1.NzCardComponent, selector: "nz-card", inputs: ["nzBordered", "nzBorderless", "nzLoading", "nzHoverable", "nzBodyStyle", "nzCover", "nzActions", "nzType", "nzSize", "nzTitle", "nzExtra"], exportAs: ["nzCard"] }, { type: i2.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }], directives: [{ type: i3.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
34
34
|
__decorate([
|
|
35
35
|
InputBoolean()
|
|
36
36
|
], G2CardComponent.prototype, "bordered", void 0);
|
|
37
37
|
__decorate([
|
|
38
38
|
InputBoolean()
|
|
39
39
|
], G2CardComponent.prototype, "loading", void 0);
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CardComponent, decorators: [{
|
|
41
41
|
type: Component,
|
|
42
42
|
args: [{ selector: 'g2-card', exportAs: 'g2Card', host: { '[class.g2-card]': 'true' }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<nz-card [nzBodyStyle]=\"{ padding: '20px 24px 8px 24px' }\" [nzBordered]=\"bordered\">\n <nz-spin [nzSpinning]=\"loading\">\n <div class=\"g2-card__top\">\n <div class=\"g2-card__avatar\">\n <ng-container *nzStringTemplateOutlet=\"avatar\">{{ avatar }}</ng-container>\n </div>\n <div class=\"g2-card__meta-wrap\">\n <div class=\"g2-card__meta\">\n <span class=\"g2-card__meta-title\" *ngIf=\"title\">\n <ng-container *nzStringTemplateOutlet=\"title\">{{ title }}</ng-container>\n </span>\n <span class=\"g2-card__meta-action\" *ngIf=\"action\">\n <ng-container *nzStringTemplateOutlet=\"action\">{{ action }}</ng-container>\n </span>\n </div>\n <p *ngIf=\"total\" class=\"g2-card__total\">{{ total }}</p>\n </div>\n </div>\n <div class=\"g2-card__desc\" [ngStyle]=\"{ height: _height }\">\n <div [ngClass]=\"{ 'g2-card__fixed': !!_orgHeight }\">\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"g2-card__footer\" *ngIf=\"footer\">\n <ng-container *nzStringTemplateOutlet=\"footer\">{{ footer }}</ng-container>\n </div>\n </nz-spin>\n</nz-card>\n" }]
|
|
43
43
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { bordered: [{
|
|
@@ -61,10 +61,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
61
61
|
const COMPONENTS = [G2CardComponent];
|
|
62
62
|
class G2CardModule {
|
|
63
63
|
}
|
|
64
|
-
G2CardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
65
|
-
G2CardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
66
|
-
G2CardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
64
|
+
G2CardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
65
|
+
G2CardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CardModule, declarations: [G2CardComponent], imports: [CommonModule, NzCardModule, NzSpinModule, NzOutletModule], exports: [G2CardComponent] });
|
|
66
|
+
G2CardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CardModule, imports: [[CommonModule, NzCardModule, NzSpinModule, NzOutletModule]] });
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CardModule, decorators: [{
|
|
68
68
|
type: NgModule,
|
|
69
69
|
args: [{
|
|
70
70
|
imports: [CommonModule, NzCardModule, NzSpinModule, NzOutletModule],
|
|
@@ -60,9 +60,9 @@ class ChartEChartsService {
|
|
|
60
60
|
this.notify$.unsubscribe();
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
ChartEChartsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
64
|
-
ChartEChartsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
63
|
+
ChartEChartsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsService, deps: [{ token: i1.AlainConfigService }, { token: i2.LazyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
64
|
+
ChartEChartsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsService, providedIn: 'root' });
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsService, decorators: [{
|
|
66
66
|
type: Injectable,
|
|
67
67
|
args: [{ providedIn: 'root' }]
|
|
68
68
|
}], ctorParameters: function () { return [{ type: i1.AlainConfigService }, { type: i2.LazyService }]; } });
|
|
@@ -174,15 +174,15 @@ class ChartEChartsComponent {
|
|
|
174
174
|
this.destroy();
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
ChartEChartsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
178
|
-
ChartEChartsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
177
|
+
ChartEChartsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsComponent, deps: [{ token: ChartEChartsService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i2$1.Platform }], target: i0.ɵɵFactoryTarget.Component });
|
|
178
|
+
ChartEChartsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: ChartEChartsComponent, selector: "chart-echarts, [chart-echarts]", inputs: { width: "width", height: "height", theme: "theme", initOpt: "initOpt", option: "option", on: "on" }, outputs: { events: "events" }, host: { properties: { "style.display": "'inline-block'", "style.width": "_width", "style.height": "_height" } }, viewQueries: [{ propertyName: "node", first: true, predicate: ["container"], descendants: true, static: true }], exportAs: ["chartECharts"], ngImport: i0, template: `
|
|
179
179
|
<nz-skeleton *ngIf="!loaded"></nz-skeleton>
|
|
180
180
|
<div #container [style.width]="_width" [style.height]="_height"></div>
|
|
181
181
|
`, isInline: true, components: [{ type: i3.NzSkeletonComponent, selector: "nz-skeleton", inputs: ["nzActive", "nzLoading", "nzRound", "nzTitle", "nzAvatar", "nzParagraph"], exportAs: ["nzSkeleton"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
182
182
|
__decorate([
|
|
183
183
|
ZoneOutside()
|
|
184
184
|
], ChartEChartsComponent.prototype, "load", null);
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsComponent, decorators: [{
|
|
186
186
|
type: Component,
|
|
187
187
|
args: [{
|
|
188
188
|
selector: 'chart-echarts, [chart-echarts]',
|
|
@@ -222,10 +222,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
222
222
|
const COMPONENTS = [ChartEChartsComponent];
|
|
223
223
|
class ChartEChartsModule {
|
|
224
224
|
}
|
|
225
|
-
ChartEChartsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
226
|
-
ChartEChartsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
227
|
-
ChartEChartsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
225
|
+
ChartEChartsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
226
|
+
ChartEChartsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsModule, declarations: [ChartEChartsComponent], imports: [CommonModule, NzSkeletonModule], exports: [ChartEChartsComponent] });
|
|
227
|
+
ChartEChartsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsModule, imports: [[CommonModule, NzSkeletonModule]] });
|
|
228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ChartEChartsModule, decorators: [{
|
|
229
229
|
type: NgModule,
|
|
230
230
|
args: [{
|
|
231
231
|
imports: [CommonModule, NzSkeletonModule],
|
package/fesm2020/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Directive, Input, ViewChild } from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Directive, Input, ViewChild, Output } from '@angular/core';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import * as i1 from '@delon/util/config';
|
|
5
5
|
import * as i2 from '@delon/util/other';
|
|
@@ -24,7 +24,7 @@ class G2Service {
|
|
|
24
24
|
this._cog = this.cogSrv.merge('chart', {
|
|
25
25
|
theme: '',
|
|
26
26
|
libs: [
|
|
27
|
-
'https://gw.alipayobjects.com/os/lib/antv/g2/4.1.
|
|
27
|
+
'https://gw.alipayobjects.com/os/lib/antv/g2/4.1.46/dist/g2.min.js',
|
|
28
28
|
'https://gw.alipayobjects.com/os/lib/antv/data-set/0.11.8/dist/data-set.js'
|
|
29
29
|
]
|
|
30
30
|
}, val);
|
|
@@ -50,9 +50,9 @@ class G2Service {
|
|
|
50
50
|
this.notify$.unsubscribe();
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
G2Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
54
|
-
G2Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
53
|
+
G2Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2Service, deps: [{ token: i1.AlainConfigService }, { token: i2.LazyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
54
|
+
G2Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2Service, providedIn: 'root' });
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2Service, decorators: [{
|
|
56
56
|
type: Injectable,
|
|
57
57
|
args: [{ providedIn: 'root' }]
|
|
58
58
|
}], ctorParameters: function () { return [{ type: i1.AlainConfigService }, { type: i2.LazyService }]; } });
|
|
@@ -68,6 +68,7 @@ class G2BaseComponent {
|
|
|
68
68
|
this.destroy$ = new Subject();
|
|
69
69
|
this.loaded = false;
|
|
70
70
|
this.delay = 0;
|
|
71
|
+
this.ready = new EventEmitter();
|
|
71
72
|
this.theme = srv.cog.theme;
|
|
72
73
|
this.srv.notify
|
|
73
74
|
.pipe(takeUntil(this.destroy$), filter(() => !this.loaded))
|
|
@@ -76,6 +77,9 @@ class G2BaseComponent {
|
|
|
76
77
|
get chart() {
|
|
77
78
|
return this._chart;
|
|
78
79
|
}
|
|
80
|
+
get winG2() {
|
|
81
|
+
return window.G2;
|
|
82
|
+
}
|
|
79
83
|
/** G2数据变更 */
|
|
80
84
|
changeData() { }
|
|
81
85
|
/** 等同 `ngOnInit` */
|
|
@@ -94,7 +98,7 @@ class G2BaseComponent {
|
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
96
100
|
this.onInit();
|
|
97
|
-
if (
|
|
101
|
+
if (this.winG2) {
|
|
98
102
|
this.load();
|
|
99
103
|
}
|
|
100
104
|
else {
|
|
@@ -131,8 +135,8 @@ class G2BaseComponent {
|
|
|
131
135
|
this.destroyChart();
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
|
-
G2BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
135
|
-
G2BaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.
|
|
138
|
+
G2BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BaseComponent, deps: [{ token: G2Service }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i2$1.Platform }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
139
|
+
G2BaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.5", type: G2BaseComponent, inputs: { repaint: "repaint", delay: "delay", theme: "theme" }, outputs: { ready: "ready" }, viewQueries: [{ propertyName: "node", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0 });
|
|
136
140
|
__decorate([
|
|
137
141
|
InputBoolean()
|
|
138
142
|
], G2BaseComponent.prototype, "repaint", void 0);
|
|
@@ -145,7 +149,7 @@ __decorate([
|
|
|
145
149
|
__decorate([
|
|
146
150
|
ZoneOutside()
|
|
147
151
|
], G2BaseComponent.prototype, "destroyChart", null);
|
|
148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2BaseComponent, decorators: [{
|
|
149
153
|
type: Directive
|
|
150
154
|
}], ctorParameters: function () { return [{ type: G2Service }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i2$1.Platform }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { repaint: [{
|
|
151
155
|
type: Input
|
|
@@ -156,6 +160,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
156
160
|
type: Input
|
|
157
161
|
}], theme: [{
|
|
158
162
|
type: Input
|
|
163
|
+
}], ready: [{
|
|
164
|
+
type: Output
|
|
159
165
|
}], load: [], destroyChart: [] } });
|
|
160
166
|
|
|
161
167
|
function genMiniTooltipOptions(type, options) {
|
package/fesm2020/core.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.mjs","sources":["../../../../packages/chart/core/g2.servicce.ts","../../../../packages/chart/core/g2.base.component.ts","../../../../packages/chart/core/utils.ts","../../../../packages/chart/core/core.ts"],"sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { AlainChartConfig, AlainConfigService } from '@delon/util/config';\nimport { LazyService } from '@delon/util/other';\n\n@Injectable({ providedIn: 'root' })\nexport class G2Service implements OnDestroy {\n private _cog!: AlainChartConfig;\n private loading = false;\n private loaded = false;\n private notify$ = new Subject<void>();\n\n get cog(): AlainChartConfig {\n return this._cog;\n }\n set cog(val: AlainChartConfig) {\n this._cog = this.cogSrv.merge(\n 'chart',\n {\n theme: '',\n libs: [\n 'https://gw.alipayobjects.com/os/lib/antv/g2/4.1.
|
|
1
|
+
{"version":3,"file":"core.mjs","sources":["../../../../packages/chart/core/g2.servicce.ts","../../../../packages/chart/core/g2.base.component.ts","../../../../packages/chart/core/utils.ts","../../../../packages/chart/core/core.ts"],"sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { AlainChartConfig, AlainConfigService } from '@delon/util/config';\nimport { LazyService } from '@delon/util/other';\n\n@Injectable({ providedIn: 'root' })\nexport class G2Service implements OnDestroy {\n private _cog!: AlainChartConfig;\n private loading = false;\n private loaded = false;\n private notify$ = new Subject<void>();\n\n get cog(): AlainChartConfig {\n return this._cog;\n }\n set cog(val: AlainChartConfig) {\n this._cog = this.cogSrv.merge(\n 'chart',\n {\n theme: '',\n libs: [\n 'https://gw.alipayobjects.com/os/lib/antv/g2/4.1.46/dist/g2.min.js',\n 'https://gw.alipayobjects.com/os/lib/antv/data-set/0.11.8/dist/data-set.js'\n ]\n } as AlainChartConfig,\n val\n )!;\n }\n\n constructor(private cogSrv: AlainConfigService, private lazySrv: LazyService) {\n this.cog = { theme: '' };\n }\n\n libLoad(): this {\n if (this.loading) {\n if (this.loaded) {\n this.notify$.next();\n }\n return this;\n }\n this.loading = true;\n this.lazySrv.load(this.cog.libs!).then(() => {\n this.loaded = true;\n this.notify$.next();\n });\n return this;\n }\n\n get notify(): Observable<void> {\n return this.notify$.asObservable();\n }\n\n ngOnDestroy(): void {\n this.notify$.unsubscribe();\n }\n}\n","import { Platform } from '@angular/cdk/platform';\nimport {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { Subject, Subscription } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport type { Chart, Types } from '@antv/g2';\n\nimport { BooleanInput, InputBoolean, InputNumber, NumberInput, ZoneOutside } from '@delon/util/decorator';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { G2Service } from './g2.servicce';\n\n@Directive()\nexport abstract class G2BaseComponent implements OnInit, OnChanges, OnDestroy {\n get chart(): Chart {\n return this._chart;\n }\n\n get winG2(): NzSafeAny {\n return (window as NzSafeAny).G2;\n }\n\n constructor(\n protected srv: G2Service,\n protected el: ElementRef<HTMLElement>,\n protected ngZone: NgZone,\n protected platform: Platform,\n protected cdr: ChangeDetectorRef\n ) {\n this.theme = srv.cog.theme!;\n this.srv.notify\n .pipe(\n takeUntil(this.destroy$),\n filter(() => !this.loaded)\n )\n .subscribe(() => this.load());\n }\n static ngAcceptInputType_repaint: BooleanInput;\n static ngAcceptInputType_delay: NumberInput;\n @Input() @InputBoolean() repaint = true;\n\n @ViewChild('container', { static: true }) protected node!: ElementRef;\n protected resize$?: Subscription;\n protected destroy$ = new Subject<void>();\n protected _chart!: Chart;\n loaded = false;\n\n @Input() @InputNumber() delay = 0;\n @Input() theme: string | Types.LooseObject;\n @Output() readonly ready = new EventEmitter<Chart>();\n\n /** 检查是否只变更数据 */\n onlyChangeData?: (changes: SimpleChanges) => boolean;\n\n abstract install(): void;\n\n /** G2数据变更 */\n changeData(): void {}\n\n /** 等同 `ngOnInit` */\n onInit(): void {}\n\n /** 等同 `ngOnChanges` */\n onChanges(_: SimpleChanges): void {}\n\n @ZoneOutside()\n private load(): void {\n this.ngZone.run(() => {\n this.loaded = true;\n this.cdr.detectChanges();\n });\n setTimeout(() => this.install(), this.delay);\n }\n\n ngOnInit(): void {\n if (!this.platform.isBrowser) {\n return;\n }\n this.onInit();\n if (this.winG2) {\n this.load();\n } else {\n this.srv.libLoad();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.onChanges(changes);\n\n const isOnlyChangeData = this.onlyChangeData\n ? this.onlyChangeData(changes)\n : Object.keys(changes).length === 1 && !!changes.data;\n if (isOnlyChangeData) {\n this.changeData();\n return;\n }\n if (!this.chart || !this.repaint) return;\n this.ngZone.runOutsideAngular(() => {\n this.destroyChart().install();\n });\n }\n\n @ZoneOutside()\n protected destroyChart(): this {\n if (this._chart) {\n this._chart.destroy();\n }\n return this;\n }\n\n ngOnDestroy(): void {\n if (this.resize$) {\n this.resize$.unsubscribe();\n }\n this.destroy$.next();\n this.destroy$.complete();\n this.destroyChart();\n }\n}\n","import type { Types } from '@antv/g2';\n\nexport function genMiniTooltipOptions(type: 'mini' | 'default', options?: Types.TooltipCfg): Types.TooltipCfg {\n const res: Types.TooltipCfg = {\n showTitle: false,\n showMarkers: true,\n enterable: true,\n domStyles: {\n 'g2-tooltip': { padding: '0px' },\n 'g2-tooltip-title': { display: 'none' },\n 'g2-tooltip-list-item': { margin: '4px' }\n },\n ...options\n };\n if (type === 'mini') {\n res.position = 'top';\n res.domStyles!['g2-tooltip'] = { padding: '0px', backgroundColor: 'transparent', boxShadow: 'none' };\n res.itemTpl = `<li>{value}</li>`;\n res.offset = 8;\n }\n\n return res;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAOa,SAAS;IAuBpB,YAAoB,MAA0B,EAAU,OAAoB;QAAxD,WAAM,GAAN,MAAM,CAAoB;QAAU,YAAO,GAAP,OAAO,CAAa;QArBpE,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAG,KAAK,CAAC;QACf,YAAO,GAAG,IAAI,OAAO,EAAQ,CAAC;QAoBpC,IAAI,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;KAC1B;IAnBD,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;IACD,IAAI,GAAG,CAAC,GAAqB;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAC3B,OAAO,EACP;YACE,KAAK,EAAE,EAAE;YACT,IAAI,EAAE;gBACJ,mEAAmE;gBACnE,2EAA2E;aAC5E;SACkB,EACrB,GAAG,CACH,CAAC;KACJ;IAMD,OAAO;QACL,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;aACrB;YACD,OAAO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AAG,CAAC,SAAU,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QACrG,GAAG,CAAC,OAAO,GAAG,kBAAkB,CAAC;QACjC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;KAChB;IAED,OAAO,GAAG,CAAC;AACb;;ACtBA;;;;;;"}
|
package/fesm2020/custom.mjs
CHANGED
|
@@ -32,8 +32,8 @@ class G2CustomComponent extends G2BaseComponent {
|
|
|
32
32
|
.subscribe(() => this.resize.emit(this.el));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
G2CustomComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
36
|
-
G2CustomComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.
|
|
35
|
+
G2CustomComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CustomComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
G2CustomComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: G2CustomComponent, selector: "g2,g2-custom", inputs: { height: "height", resizeTime: "resizeTime" }, outputs: { render: "render", resize: "resize", destroy: "destroy" }, host: { properties: { "style.height.px": "height" } }, exportAs: ["g2Custom"], usesInheritance: true, ngImport: i0, template: `
|
|
37
37
|
<nz-skeleton *ngIf="!loaded"></nz-skeleton>
|
|
38
38
|
<ng-content></ng-content>
|
|
39
39
|
`, 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 });
|
|
@@ -43,7 +43,7 @@ __decorate([
|
|
|
43
43
|
__decorate([
|
|
44
44
|
InputNumber()
|
|
45
45
|
], G2CustomComponent.prototype, "resizeTime", void 0);
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CustomComponent, decorators: [{
|
|
47
47
|
type: Component,
|
|
48
48
|
args: [{
|
|
49
49
|
selector: 'g2,g2-custom',
|
|
@@ -74,10 +74,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
74
74
|
const COMPONENTS = [G2CustomComponent];
|
|
75
75
|
class G2CustomModule {
|
|
76
76
|
}
|
|
77
|
-
G2CustomModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.
|
|
78
|
-
G2CustomModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.
|
|
79
|
-
G2CustomModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.
|
|
77
|
+
G2CustomModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CustomModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
78
|
+
G2CustomModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CustomModule, declarations: [G2CustomComponent], imports: [CommonModule, NzSkeletonModule], exports: [G2CustomComponent] });
|
|
79
|
+
G2CustomModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CustomModule, imports: [[CommonModule, NzSkeletonModule]] });
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: G2CustomModule, decorators: [{
|
|
81
81
|
type: NgModule,
|
|
82
82
|
args: [{
|
|
83
83
|
imports: [CommonModule, NzSkeletonModule],
|