logitude-dashboard-library 3.1.12 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/styles/dl-dashboard.scss +7 -39
- package/dist/features/Dashboard/ChartsComponents/FusionCharts/FusionChartObjectHelper.d.ts +0 -3
- package/dist/features/Dashboard/ChartsComponents/FusionCharts/FusionColors.d.ts +0 -16
- package/dist/index.js +121 -221
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +121 -221
- package/dist/index.modern.js.map +1 -1
- package/dist/services/ApiServices.d.ts +1 -1
- package/dist/services/DashboardAnalyticsService.d.ts +1 -1
- package/dist/styles/dl-dashboard.scss +7 -39
- package/dist/types/widget.d.ts +0 -1
- package/package.json +1 -1
|
@@ -388,12 +388,6 @@ $dark-grey: #717585;
|
|
|
388
388
|
align-items: flex-start;
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
.table-rows-number-indicator {
|
|
392
|
-
margin: 4px 0px 2px 0px;
|
|
393
|
-
color: #939393;
|
|
394
|
-
font-size: 11px;
|
|
395
|
-
padding-left: 12px;
|
|
396
|
-
}
|
|
397
391
|
.filter-label {
|
|
398
392
|
font-size: 12px;
|
|
399
393
|
color: $dark-grey;
|
|
@@ -723,41 +717,21 @@ $dark-grey: #717585;
|
|
|
723
717
|
.dl-table-chart-container {
|
|
724
718
|
overflow: auto;
|
|
725
719
|
position: absolute;
|
|
726
|
-
top:
|
|
720
|
+
top: 0;
|
|
727
721
|
right: 0;
|
|
728
722
|
left: 0;
|
|
729
723
|
bottom: 0;
|
|
730
|
-
height: calc(100% -
|
|
724
|
+
height: calc(100% - 15px);
|
|
731
725
|
width: calc(100% - 25px);
|
|
732
726
|
margin: 0 auto;
|
|
733
727
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
height: 10px
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
&::-webkit-scrollbar-thumb {
|
|
740
|
-
border: 1px solid rgba(0, 0, 0, 0);
|
|
741
|
-
background-clip: padding-box;
|
|
742
|
-
border-radius: 9999px;
|
|
743
|
-
background-color: #D9D9D9;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
&::-webkit-scrollbar-track {
|
|
747
|
-
background: #F3F3F3;
|
|
748
|
-
border: 1px solid white;
|
|
749
|
-
border-radius: 9999px;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
.p-datatable {
|
|
728
|
+
table {
|
|
729
|
+
border-collapse: collapse;
|
|
753
730
|
width: 100%;
|
|
731
|
+
height: auto;
|
|
732
|
+
max-height: 100%;
|
|
754
733
|
}
|
|
755
734
|
|
|
756
|
-
.p-datatable > .p-datatable-wrapper {
|
|
757
|
-
overflow-x: inherit;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
735
|
td,
|
|
762
736
|
th {
|
|
763
737
|
border: 1px solid #ddd;
|
|
@@ -769,18 +743,12 @@ $dark-grey: #717585;
|
|
|
769
743
|
font-weight: bold;
|
|
770
744
|
font-size: 14px;
|
|
771
745
|
white-space: nowrap;
|
|
772
|
-
|
|
773
|
-
.p-column-title {
|
|
774
|
-
font-weight: bold !important;
|
|
775
|
-
font-size: 14px !important;
|
|
776
|
-
}
|
|
777
746
|
}
|
|
778
747
|
|
|
779
748
|
td {
|
|
780
749
|
border: 1px solid #ddd;
|
|
781
|
-
padding:
|
|
750
|
+
padding: 8px;
|
|
782
751
|
max-width: 1px;
|
|
783
|
-
height: 36px;
|
|
784
752
|
min-width: 140px;
|
|
785
753
|
line-height: normal;
|
|
786
754
|
word-break: break-all;
|
|
@@ -83,9 +83,6 @@ export interface ChartInfo {
|
|
|
83
83
|
minPlotHeightForValue: string;
|
|
84
84
|
minAngleForValue: string;
|
|
85
85
|
drawCrossLine: string;
|
|
86
|
-
palettecolors: string;
|
|
87
|
-
plotHoverEffect: string;
|
|
88
86
|
}
|
|
89
87
|
export declare function getSeriesPositionColor(position: number): string | null;
|
|
90
88
|
export declare function getSeriesHoverPositionColor(position: number): string | null;
|
|
91
|
-
export declare const getPlotColorByIndexOrder: (index: number) => string;
|
|
@@ -16,19 +16,3 @@ export declare const grey1Color = "#F6F6F6";
|
|
|
16
16
|
export declare const grey2Color = "#F0F0F0";
|
|
17
17
|
export declare const grey3Color = "#D9D9D9";
|
|
18
18
|
export declare const grey4Color = "#A4A4A4";
|
|
19
|
-
export declare const plotColorsDictionary: {
|
|
20
|
-
plotColor0: string;
|
|
21
|
-
plotColor1: string;
|
|
22
|
-
plotColor2: string;
|
|
23
|
-
plotColor3: string;
|
|
24
|
-
plotColor4: string;
|
|
25
|
-
plotColor5: string;
|
|
26
|
-
plotColor6: string;
|
|
27
|
-
plotColor7: string;
|
|
28
|
-
plotColor8: string;
|
|
29
|
-
plotColor9: string;
|
|
30
|
-
plotColor10: string;
|
|
31
|
-
plotColor11: string;
|
|
32
|
-
plotColor12: string;
|
|
33
|
-
plotColor13: string;
|
|
34
|
-
};
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,6 @@ var progressspinner = require('primereact/progressspinner');
|
|
|
7
7
|
var axios = _interopDefault(require('axios'));
|
|
8
8
|
var moment = _interopDefault(require('moment'));
|
|
9
9
|
var uuid = require('uuid');
|
|
10
|
-
var datatable = require('primereact/datatable');
|
|
11
|
-
var column = require('primereact/column');
|
|
12
10
|
var ReactFC = _interopDefault(require('react-fusioncharts'));
|
|
13
11
|
var FusionCharts = _interopDefault(require('fusioncharts'));
|
|
14
12
|
var Charts = _interopDefault(require('fusioncharts/fusioncharts.charts'));
|
|
@@ -142,19 +140,14 @@ var ApiServices = /*#__PURE__*/function () {
|
|
|
142
140
|
});
|
|
143
141
|
};
|
|
144
142
|
|
|
145
|
-
_proto.post = function post(api, date
|
|
146
|
-
if (requestSignal === void 0) {
|
|
147
|
-
requestSignal = undefined;
|
|
148
|
-
}
|
|
149
|
-
|
|
143
|
+
_proto.post = function post(api, date) {
|
|
150
144
|
var token = this.getTokenFromStorage();
|
|
151
145
|
var apiURL = "" + this._apiUrl + api;
|
|
152
146
|
return axios.post(apiURL, date, {
|
|
153
147
|
headers: {
|
|
154
148
|
'Content-Type': 'application/json',
|
|
155
149
|
'Token': token
|
|
156
|
-
}
|
|
157
|
-
signal: requestSignal
|
|
150
|
+
}
|
|
158
151
|
});
|
|
159
152
|
};
|
|
160
153
|
|
|
@@ -203,12 +196,8 @@ var DashboardAnalyticsService = /*#__PURE__*/function () {
|
|
|
203
196
|
|
|
204
197
|
var _proto = DashboardAnalyticsService.prototype;
|
|
205
198
|
|
|
206
|
-
_proto.getData = function getData(widget
|
|
207
|
-
|
|
208
|
-
signal = undefined;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return this._ApiServices.post("/api/" + this.controller + "/PostGetDataAnalytic", widget, signal);
|
|
199
|
+
_proto.getData = function getData(widget) {
|
|
200
|
+
return this._ApiServices.post("/api/" + this.controller + "/PostGetDataAnalytic", widget);
|
|
212
201
|
};
|
|
213
202
|
|
|
214
203
|
_proto.getKpiData = function getKpiData(widget) {
|
|
@@ -562,10 +551,6 @@ var TableChart = function TableChart(props) {
|
|
|
562
551
|
tableData = _useState4[0],
|
|
563
552
|
setTableData = _useState4[1];
|
|
564
553
|
|
|
565
|
-
var _useState5 = React.useState([]),
|
|
566
|
-
tableColumns = _useState5[0],
|
|
567
|
-
setTableColumns = _useState5[1];
|
|
568
|
-
|
|
569
554
|
React.useEffect(function () {
|
|
570
555
|
if (props.customChartProps && props.customChartProps.widget) {
|
|
571
556
|
setWidget(props.customChartProps.widget);
|
|
@@ -583,7 +568,7 @@ var TableChart = function TableChart(props) {
|
|
|
583
568
|
var dashboardAnalyticsService = new DashboardAnalyticsService();
|
|
584
569
|
widget.onChange = undefined;
|
|
585
570
|
widget.PageIndex = 0;
|
|
586
|
-
widget.PageSize =
|
|
571
|
+
widget.PageSize = 50;
|
|
587
572
|
dashboardAnalyticsService.getTableData(widget).then(function (res) {
|
|
588
573
|
if (res && res.data) {
|
|
589
574
|
fillTableData(res.data);
|
|
@@ -616,29 +601,56 @@ var TableChart = function TableChart(props) {
|
|
|
616
601
|
};
|
|
617
602
|
|
|
618
603
|
var fillTableData = function fillTableData(tableData) {
|
|
619
|
-
var
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
604
|
+
var tableRecoreds = [];
|
|
605
|
+
var tableRow = [];
|
|
606
|
+
|
|
607
|
+
if (tableData.Fields) {
|
|
608
|
+
tableData.Fields.forEach(function (item) {
|
|
609
|
+
tableRow.push(_extends({}, item, {
|
|
610
|
+
value: item.DisplayName ? item.DisplayName : "",
|
|
611
|
+
isHeader: true
|
|
612
|
+
}));
|
|
613
|
+
});
|
|
623
614
|
}
|
|
624
615
|
|
|
625
|
-
|
|
626
|
-
tableData.Result.forEach(function (item) {
|
|
627
|
-
var _tableRow = _extends({}, item);
|
|
616
|
+
tableRecoreds.push(tableRow);
|
|
628
617
|
|
|
618
|
+
if (tableData.Result) {
|
|
619
|
+
tableData.Result.forEach(function (item) {
|
|
620
|
+
var _tableRow = [];
|
|
629
621
|
tableData.Fields.forEach(function (field) {
|
|
630
622
|
var key = field.FieldCode;
|
|
631
623
|
var valueType = field.DataTypeCode;
|
|
632
624
|
|
|
633
625
|
var _value = valueType && (valueType == "Date" || valueType == "DateTime") ? getDateTimeValue(item[key]) : valueType == "Boolean" ? getBooleanStringValue(item[key]) : item[key];
|
|
634
626
|
|
|
635
|
-
_tableRow
|
|
627
|
+
_tableRow.push({
|
|
628
|
+
value: _value
|
|
629
|
+
});
|
|
636
630
|
});
|
|
637
|
-
|
|
631
|
+
tableRecoreds.push(_tableRow);
|
|
638
632
|
});
|
|
639
633
|
}
|
|
640
634
|
|
|
641
|
-
setTableData([].concat(
|
|
635
|
+
setTableData([].concat(tableRecoreds));
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
var getTableTemplate = function getTableTemplate() {
|
|
639
|
+
return tableData.length == 0 ? React__default.createElement("div", {
|
|
640
|
+
className: "dl-kpi-no-data margin-auto"
|
|
641
|
+
}, "No data to display.") : React__default.createElement("table", null, React__default.createElement("thead", null, React__default.createElement("tr", null, tableData[0].map(function (el) {
|
|
642
|
+
return React__default.createElement("th", {
|
|
643
|
+
key: el.value
|
|
644
|
+
}, !isNullOrUndefined(el.value) ? el.value + "" : '');
|
|
645
|
+
}))), React__default.createElement("tbody", null, tableData.map(function (el, index) {
|
|
646
|
+
return index == 0 ? null : React__default.createElement("tr", {
|
|
647
|
+
key: index
|
|
648
|
+
}, el.map(function (item, index2) {
|
|
649
|
+
return React__default.createElement("td", {
|
|
650
|
+
key: index2 + "_" + el.value
|
|
651
|
+
}, !isNullOrUndefined(item.value) ? item.value + "" : '');
|
|
652
|
+
}));
|
|
653
|
+
})));
|
|
642
654
|
};
|
|
643
655
|
|
|
644
656
|
return isLoading ? React__default.createElement("div", {
|
|
@@ -661,20 +673,11 @@ var TableChart = function TableChart(props) {
|
|
|
661
673
|
className: "red-warning-icon"
|
|
662
674
|
}), React__default.createElement("span", {
|
|
663
675
|
className: "dl-tooltiptext"
|
|
664
|
-
}, error))) :
|
|
665
|
-
value: tableData,
|
|
666
|
-
responsiveLayout: "scroll"
|
|
667
|
-
}, tableColumns.map(function (column$1, index) {
|
|
668
|
-
return React__default.createElement(column.Column, {
|
|
669
|
-
key: column$1.FieldCode + "_" + index,
|
|
670
|
-
field: column$1.FieldCode,
|
|
671
|
-
header: column$1.DisplayName
|
|
672
|
-
});
|
|
673
|
-
}));
|
|
676
|
+
}, error))) : getTableTemplate();
|
|
674
677
|
};
|
|
675
678
|
|
|
676
679
|
var CustomChart = function CustomChart(props) {
|
|
677
|
-
var _props$widget2
|
|
680
|
+
var _props$widget2;
|
|
678
681
|
|
|
679
682
|
var project = function project() {
|
|
680
683
|
var _props$widget;
|
|
@@ -695,16 +698,50 @@ var CustomChart = function CustomChart(props) {
|
|
|
695
698
|
}
|
|
696
699
|
};
|
|
697
700
|
|
|
698
|
-
return React__default.createElement(
|
|
699
|
-
className: "table-
|
|
700
|
-
},
|
|
701
|
-
className: props.widget && ((_props$widget4 = props.widget) === null || _props$widget4 === void 0 ? void 0 : _props$widget4.TypeCode) == 'table' ? "dl-custom-chart-container dl-table-chart-container" : "dl-custom-chart-container"
|
|
702
|
-
}, project()));
|
|
701
|
+
return React__default.createElement("div", {
|
|
702
|
+
className: props.widget && ((_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.TypeCode) == 'table' ? "dl-custom-chart-container dl-table-chart-container" : "dl-custom-chart-container"
|
|
703
|
+
}, project());
|
|
703
704
|
};
|
|
704
705
|
|
|
706
|
+
var mainYellowColor = "#F6CF33";
|
|
707
|
+
var mainRedColor = "#EE5F77";
|
|
708
|
+
var mainGreenColor = "#4AC76F";
|
|
709
|
+
var mainTurquoiseColor = "#32C7C7";
|
|
710
|
+
var mainBlueColor = "#369CFB";
|
|
711
|
+
var mainPurpleColor = "#935BE0";
|
|
712
|
+
var mainOrangeColor = "#FAAD14";
|
|
713
|
+
|
|
714
|
+
function getSeriesPositionColor(position) {
|
|
715
|
+
switch (position) {
|
|
716
|
+
case 1:
|
|
717
|
+
return mainBlueColor;
|
|
718
|
+
|
|
719
|
+
case 2:
|
|
720
|
+
return mainGreenColor;
|
|
721
|
+
|
|
722
|
+
case 3:
|
|
723
|
+
return mainYellowColor;
|
|
724
|
+
|
|
725
|
+
case 4:
|
|
726
|
+
return mainTurquoiseColor;
|
|
727
|
+
|
|
728
|
+
case 5:
|
|
729
|
+
return mainPurpleColor;
|
|
730
|
+
|
|
731
|
+
case 6:
|
|
732
|
+
return mainOrangeColor;
|
|
733
|
+
|
|
734
|
+
case 7:
|
|
735
|
+
return mainRedColor;
|
|
736
|
+
|
|
737
|
+
default:
|
|
738
|
+
return null;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
705
742
|
function buildToolTip(widget, value, seriesName, label, index) {
|
|
706
743
|
var padding = widget.TypeCode == 'line' && index > 0 ? 'padding-top: 3px' : '';
|
|
707
|
-
return "\n <div style=\"min-width: 108px;" + padding + "\">\n <div style=\"display: flex;align-items: center;margin-bottom: 6px;\">\n <span style=\"margin: 0; height: 10px; width: 10px; background-color:
|
|
744
|
+
return "\n <div style=\"min-width: 108px;" + padding + "\">\n <div style=\"display: flex;align-items: center;margin-bottom: 6px;\">\n <span style=\"margin: 0; height: 10px; width: 10px; background-color: #A4A4A4; border-radius: 50%; display: inline-block;\"></span>\n <p style=\" margin: 0; margin-left: 4px;font-family: 'Manrope'; font-style: normal;font-weight: 400; font-size: 11px; line-height: 100%; color: #323232; flex: none; order: 1;flex-grow: 0;\"> " + getTooltiplabel(label) + "</p>\n </div>\n <hr style=\"margin: 0;border-top: 1px solid #F0F0F0;\">\n <div style=\"display: flex;align-items: center;margin:0;margin-top: 6px;\">\n <p style=\"margin: 0;font-family: 'Manrope';font-style: normal;font-weight: 400; font-size: 11px;line-height: 100%;color: #A4A4A4;flex: none;order: 0;flex-grow: 0;\"> " + getMeasureType(seriesName) + "</p>\n <p style=\"margin: 0;margin-left: 6px;font-family: 'Manrope';font-style: normal;font-weight: 500;font-size: 11px;line-height: 100%; color: #323232;flex: none; order: 1;flex-grow: 0;\">" + getTooltipValue(value) + "</p>\n " + getTooltipPercentage(widget) + " </div>\n </div>\n ";
|
|
708
745
|
}
|
|
709
746
|
|
|
710
747
|
function getTooltipPercentage(widget) {
|
|
@@ -793,7 +830,8 @@ function buildDataSource(values, widget) {
|
|
|
793
830
|
MeasureCode: series.MeasureCode,
|
|
794
831
|
Formula: series.Formula
|
|
795
832
|
},
|
|
796
|
-
tooltext: buildToolTip(widget, null, series, e.Label, 0)
|
|
833
|
+
tooltext: buildToolTip(widget, null, series, e.Label, 0),
|
|
834
|
+
color: getSeriesPositionColor(index + 1)
|
|
797
835
|
};
|
|
798
836
|
return item;
|
|
799
837
|
});
|
|
@@ -802,6 +840,7 @@ function buildDataSource(values, widget) {
|
|
|
802
840
|
|
|
803
841
|
function buildDataSet(seriesMeasures, widget) {
|
|
804
842
|
var dataSet = [];
|
|
843
|
+
var seriesPosition = 1;
|
|
805
844
|
seriesMeasures.forEach(function (seriesMeasure) {
|
|
806
845
|
var datas = seriesMeasure.Values.map(function (e, index) {
|
|
807
846
|
return {
|
|
@@ -815,22 +854,26 @@ function buildDataSet(seriesMeasures, widget) {
|
|
|
815
854
|
tooltext: buildToolTip(widget, e.Value, seriesMeasure, null, index)
|
|
816
855
|
};
|
|
817
856
|
});
|
|
857
|
+
var color = getSeriesPositionColor(seriesPosition);
|
|
818
858
|
dataSet.push({
|
|
819
859
|
data: datas,
|
|
820
860
|
seriesname: seriesMeasure.Name,
|
|
821
|
-
|
|
861
|
+
color: color,
|
|
862
|
+
anchorBgColor: color,
|
|
822
863
|
anchorBorderColor: "#FFFFFF",
|
|
823
864
|
anchorBorderThickness: "2",
|
|
824
|
-
anchorHoverColor:
|
|
865
|
+
anchorHoverColor: color,
|
|
825
866
|
parentyaxis: seriesMeasure.PlotasLineChart && seriesMeasure.PlotonSecondAxis ? 'S' : "P",
|
|
826
867
|
renderAs: seriesMeasure.PlotasLineChart ? 'line' : "column"
|
|
827
868
|
});
|
|
869
|
+
seriesPosition++;
|
|
828
870
|
});
|
|
829
871
|
return dataSet;
|
|
830
872
|
}
|
|
831
873
|
|
|
832
874
|
function buildStackedDataSet(seriesMeasures, widget) {
|
|
833
875
|
var dataSet = [];
|
|
876
|
+
var seriesPosition = 1;
|
|
834
877
|
var series = seriesMeasures[0];
|
|
835
878
|
var uniqueGroups = [];
|
|
836
879
|
series.Values.forEach(function (element) {
|
|
@@ -842,10 +885,13 @@ function buildStackedDataSet(seriesMeasures, widget) {
|
|
|
842
885
|
});
|
|
843
886
|
});
|
|
844
887
|
uniqueGroups.forEach(function (group) {
|
|
888
|
+
var color = getSeriesPositionColor(seriesPosition);
|
|
845
889
|
dataSet.push({
|
|
846
890
|
seriesName: group.label,
|
|
891
|
+
color: color,
|
|
847
892
|
data: buildStackedGroupData(group, series, widget)
|
|
848
893
|
});
|
|
894
|
+
seriesPosition++;
|
|
849
895
|
});
|
|
850
896
|
var emptylabels = dataSet.filter(function (e) {
|
|
851
897
|
return e.seriesName == null;
|
|
@@ -1205,7 +1251,6 @@ function getDefaultChartInfo(widget) {
|
|
|
1205
1251
|
chart.minAngleForValue = "27";
|
|
1206
1252
|
}
|
|
1207
1253
|
|
|
1208
|
-
chart.palettecolors = "#369CFB,#4AC76F,#F6CF33,#32C7C7,#935BE0,#FAAD14,#EE5F77,#5D62B5, #29C3BE, #F2726F, #FFC533, #62B58F, #BC95DF, #67CDF2";
|
|
1209
1254
|
chart.enableSlicing = "0";
|
|
1210
1255
|
chart.enableRotation = "0";
|
|
1211
1256
|
chart.chartTopMargin = "10";
|
|
@@ -1214,7 +1259,6 @@ function getDefaultChartInfo(widget) {
|
|
|
1214
1259
|
chart.chartRightMargin = "40";
|
|
1215
1260
|
chart.toolTipBgColor = "#FFFFFF";
|
|
1216
1261
|
chart.showToolTipShadow = "1";
|
|
1217
|
-
chart.plotHoverEffect = "0";
|
|
1218
1262
|
chart.scrollHeight = "6";
|
|
1219
1263
|
chart.scrollWidth = "6";
|
|
1220
1264
|
chart.plotColorinTooltip = "0";
|
|
@@ -1348,78 +1392,6 @@ var FusionChartHelper = /*#__PURE__*/function () {
|
|
|
1348
1392
|
return FusionChartHelper;
|
|
1349
1393
|
}();
|
|
1350
1394
|
|
|
1351
|
-
var plotColorsDictionary = {
|
|
1352
|
-
plotColor0: "#369CFB",
|
|
1353
|
-
plotColor1: "#4AC76F",
|
|
1354
|
-
plotColor2: "#F6CF33",
|
|
1355
|
-
plotColor3: "#32C7C7",
|
|
1356
|
-
plotColor4: "#935BE0",
|
|
1357
|
-
plotColor5: "#FAAD14",
|
|
1358
|
-
plotColor6: "#EE5F77",
|
|
1359
|
-
plotColor7: "#5D62B5",
|
|
1360
|
-
plotColor8: "#29C3BE",
|
|
1361
|
-
plotColor9: "#F2726F",
|
|
1362
|
-
plotColor10: "#FFC533",
|
|
1363
|
-
plotColor11: "#62B58F",
|
|
1364
|
-
plotColor12: "#BC95DF",
|
|
1365
|
-
plotColor13: "#67CDF2"
|
|
1366
|
-
};
|
|
1367
|
-
|
|
1368
|
-
var getPlotColorByIndexOrder = function getPlotColorByIndexOrder(index) {
|
|
1369
|
-
var _index = index;
|
|
1370
|
-
|
|
1371
|
-
if (_index >= 14) {
|
|
1372
|
-
_index = _index % 14;
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
switch (_index) {
|
|
1376
|
-
case 0:
|
|
1377
|
-
return plotColorsDictionary.plotColor0;
|
|
1378
|
-
|
|
1379
|
-
case 1:
|
|
1380
|
-
return plotColorsDictionary.plotColor1;
|
|
1381
|
-
|
|
1382
|
-
case 2:
|
|
1383
|
-
return plotColorsDictionary.plotColor2;
|
|
1384
|
-
|
|
1385
|
-
case 3:
|
|
1386
|
-
return plotColorsDictionary.plotColor3;
|
|
1387
|
-
|
|
1388
|
-
case 4:
|
|
1389
|
-
return plotColorsDictionary.plotColor4;
|
|
1390
|
-
|
|
1391
|
-
case 5:
|
|
1392
|
-
return plotColorsDictionary.plotColor5;
|
|
1393
|
-
|
|
1394
|
-
case 6:
|
|
1395
|
-
return plotColorsDictionary.plotColor6;
|
|
1396
|
-
|
|
1397
|
-
case 7:
|
|
1398
|
-
return plotColorsDictionary.plotColor7;
|
|
1399
|
-
|
|
1400
|
-
case 8:
|
|
1401
|
-
return plotColorsDictionary.plotColor8;
|
|
1402
|
-
|
|
1403
|
-
case 9:
|
|
1404
|
-
return plotColorsDictionary.plotColor9;
|
|
1405
|
-
|
|
1406
|
-
case 10:
|
|
1407
|
-
return plotColorsDictionary.plotColor10;
|
|
1408
|
-
|
|
1409
|
-
case 11:
|
|
1410
|
-
return plotColorsDictionary.plotColor11;
|
|
1411
|
-
|
|
1412
|
-
case 12:
|
|
1413
|
-
return plotColorsDictionary.plotColor12;
|
|
1414
|
-
|
|
1415
|
-
case 13:
|
|
1416
|
-
return plotColorsDictionary.plotColor13;
|
|
1417
|
-
|
|
1418
|
-
default:
|
|
1419
|
-
return "#0566c2";
|
|
1420
|
-
}
|
|
1421
|
-
};
|
|
1422
|
-
|
|
1423
1395
|
ReactFC.fcRoot(FusionCharts, Charts, FusionTheme);
|
|
1424
1396
|
FusionCharts.options['license']({
|
|
1425
1397
|
key: 'prD4C-8eiA7A3A3C7E6G4B4A3J4C7B2D3D2nyqE1C3fd1npaE4D4tlA-21D7E4F4F1F1E1F4F1A10A8C2C5F5E2F2D1hwqD1B5D1aG4A19A32twbC6D3G4lhJ-7A9C11A5B-13ddA2I3A1B9B3D7A2B4G2H3H1F-7smC8B2XB4cetB8A7A5mxD3SG4F2tvgB2A3B2E4C3I3C7B3A4A3A2D3D2G4J-7==',
|
|
@@ -1438,35 +1410,27 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1438
1410
|
fusionKey = _useState3[0];
|
|
1439
1411
|
|
|
1440
1412
|
var chartData = React.useRef(null);
|
|
1441
|
-
|
|
1442
|
-
var _useState4 = React.useState(null),
|
|
1443
|
-
resizeTimer = _useState4[0],
|
|
1444
|
-
setResizeTimer = _useState4[1];
|
|
1445
|
-
|
|
1446
|
-
var axiosController = React.useRef(new AbortController());
|
|
1447
1413
|
var widget = React.useRef();
|
|
1448
1414
|
|
|
1449
|
-
var
|
|
1450
|
-
args =
|
|
1451
|
-
setArgs =
|
|
1415
|
+
var _useState4 = React.useState({}),
|
|
1416
|
+
args = _useState4[0],
|
|
1417
|
+
setArgs = _useState4[1];
|
|
1452
1418
|
|
|
1453
|
-
var
|
|
1454
|
-
fChart =
|
|
1455
|
-
setFchart =
|
|
1456
|
-
|
|
1457
|
-
var _useState7 = React.useState(uuid.v4()),
|
|
1458
|
-
chartContainerId = _useState7[0];
|
|
1419
|
+
var _useState5 = React.useState(),
|
|
1420
|
+
fChart = _useState5[0],
|
|
1421
|
+
setFchart = _useState5[1];
|
|
1459
1422
|
|
|
1423
|
+
var id = (Math.random() + 1).toString(36).substring(7);
|
|
1460
1424
|
var progressRef = React.useRef(null);
|
|
1461
1425
|
var fusionRef = React.useRef(null);
|
|
1462
1426
|
var fusionChartHelper = React.useRef();
|
|
1463
|
-
var isDummyChangesActive = React.useRef(false);
|
|
1464
1427
|
React.useEffect(function () {
|
|
1465
1428
|
var _props$dataBinding;
|
|
1466
1429
|
|
|
1467
|
-
axiosController.current = new AbortController();
|
|
1468
1430
|
widget.current = props.widget;
|
|
1469
|
-
|
|
1431
|
+
setTimeout(function () {
|
|
1432
|
+
RefreshData();
|
|
1433
|
+
}, 500);
|
|
1470
1434
|
(_props$dataBinding = props.dataBinding) === null || _props$dataBinding === void 0 ? void 0 : _props$dataBinding.widgetUpdated.subscribe(function (updatedWidget) {
|
|
1471
1435
|
var _widget$current;
|
|
1472
1436
|
|
|
@@ -1476,32 +1440,25 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1476
1440
|
if (chartData && chartData.current) {
|
|
1477
1441
|
var _data = JSON.parse(JSON.stringify(chartData.current));
|
|
1478
1442
|
|
|
1479
|
-
isDummyChangesActive.current = true;
|
|
1480
1443
|
handleData(_data, true);
|
|
1481
1444
|
}
|
|
1482
1445
|
});
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
window.removeEventListener("resize", handleResize);
|
|
1488
|
-
setDataLoaded(false);
|
|
1446
|
+
}, []);
|
|
1447
|
+
React.useEffect(function () {
|
|
1448
|
+
var timeout;
|
|
1489
1449
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1450
|
+
var handleResize = function handleResize() {
|
|
1451
|
+
clearTimeout(timeout);
|
|
1452
|
+
timeout = setTimeout(function () {
|
|
1453
|
+
HandleSizeChange();
|
|
1454
|
+
}, 200);
|
|
1455
|
+
};
|
|
1492
1456
|
|
|
1493
|
-
|
|
1494
|
-
|
|
1457
|
+
window.addEventListener("resize", handleResize);
|
|
1458
|
+
return function () {
|
|
1459
|
+
return window.removeEventListener("resize", handleResize);
|
|
1495
1460
|
};
|
|
1496
1461
|
}, []);
|
|
1497
|
-
|
|
1498
|
-
var handleResize = function handleResize() {
|
|
1499
|
-
clearTimeout(resizeTimer);
|
|
1500
|
-
setResizeTimer(setTimeout(function () {
|
|
1501
|
-
HandleSizeChange();
|
|
1502
|
-
}, 200));
|
|
1503
|
-
};
|
|
1504
|
-
|
|
1505
1462
|
React.useImperativeHandle(comRef, function () {
|
|
1506
1463
|
return {
|
|
1507
1464
|
onResizeFinish: function onResizeFinish() {
|
|
@@ -1540,21 +1497,9 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1540
1497
|
var postWidget = _extends({}, widget.current);
|
|
1541
1498
|
|
|
1542
1499
|
postWidget.onChange = undefined;
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
if (axiosController) {
|
|
1546
|
-
var _axiosController$curr3;
|
|
1547
|
-
|
|
1548
|
-
axiosController === null || axiosController === void 0 ? void 0 : (_axiosController$curr3 = axiosController.current) === null || _axiosController$curr3 === void 0 ? void 0 : _axiosController$curr3.abort();
|
|
1549
|
-
var updatedAxiosController = new AbortController();
|
|
1550
|
-
axiosController.current = updatedAxiosController;
|
|
1551
|
-
signal = updatedAxiosController === null || updatedAxiosController === void 0 ? void 0 : updatedAxiosController.signal;
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
dashboardAnalyticsService.getData(postWidget, signal).then(function (result) {
|
|
1500
|
+
dashboardAnalyticsService.getData(postWidget).then(function (result) {
|
|
1555
1501
|
handleData(result === null || result === void 0 ? void 0 : result.data);
|
|
1556
1502
|
chartData.current = result === null || result === void 0 ? void 0 : result.data;
|
|
1557
|
-
setDataLoaded(true);
|
|
1558
1503
|
}, function (error) {
|
|
1559
1504
|
var _error$response, _error$response$data, _error$response2, _error$response2$data;
|
|
1560
1505
|
|
|
@@ -1578,10 +1523,6 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1578
1523
|
|
|
1579
1524
|
if (!isDummyChange) {
|
|
1580
1525
|
setDataLoaded(true);
|
|
1581
|
-
} else {
|
|
1582
|
-
setTimeout(function () {
|
|
1583
|
-
isDummyChangesActive.current = false;
|
|
1584
|
-
}, 100);
|
|
1585
1526
|
}
|
|
1586
1527
|
};
|
|
1587
1528
|
|
|
@@ -1609,46 +1550,6 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1609
1550
|
setFchart(chart);
|
|
1610
1551
|
};
|
|
1611
1552
|
|
|
1612
|
-
var handlePieDonutChartTooltip = function handlePieDonutChartTooltip(chartData) {
|
|
1613
|
-
if (chartData && chartData.data && chartData.data.length) {
|
|
1614
|
-
chartData.data.forEach(function (item, index) {
|
|
1615
|
-
var color = getPlotColorByIndexOrder(index);
|
|
1616
|
-
item.tooltext = item.tooltext.replaceAll("transparent", color);
|
|
1617
|
-
});
|
|
1618
|
-
setArgs(_extends({}, args, {
|
|
1619
|
-
dataSource: chartData
|
|
1620
|
-
}));
|
|
1621
|
-
}
|
|
1622
|
-
};
|
|
1623
|
-
|
|
1624
|
-
var handleOtherChartsTooltip = function handleOtherChartsTooltip(chartData) {
|
|
1625
|
-
if (chartData && chartData.dataset && chartData.dataset.length) {
|
|
1626
|
-
chartData.dataset.forEach(function (el, index) {
|
|
1627
|
-
el.data.forEach(function (item) {
|
|
1628
|
-
var color = getPlotColorByIndexOrder(index);
|
|
1629
|
-
item.tooltext = item.tooltext.replaceAll("transparent", color);
|
|
1630
|
-
});
|
|
1631
|
-
});
|
|
1632
|
-
setArgs(_extends({}, args, {
|
|
1633
|
-
dataSource: chartData
|
|
1634
|
-
}));
|
|
1635
|
-
}
|
|
1636
|
-
};
|
|
1637
|
-
|
|
1638
|
-
var loaded = function loaded(event) {
|
|
1639
|
-
var _widget$current6, _widget$current7;
|
|
1640
|
-
|
|
1641
|
-
if (isDummyChangesActive && isDummyChangesActive.current) return;
|
|
1642
|
-
var chartData = event.sender.args && event.sender.args.dataSource ? event.sender.args.dataSource : null;
|
|
1643
|
-
var isPieOrDonutChart = ((_widget$current6 = widget.current) === null || _widget$current6 === void 0 ? void 0 : _widget$current6.TypeCode) == 'pie' || ((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.TypeCode) == 'donut';
|
|
1644
|
-
|
|
1645
|
-
if (isPieOrDonutChart) {
|
|
1646
|
-
handlePieDonutChartTooltip(chartData);
|
|
1647
|
-
} else {
|
|
1648
|
-
handleOtherChartsTooltip(chartData);
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
|
|
1652
1553
|
return !dataLoaded ? React__default.createElement("div", {
|
|
1653
1554
|
ref: progressRef,
|
|
1654
1555
|
className: 'dl-full-hight dl-flex-content-center spinner-custome'
|
|
@@ -1663,13 +1564,12 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1663
1564
|
className: 'db-fc-parent-container',
|
|
1664
1565
|
ref: fusionRef
|
|
1665
1566
|
}, React__default.createElement("div", {
|
|
1666
|
-
className: 'db-fc-container',
|
|
1667
1567
|
key: fusionKey,
|
|
1568
|
+
className: 'db-fc-container',
|
|
1668
1569
|
ref: ref,
|
|
1669
|
-
id:
|
|
1570
|
+
id: id
|
|
1670
1571
|
}, React__default.createElement(ReactFC, Object.assign({}, args, {
|
|
1671
1572
|
"fcEvent-dataplotClick": dataplotClick,
|
|
1672
|
-
"fcEvent-loaded": loaded,
|
|
1673
1573
|
onRender: renderComplete
|
|
1674
1574
|
})))) : React__default.createElement("div", {
|
|
1675
1575
|
className: "dl-flex-content-center dl-full-hight",
|