aril 2.0.1-dev.4 → 2.0.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/boot/config/apps/src/interfaces.d.ts +7 -1
- package/boot/config/apps/src/route-close.service.d.ts +8 -3
- package/boot/config/apps/src/route-permissions.d.ts +2 -2
- package/esm2022/boot/config/api/src/interfaces.mjs +3 -2
- package/esm2022/boot/config/apps/src/apps.service.mjs +2 -2
- package/esm2022/boot/config/apps/src/custom-route-reuse-strategy.class.mjs +4 -4
- package/esm2022/boot/config/apps/src/interfaces.mjs +2 -1
- package/esm2022/boot/config/apps/src/route-close.service.mjs +11 -4
- package/esm2022/boot/config/apps/src/route-permissions.mjs +24 -6
- package/esm2022/boot/config/plugins/src/plugins.service.mjs +7 -5
- package/esm2022/boot/host/src/bootstrap.mjs +5 -3
- package/esm2022/boot/mfe/src/bootstrap.mjs +11 -3
- package/esm2022/http/index.mjs +1 -2
- package/esm2022/http/src/serviceBase.mjs +4 -4
- package/esm2022/http/src/serviceStateMethods.mjs +9 -1
- package/esm2022/keycloak/src/auth.interceptor.mjs +5 -2
- package/esm2022/selection/aril-selection.mjs +5 -0
- package/esm2022/selection/index.mjs +2 -0
- package/esm2022/selection/src/interfaces.mjs +2 -0
- package/esm2022/selection/src/selection-group.service.mjs +195 -0
- package/esm2022/theme/layout/app/profileSidebar/modals/edit-profile-modal/edit-profile-modal.component.mjs +2 -2
- package/esm2022/theme/layout/index.mjs +4 -2
- package/esm2022/theme/layout/service/tab-session.service.mjs +1 -1
- package/esm2022/ui/button/index.mjs +1 -2
- package/esm2022/ui/button/src/button.component.mjs +5 -2
- package/esm2022/ui/charts/index.mjs +1 -11
- package/esm2022/ui/lib/index.mjs +1 -4
- package/esm2022/ui/lib/src/form/form-error-message.directive.mjs +9 -5
- package/esm2022/ui/multiSelect/src/multi-select.component.mjs +25 -25
- package/esm2022/ui/relativeDateSelector/src/relative-date-selector.component.mjs +2 -2
- package/esm2022/ui/selectBox/src/select-box.component.mjs +11 -34
- package/esm2022/ui/table/src/table.component.mjs +10 -5
- package/esm2022/ui/value/src/value.component.mjs +3 -2
- package/esm2022/ui-business/enumPicker/src/enum-picker.component.mjs +14 -6
- package/esm2022/util/activity/aril-util-activity.mjs +5 -0
- package/esm2022/util/activity/index.mjs +4 -0
- package/esm2022/util/activity/src/activity.constants.mjs +4 -0
- package/esm2022/util/activity/src/activity.service.mjs +218 -0
- package/esm2022/util/activity/src/activity.types.mjs +2 -0
- package/esm2022/util/block/src/block.mjs +9 -25
- package/esm2022/util/pub-sub/src/pub-sub.service.mjs +10 -5
- package/fesm2022/{aril-app.component-s14ruALV.mjs → aril-app.component-MjG_tPEe.mjs} +2 -1
- package/fesm2022/{aril-app.component-s14ruALV.mjs.map → aril-app.component-MjG_tPEe.mjs.map} +1 -1
- package/fesm2022/aril-boot-config-api.mjs +2 -1
- package/fesm2022/aril-boot-config-api.mjs.map +1 -1
- package/fesm2022/aril-boot-config-apps.mjs +36 -12
- package/fesm2022/aril-boot-config-apps.mjs.map +1 -1
- package/fesm2022/aril-boot-config-plugins.mjs +6 -4
- package/fesm2022/aril-boot-config-plugins.mjs.map +1 -1
- package/fesm2022/aril-boot-host.mjs +4 -2
- package/fesm2022/aril-boot-host.mjs.map +1 -1
- package/fesm2022/{aril-boot-mfe-app.component-oxzMhRXe.mjs → aril-boot-mfe-app.component-DtspQ3J8.mjs} +3 -2
- package/fesm2022/{aril-boot-mfe-app.component-oxzMhRXe.mjs.map → aril-boot-mfe-app.component-DtspQ3J8.mjs.map} +1 -1
- package/fesm2022/{aril-boot-mfe-aril-boot-mfe-CKOM61xb.mjs → aril-boot-mfe-aril-boot-mfe-lovoFcgw.mjs} +12 -4
- package/fesm2022/aril-boot-mfe-aril-boot-mfe-lovoFcgw.mjs.map +1 -0
- package/fesm2022/aril-boot-mfe.mjs +2 -1
- package/fesm2022/aril-boot-mfe.mjs.map +1 -1
- package/fesm2022/aril-http.mjs +11 -7
- package/fesm2022/aril-http.mjs.map +1 -1
- package/fesm2022/aril-keycloak.mjs +4 -1
- package/fesm2022/aril-keycloak.mjs.map +1 -1
- package/fesm2022/aril-selection.mjs +202 -0
- package/fesm2022/aril-selection.mjs.map +1 -0
- package/fesm2022/aril-theme-layout.mjs +4 -193
- package/fesm2022/aril-theme-layout.mjs.map +1 -1
- package/fesm2022/aril-ui-business-enumPicker.mjs +14 -6
- package/fesm2022/aril-ui-business-enumPicker.mjs.map +1 -1
- package/fesm2022/aril-ui-button.mjs +5 -17
- package/fesm2022/aril-ui-button.mjs.map +1 -1
- package/fesm2022/aril-ui-charts.mjs +4 -1302
- package/fesm2022/aril-ui-charts.mjs.map +1 -1
- package/fesm2022/aril-ui-lib.mjs +10 -98
- package/fesm2022/aril-ui-lib.mjs.map +1 -1
- package/fesm2022/aril-ui-multiSelect.mjs +24 -24
- package/fesm2022/aril-ui-multiSelect.mjs.map +1 -1
- package/fesm2022/aril-ui-relativeDateSelector.mjs +1 -1
- package/fesm2022/aril-ui-relativeDateSelector.mjs.map +1 -1
- package/fesm2022/aril-ui-selectBox.mjs +10 -33
- package/fesm2022/aril-ui-selectBox.mjs.map +1 -1
- package/fesm2022/aril-ui-table.mjs +9 -4
- package/fesm2022/aril-ui-table.mjs.map +1 -1
- package/fesm2022/aril-ui-value.mjs +2 -1
- package/fesm2022/aril-ui-value.mjs.map +1 -1
- package/fesm2022/aril-util-activity.mjs +228 -0
- package/fesm2022/aril-util-activity.mjs.map +1 -0
- package/fesm2022/aril-util-block.mjs +9 -25
- package/fesm2022/aril-util-block.mjs.map +1 -1
- package/fesm2022/aril-util-pub-sub.mjs +9 -4
- package/fesm2022/aril-util-pub-sub.mjs.map +1 -1
- package/fesm2022/aril.mjs +14 -5
- package/fesm2022/aril.mjs.map +1 -1
- package/http/index.d.ts +0 -1
- package/http/src/serviceStateMethods.d.ts +1 -0
- package/package.json +184 -208
- package/scripts/mf-shared.js +47 -47
- package/selection/index.d.ts +1 -0
- package/selection/src/interfaces.d.ts +8 -0
- package/{theme/layout/service → selection/src}/selection-group.service.d.ts +1 -1
- package/theme/layout/index.d.ts +1 -1
- package/theme/layout/index.ts +3 -1
- package/theme/layout/service/tab-session.service.ts +138 -138
- package/ui/button/index.d.ts +0 -1
- package/ui/button/src/button.component.d.ts +2 -0
- package/ui/charts/index.d.ts +0 -10
- package/ui/lib/index.d.ts +0 -3
- package/ui/lib/src/form/form-error-message.directive.d.ts +4 -3
- package/ui/multiSelect/src/multi-select.component.d.ts +4 -5
- package/ui/selectBox/src/select-box.component.d.ts +2 -7
- package/ui/table/src/table.component.d.ts +3 -2
- package/util/activity/index.d.ts +3 -0
- package/util/activity/src/activity.constants.d.ts +3 -0
- package/util/activity/src/activity.service.d.ts +35 -0
- package/util/activity/src/activity.types.d.ts +13 -0
- package/util/block/src/block.d.ts +4 -10
- package/util/pub-sub/src/pub-sub.service.d.ts +2 -2
- package/esm2022/http/src/serviceMockBase.mjs +0 -4
- package/esm2022/theme/layout/service/selection-group.service.mjs +0 -195
- package/esm2022/ui/button/src/split-button.component.mjs +0 -18
- package/esm2022/ui/charts/src/amCharts/column/column-chart.component.mjs +0 -124
- package/esm2022/ui/charts/src/amCharts/line/line-chart.component.mjs +0 -164
- package/esm2022/ui/charts/src/amCharts/pie/pie-chart.component.mjs +0 -116
- package/esm2022/ui/charts/src/highCharts/area/area-chart.component.mjs +0 -114
- package/esm2022/ui/charts/src/highCharts/bar/bar-chart.component.mjs +0 -100
- package/esm2022/ui/charts/src/highCharts/column/column-chart.component.mjs +0 -117
- package/esm2022/ui/charts/src/highCharts/heatmap/heatMap-chart.component.mjs +0 -252
- package/esm2022/ui/charts/src/highCharts/line/line-chart-series.component.mjs +0 -89
- package/esm2022/ui/charts/src/highCharts/line/line-chart.component.mjs +0 -82
- package/esm2022/ui/charts/src/highCharts/pie/pie-chart.component.mjs +0 -137
- package/esm2022/ui/charts/src/theme/theme.mjs +0 -54
- package/esm2022/ui/dxEditor/aril-ui-dxEditor.mjs +0 -5
- package/esm2022/ui/dxEditor/index.mjs +0 -2
- package/esm2022/ui/dxEditor/src/dx-editor.component.mjs +0 -26
- package/esm2022/ui/lib/src/form/form-field-builder.mjs +0 -23
- package/esm2022/ui/lib/src/input/common-input-validators.service.mjs +0 -49
- package/esm2022/ui/lib/src/input/input-disabled.directive.mjs +0 -25
- package/esm2022/ui/overlayPanel/aril-ui-overlayPanel.mjs +0 -5
- package/esm2022/ui/overlayPanel/index.mjs +0 -2
- package/esm2022/ui/overlayPanel/src/overlay-panel.component.mjs +0 -20
- package/esm2022/ui/tooltip/aril-ui-tooltip.mjs +0 -5
- package/esm2022/ui/tooltip/index.mjs +0 -2
- package/esm2022/ui/tooltip/src/tooltip-component.mjs +0 -23
- package/esm2022/ui/treeTable/aril-ui-treeTable.mjs +0 -5
- package/esm2022/ui/treeTable/index.mjs +0 -2
- package/esm2022/ui/treeTable/src/tree-table.component.mjs +0 -55
- package/esm2022/ui-business/operation-types-dialog/aril-ui-business-operation-types-dialog.mjs +0 -5
- package/esm2022/ui-business/operation-types-dialog/index.mjs +0 -2
- package/esm2022/ui-business/operation-types-dialog/src/operation-types-dialog.component.mjs +0 -76
- package/esm2022/util/unwrap/aril-util-unwrap.mjs +0 -5
- package/esm2022/util/unwrap/index.mjs +0 -2
- package/esm2022/util/unwrap/src/unwrap-tag.directive.mjs +0 -24
- package/fesm2022/aril-boot-mfe-aril-boot-mfe-CKOM61xb.mjs.map +0 -1
- package/fesm2022/aril-ui-business-operation-types-dialog.mjs +0 -83
- package/fesm2022/aril-ui-business-operation-types-dialog.mjs.map +0 -1
- package/fesm2022/aril-ui-dxEditor.mjs +0 -33
- package/fesm2022/aril-ui-dxEditor.mjs.map +0 -1
- package/fesm2022/aril-ui-overlayPanel.mjs +0 -27
- package/fesm2022/aril-ui-overlayPanel.mjs.map +0 -1
- package/fesm2022/aril-ui-tooltip.mjs +0 -30
- package/fesm2022/aril-ui-tooltip.mjs.map +0 -1
- package/fesm2022/aril-ui-treeTable.mjs +0 -62
- package/fesm2022/aril-ui-treeTable.mjs.map +0 -1
- package/fesm2022/aril-util-unwrap.mjs +0 -31
- package/fesm2022/aril-util-unwrap.mjs.map +0 -1
- package/http/src/serviceMockBase.d.ts +0 -6
- package/theme/layout/service/selection-group.service.ts +0 -209
- package/ui/button/src/split-button.component.d.ts +0 -8
- package/ui/charts/src/amCharts/column/column-chart.component.d.ts +0 -25
- package/ui/charts/src/amCharts/line/line-chart.component.d.ts +0 -26
- package/ui/charts/src/amCharts/pie/pie-chart.component.d.ts +0 -24
- package/ui/charts/src/highCharts/area/area-chart.component.d.ts +0 -20
- package/ui/charts/src/highCharts/bar/bar-chart.component.d.ts +0 -26
- package/ui/charts/src/highCharts/column/column-chart.component.d.ts +0 -28
- package/ui/charts/src/highCharts/heatmap/heatMap-chart.component.d.ts +0 -32
- package/ui/charts/src/highCharts/line/line-chart-series.component.d.ts +0 -21
- package/ui/charts/src/highCharts/line/line-chart.component.d.ts +0 -21
- package/ui/charts/src/highCharts/pie/pie-chart.component.d.ts +0 -27
- package/ui/charts/src/theme/theme.d.ts +0 -5
- package/ui/dxEditor/index.d.ts +0 -1
- package/ui/dxEditor/src/dx-editor.component.d.ts +0 -11
- package/ui/lib/src/form/form-field-builder.d.ts +0 -8
- package/ui/lib/src/input/common-input-validators.service.d.ts +0 -20
- package/ui/lib/src/input/input-disabled.directive.d.ts +0 -9
- package/ui/overlayPanel/index.d.ts +0 -1
- package/ui/overlayPanel/src/overlay-panel.component.d.ts +0 -8
- package/ui/tooltip/index.d.ts +0 -1
- package/ui/tooltip/src/tooltip-component.d.ts +0 -14
- package/ui/treeTable/index.d.ts +0 -1
- package/ui/treeTable/src/tree-table.component.d.ts +0 -21
- package/ui-business/operation-types-dialog/index.d.ts +0 -1
- package/ui-business/operation-types-dialog/src/operation-types-dialog.component.d.ts +0 -28
- package/util/unwrap/index.d.ts +0 -1
- package/util/unwrap/src/unwrap-tag.directive.d.ts +0 -9
|
@@ -1,897 +1,11 @@
|
|
|
1
|
-
import { isPlatformBrowser, NgClass } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input,
|
|
4
|
-
import * as am5 from '@amcharts/amcharts5';
|
|
5
|
-
import * as am5percent from '@amcharts/amcharts5/percent';
|
|
6
|
-
import am5themes_Animated from '@amcharts/amcharts5/themes/Animated';
|
|
7
|
-
import * as am5xy from '@amcharts/amcharts5/xy';
|
|
8
|
-
import * as Highcharts from 'highcharts';
|
|
2
|
+
import { input, effect, Component, computed } from '@angular/core';
|
|
9
3
|
import * as i1 from 'highcharts-angular';
|
|
10
4
|
import { HighchartsChartModule } from 'highcharts-angular';
|
|
11
|
-
import
|
|
5
|
+
import * as Highcharts from 'highcharts';
|
|
12
6
|
import NoDataToDisplay from 'highcharts/modules/no-data-to-display';
|
|
7
|
+
import highchartsMore from 'highcharts/highcharts-more';
|
|
13
8
|
import solidGauge from 'highcharts/modules/solid-gauge';
|
|
14
|
-
import heatmap from 'highcharts/modules/heatmap';
|
|
15
|
-
|
|
16
|
-
class ChartThemes {
|
|
17
|
-
static getThorAppColors() {
|
|
18
|
-
return [
|
|
19
|
-
'#e7625f',
|
|
20
|
-
'#c85250',
|
|
21
|
-
'#f7bec0',
|
|
22
|
-
'#e9eae0',
|
|
23
|
-
'#aa1945',
|
|
24
|
-
'#f1ced4',
|
|
25
|
-
'#391306',
|
|
26
|
-
'#821d30',
|
|
27
|
-
'#fb4570',
|
|
28
|
-
'#fb4570',
|
|
29
|
-
'#fb4570',
|
|
30
|
-
'#5f093d',
|
|
31
|
-
'#b21368',
|
|
32
|
-
'#d67ba8'
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
static getYeapAppColors() {
|
|
36
|
-
return [
|
|
37
|
-
'#525252',
|
|
38
|
-
'#9A9A9A',
|
|
39
|
-
'#767676',
|
|
40
|
-
'#828282',
|
|
41
|
-
'#BEBEBE',
|
|
42
|
-
'#8E8E8E',
|
|
43
|
-
'#6A6A6A',
|
|
44
|
-
'#A6A6A6',
|
|
45
|
-
'#5E5E5E',
|
|
46
|
-
'#B2B2B2',
|
|
47
|
-
'#CACACA'
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
static getLenaAppColors() {
|
|
51
|
-
return [
|
|
52
|
-
'#abea7c',
|
|
53
|
-
'#fede00',
|
|
54
|
-
'#c8df52',
|
|
55
|
-
'#0a7029',
|
|
56
|
-
'#dbe8d8',
|
|
57
|
-
'#65463e',
|
|
58
|
-
'#aad6a0',
|
|
59
|
-
'#013a20',
|
|
60
|
-
'#bacc81',
|
|
61
|
-
'#cdd193',
|
|
62
|
-
'#fad02c',
|
|
63
|
-
'#282120',
|
|
64
|
-
'#333652',
|
|
65
|
-
'#b2d7da'
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// EXAMPLE CHART DATA
|
|
71
|
-
// testChartData = [
|
|
72
|
-
// {
|
|
73
|
-
// label: "part1",
|
|
74
|
-
// value: 100000
|
|
75
|
-
// },
|
|
76
|
-
// {
|
|
77
|
-
// label: "part1",
|
|
78
|
-
// value: 160000
|
|
79
|
-
// },
|
|
80
|
-
// {
|
|
81
|
-
// label: "part1",
|
|
82
|
-
// value: 80000
|
|
83
|
-
// }
|
|
84
|
-
// ];
|
|
85
|
-
class PieChartComponent {
|
|
86
|
-
constructor(platformId, zone) {
|
|
87
|
-
this.platformId = platformId;
|
|
88
|
-
this.zone = zone;
|
|
89
|
-
this.data = input.required();
|
|
90
|
-
this.chartId = input.required(); // must be given unique names for all charts. Its because angular and am5 rendering methods needs unique id to draw different canvas
|
|
91
|
-
this.appName = input('yeap');
|
|
92
|
-
this.chartColorSet = [];
|
|
93
|
-
this.chartHeight = input.required();
|
|
94
|
-
}
|
|
95
|
-
browserOnly(f) {
|
|
96
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
97
|
-
this.zone.runOutsideAngular(() => {
|
|
98
|
-
f();
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
ngAfterViewInit() {
|
|
103
|
-
// Chart code goes in here
|
|
104
|
-
this.browserOnly(() => {
|
|
105
|
-
switch (this.appName()) {
|
|
106
|
-
case 'yeap':
|
|
107
|
-
this.chartColorSet = ChartThemes.getYeapAppColors();
|
|
108
|
-
break;
|
|
109
|
-
case 'thor':
|
|
110
|
-
this.chartColorSet = ChartThemes.getThorAppColors();
|
|
111
|
-
break;
|
|
112
|
-
case 'lena':
|
|
113
|
-
this.chartColorSet = ChartThemes.getLenaAppColors();
|
|
114
|
-
break;
|
|
115
|
-
case 'billing':
|
|
116
|
-
this.chartColorSet = ChartThemes.getThorAppColors();
|
|
117
|
-
break;
|
|
118
|
-
default:
|
|
119
|
-
this.chartColorSet = ChartThemes.getYeapAppColors();
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
const root = am5.Root.new(this.chartId());
|
|
123
|
-
root._logo?.dispose();
|
|
124
|
-
root.setThemes([am5themes_Animated.new(root)]);
|
|
125
|
-
const chart = root.container.children.push(am5percent.PieChart.new(root, {}));
|
|
126
|
-
const series = chart.series.push(am5percent.PieSeries.new(root, {
|
|
127
|
-
name: 'Series',
|
|
128
|
-
categoryField: 'label',
|
|
129
|
-
valueField: 'value',
|
|
130
|
-
fillField: 'color'
|
|
131
|
-
}));
|
|
132
|
-
series.slices.template.adapters.add('fill', (fill, target) => {
|
|
133
|
-
const dataContext = target.dataItem?.dataContext;
|
|
134
|
-
if (dataContext) {
|
|
135
|
-
const index = this.data().findIndex((item) => item.label === dataContext.label);
|
|
136
|
-
return am5.color(this.chartColorSet[index % this.chartColorSet.length]); // Sıralı renk seçimi
|
|
137
|
-
}
|
|
138
|
-
return fill;
|
|
139
|
-
});
|
|
140
|
-
series.slices.template.setAll({
|
|
141
|
-
stroke: am5.color(0xffffff),
|
|
142
|
-
strokeWidth: 2
|
|
143
|
-
});
|
|
144
|
-
series.data.setAll(this.data());
|
|
145
|
-
const legend = chart.children.push(am5.Legend.new(root, {
|
|
146
|
-
centerX: am5.percent(50),
|
|
147
|
-
x: am5.percent(50),
|
|
148
|
-
layout: root.horizontalLayout
|
|
149
|
-
}));
|
|
150
|
-
legend.data.setAll(series.dataItems);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
ngOnDestroy() {
|
|
154
|
-
// Clean up chart when the component is removed
|
|
155
|
-
this.browserOnly(() => {
|
|
156
|
-
if (this.root) {
|
|
157
|
-
this.root.dispose();
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: PieChartComponent, deps: [{ token: PLATFORM_ID }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
162
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: PieChartComponent, isStandalone: true, selector: "aril-pie-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, chartId: { classPropertyName: "chartId", publicName: "chartId", isSignal: true, isRequired: true, transformFunction: null }, appName: { classPropertyName: "appName", publicName: "appName", isSignal: true, isRequired: false, transformFunction: null }, chartHeight: { classPropertyName: "chartHeight", publicName: "chartHeight", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<div style="width: 100%; height:{{ chartHeight() }}px;" id="{{ chartId() }}"></div>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
163
|
-
}
|
|
164
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: PieChartComponent, decorators: [{
|
|
165
|
-
type: Component,
|
|
166
|
-
args: [{
|
|
167
|
-
standalone: true,
|
|
168
|
-
selector: 'aril-pie-chart',
|
|
169
|
-
template: `<div style="width: 100%; height:{{ chartHeight() }}px;" id="{{ chartId() }}"></div>`,
|
|
170
|
-
imports: [NgClass],
|
|
171
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
172
|
-
}]
|
|
173
|
-
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
174
|
-
type: Inject,
|
|
175
|
-
args: [PLATFORM_ID]
|
|
176
|
-
}] }, { type: i0.NgZone }] });
|
|
177
|
-
|
|
178
|
-
// EXAMPLE CHART DATA
|
|
179
|
-
// testChartData = [
|
|
180
|
-
// {
|
|
181
|
-
// label: "col1",
|
|
182
|
-
// value: 100000
|
|
183
|
-
// },
|
|
184
|
-
// {
|
|
185
|
-
// label: "col2",
|
|
186
|
-
// value: 160000
|
|
187
|
-
// },
|
|
188
|
-
// {
|
|
189
|
-
// label: "col3",
|
|
190
|
-
// value: 80000
|
|
191
|
-
// }
|
|
192
|
-
// ];
|
|
193
|
-
class ColumnChartComponent {
|
|
194
|
-
constructor(platformId, zone) {
|
|
195
|
-
this.platformId = platformId;
|
|
196
|
-
this.zone = zone;
|
|
197
|
-
this.data = input.required();
|
|
198
|
-
this.chartId = input.required(); // must be given unique names for all charts. Its because angular and am5 rendering methods needs unique id to draw different canvas
|
|
199
|
-
this.appName = input('yeap');
|
|
200
|
-
this.chartHeight = input.required();
|
|
201
|
-
this.chartColorSet = [];
|
|
202
|
-
}
|
|
203
|
-
browserOnly(f) {
|
|
204
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
205
|
-
this.zone.runOutsideAngular(() => {
|
|
206
|
-
f();
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
ngAfterViewInit() {
|
|
211
|
-
// Chart code goes in here
|
|
212
|
-
this.browserOnly(() => {
|
|
213
|
-
switch (this.appName()) {
|
|
214
|
-
case 'yeap':
|
|
215
|
-
this.chartColorSet = ChartThemes.getYeapAppColors();
|
|
216
|
-
break;
|
|
217
|
-
case 'thor':
|
|
218
|
-
this.chartColorSet = ChartThemes.getThorAppColors();
|
|
219
|
-
break;
|
|
220
|
-
case 'lena':
|
|
221
|
-
this.chartColorSet = ChartThemes.getLenaAppColors();
|
|
222
|
-
break;
|
|
223
|
-
case 'billing':
|
|
224
|
-
this.chartColorSet = ChartThemes.getThorAppColors();
|
|
225
|
-
break;
|
|
226
|
-
default:
|
|
227
|
-
this.chartColorSet = ChartThemes.getYeapAppColors();
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
const root = am5.Root.new(this.chartId());
|
|
231
|
-
root._logo?.dispose();
|
|
232
|
-
root.setThemes([am5themes_Animated.new(root)]);
|
|
233
|
-
const chart = root.container.children.push(am5xy.XYChart.new(root, {
|
|
234
|
-
panY: false,
|
|
235
|
-
layout: root.verticalLayout
|
|
236
|
-
}));
|
|
237
|
-
const yAxis = chart.yAxes.push(am5xy.ValueAxis.new(root, {
|
|
238
|
-
renderer: am5xy.AxisRendererY.new(root, {})
|
|
239
|
-
}));
|
|
240
|
-
const xAxis = chart.xAxes.push(am5xy.CategoryAxis.new(root, {
|
|
241
|
-
renderer: am5xy.AxisRendererX.new(root, {}),
|
|
242
|
-
categoryField: 'label'
|
|
243
|
-
}));
|
|
244
|
-
xAxis.data.setAll(this.data());
|
|
245
|
-
const series = chart.series.push(am5xy.ColumnSeries.new(root, {
|
|
246
|
-
xAxis: xAxis,
|
|
247
|
-
yAxis: yAxis,
|
|
248
|
-
valueYField: 'value',
|
|
249
|
-
categoryXField: 'label',
|
|
250
|
-
stacked: true
|
|
251
|
-
}));
|
|
252
|
-
series.data.setAll(this.data());
|
|
253
|
-
xAxis.data.setAll(this.data());
|
|
254
|
-
series.columns.template.setAll({
|
|
255
|
-
stroke: am5.color(0xffffff),
|
|
256
|
-
strokeWidth: 2
|
|
257
|
-
});
|
|
258
|
-
series.columns.template.adapters.add('fill', (fill, target) => {
|
|
259
|
-
const dataContext = target.dataItem?.dataContext;
|
|
260
|
-
if (dataContext) {
|
|
261
|
-
const index = this.data().findIndex((item) => item.label === dataContext.label);
|
|
262
|
-
return am5.color(this.chartColorSet[index % this.chartColorSet.length]); // Sıralı renk seçimi
|
|
263
|
-
}
|
|
264
|
-
return fill;
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
ngOnDestroy() {
|
|
269
|
-
// Clean up chart when the component is removed
|
|
270
|
-
this.browserOnly(() => {
|
|
271
|
-
if (this.root) {
|
|
272
|
-
this.root.dispose();
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: ColumnChartComponent, deps: [{ token: PLATFORM_ID }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
277
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: ColumnChartComponent, isStandalone: true, selector: "aril-column-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, chartId: { classPropertyName: "chartId", publicName: "chartId", isSignal: true, isRequired: true, transformFunction: null }, appName: { classPropertyName: "appName", publicName: "appName", isSignal: true, isRequired: false, transformFunction: null }, chartHeight: { classPropertyName: "chartHeight", publicName: "chartHeight", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<div style="width: 100%; height:{{ chartHeight() }}px;" id="{{ chartId() }}"></div>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
278
|
-
}
|
|
279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: ColumnChartComponent, decorators: [{
|
|
280
|
-
type: Component,
|
|
281
|
-
args: [{
|
|
282
|
-
standalone: true,
|
|
283
|
-
selector: 'aril-column-chart',
|
|
284
|
-
// templateUrl: './column-chart.component.html',
|
|
285
|
-
template: `<div style="width: 100%; height:{{ chartHeight() }}px;" id="{{ chartId() }}"></div>`,
|
|
286
|
-
imports: [NgClass],
|
|
287
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
288
|
-
}]
|
|
289
|
-
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
290
|
-
type: Inject,
|
|
291
|
-
args: [PLATFORM_ID]
|
|
292
|
-
}] }, { type: i0.NgZone }] });
|
|
293
|
-
|
|
294
|
-
// EXAMPLE CHART DATA
|
|
295
|
-
// https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/
|
|
296
|
-
// testChartData = [
|
|
297
|
-
// {
|
|
298
|
-
// date: 1732628383422,
|
|
299
|
-
// value: 100000
|
|
300
|
-
// },
|
|
301
|
-
// {
|
|
302
|
-
// date: 1732638383422,
|
|
303
|
-
// value: 160000
|
|
304
|
-
// },
|
|
305
|
-
// {
|
|
306
|
-
// date: 1732658383422,
|
|
307
|
-
// value: 80000
|
|
308
|
-
// }
|
|
309
|
-
// ];
|
|
310
|
-
let LineChartComponent$1 = class LineChartComponent {
|
|
311
|
-
constructor(platformId, zone) {
|
|
312
|
-
this.platformId = platformId;
|
|
313
|
-
this.zone = zone;
|
|
314
|
-
this.data = input.required();
|
|
315
|
-
this.chartId = input.required(); // must be given unique names for all charts. Its because angular and am5 rendering methods needs unique id to draw different canvas
|
|
316
|
-
this.appName = input('yeap');
|
|
317
|
-
this.timeUnit = input('day');
|
|
318
|
-
this.chartHeight = input.required();
|
|
319
|
-
this.chartColorSet = [];
|
|
320
|
-
}
|
|
321
|
-
browserOnly(f) {
|
|
322
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
323
|
-
this.zone.runOutsideAngular(() => {
|
|
324
|
-
f();
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
ngAfterViewInit() {
|
|
329
|
-
// Chart code goes in here
|
|
330
|
-
this.browserOnly(() => {
|
|
331
|
-
switch (this.appName()) {
|
|
332
|
-
case 'yeap':
|
|
333
|
-
this.chartColorSet = ChartThemes.getYeapAppColors();
|
|
334
|
-
break;
|
|
335
|
-
case 'thor':
|
|
336
|
-
this.chartColorSet = ChartThemes.getThorAppColors();
|
|
337
|
-
break;
|
|
338
|
-
case 'lena':
|
|
339
|
-
this.chartColorSet = ChartThemes.getLenaAppColors();
|
|
340
|
-
break;
|
|
341
|
-
case 'billing':
|
|
342
|
-
this.chartColorSet = ChartThemes.getThorAppColors();
|
|
343
|
-
break;
|
|
344
|
-
default:
|
|
345
|
-
this.chartColorSet = ChartThemes.getYeapAppColors();
|
|
346
|
-
break;
|
|
347
|
-
}
|
|
348
|
-
const root = am5.Root.new(this.chartId());
|
|
349
|
-
root._logo?.dispose();
|
|
350
|
-
root.setThemes([am5themes_Animated.new(root)]);
|
|
351
|
-
const chart = root.container.children.push(am5xy.XYChart.new(root, {
|
|
352
|
-
panX: false,
|
|
353
|
-
panY: false,
|
|
354
|
-
wheelX: 'panX',
|
|
355
|
-
wheelY: 'zoomX',
|
|
356
|
-
paddingLeft: 0
|
|
357
|
-
}));
|
|
358
|
-
const cursor = chart.set('cursor', am5xy.XYCursor.new(root, {
|
|
359
|
-
behavior: 'zoomX'
|
|
360
|
-
}));
|
|
361
|
-
cursor.lineY.set('visible', false);
|
|
362
|
-
const xAxis = chart.xAxes.push(am5xy.DateAxis.new(root, {
|
|
363
|
-
maxDeviation: 0,
|
|
364
|
-
baseInterval: {
|
|
365
|
-
timeUnit: this.timeUnit(),
|
|
366
|
-
count: 1
|
|
367
|
-
},
|
|
368
|
-
markUnitChange: false,
|
|
369
|
-
gridIntervals: [
|
|
370
|
-
{ timeUnit: 'day', count: 1 },
|
|
371
|
-
{ timeUnit: 'month', count: 1 },
|
|
372
|
-
{ timeUnit: 'year', count: 1 }
|
|
373
|
-
],
|
|
374
|
-
tooltipDateFormat: 'dd-MM-yyyy',
|
|
375
|
-
renderer: am5xy.AxisRendererX.new(root, {
|
|
376
|
-
minorGridEnabled: true,
|
|
377
|
-
minGridDistance: 200,
|
|
378
|
-
minorLabelsEnabled: true
|
|
379
|
-
}),
|
|
380
|
-
tooltip: am5.Tooltip.new(root, {})
|
|
381
|
-
}));
|
|
382
|
-
xAxis.set('minorDateFormats', {
|
|
383
|
-
day: 'dd',
|
|
384
|
-
month: 'MM',
|
|
385
|
-
year: 'yyyy'
|
|
386
|
-
});
|
|
387
|
-
xAxis.get('dateFormats')['day'] = 'dd/MM/yyyy';
|
|
388
|
-
const yAxis = chart.yAxes.push(am5xy.ValueAxis.new(root, {
|
|
389
|
-
renderer: am5xy.AxisRendererY.new(root, {})
|
|
390
|
-
}));
|
|
391
|
-
const series = chart.series.push(am5xy.LineSeries.new(root, {
|
|
392
|
-
name: 'Series',
|
|
393
|
-
xAxis: xAxis,
|
|
394
|
-
yAxis: yAxis,
|
|
395
|
-
valueYField: 'value',
|
|
396
|
-
valueXField: 'date',
|
|
397
|
-
stroke: am5.color(this.chartColorSet[0]),
|
|
398
|
-
tooltip: am5.Tooltip.new(root, {
|
|
399
|
-
labelText: '{valueY}'
|
|
400
|
-
})
|
|
401
|
-
}));
|
|
402
|
-
series.bullets.push(function () {
|
|
403
|
-
const bulletCircle = am5.Circle.new(root, {
|
|
404
|
-
radius: 5,
|
|
405
|
-
fill: series.get('fill')
|
|
406
|
-
});
|
|
407
|
-
return am5.Bullet.new(root, {
|
|
408
|
-
sprite: bulletCircle
|
|
409
|
-
});
|
|
410
|
-
});
|
|
411
|
-
chart.set('scrollbarX', am5.Scrollbar.new(root, {
|
|
412
|
-
orientation: 'horizontal'
|
|
413
|
-
}));
|
|
414
|
-
series.set('fill', am5.color(this.chartColorSet[0])); // set Series color to red
|
|
415
|
-
// series.fills.template.setAll({
|
|
416
|
-
// fillOpacity: 0.5,
|
|
417
|
-
// visible: true
|
|
418
|
-
// color
|
|
419
|
-
// });
|
|
420
|
-
series.data.setAll(this.data());
|
|
421
|
-
series.appear(1000);
|
|
422
|
-
chart.appear(1000, 100);
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
ngOnDestroy() {
|
|
426
|
-
// Clean up chart when the component is removed
|
|
427
|
-
this.browserOnly(() => {
|
|
428
|
-
if (this.root) {
|
|
429
|
-
this.root.dispose();
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: LineChartComponent, deps: [{ token: PLATFORM_ID }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
434
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: LineChartComponent, isStandalone: true, selector: "aril-line-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, chartId: { classPropertyName: "chartId", publicName: "chartId", isSignal: true, isRequired: true, transformFunction: null }, appName: { classPropertyName: "appName", publicName: "appName", isSignal: true, isRequired: false, transformFunction: null }, timeUnit: { classPropertyName: "timeUnit", publicName: "timeUnit", isSignal: true, isRequired: false, transformFunction: null }, chartHeight: { classPropertyName: "chartHeight", publicName: "chartHeight", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<div style="width: 100%; height:{{ chartHeight() }}px;" id="{{ chartId() }}"></div>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
435
|
-
};
|
|
436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: LineChartComponent$1, decorators: [{
|
|
437
|
-
type: Component,
|
|
438
|
-
args: [{
|
|
439
|
-
standalone: true,
|
|
440
|
-
selector: 'aril-line-chart',
|
|
441
|
-
template: `<div style="width: 100%; height:{{ chartHeight() }}px;" id="{{ chartId() }}"></div>`,
|
|
442
|
-
imports: [NgClass],
|
|
443
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
444
|
-
}]
|
|
445
|
-
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
446
|
-
type: Inject,
|
|
447
|
-
args: [PLATFORM_ID]
|
|
448
|
-
}] }, { type: i0.NgZone }] });
|
|
449
|
-
|
|
450
|
-
// Example Data
|
|
451
|
-
// data = [
|
|
452
|
-
// { name: 'Kategori A', y: 200 },
|
|
453
|
-
// { name: 'Kategori B', y: 100 },
|
|
454
|
-
// { name: 'Kategori C', y: 500 },
|
|
455
|
-
// { name: 'Kategori D', y: 250 },
|
|
456
|
-
// { name: 'Kategori E', y: 400 },
|
|
457
|
-
// ]
|
|
458
|
-
class PieHighChartComponent {
|
|
459
|
-
constructor() {
|
|
460
|
-
this.data = input.required();
|
|
461
|
-
this.title = input('');
|
|
462
|
-
this.size = input('70%');
|
|
463
|
-
this.width = input('460');
|
|
464
|
-
this.height = input('380');
|
|
465
|
-
this.showLegend = input(false);
|
|
466
|
-
this.dataLabelsFormat = input('<span style="font-size: 1.2em"><b>{point.name}:</b> <span style="opacity: 0.6">' +
|
|
467
|
-
'{point.percentage:.1f}%</span><br>');
|
|
468
|
-
this.selected = new EventEmitter();
|
|
469
|
-
this.Highcharts = Highcharts;
|
|
470
|
-
this.chartOptions = {};
|
|
471
|
-
effect(() => {
|
|
472
|
-
if (this.data()) {
|
|
473
|
-
this.setChartOptions();
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
setChartOptions() {
|
|
478
|
-
this.chartOptions = {
|
|
479
|
-
chart: {
|
|
480
|
-
type: 'pie',
|
|
481
|
-
plotShadow: false,
|
|
482
|
-
width: this.width(),
|
|
483
|
-
height: this.height()
|
|
484
|
-
},
|
|
485
|
-
title: {
|
|
486
|
-
text: this.title()
|
|
487
|
-
},
|
|
488
|
-
tooltip: {
|
|
489
|
-
pointFormat: '<b>{point.percentage:.1f}%</b>'
|
|
490
|
-
},
|
|
491
|
-
accessibility: {
|
|
492
|
-
point: {
|
|
493
|
-
valueSuffix: '%'
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
plotOptions: {
|
|
497
|
-
pie: {
|
|
498
|
-
size: this.size(),
|
|
499
|
-
allowPointSelect: true,
|
|
500
|
-
cursor: 'pointer',
|
|
501
|
-
showInLegend: this.showLegend(),
|
|
502
|
-
dataLabels: {
|
|
503
|
-
formatter: function () {
|
|
504
|
-
const percentage = this.point.percentage.toFixed(1);
|
|
505
|
-
const value = this.point.y.toLocaleString('tr-TR', {
|
|
506
|
-
minimumFractionDigits: 2,
|
|
507
|
-
maximumFractionDigits: 2
|
|
508
|
-
});
|
|
509
|
-
return `
|
|
510
|
-
<span style="font-size: 1.2em"><b>${this.point.name}:</b></span>
|
|
511
|
-
<span style="opacity: 0.6">${percentage}%</span>
|
|
512
|
-
<br>
|
|
513
|
-
<span style="font-weight: bold;">${value} TL</span>`;
|
|
514
|
-
},
|
|
515
|
-
enabled: true,
|
|
516
|
-
style: {
|
|
517
|
-
fontWeight: 'normal'
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
|
-
events: {
|
|
521
|
-
click: (event) => {
|
|
522
|
-
this.selected.emit(event.point.options);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
},
|
|
527
|
-
series: [
|
|
528
|
-
{
|
|
529
|
-
type: 'pie',
|
|
530
|
-
name: 'Data',
|
|
531
|
-
data: this.data()
|
|
532
|
-
}
|
|
533
|
-
],
|
|
534
|
-
credits: {
|
|
535
|
-
enabled: false
|
|
536
|
-
},
|
|
537
|
-
responsive: {
|
|
538
|
-
rules: [
|
|
539
|
-
{
|
|
540
|
-
condition: {
|
|
541
|
-
maxWidth: 500
|
|
542
|
-
},
|
|
543
|
-
chartOptions: {
|
|
544
|
-
legend: {
|
|
545
|
-
layout: 'vertical',
|
|
546
|
-
align: 'right',
|
|
547
|
-
verticalAlign: 'middle'
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
]
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: PieHighChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
556
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: PieHighChartComponent, isStandalone: true, selector: "aril-pie-highchart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, dataLabelsFormat: { classPropertyName: "dataLabelsFormat", publicName: "dataLabelsFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, ngImport: i0, template: ` <highcharts-chart
|
|
557
|
-
style="width: 100%; display: block"
|
|
558
|
-
[Highcharts]="Highcharts"
|
|
559
|
-
[oneToOne]="true"
|
|
560
|
-
[runOutsideAngular]="true"
|
|
561
|
-
[options]="chartOptions">
|
|
562
|
-
</highcharts-chart>`, isInline: true, dependencies: [{ kind: "ngmodule", type: HighchartsChartModule }, { kind: "component", type: i1.HighchartsChartComponent, selector: "highcharts-chart", inputs: ["Highcharts", "constructorType", "callbackFunction", "oneToOne", "runOutsideAngular", "options", "update"], outputs: ["updateChange", "chartInstance"] }] }); }
|
|
563
|
-
}
|
|
564
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: PieHighChartComponent, decorators: [{
|
|
565
|
-
type: Component,
|
|
566
|
-
args: [{
|
|
567
|
-
standalone: true,
|
|
568
|
-
selector: 'aril-pie-highchart',
|
|
569
|
-
template: ` <highcharts-chart
|
|
570
|
-
style="width: 100%; display: block"
|
|
571
|
-
[Highcharts]="Highcharts"
|
|
572
|
-
[oneToOne]="true"
|
|
573
|
-
[runOutsideAngular]="true"
|
|
574
|
-
[options]="chartOptions">
|
|
575
|
-
</highcharts-chart>`,
|
|
576
|
-
imports: [HighchartsChartModule]
|
|
577
|
-
}]
|
|
578
|
-
}], ctorParameters: () => [], propDecorators: { selected: [{
|
|
579
|
-
type: Output
|
|
580
|
-
}] } });
|
|
581
|
-
|
|
582
|
-
// Example Data
|
|
583
|
-
// data = [
|
|
584
|
-
// { name: 'Kategori A', y: 200 },
|
|
585
|
-
// { name: 'Kategori B', y: 100 },
|
|
586
|
-
// { name: 'Kategori C', y: 500 },
|
|
587
|
-
// { name: 'Kategori D', y: 250 },
|
|
588
|
-
// { name: 'Kategori E', y: 400 },
|
|
589
|
-
// ]
|
|
590
|
-
class BarHighChartComponent {
|
|
591
|
-
constructor() {
|
|
592
|
-
this.data = input.required();
|
|
593
|
-
this.title = input('');
|
|
594
|
-
this.categoriesTitle = input('');
|
|
595
|
-
this.valuesTitle = input('');
|
|
596
|
-
this.seriesName = input();
|
|
597
|
-
this.width = input('460');
|
|
598
|
-
this.height = input('380');
|
|
599
|
-
this.Highcharts = Highcharts;
|
|
600
|
-
this.chartOptions = {}; // Highcharts.Options
|
|
601
|
-
}
|
|
602
|
-
setChartOptions() {
|
|
603
|
-
this.chartOptions = {
|
|
604
|
-
chart: {
|
|
605
|
-
type: 'bar',
|
|
606
|
-
height: this.height(),
|
|
607
|
-
width: this.width()
|
|
608
|
-
},
|
|
609
|
-
title: {
|
|
610
|
-
text: this.title()
|
|
611
|
-
},
|
|
612
|
-
xAxis: {
|
|
613
|
-
categories: this.data().map((item) => item.name),
|
|
614
|
-
title: {
|
|
615
|
-
text: this.categoriesTitle()
|
|
616
|
-
}
|
|
617
|
-
},
|
|
618
|
-
yAxis: {
|
|
619
|
-
min: 0,
|
|
620
|
-
title: {
|
|
621
|
-
text: this.valuesTitle()
|
|
622
|
-
}
|
|
623
|
-
},
|
|
624
|
-
tooltip: {
|
|
625
|
-
formatter: function () {
|
|
626
|
-
return `
|
|
627
|
-
<strong>${this.point.category}</strong><br>
|
|
628
|
-
Değer: <b>${this.point.y.toLocaleString('tr-TR', {
|
|
629
|
-
minimumFractionDigits: 2,
|
|
630
|
-
maximumFractionDigits: 2
|
|
631
|
-
})}</b>
|
|
632
|
-
`;
|
|
633
|
-
},
|
|
634
|
-
useHTML: true
|
|
635
|
-
},
|
|
636
|
-
series: [
|
|
637
|
-
{
|
|
638
|
-
name: this.seriesName(),
|
|
639
|
-
data: this.data().map((item) => item.y)
|
|
640
|
-
}
|
|
641
|
-
],
|
|
642
|
-
legend: { enabled: this.seriesName() ? true : false },
|
|
643
|
-
credits: {
|
|
644
|
-
enabled: false
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
}
|
|
648
|
-
ngOnChanges(changes) {
|
|
649
|
-
if (changes['data'] || changes['title']) {
|
|
650
|
-
this.setChartOptions();
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: BarHighChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
654
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: BarHighChartComponent, isStandalone: true, selector: "aril-bar-highchart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, categoriesTitle: { classPropertyName: "categoriesTitle", publicName: "categoriesTitle", isSignal: true, isRequired: false, transformFunction: null }, valuesTitle: { classPropertyName: "valuesTitle", publicName: "valuesTitle", isSignal: true, isRequired: false, transformFunction: null }, seriesName: { classPropertyName: "seriesName", publicName: "seriesName", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0, template: ` <highcharts-chart
|
|
655
|
-
style="width: 100%; display: block"
|
|
656
|
-
[Highcharts]="Highcharts"
|
|
657
|
-
[options]="chartOptions"
|
|
658
|
-
[oneToOne]="true">
|
|
659
|
-
</highcharts-chart>`, isInline: true, dependencies: [{ kind: "ngmodule", type: HighchartsChartModule }, { kind: "component", type: i1.HighchartsChartComponent, selector: "highcharts-chart", inputs: ["Highcharts", "constructorType", "callbackFunction", "oneToOne", "runOutsideAngular", "options", "update"], outputs: ["updateChange", "chartInstance"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
660
|
-
}
|
|
661
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: BarHighChartComponent, decorators: [{
|
|
662
|
-
type: Component,
|
|
663
|
-
args: [{
|
|
664
|
-
standalone: true,
|
|
665
|
-
selector: 'aril-bar-highchart',
|
|
666
|
-
template: ` <highcharts-chart
|
|
667
|
-
style="width: 100%; display: block"
|
|
668
|
-
[Highcharts]="Highcharts"
|
|
669
|
-
[options]="chartOptions"
|
|
670
|
-
[oneToOne]="true">
|
|
671
|
-
</highcharts-chart>`,
|
|
672
|
-
imports: [HighchartsChartModule],
|
|
673
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
674
|
-
}]
|
|
675
|
-
}] });
|
|
676
|
-
|
|
677
|
-
// Example Data
|
|
678
|
-
// data = [
|
|
679
|
-
// { name: 'Kategori A', y: 200 },
|
|
680
|
-
// { name: 'Kategori B', y: 100 },
|
|
681
|
-
// { name: 'Kategori C', y: 500 },
|
|
682
|
-
// { name: 'Kategori D', y: 250 },
|
|
683
|
-
// { name: 'Kategori E', y: 400 },
|
|
684
|
-
// ]
|
|
685
|
-
class ColumnHighChartComponent {
|
|
686
|
-
constructor() {
|
|
687
|
-
this.data = input.required();
|
|
688
|
-
this.title = input('');
|
|
689
|
-
this.categoriesTitle = input('');
|
|
690
|
-
this.valuesTitle = input('');
|
|
691
|
-
this.seriesName = input();
|
|
692
|
-
this.dateFormat = input();
|
|
693
|
-
this.width = input('460');
|
|
694
|
-
this.height = input('380');
|
|
695
|
-
this.series = input([]);
|
|
696
|
-
this.Highcharts = Highcharts;
|
|
697
|
-
this.chartOptions = {}; // Highcharts.Options
|
|
698
|
-
effect(() => {
|
|
699
|
-
if (this.data()) {
|
|
700
|
-
this.setChartOptions();
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
formatDate(name) {
|
|
705
|
-
const date = new Date(`${name.toString().slice(0, 4)}-${name.toString().slice(4, 6)}-${name.toString().slice(6, 8)}T` +
|
|
706
|
-
`${name.toString().slice(8, 10)}:${name.toString().slice(10, 12)}:${name.toString().slice(12, 14)}Z`);
|
|
707
|
-
switch (this.dateFormat()) {
|
|
708
|
-
case 'date':
|
|
709
|
-
return new Intl.DateTimeFormat('tr-TR', { day: '2-digit', month: 'long', year: 'numeric' }).format(date);
|
|
710
|
-
case 'month':
|
|
711
|
-
return new Intl.DateTimeFormat('tr-TR', { month: 'long', year: 'numeric' }).format(date).replace(' ', '/');
|
|
712
|
-
case 'year':
|
|
713
|
-
return new Intl.DateTimeFormat('tr-TR', { year: 'numeric' }).format(date);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
setChartOptions() {
|
|
717
|
-
this.chartOptions = {
|
|
718
|
-
chart: {
|
|
719
|
-
type: 'column',
|
|
720
|
-
width: this.width(),
|
|
721
|
-
height: this.height()
|
|
722
|
-
},
|
|
723
|
-
title: {
|
|
724
|
-
text: this.title()
|
|
725
|
-
},
|
|
726
|
-
xAxis: {
|
|
727
|
-
categories: this.dateFormat() ?
|
|
728
|
-
this.data().map((item) => this.formatDate(item.name))
|
|
729
|
-
: this.data().map((item) => item.name),
|
|
730
|
-
title: {
|
|
731
|
-
text: this.categoriesTitle()
|
|
732
|
-
}
|
|
733
|
-
},
|
|
734
|
-
yAxis: {
|
|
735
|
-
min: 0,
|
|
736
|
-
title: {
|
|
737
|
-
text: this.valuesTitle()
|
|
738
|
-
}
|
|
739
|
-
},
|
|
740
|
-
tooltip: {
|
|
741
|
-
formatter: function () {
|
|
742
|
-
return `
|
|
743
|
-
<strong>${this.point.category}</strong><br>
|
|
744
|
-
Değer: <b>${this.point.y.toLocaleString('tr-TR', {
|
|
745
|
-
minimumFractionDigits: 2,
|
|
746
|
-
maximumFractionDigits: 2
|
|
747
|
-
})}</b>
|
|
748
|
-
`;
|
|
749
|
-
},
|
|
750
|
-
useHTML: true
|
|
751
|
-
},
|
|
752
|
-
series: this.series().length ?
|
|
753
|
-
this.series()
|
|
754
|
-
: [
|
|
755
|
-
{
|
|
756
|
-
name: this.seriesName(),
|
|
757
|
-
data: this.data().map((item) => item.y)
|
|
758
|
-
}
|
|
759
|
-
],
|
|
760
|
-
legend: { enabled: this.seriesName() ? true : false },
|
|
761
|
-
credits: {
|
|
762
|
-
enabled: false
|
|
763
|
-
}
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: ColumnHighChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
767
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: ColumnHighChartComponent, isStandalone: true, selector: "aril-column-highchart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, categoriesTitle: { classPropertyName: "categoriesTitle", publicName: "categoriesTitle", isSignal: true, isRequired: false, transformFunction: null }, valuesTitle: { classPropertyName: "valuesTitle", publicName: "valuesTitle", isSignal: true, isRequired: false, transformFunction: null }, seriesName: { classPropertyName: "seriesName", publicName: "seriesName", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: ` <highcharts-chart
|
|
768
|
-
style="width: 100%; display: block"
|
|
769
|
-
[Highcharts]="Highcharts"
|
|
770
|
-
[oneToOne]="true"
|
|
771
|
-
[options]="chartOptions">
|
|
772
|
-
</highcharts-chart>`, isInline: true, dependencies: [{ kind: "ngmodule", type: HighchartsChartModule }, { kind: "component", type: i1.HighchartsChartComponent, selector: "highcharts-chart", inputs: ["Highcharts", "constructorType", "callbackFunction", "oneToOne", "runOutsideAngular", "options", "update"], outputs: ["updateChange", "chartInstance"] }] }); }
|
|
773
|
-
}
|
|
774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: ColumnHighChartComponent, decorators: [{
|
|
775
|
-
type: Component,
|
|
776
|
-
args: [{
|
|
777
|
-
standalone: true,
|
|
778
|
-
selector: 'aril-column-highchart',
|
|
779
|
-
template: ` <highcharts-chart
|
|
780
|
-
style="width: 100%; display: block"
|
|
781
|
-
[Highcharts]="Highcharts"
|
|
782
|
-
[oneToOne]="true"
|
|
783
|
-
[options]="chartOptions">
|
|
784
|
-
</highcharts-chart>`,
|
|
785
|
-
imports: [HighchartsChartModule]
|
|
786
|
-
}]
|
|
787
|
-
}], ctorParameters: () => [] });
|
|
788
|
-
|
|
789
|
-
highchartsMore(Highcharts);
|
|
790
|
-
NoDataToDisplay(Highcharts);
|
|
791
|
-
class AreaChartComponent {
|
|
792
|
-
constructor() {
|
|
793
|
-
this.Highcharts = Highcharts;
|
|
794
|
-
this.data = input.required();
|
|
795
|
-
this.title = input.required();
|
|
796
|
-
this.loading = input(false);
|
|
797
|
-
this.chartCallback = (chart) => {
|
|
798
|
-
this.chart = chart;
|
|
799
|
-
if (this.loading()) {
|
|
800
|
-
this.chart.showLoading();
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
this.chartOptions = computed(() => {
|
|
804
|
-
const currentData = this.data();
|
|
805
|
-
if (!currentData || currentData.length === 0) {
|
|
806
|
-
return {
|
|
807
|
-
chart: {
|
|
808
|
-
type: 'area',
|
|
809
|
-
height: 200
|
|
810
|
-
},
|
|
811
|
-
title: { text: undefined },
|
|
812
|
-
xAxis: { type: 'datetime', visible: true },
|
|
813
|
-
yAxis: { visible: true },
|
|
814
|
-
series: [{
|
|
815
|
-
name: 'Çalışma Süresi',
|
|
816
|
-
data: [],
|
|
817
|
-
type: 'area'
|
|
818
|
-
}],
|
|
819
|
-
credits: { enabled: false },
|
|
820
|
-
tooltip: { enabled: true },
|
|
821
|
-
plotOptions: {
|
|
822
|
-
area: {
|
|
823
|
-
fillColor: '#D6EAF8',
|
|
824
|
-
marker: { enabled: false },
|
|
825
|
-
lineWidth: 2
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
return {
|
|
831
|
-
chart: {
|
|
832
|
-
type: 'area',
|
|
833
|
-
height: 200
|
|
834
|
-
},
|
|
835
|
-
title: { text: this.title() },
|
|
836
|
-
xAxis: { type: 'datetime', visible: true },
|
|
837
|
-
yAxis: { visible: true },
|
|
838
|
-
series: currentData.map(s => ({
|
|
839
|
-
...s,
|
|
840
|
-
type: 'area'
|
|
841
|
-
})),
|
|
842
|
-
credits: { enabled: false },
|
|
843
|
-
tooltip: { enabled: true },
|
|
844
|
-
plotOptions: {
|
|
845
|
-
area: {
|
|
846
|
-
fillColor: '#D6EAF8',
|
|
847
|
-
marker: { enabled: false },
|
|
848
|
-
lineWidth: 2
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
};
|
|
852
|
-
});
|
|
853
|
-
effect(() => {
|
|
854
|
-
const isLoading = this.loading();
|
|
855
|
-
if (this.chart) {
|
|
856
|
-
if (isLoading) {
|
|
857
|
-
this.chart.showLoading();
|
|
858
|
-
}
|
|
859
|
-
else {
|
|
860
|
-
this.chart.hideLoading();
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
});
|
|
864
|
-
}
|
|
865
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
866
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: AreaChartComponent, isStandalone: true, selector: "aril-area-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
867
|
-
<highcharts-chart
|
|
868
|
-
style="display: block"
|
|
869
|
-
[Highcharts]="Highcharts"
|
|
870
|
-
[oneToOne]="true"
|
|
871
|
-
[runOutsideAngular]="true"
|
|
872
|
-
[options]="chartOptions()"
|
|
873
|
-
[callbackFunction]="chartCallback">
|
|
874
|
-
</highcharts-chart>
|
|
875
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: HighchartsChartModule }, { kind: "component", type: i1.HighchartsChartComponent, selector: "highcharts-chart", inputs: ["Highcharts", "constructorType", "callbackFunction", "oneToOne", "runOutsideAngular", "options", "update"], outputs: ["updateChange", "chartInstance"] }] }); }
|
|
876
|
-
}
|
|
877
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AreaChartComponent, decorators: [{
|
|
878
|
-
type: Component,
|
|
879
|
-
args: [{
|
|
880
|
-
selector: 'aril-area-chart',
|
|
881
|
-
standalone: true,
|
|
882
|
-
imports: [HighchartsChartModule],
|
|
883
|
-
template: `
|
|
884
|
-
<highcharts-chart
|
|
885
|
-
style="display: block"
|
|
886
|
-
[Highcharts]="Highcharts"
|
|
887
|
-
[oneToOne]="true"
|
|
888
|
-
[runOutsideAngular]="true"
|
|
889
|
-
[options]="chartOptions()"
|
|
890
|
-
[callbackFunction]="chartCallback">
|
|
891
|
-
</highcharts-chart>
|
|
892
|
-
`
|
|
893
|
-
}]
|
|
894
|
-
}], ctorParameters: () => [] });
|
|
895
9
|
|
|
896
10
|
NoDataToDisplay(Highcharts);
|
|
897
11
|
var MetricUnit;
|
|
@@ -1074,174 +188,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1074
188
|
}]
|
|
1075
189
|
}], ctorParameters: () => [] });
|
|
1076
190
|
|
|
1077
|
-
class LineSeriesChartComponent {
|
|
1078
|
-
constructor() {
|
|
1079
|
-
this.seriesData = input([]);
|
|
1080
|
-
this.title = input('Time Series Chart');
|
|
1081
|
-
this.yAxisTitle = input('Value');
|
|
1082
|
-
this.xAxisTitle = input('Time');
|
|
1083
|
-
}
|
|
1084
|
-
ngOnInit() {
|
|
1085
|
-
this.initChart();
|
|
1086
|
-
}
|
|
1087
|
-
initChart() {
|
|
1088
|
-
const options = {
|
|
1089
|
-
chart: {
|
|
1090
|
-
type: 'line',
|
|
1091
|
-
zoomType: 'x'
|
|
1092
|
-
},
|
|
1093
|
-
title: {
|
|
1094
|
-
text: this.title()
|
|
1095
|
-
},
|
|
1096
|
-
xAxis: {
|
|
1097
|
-
type: 'datetime',
|
|
1098
|
-
title: {
|
|
1099
|
-
text: this.xAxisTitle()
|
|
1100
|
-
}
|
|
1101
|
-
},
|
|
1102
|
-
yAxis: {
|
|
1103
|
-
title: {
|
|
1104
|
-
text: this.yAxisTitle()
|
|
1105
|
-
}
|
|
1106
|
-
},
|
|
1107
|
-
series: this.seriesData().map(series => ({
|
|
1108
|
-
type: 'line',
|
|
1109
|
-
name: series.name,
|
|
1110
|
-
data: series.data,
|
|
1111
|
-
color: series.color
|
|
1112
|
-
})),
|
|
1113
|
-
tooltip: {
|
|
1114
|
-
xDateFormat: '%Y-%m-%d %H:%M:%S',
|
|
1115
|
-
shared: true
|
|
1116
|
-
},
|
|
1117
|
-
legend: {
|
|
1118
|
-
enabled: true
|
|
1119
|
-
},
|
|
1120
|
-
plotOptions: {
|
|
1121
|
-
series: {
|
|
1122
|
-
marker: {
|
|
1123
|
-
enabled: false
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
},
|
|
1127
|
-
noData: {
|
|
1128
|
-
style: {
|
|
1129
|
-
fontWeight: 'bold',
|
|
1130
|
-
fontSize: '16px',
|
|
1131
|
-
color: '#303030'
|
|
1132
|
-
},
|
|
1133
|
-
position: {
|
|
1134
|
-
align: 'center',
|
|
1135
|
-
verticalAlign: 'middle'
|
|
1136
|
-
},
|
|
1137
|
-
useHTML: true
|
|
1138
|
-
},
|
|
1139
|
-
};
|
|
1140
|
-
this.chart = Highcharts.chart(this.chartContainer.nativeElement, options);
|
|
1141
|
-
}
|
|
1142
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: LineSeriesChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1143
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: LineSeriesChartComponent, isStandalone: true, selector: "aril-lineseries-chart", inputs: { seriesData: { classPropertyName: "seriesData", publicName: "seriesData", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, yAxisTitle: { classPropertyName: "yAxisTitle", publicName: "yAxisTitle", isSignal: true, isRequired: false, transformFunction: null }, xAxisTitle: { classPropertyName: "xAxisTitle", publicName: "xAxisTitle", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "chartContainer", first: true, predicate: ["chartContainer"], descendants: true, static: true }], ngImport: i0, template: `
|
|
1144
|
-
<div #chartContainer style="width: 100%; height: 100%;"></div>
|
|
1145
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: HighchartsChartModule }] }); }
|
|
1146
|
-
}
|
|
1147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: LineSeriesChartComponent, decorators: [{
|
|
1148
|
-
type: Component,
|
|
1149
|
-
args: [{
|
|
1150
|
-
standalone: true,
|
|
1151
|
-
selector: 'aril-lineseries-chart',
|
|
1152
|
-
template: `
|
|
1153
|
-
<div #chartContainer style="width: 100%; height: 100%;"></div>
|
|
1154
|
-
`,
|
|
1155
|
-
imports: [HighchartsChartModule]
|
|
1156
|
-
}]
|
|
1157
|
-
}], propDecorators: { chartContainer: [{
|
|
1158
|
-
type: ViewChild,
|
|
1159
|
-
args: ['chartContainer', { static: true }]
|
|
1160
|
-
}] } });
|
|
1161
|
-
|
|
1162
|
-
class LineChartComponent {
|
|
1163
|
-
constructor() {
|
|
1164
|
-
this.seriesData = input([]);
|
|
1165
|
-
this.title = input('Line Chart');
|
|
1166
|
-
this.yAxisTitle = input('Value');
|
|
1167
|
-
this.xAxisTitle = input('Category');
|
|
1168
|
-
}
|
|
1169
|
-
ngOnInit() {
|
|
1170
|
-
this.initChart();
|
|
1171
|
-
}
|
|
1172
|
-
initChart() {
|
|
1173
|
-
const options = {
|
|
1174
|
-
chart: {
|
|
1175
|
-
type: 'line'
|
|
1176
|
-
},
|
|
1177
|
-
title: {
|
|
1178
|
-
text: this.title()
|
|
1179
|
-
},
|
|
1180
|
-
xAxis: {
|
|
1181
|
-
title: {
|
|
1182
|
-
text: this.xAxisTitle()
|
|
1183
|
-
}
|
|
1184
|
-
},
|
|
1185
|
-
yAxis: {
|
|
1186
|
-
title: {
|
|
1187
|
-
text: this.yAxisTitle()
|
|
1188
|
-
}
|
|
1189
|
-
},
|
|
1190
|
-
series: this.seriesData().map((series) => ({
|
|
1191
|
-
type: 'line',
|
|
1192
|
-
name: series.name,
|
|
1193
|
-
data: series.data,
|
|
1194
|
-
color: series.color
|
|
1195
|
-
})),
|
|
1196
|
-
tooltip: {
|
|
1197
|
-
shared: true
|
|
1198
|
-
},
|
|
1199
|
-
legend: {
|
|
1200
|
-
enabled: true
|
|
1201
|
-
},
|
|
1202
|
-
plotOptions: {
|
|
1203
|
-
series: {
|
|
1204
|
-
marker: {
|
|
1205
|
-
enabled: true
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
},
|
|
1209
|
-
noData: {
|
|
1210
|
-
style: {
|
|
1211
|
-
fontWeight: 'bold',
|
|
1212
|
-
fontSize: '16px',
|
|
1213
|
-
color: '#303030'
|
|
1214
|
-
},
|
|
1215
|
-
position: {
|
|
1216
|
-
align: 'center',
|
|
1217
|
-
verticalAlign: 'middle'
|
|
1218
|
-
},
|
|
1219
|
-
useHTML: true
|
|
1220
|
-
},
|
|
1221
|
-
};
|
|
1222
|
-
this.chart = Highcharts.chart(this.chartContainer.nativeElement, options);
|
|
1223
|
-
}
|
|
1224
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: LineChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1225
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: LineChartComponent, isStandalone: true, selector: "aril-line-chart", inputs: { seriesData: { classPropertyName: "seriesData", publicName: "seriesData", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, yAxisTitle: { classPropertyName: "yAxisTitle", publicName: "yAxisTitle", isSignal: true, isRequired: false, transformFunction: null }, xAxisTitle: { classPropertyName: "xAxisTitle", publicName: "xAxisTitle", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "chartContainer", first: true, predicate: ["chartContainer"], descendants: true, static: true }], ngImport: i0, template: ` <div #chartContainer style="width: 100%; height: 100%;"></div> `, isInline: true, dependencies: [{ kind: "ngmodule", type: HighchartsChartModule }] }); }
|
|
1226
|
-
}
|
|
1227
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: LineChartComponent, decorators: [{
|
|
1228
|
-
type: Component,
|
|
1229
|
-
args: [{
|
|
1230
|
-
standalone: true,
|
|
1231
|
-
selector: 'aril-line-chart',
|
|
1232
|
-
template: ` <div #chartContainer style="width: 100%; height: 100%;"></div> `,
|
|
1233
|
-
imports: [HighchartsChartModule]
|
|
1234
|
-
}]
|
|
1235
|
-
}], propDecorators: { chartContainer: [{
|
|
1236
|
-
type: ViewChild,
|
|
1237
|
-
args: ['chartContainer', { static: true }]
|
|
1238
|
-
}] } });
|
|
1239
|
-
|
|
1240
|
-
var lineChart_component = /*#__PURE__*/Object.freeze({
|
|
1241
|
-
__proto__: null,
|
|
1242
|
-
LineChartComponent: LineChartComponent
|
|
1243
|
-
});
|
|
1244
|
-
|
|
1245
191
|
highchartsMore(Highcharts);
|
|
1246
192
|
solidGauge(Highcharts);
|
|
1247
193
|
NoDataToDisplay(Highcharts);
|
|
@@ -1414,253 +360,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1414
360
|
}]
|
|
1415
361
|
}], ctorParameters: () => [] });
|
|
1416
362
|
|
|
1417
|
-
highchartsMore(Highcharts);
|
|
1418
|
-
heatmap(Highcharts);
|
|
1419
|
-
NoDataToDisplay(Highcharts);
|
|
1420
|
-
class HeatmapChartComponent {
|
|
1421
|
-
constructor() {
|
|
1422
|
-
this.Highcharts = Highcharts;
|
|
1423
|
-
this.series = input.required();
|
|
1424
|
-
this.title = input('Chart');
|
|
1425
|
-
this.yAxisTitle = input('');
|
|
1426
|
-
this.loading = input(false);
|
|
1427
|
-
this.chartOptions = {};
|
|
1428
|
-
this.xAxisCategories = [];
|
|
1429
|
-
this.yAxisCategories = [];
|
|
1430
|
-
this.chartCallback = (chart) => {
|
|
1431
|
-
this.chart = chart;
|
|
1432
|
-
};
|
|
1433
|
-
effect(() => {
|
|
1434
|
-
if (this.series()) {
|
|
1435
|
-
this.setChartOptions();
|
|
1436
|
-
}
|
|
1437
|
-
});
|
|
1438
|
-
effect(() => {
|
|
1439
|
-
if (this.chart) {
|
|
1440
|
-
const newSeries = this.prometheusToHighchartsSeries();
|
|
1441
|
-
this.chart.update({
|
|
1442
|
-
series: newSeries,
|
|
1443
|
-
yAxis: { categories: this.yAxisCategories },
|
|
1444
|
-
xAxis: { categories: this.xAxisCategories }
|
|
1445
|
-
}, true, true);
|
|
1446
|
-
}
|
|
1447
|
-
});
|
|
1448
|
-
effect(() => {
|
|
1449
|
-
if (this.chart) {
|
|
1450
|
-
if (this.loading()) {
|
|
1451
|
-
this.chart.showLoading();
|
|
1452
|
-
}
|
|
1453
|
-
else {
|
|
1454
|
-
this.chart.hideLoading();
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
});
|
|
1458
|
-
effect(() => {
|
|
1459
|
-
if (this.chart) {
|
|
1460
|
-
this.chart.update({
|
|
1461
|
-
title: {
|
|
1462
|
-
text: this.title()
|
|
1463
|
-
},
|
|
1464
|
-
yAxis: {
|
|
1465
|
-
title: {
|
|
1466
|
-
text: this.yAxisTitle()
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
});
|
|
1470
|
-
}
|
|
1471
|
-
});
|
|
1472
|
-
}
|
|
1473
|
-
setChartOptions() {
|
|
1474
|
-
const series = this.prometheusToHighchartsSeries();
|
|
1475
|
-
let minValue = Number.POSITIVE_INFINITY;
|
|
1476
|
-
let maxValue = Number.NEGATIVE_INFINITY;
|
|
1477
|
-
if (series && series.length && series[0].type === 'heatmap' && Array.isArray(series[0].data)) {
|
|
1478
|
-
for (const d of series[0].data) {
|
|
1479
|
-
const value = d[2];
|
|
1480
|
-
if (typeof value === 'number') {
|
|
1481
|
-
if (value < minValue)
|
|
1482
|
-
minValue = value;
|
|
1483
|
-
if (value > maxValue)
|
|
1484
|
-
maxValue = value;
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
if (!isFinite(minValue))
|
|
1489
|
-
minValue = 0;
|
|
1490
|
-
if (!isFinite(maxValue))
|
|
1491
|
-
maxValue = 1;
|
|
1492
|
-
console.log("minValue", minValue);
|
|
1493
|
-
console.log("maxValue", maxValue);
|
|
1494
|
-
this.chartOptions = {
|
|
1495
|
-
chart: {
|
|
1496
|
-
type: 'heatmap',
|
|
1497
|
-
marginTop: 40,
|
|
1498
|
-
marginBottom: 80,
|
|
1499
|
-
plotBorderWidth: 0
|
|
1500
|
-
},
|
|
1501
|
-
title: {
|
|
1502
|
-
text: this.title() || 'Heatmap'
|
|
1503
|
-
},
|
|
1504
|
-
colorAxis: {
|
|
1505
|
-
stops: [
|
|
1506
|
-
[0, '#73BF69'],
|
|
1507
|
-
[0.3, '#fffbbc'],
|
|
1508
|
-
[0.5, '#fffbbc'],
|
|
1509
|
-
[0.7, '#c4463a'],
|
|
1510
|
-
[0.9, '#c4463a'],
|
|
1511
|
-
[1, '#c4463a']
|
|
1512
|
-
],
|
|
1513
|
-
min: minValue,
|
|
1514
|
-
max: maxValue,
|
|
1515
|
-
startOnTick: false,
|
|
1516
|
-
endOnTick: false
|
|
1517
|
-
},
|
|
1518
|
-
tooltip: {
|
|
1519
|
-
formatter: function () {
|
|
1520
|
-
const dateStr = Highcharts.dateFormat('%Y-%m-%d %H:%M', this.point.x);
|
|
1521
|
-
return '<b> Value </b>' + this.point.value?.toFixed(2) + '<br/><b> Time </b>' + dateStr;
|
|
1522
|
-
},
|
|
1523
|
-
enabled: true
|
|
1524
|
-
},
|
|
1525
|
-
legend: {
|
|
1526
|
-
enabled: false
|
|
1527
|
-
},
|
|
1528
|
-
plotOptions: {
|
|
1529
|
-
heatmap: {
|
|
1530
|
-
pointPadding: 5
|
|
1531
|
-
},
|
|
1532
|
-
series: {
|
|
1533
|
-
stickyTracking: false
|
|
1534
|
-
}
|
|
1535
|
-
},
|
|
1536
|
-
noData: {
|
|
1537
|
-
style: {
|
|
1538
|
-
fontWeight: 'bold',
|
|
1539
|
-
fontSize: '16px',
|
|
1540
|
-
color: '#303030'
|
|
1541
|
-
},
|
|
1542
|
-
position: {
|
|
1543
|
-
align: 'center',
|
|
1544
|
-
verticalAlign: 'middle'
|
|
1545
|
-
},
|
|
1546
|
-
useHTML: true
|
|
1547
|
-
},
|
|
1548
|
-
xAxis: {
|
|
1549
|
-
type: 'datetime',
|
|
1550
|
-
categories: this.xAxisCategories,
|
|
1551
|
-
labels: {
|
|
1552
|
-
align: 'left',
|
|
1553
|
-
x: 5,
|
|
1554
|
-
y: 14,
|
|
1555
|
-
format: '{value:%H:00}',
|
|
1556
|
-
rotation: 0,
|
|
1557
|
-
step: 2
|
|
1558
|
-
},
|
|
1559
|
-
showLastLabel: false,
|
|
1560
|
-
tickInterval: 2 * 3600 * 1000,
|
|
1561
|
-
minTickInterval: 3600 * 1000
|
|
1562
|
-
},
|
|
1563
|
-
yAxis: {
|
|
1564
|
-
categories: this.yAxisCategories,
|
|
1565
|
-
title: {
|
|
1566
|
-
text: this.yAxisTitle()
|
|
1567
|
-
}
|
|
1568
|
-
},
|
|
1569
|
-
series: series
|
|
1570
|
-
};
|
|
1571
|
-
}
|
|
1572
|
-
epochToTimeString(epoch) {
|
|
1573
|
-
const date = new Date(Number(epoch) * 1000);
|
|
1574
|
-
const hours = date.getHours().toString().padStart(2, '0');
|
|
1575
|
-
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
1576
|
-
return `${hours}:${minutes}`;
|
|
1577
|
-
}
|
|
1578
|
-
prometheusToHighchartsSeries() {
|
|
1579
|
-
const xCategorySet = new Set();
|
|
1580
|
-
const yCategorySet = new Set();
|
|
1581
|
-
const seriesData = this.series();
|
|
1582
|
-
if (!seriesData) {
|
|
1583
|
-
return [];
|
|
1584
|
-
}
|
|
1585
|
-
for (const key in seriesData) {
|
|
1586
|
-
if (key === 'response') {
|
|
1587
|
-
if (Object.prototype.hasOwnProperty.call(seriesData, key)) {
|
|
1588
|
-
const dataSet = seriesData[key];
|
|
1589
|
-
const result = dataSet?.result || dataSet?.data?.result;
|
|
1590
|
-
if (result) {
|
|
1591
|
-
for (const item of result) {
|
|
1592
|
-
yCategorySet.add(item.metric?.le);
|
|
1593
|
-
for (const itemValue of item.values) {
|
|
1594
|
-
xCategorySet.add(this.epochToTimeString(itemValue[0]));
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
this.xAxisCategories = Array.from(xCategorySet);
|
|
1602
|
-
this.yAxisCategories = Array.from(yCategorySet);
|
|
1603
|
-
const data = [];
|
|
1604
|
-
for (const key in seriesData) {
|
|
1605
|
-
if (key === 'response') {
|
|
1606
|
-
if (Object.prototype.hasOwnProperty.call(seriesData, key)) {
|
|
1607
|
-
const dataSet = seriesData[key];
|
|
1608
|
-
const result = dataSet?.result || dataSet?.data?.result;
|
|
1609
|
-
if (result) {
|
|
1610
|
-
for (const item of result) {
|
|
1611
|
-
const yValue = item.metric?.le;
|
|
1612
|
-
const yIndex = this.yAxisCategories.indexOf(yValue);
|
|
1613
|
-
for (const itemValue of item.values) {
|
|
1614
|
-
const epoch = Number(itemValue[0]);
|
|
1615
|
-
const date = new Date(epoch * 1000);
|
|
1616
|
-
const utcTime = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes());
|
|
1617
|
-
const value = Number(itemValue[1]);
|
|
1618
|
-
data.push([utcTime, yIndex, value]);
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
return [
|
|
1626
|
-
{
|
|
1627
|
-
type: 'heatmap',
|
|
1628
|
-
data: data,
|
|
1629
|
-
colsize: 8 * 60 * 1000,
|
|
1630
|
-
borderWidth: 1
|
|
1631
|
-
}
|
|
1632
|
-
];
|
|
1633
|
-
}
|
|
1634
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: HeatmapChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1635
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.1.2", type: HeatmapChartComponent, isStandalone: true, selector: "aril-heatmap-chart", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, yAxisTitle: { classPropertyName: "yAxisTitle", publicName: "yAxisTitle", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1636
|
-
<highcharts-chart
|
|
1637
|
-
style="width: 100%; height: 100%; display: block"
|
|
1638
|
-
[Highcharts]="Highcharts"
|
|
1639
|
-
[options]="chartOptions"
|
|
1640
|
-
[callbackFunction]="chartCallback">
|
|
1641
|
-
</highcharts-chart>
|
|
1642
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: HighchartsChartModule }, { kind: "component", type: i1.HighchartsChartComponent, selector: "highcharts-chart", inputs: ["Highcharts", "constructorType", "callbackFunction", "oneToOne", "runOutsideAngular", "options", "update"], outputs: ["updateChange", "chartInstance"] }] }); }
|
|
1643
|
-
}
|
|
1644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: HeatmapChartComponent, decorators: [{
|
|
1645
|
-
type: Component,
|
|
1646
|
-
args: [{
|
|
1647
|
-
selector: 'aril-heatmap-chart',
|
|
1648
|
-
standalone: true,
|
|
1649
|
-
imports: [HighchartsChartModule],
|
|
1650
|
-
template: `
|
|
1651
|
-
<highcharts-chart
|
|
1652
|
-
style="width: 100%; height: 100%; display: block"
|
|
1653
|
-
[Highcharts]="Highcharts"
|
|
1654
|
-
[options]="chartOptions"
|
|
1655
|
-
[callbackFunction]="chartCallback">
|
|
1656
|
-
</highcharts-chart>
|
|
1657
|
-
`
|
|
1658
|
-
}]
|
|
1659
|
-
}], ctorParameters: () => [] });
|
|
1660
|
-
|
|
1661
363
|
/**
|
|
1662
364
|
* Generated bundle index. Do not edit.
|
|
1663
365
|
*/
|
|
1664
366
|
|
|
1665
|
-
export {
|
|
367
|
+
export { LineDatetimeAxisChartComponent, MetricUnit, SolidGaugeChartComponent };
|
|
1666
368
|
//# sourceMappingURL=aril-ui-charts.mjs.map
|