pace-chart-lib 1.0.29 → 1.0.31
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/Components/Charts/ChartsWithAxis/ChartsWithAxisFunctions.d.ts +1 -27
- package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisTypes.types.d.ts +1 -0
- package/dist/Components/Charts/Core/DefaultProperties.types.d.ts +1 -0
- package/dist/pace-chart-lib.es.js +68 -38
- package/dist/pace-chart-lib.umd.js +68 -38
- package/package.json +1 -1
|
@@ -417,33 +417,7 @@ export declare function setChartTitle(svg: any, formatOptions: TDefaultChartForm
|
|
|
417
417
|
* @returns The appropriate D3 curve function based on the interpolation and smoothing settings.
|
|
418
418
|
*/
|
|
419
419
|
export declare function getCurveType(formatOptions: TDefaultChartFormatOptionsType): d3.CurveFactory;
|
|
420
|
-
|
|
421
|
-
* @param {TSeries[]} chartData - Array of data series for the chart.
|
|
422
|
-
* @param {any} xScale - D3 scale function for the X axis.
|
|
423
|
-
* @param {any} yScaleLeft - D3 scale function for the left Y axis.
|
|
424
|
-
* @param {any} yScaleRight - D3 scale function for the right Y axis.
|
|
425
|
-
* @param {TMargin} margin - Margin object defining chart margins.
|
|
426
|
-
* @param {any} d3Annotation - D3 annotation library or object.
|
|
427
|
-
* @param {string[]} labelExcludeList - List of labels to exclude from annotations.
|
|
428
|
-
* @param {any[]} individualLabelColor - Array of colors for individual labels.
|
|
429
|
-
* @param {any[]} oldAnnotationList - List of existing annotations to update or remove.
|
|
430
|
-
* @param {TDefaultChartFormatOptionsType} formatOptions - Formatting options for the chart.
|
|
431
|
-
* @param {string} chartType - Type of the chart (e.g., "line", "area").
|
|
432
|
-
* @param {number} height - Total height of the SVG container.
|
|
433
|
-
* @param {number} width - Total width of the SVG container.
|
|
434
|
-
* @param {number} innerWidth - Inner width of the chart area.
|
|
435
|
-
* @param {string[]} dimensionList - List of dimensions present in the chart data.
|
|
436
|
-
* @param {number} innerHeight - Inner height of the chart area.
|
|
437
|
-
* @param {string} widgetId - Unique identifier for the widget/chart instance.
|
|
438
|
-
* @param {any} svg - D3 selection of the SVG element to render annotations.
|
|
439
|
-
* @param {any} xScaleForLegends - D3 scale function for the X axis for legends.
|
|
440
|
-
* @param {number} columnWidth - Column width for the chart.
|
|
441
|
-
* @param {boolean} isSensitivityChart - Flag indicating if the chart is a sensitivity chart.
|
|
442
|
-
* @param {boolean} barChart - Flag indicating if the chart is a barChart chart.
|
|
443
|
-
*
|
|
444
|
-
* @return {void} - This function does not return a value; it updates the SVG with annotations.
|
|
445
|
-
*/
|
|
446
|
-
export declare function commonAnnotations(chartData: TSeries[], xScale: any, yScaleLeft: any, yScaleRight: any, margin: TMargin, d3Annotation: any, labelExcludeList: string[], individualLabelColor: any[], oldAnnotationList: any[], formatOptions: TDefaultChartFormatOptionsType, chartType: string, height: number, width: number, innerWidth: number, dimensionList: string[], innerHeight: number, widgetId: string, svg: any, xScaleForLegends?: any, columnWidth?: number, isReportEditable?: boolean, isSensitivityChart?: boolean, barChart?: boolean): void;
|
|
420
|
+
export declare function commonAnnotations(chartData: TSeries[], xScale: any, yScaleLeft: any, yScaleRight: any, margin: TMargin, d3Annotation: any, labelExcludeList: string[], individualLabelColor: any[], oldAnnotationList: any[], formatOptions: TDefaultChartFormatOptionsType, chartType: string, height: number, width: number, innerWidth: number, dimensionList: string[], innerHeight: number, widgetId: string, svg: any, xScaleForLegends?: any, columnWidth?: number, isReportEditable?: boolean, isSensitivityChart?: boolean, barChart?: boolean, isAATornado?: boolean): void;
|
|
447
421
|
/**
|
|
448
422
|
* @param {Array} chartData - The main data used to render the chart.
|
|
449
423
|
* @param {Function} xscale - D3 scale function for the x-axis.
|
|
@@ -566,6 +566,7 @@ export declare const defaultChartFormatOptions: {
|
|
|
566
566
|
dataTableDecimalPrecision: string;
|
|
567
567
|
dataTableDisplayUnits: string;
|
|
568
568
|
dataTableLabelColor: commonColors;
|
|
569
|
+
dataTableAxisLabel: boolean;
|
|
569
570
|
};
|
|
570
571
|
dataTableOuterBorder: {
|
|
571
572
|
borderButtonVisibility: boolean;
|
|
@@ -11443,7 +11443,8 @@ const defaultChartFormatOptions = {
|
|
|
11443
11443
|
dataTableNumberFormat: ",",
|
|
11444
11444
|
dataTableDecimalPrecision: "2",
|
|
11445
11445
|
dataTableDisplayUnits: "None",
|
|
11446
|
-
dataTableLabelColor: commonColors.black
|
|
11446
|
+
dataTableLabelColor: commonColors.black,
|
|
11447
|
+
dataTableAxisLabel: true
|
|
11447
11448
|
},
|
|
11448
11449
|
dataTableOuterBorder: {
|
|
11449
11450
|
borderButtonVisibility: true,
|
|
@@ -11784,7 +11785,7 @@ function calculateVerticalMargins(windowWidth, windowHeight, maxNumberForPrimary
|
|
|
11784
11785
|
bottom2 = xAxisRelatedMargin + 5 + scrollHeightConstant;
|
|
11785
11786
|
break;
|
|
11786
11787
|
case staticLegendPosition.bottom:
|
|
11787
|
-
bottom2 =
|
|
11788
|
+
bottom2 = 30 + xAxisRelatedMargin + scrollHeightConstant;
|
|
11788
11789
|
top2 = metrics.chartTitleHeight + 5 + (isNormalizedChart ? 12 : 0);
|
|
11789
11790
|
break;
|
|
11790
11791
|
case staticLegendPosition.left:
|
|
@@ -12837,8 +12838,15 @@ function setChartTitle(svg, formatOptions, width, chartTitleHeight) {
|
|
|
12837
12838
|
"visibility",
|
|
12838
12839
|
formatOptions.chartTitle.chartTitleVisibility ? "visible" : "hidden"
|
|
12839
12840
|
).attr("transform", `translate(2,2)`).attr("class", "chartTitle").attr("width", width).attr("height", chartTitleHeight + "px");
|
|
12841
|
+
const parseHTMLText = (html) => {
|
|
12842
|
+
const temp = document.createElement("div");
|
|
12843
|
+
temp.innerHTML = html;
|
|
12844
|
+
return temp.textContent || temp.innerText || "";
|
|
12845
|
+
};
|
|
12846
|
+
const hasHTML = !!formatOptions.chartTitle.chartTitleHTML;
|
|
12847
|
+
const titleText = hasHTML ? parseHTMLText(formatOptions.chartTitle.chartTitleHTML) : formatOptions.chartTitle.chartTitleText;
|
|
12840
12848
|
if (formatOptions.chartTitle.dynamicTitleText.length !== 0) {
|
|
12841
|
-
object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title",
|
|
12849
|
+
object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", titleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
|
|
12842
12850
|
formatOptions.chartTitle.chartTitleHTML ? formatOptions.chartTitle.chartTitleHTML : formatOptions.chartTitle.chartTitleText
|
|
12843
12851
|
);
|
|
12844
12852
|
} else {
|
|
@@ -12865,7 +12873,8 @@ function getSlicedLegendForTornado(legend) {
|
|
|
12865
12873
|
if (index2 == -1) return legend;
|
|
12866
12874
|
return legend.slice(index2 + 3);
|
|
12867
12875
|
}
|
|
12868
|
-
|
|
12876
|
+
const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
|
|
12877
|
+
function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart, isAATornado) {
|
|
12869
12878
|
try {
|
|
12870
12879
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
12871
12880
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
@@ -12905,6 +12914,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12905
12914
|
Legend: d.data[0].legend,
|
|
12906
12915
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12907
12916
|
Labelcolor: d.properties[dataLabelColor],
|
|
12917
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12908
12918
|
Axis: d.properties.axis
|
|
12909
12919
|
});
|
|
12910
12920
|
}
|
|
@@ -12920,6 +12930,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12920
12930
|
Legend: d.data[d.data.length - 1].legend,
|
|
12921
12931
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12922
12932
|
Labelcolor: d.properties[dataLabelColor],
|
|
12933
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12923
12934
|
Axis: d.properties.axis
|
|
12924
12935
|
});
|
|
12925
12936
|
}
|
|
@@ -12936,6 +12947,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12936
12947
|
Legend: d.data[0].legend,
|
|
12937
12948
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12938
12949
|
Labelcolor: d.properties[dataLabelColor],
|
|
12950
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12939
12951
|
Axis: d.properties.axis
|
|
12940
12952
|
});
|
|
12941
12953
|
}
|
|
@@ -12949,6 +12961,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12949
12961
|
Legend: d.data[d.data.length - 1].legend,
|
|
12950
12962
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12951
12963
|
Labelcolor: d.properties[dataLabelColor],
|
|
12964
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12952
12965
|
Axis: d.properties.axis
|
|
12953
12966
|
});
|
|
12954
12967
|
}
|
|
@@ -12965,6 +12978,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12965
12978
|
Legend: d.data[i].legend,
|
|
12966
12979
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12967
12980
|
Labelcolor: d.properties[dataLabelColor],
|
|
12981
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12968
12982
|
Axis: d.properties.axis
|
|
12969
12983
|
});
|
|
12970
12984
|
}
|
|
@@ -12987,6 +13001,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12987
13001
|
Legend: d.data[i].legend,
|
|
12988
13002
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12989
13003
|
Labelcolor: d.properties[dataLabelColor],
|
|
13004
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12990
13005
|
Axis: d.properties.axis
|
|
12991
13006
|
});
|
|
12992
13007
|
}
|
|
@@ -13002,6 +13017,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13002
13017
|
Legend: d.data[0].legend,
|
|
13003
13018
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13004
13019
|
Labelcolor: d.properties[dataLabelColor],
|
|
13020
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13005
13021
|
Axis: d.properties.axis
|
|
13006
13022
|
});
|
|
13007
13023
|
break;
|
|
@@ -13013,6 +13029,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13013
13029
|
Legend: d.data[d.data.length - 1].legend,
|
|
13014
13030
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13015
13031
|
Labelcolor: d.properties[dataLabelColor],
|
|
13032
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13016
13033
|
Axis: d.properties.axis
|
|
13017
13034
|
});
|
|
13018
13035
|
break;
|
|
@@ -13024,6 +13041,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13024
13041
|
Legend: d.data[0].legend,
|
|
13025
13042
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13026
13043
|
Labelcolor: d.properties[dataLabelColor],
|
|
13044
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13027
13045
|
Axis: d.properties.axis
|
|
13028
13046
|
});
|
|
13029
13047
|
if (d.data[d.data.length - 1])
|
|
@@ -13033,6 +13051,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13033
13051
|
Legend: d.data[d.data.length - 1].legend,
|
|
13034
13052
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13035
13053
|
Labelcolor: d.properties[dataLabelColor],
|
|
13054
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13036
13055
|
Axis: d.properties.axis
|
|
13037
13056
|
});
|
|
13038
13057
|
break;
|
|
@@ -13064,7 +13083,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13064
13083
|
position: parseInt(d.LabelPosition),
|
|
13065
13084
|
currentLegend: d.Legend,
|
|
13066
13085
|
//d.Legend.replaceAll(" ", "-"), need to check for this case by space replaced with -
|
|
13067
|
-
isVisible: true
|
|
13086
|
+
isVisible: true,
|
|
13087
|
+
hoverId: d.hoverText.replace(/\s+/g, "-")
|
|
13068
13088
|
} : {
|
|
13069
13089
|
x: d.Dimension,
|
|
13070
13090
|
y: { measure: d.Measure, axis: d.Axis },
|
|
@@ -13090,7 +13110,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13090
13110
|
};
|
|
13091
13111
|
if (barChart) {
|
|
13092
13112
|
let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
13093
|
-
(responsiveXaxisLabel(dimensionList,
|
|
13113
|
+
(responsiveXaxisLabel(dimensionList, innerHeight2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
|
|
13094
13114
|
} else {
|
|
13095
13115
|
responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && (d.Axis == axisTypes.primary ? yScaleLeft(d.Measure) <= innerHeight2 && yScaleLeft(d.Measure) >= 0 : yScaleRight(d.Measure) <= innerHeight2 && yScaleRight(d.Measure) >= 0) ? annotationsList.push(singleAnnotation) : null;
|
|
13096
13116
|
}
|
|
@@ -13744,7 +13764,7 @@ const dataTablePreCalculation = (formatOptions, yLabel, yTitle, seriesData, dime
|
|
|
13744
13764
|
let dataTableHeight = 20;
|
|
13745
13765
|
if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
|
|
13746
13766
|
formatOptions.xAxisLabel.xAxisLabelVisibility = false;
|
|
13747
|
-
let exactAvailableWidth = yLabel + yTitle
|
|
13767
|
+
let exactAvailableWidth = yLabel + yTitle;
|
|
13748
13768
|
seriesData.forEach((data, i) => {
|
|
13749
13769
|
let tempObj = {
|
|
13750
13770
|
"data": data.data.filter((data2) => dimensionList.includes(data2.dimension)),
|
|
@@ -13836,14 +13856,14 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
|
|
|
13836
13856
|
selectAll("#dataTableG" + chartId).remove();
|
|
13837
13857
|
let tag = currentTag.append("g").attr("id", "dataTableG" + chartId);
|
|
13838
13858
|
dataTable.forEach((data, i) => {
|
|
13839
|
-
yCordinate = yCordinate + cellHeight;
|
|
13859
|
+
yCordinate = yCordinate + (!formatOptions.dataTableProperties.dataTableAxisLabel && i === 0 ? 0 : cellHeight);
|
|
13840
13860
|
cellHeight = data.properties.height;
|
|
13841
13861
|
getLegendsAppended(tag, i, data, cellHeight);
|
|
13842
13862
|
let parentTag = tag.append("g").attr("class", "dataTableBorder").selectAll("#scaling-svg" + chartId + " .foreignObject").data((d, pos) => data["data"]).enter().filter((d) => xAxis(d.dimension)).append("g").attr("fill", commonColors.transparent).attr(
|
|
13843
13863
|
"transform",
|
|
13844
13864
|
(d, index2) => `translate(${index2 === 0 ? 0 : xAxis(d.dimension) - cellWidth / 2},0)`
|
|
13845
13865
|
);
|
|
13846
|
-
if (i == 0) {
|
|
13866
|
+
if (i == 0 && formatOptions.dataTableProperties.dataTableAxisLabel) {
|
|
13847
13867
|
parentTag.append("foreignObject").attr("class", "dataTableColHeaders").attr("x", 0).attr("y", tableStartY).attr("id", (d, index2) => index2).attr("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).attr("height", "20px").append("xhtml:div").style("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).style("height", `${20}px`).style("border-width", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "width", "colHeaders")).style("border-style", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "style", "colHeaders")).style("border-color", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "color", "colHeaders")).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-left", "3px").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
|
|
13848
13868
|
"text-decoration",
|
|
13849
13869
|
fontStyle.includes("Underline") ? "Underline" : ""
|
|
@@ -14618,6 +14638,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
14618
14638
|
let makeAnnotations = d3Annotation2.annotation();
|
|
14619
14639
|
let connector = formatOptions.annotation.connectorType;
|
|
14620
14640
|
let labelType = formatOptions.annotation.annotationVisibility;
|
|
14641
|
+
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
14621
14642
|
let fontStyle = formatOptions.annotation.annotationFontStyle;
|
|
14622
14643
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
14623
14644
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
|
|
@@ -14725,7 +14746,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
14725
14746
|
height: 15,
|
|
14726
14747
|
width: 15
|
|
14727
14748
|
},
|
|
14728
|
-
color: d.properties
|
|
14749
|
+
color: d.properties[dataLabelColor],
|
|
14729
14750
|
type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
|
|
14730
14751
|
height,
|
|
14731
14752
|
width
|
|
@@ -14863,7 +14884,7 @@ const initXaxisBar = (formatOptions, gTag, yLabel, innerHeight2, innerWidth2, xA
|
|
|
14863
14884
|
formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : "hidden"
|
|
14864
14885
|
).style("shape-rendering", "crispEdges").style(
|
|
14865
14886
|
"stroke",
|
|
14866
|
-
formatOptions.yAxisLabel.
|
|
14887
|
+
formatOptions.yAxisLabel.yAxisColor
|
|
14867
14888
|
).attr("stroke-width", formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness);
|
|
14868
14889
|
} catch (error) {
|
|
14869
14890
|
throw error;
|
|
@@ -14936,9 +14957,12 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
|
|
|
14936
14957
|
"visibility",
|
|
14937
14958
|
formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : formatOptions.plotArea.gridLinesVertical ? "visible" : "hidden"
|
|
14938
14959
|
);
|
|
14939
|
-
YaxisG.select(".domain").style("shape-rendering", "crispEdges").
|
|
14960
|
+
YaxisG.select(".domain").style("shape-rendering", "crispEdges").attr(
|
|
14961
|
+
"stroke-width",
|
|
14962
|
+
formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
|
|
14963
|
+
).style(
|
|
14940
14964
|
"stroke",
|
|
14941
|
-
formatOptions.xAxisLabel.
|
|
14965
|
+
formatOptions.xAxisLabel.xAxisColor
|
|
14942
14966
|
);
|
|
14943
14967
|
} catch (e) {
|
|
14944
14968
|
throw e;
|
|
@@ -15434,7 +15458,7 @@ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width,
|
|
|
15434
15458
|
svg,
|
|
15435
15459
|
seriesData,
|
|
15436
15460
|
7,
|
|
15437
|
-
height -
|
|
15461
|
+
height - 35,
|
|
15438
15462
|
width - 10,
|
|
15439
15463
|
30,
|
|
15440
15464
|
position,
|
|
@@ -16911,10 +16935,10 @@ const ColumnChart = ({
|
|
|
16911
16935
|
return yScale(0);
|
|
16912
16936
|
}).attr("height", 0).attr("fill", data2.properties.color).attr(
|
|
16913
16937
|
"stroke-dasharray",
|
|
16914
|
-
(d) =>
|
|
16915
|
-
).attr("stroke-width", (d) => `${
|
|
16938
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
16939
|
+
).attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
16916
16940
|
"stroke",
|
|
16917
|
-
(d) => data2.properties.stackBorderStyle
|
|
16941
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
16918
16942
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
16919
16943
|
"visibility",
|
|
16920
16944
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17622,9 +17646,9 @@ const CustomColumnChart = ({
|
|
|
17622
17646
|
}).attr("height", (d) => {
|
|
17623
17647
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17624
17648
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
17625
|
-
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) =>
|
|
17649
|
+
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
17626
17650
|
"stroke",
|
|
17627
|
-
(d) => data2.properties.stackBorderStyle
|
|
17651
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
17628
17652
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
17629
17653
|
"visibility",
|
|
17630
17654
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17886,12 +17910,12 @@ const CustomColumnChart = ({
|
|
|
17886
17910
|
(sdata) => sdata.legend === d.key
|
|
17887
17911
|
);
|
|
17888
17912
|
const props = seriesData[seriesIndex]?.properties;
|
|
17889
|
-
return props?.stackBorderStyle
|
|
17913
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
17890
17914
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
17891
17915
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17892
17916
|
(sdata) => sdata.legend === d.key
|
|
17893
17917
|
);
|
|
17894
|
-
return seriesData[seriesIndex]?.properties.stackBorderStyle
|
|
17918
|
+
return seriesData[seriesIndex]?.properties.stackBorderStyle == 2 ? "5,3" : "0";
|
|
17895
17919
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
17896
17920
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17897
17921
|
(sdata) => sdata.legend === d.key
|
|
@@ -18495,10 +18519,10 @@ const LayeredColumnChart = ({
|
|
|
18495
18519
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
18496
18520
|
}).attr("fill", data2.properties.color).attr(
|
|
18497
18521
|
"stroke-dasharray",
|
|
18498
|
-
(d) =>
|
|
18499
|
-
).attr("stroke-width", (
|
|
18522
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
18523
|
+
).attr("stroke-width", () => `${data2.properties.stackBorderWidth}px`).attr(
|
|
18500
18524
|
"stroke",
|
|
18501
|
-
(
|
|
18525
|
+
() => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
18502
18526
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
18503
18527
|
"visibility",
|
|
18504
18528
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -18978,16 +19002,16 @@ const StackColumnChart = ({
|
|
|
18978
19002
|
return props?.color || "gray";
|
|
18979
19003
|
}).attr("stroke", (d, i, nodes) => {
|
|
18980
19004
|
const { props } = getPropsForRect(nodes, i);
|
|
18981
|
-
return props?.stackBorderStyle
|
|
19005
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
18982
19006
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
18983
19007
|
const { props } = getPropsForRect(nodes, i);
|
|
18984
|
-
return props?.stackBorderStyle
|
|
19008
|
+
return props?.stackBorderStyle == 2 ? "5,3" : "0";
|
|
18985
19009
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
18986
19010
|
const { props } = getPropsForRect(nodes, i);
|
|
18987
19011
|
return (props?.stackBorderWidth || 0) + "px";
|
|
18988
19012
|
}).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("visibility", (d, i, nodes) => {
|
|
18989
19013
|
const { props } = getPropsForRect(nodes, i);
|
|
18990
|
-
return d.data[d.key]
|
|
19014
|
+
return d.data[d.key] == 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
18991
19015
|
}).on("mousemove", (event2, d) => {
|
|
18992
19016
|
showTooltipOnMouseMove(
|
|
18993
19017
|
[
|
|
@@ -21357,7 +21381,7 @@ const LineChart = ({
|
|
|
21357
21381
|
xAxis,
|
|
21358
21382
|
dimensionHeightWidthArray,
|
|
21359
21383
|
height,
|
|
21360
|
-
|
|
21384
|
+
innerWidth2 / xScale.length,
|
|
21361
21385
|
isDateType,
|
|
21362
21386
|
innerWidth2,
|
|
21363
21387
|
innerHeight2,
|
|
@@ -22986,6 +23010,9 @@ const HorizontalBarChart = ({
|
|
|
22986
23010
|
filteredDimension = fDimension;
|
|
22987
23011
|
visibleBars = fVisibleBars;
|
|
22988
23012
|
createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
|
|
23013
|
+
if (formatOptions.xAxisLabel.hideZeroValues) {
|
|
23014
|
+
filteredDimension = filteredDimension.filter((d) => totalValueMap.get(d) !== 0);
|
|
23015
|
+
}
|
|
22989
23016
|
drawColumnChart();
|
|
22990
23017
|
};
|
|
22991
23018
|
const drawColumnChart = () => {
|
|
@@ -53976,14 +54003,15 @@ const ScatterChart = ({
|
|
|
53976
54003
|
const WaterfallChart = ({
|
|
53977
54004
|
isDateType,
|
|
53978
54005
|
formatOptions,
|
|
53979
|
-
data
|
|
54006
|
+
data,
|
|
54007
|
+
isAdvancedAnalyticsWaterFall = false
|
|
53980
54008
|
}) => {
|
|
53981
54009
|
const chartId = crypto.randomUUID?.();
|
|
53982
54010
|
let columnWidth = 0;
|
|
53983
54011
|
let colorScale;
|
|
53984
54012
|
const chartType = chartTypes.WaterfallChart;
|
|
53985
54013
|
const svgRef = useRef();
|
|
53986
|
-
const isAdvancedWaterfall =
|
|
54014
|
+
const isAdvancedWaterfall = isAdvancedAnalyticsWaterFall ?? false;
|
|
53987
54015
|
const seriesData = isAdvancedWaterfall ? [] : generalizedChartData(data.ChartData, data.DimensionList);
|
|
53988
54016
|
const dimensionList = data.DimensionList;
|
|
53989
54017
|
const barChart = false;
|
|
@@ -54639,13 +54667,14 @@ const WaterfallChart = ({
|
|
|
54639
54667
|
};
|
|
54640
54668
|
const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
|
|
54641
54669
|
const mapAdvancedWaterfallData = (rawData) => {
|
|
54642
|
-
|
|
54643
|
-
|
|
54644
|
-
|
|
54645
|
-
|
|
54646
|
-
|
|
54647
|
-
|
|
54648
|
-
|
|
54670
|
+
const tempRawDataForAAWaterfallChart = rawData[0].Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : rawData;
|
|
54671
|
+
return tempRawDataForAAWaterfallChart.map((d) => ({
|
|
54672
|
+
xKey: d.Column1 || (d.Dimension || d.Legend),
|
|
54673
|
+
base: toNumber(d.Column3 || d.Total),
|
|
54674
|
+
up: toNumber(d.Column4 || d.Up),
|
|
54675
|
+
down: toNumber(d.Column5 || d.Down),
|
|
54676
|
+
total: toNumber(d.Column6 || d.total),
|
|
54677
|
+
dimensionTotal: toNumber(d.Column2 || d.Base)
|
|
54649
54678
|
}));
|
|
54650
54679
|
};
|
|
54651
54680
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -55200,7 +55229,8 @@ const TornadoChart = ({
|
|
|
55200
55229
|
columnWidth,
|
|
55201
55230
|
isReportEditable,
|
|
55202
55231
|
isAdvanceAnalyticsChart,
|
|
55203
|
-
barChart
|
|
55232
|
+
barChart,
|
|
55233
|
+
isAdvanceAnalyticsChart
|
|
55204
55234
|
);
|
|
55205
55235
|
};
|
|
55206
55236
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -11446,7 +11446,8 @@
|
|
|
11446
11446
|
dataTableNumberFormat: ",",
|
|
11447
11447
|
dataTableDecimalPrecision: "2",
|
|
11448
11448
|
dataTableDisplayUnits: "None",
|
|
11449
|
-
dataTableLabelColor: commonColors.black
|
|
11449
|
+
dataTableLabelColor: commonColors.black,
|
|
11450
|
+
dataTableAxisLabel: true
|
|
11450
11451
|
},
|
|
11451
11452
|
dataTableOuterBorder: {
|
|
11452
11453
|
borderButtonVisibility: true,
|
|
@@ -11787,7 +11788,7 @@
|
|
|
11787
11788
|
bottom2 = xAxisRelatedMargin + 5 + scrollHeightConstant;
|
|
11788
11789
|
break;
|
|
11789
11790
|
case staticLegendPosition.bottom:
|
|
11790
|
-
bottom2 =
|
|
11791
|
+
bottom2 = 30 + xAxisRelatedMargin + scrollHeightConstant;
|
|
11791
11792
|
top2 = metrics.chartTitleHeight + 5 + (isNormalizedChart ? 12 : 0);
|
|
11792
11793
|
break;
|
|
11793
11794
|
case staticLegendPosition.left:
|
|
@@ -12840,8 +12841,15 @@
|
|
|
12840
12841
|
"visibility",
|
|
12841
12842
|
formatOptions.chartTitle.chartTitleVisibility ? "visible" : "hidden"
|
|
12842
12843
|
).attr("transform", `translate(2,2)`).attr("class", "chartTitle").attr("width", width).attr("height", chartTitleHeight + "px");
|
|
12844
|
+
const parseHTMLText = (html) => {
|
|
12845
|
+
const temp = document.createElement("div");
|
|
12846
|
+
temp.innerHTML = html;
|
|
12847
|
+
return temp.textContent || temp.innerText || "";
|
|
12848
|
+
};
|
|
12849
|
+
const hasHTML = !!formatOptions.chartTitle.chartTitleHTML;
|
|
12850
|
+
const titleText = hasHTML ? parseHTMLText(formatOptions.chartTitle.chartTitleHTML) : formatOptions.chartTitle.chartTitleText;
|
|
12843
12851
|
if (formatOptions.chartTitle.dynamicTitleText.length !== 0) {
|
|
12844
|
-
object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title",
|
|
12852
|
+
object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", titleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
|
|
12845
12853
|
formatOptions.chartTitle.chartTitleHTML ? formatOptions.chartTitle.chartTitleHTML : formatOptions.chartTitle.chartTitleText
|
|
12846
12854
|
);
|
|
12847
12855
|
} else {
|
|
@@ -12868,7 +12876,8 @@
|
|
|
12868
12876
|
if (index2 == -1) return legend;
|
|
12869
12877
|
return legend.slice(index2 + 3);
|
|
12870
12878
|
}
|
|
12871
|
-
|
|
12879
|
+
const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
|
|
12880
|
+
function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart, isAATornado) {
|
|
12872
12881
|
try {
|
|
12873
12882
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
12874
12883
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
@@ -12908,6 +12917,7 @@
|
|
|
12908
12917
|
Legend: d.data[0].legend,
|
|
12909
12918
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12910
12919
|
Labelcolor: d.properties[dataLabelColor],
|
|
12920
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12911
12921
|
Axis: d.properties.axis
|
|
12912
12922
|
});
|
|
12913
12923
|
}
|
|
@@ -12923,6 +12933,7 @@
|
|
|
12923
12933
|
Legend: d.data[d.data.length - 1].legend,
|
|
12924
12934
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12925
12935
|
Labelcolor: d.properties[dataLabelColor],
|
|
12936
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12926
12937
|
Axis: d.properties.axis
|
|
12927
12938
|
});
|
|
12928
12939
|
}
|
|
@@ -12939,6 +12950,7 @@
|
|
|
12939
12950
|
Legend: d.data[0].legend,
|
|
12940
12951
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12941
12952
|
Labelcolor: d.properties[dataLabelColor],
|
|
12953
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12942
12954
|
Axis: d.properties.axis
|
|
12943
12955
|
});
|
|
12944
12956
|
}
|
|
@@ -12952,6 +12964,7 @@
|
|
|
12952
12964
|
Legend: d.data[d.data.length - 1].legend,
|
|
12953
12965
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12954
12966
|
Labelcolor: d.properties[dataLabelColor],
|
|
12967
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12955
12968
|
Axis: d.properties.axis
|
|
12956
12969
|
});
|
|
12957
12970
|
}
|
|
@@ -12968,6 +12981,7 @@
|
|
|
12968
12981
|
Legend: d.data[i].legend,
|
|
12969
12982
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12970
12983
|
Labelcolor: d.properties[dataLabelColor],
|
|
12984
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12971
12985
|
Axis: d.properties.axis
|
|
12972
12986
|
});
|
|
12973
12987
|
}
|
|
@@ -12990,6 +13004,7 @@
|
|
|
12990
13004
|
Legend: d.data[i].legend,
|
|
12991
13005
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
12992
13006
|
Labelcolor: d.properties[dataLabelColor],
|
|
13007
|
+
hoverText: getHoverText(d, isAATornado),
|
|
12993
13008
|
Axis: d.properties.axis
|
|
12994
13009
|
});
|
|
12995
13010
|
}
|
|
@@ -13005,6 +13020,7 @@
|
|
|
13005
13020
|
Legend: d.data[0].legend,
|
|
13006
13021
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13007
13022
|
Labelcolor: d.properties[dataLabelColor],
|
|
13023
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13008
13024
|
Axis: d.properties.axis
|
|
13009
13025
|
});
|
|
13010
13026
|
break;
|
|
@@ -13016,6 +13032,7 @@
|
|
|
13016
13032
|
Legend: d.data[d.data.length - 1].legend,
|
|
13017
13033
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13018
13034
|
Labelcolor: d.properties[dataLabelColor],
|
|
13035
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13019
13036
|
Axis: d.properties.axis
|
|
13020
13037
|
});
|
|
13021
13038
|
break;
|
|
@@ -13027,6 +13044,7 @@
|
|
|
13027
13044
|
Legend: d.data[0].legend,
|
|
13028
13045
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13029
13046
|
Labelcolor: d.properties[dataLabelColor],
|
|
13047
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13030
13048
|
Axis: d.properties.axis
|
|
13031
13049
|
});
|
|
13032
13050
|
if (d.data[d.data.length - 1])
|
|
@@ -13036,6 +13054,7 @@
|
|
|
13036
13054
|
Legend: d.data[d.data.length - 1].legend,
|
|
13037
13055
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13038
13056
|
Labelcolor: d.properties[dataLabelColor],
|
|
13057
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13039
13058
|
Axis: d.properties.axis
|
|
13040
13059
|
});
|
|
13041
13060
|
break;
|
|
@@ -13067,7 +13086,8 @@
|
|
|
13067
13086
|
position: parseInt(d.LabelPosition),
|
|
13068
13087
|
currentLegend: d.Legend,
|
|
13069
13088
|
//d.Legend.replaceAll(" ", "-"), need to check for this case by space replaced with -
|
|
13070
|
-
isVisible: true
|
|
13089
|
+
isVisible: true,
|
|
13090
|
+
hoverId: d.hoverText.replace(/\s+/g, "-")
|
|
13071
13091
|
} : {
|
|
13072
13092
|
x: d.Dimension,
|
|
13073
13093
|
y: { measure: d.Measure, axis: d.Axis },
|
|
@@ -13093,7 +13113,7 @@
|
|
|
13093
13113
|
};
|
|
13094
13114
|
if (barChart) {
|
|
13095
13115
|
let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
13096
|
-
(responsiveXaxisLabel(dimensionList,
|
|
13116
|
+
(responsiveXaxisLabel(dimensionList, innerHeight2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
|
|
13097
13117
|
} else {
|
|
13098
13118
|
responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && (d.Axis == axisTypes.primary ? yScaleLeft(d.Measure) <= innerHeight2 && yScaleLeft(d.Measure) >= 0 : yScaleRight(d.Measure) <= innerHeight2 && yScaleRight(d.Measure) >= 0) ? annotationsList.push(singleAnnotation) : null;
|
|
13099
13119
|
}
|
|
@@ -13747,7 +13767,7 @@
|
|
|
13747
13767
|
let dataTableHeight = 20;
|
|
13748
13768
|
if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
|
|
13749
13769
|
formatOptions.xAxisLabel.xAxisLabelVisibility = false;
|
|
13750
|
-
let exactAvailableWidth = yLabel + yTitle
|
|
13770
|
+
let exactAvailableWidth = yLabel + yTitle;
|
|
13751
13771
|
seriesData.forEach((data, i) => {
|
|
13752
13772
|
let tempObj = {
|
|
13753
13773
|
"data": data.data.filter((data2) => dimensionList.includes(data2.dimension)),
|
|
@@ -13839,14 +13859,14 @@
|
|
|
13839
13859
|
selectAll("#dataTableG" + chartId).remove();
|
|
13840
13860
|
let tag = currentTag.append("g").attr("id", "dataTableG" + chartId);
|
|
13841
13861
|
dataTable.forEach((data, i) => {
|
|
13842
|
-
yCordinate = yCordinate + cellHeight;
|
|
13862
|
+
yCordinate = yCordinate + (!formatOptions.dataTableProperties.dataTableAxisLabel && i === 0 ? 0 : cellHeight);
|
|
13843
13863
|
cellHeight = data.properties.height;
|
|
13844
13864
|
getLegendsAppended(tag, i, data, cellHeight);
|
|
13845
13865
|
let parentTag = tag.append("g").attr("class", "dataTableBorder").selectAll("#scaling-svg" + chartId + " .foreignObject").data((d, pos) => data["data"]).enter().filter((d) => xAxis(d.dimension)).append("g").attr("fill", commonColors.transparent).attr(
|
|
13846
13866
|
"transform",
|
|
13847
13867
|
(d, index2) => `translate(${index2 === 0 ? 0 : xAxis(d.dimension) - cellWidth / 2},0)`
|
|
13848
13868
|
);
|
|
13849
|
-
if (i == 0) {
|
|
13869
|
+
if (i == 0 && formatOptions.dataTableProperties.dataTableAxisLabel) {
|
|
13850
13870
|
parentTag.append("foreignObject").attr("class", "dataTableColHeaders").attr("x", 0).attr("y", tableStartY).attr("id", (d, index2) => index2).attr("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).attr("height", "20px").append("xhtml:div").style("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).style("height", `${20}px`).style("border-width", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "width", "colHeaders")).style("border-style", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "style", "colHeaders")).style("border-color", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "color", "colHeaders")).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-left", "3px").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
|
|
13851
13871
|
"text-decoration",
|
|
13852
13872
|
fontStyle.includes("Underline") ? "Underline" : ""
|
|
@@ -14621,6 +14641,7 @@
|
|
|
14621
14641
|
let makeAnnotations = d3Annotation2.annotation();
|
|
14622
14642
|
let connector = formatOptions.annotation.connectorType;
|
|
14623
14643
|
let labelType = formatOptions.annotation.annotationVisibility;
|
|
14644
|
+
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
14624
14645
|
let fontStyle = formatOptions.annotation.annotationFontStyle;
|
|
14625
14646
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
14626
14647
|
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
|
|
@@ -14728,7 +14749,7 @@
|
|
|
14728
14749
|
height: 15,
|
|
14729
14750
|
width: 15
|
|
14730
14751
|
},
|
|
14731
|
-
color: d.properties
|
|
14752
|
+
color: d.properties[dataLabelColor],
|
|
14732
14753
|
type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
|
|
14733
14754
|
height,
|
|
14734
14755
|
width
|
|
@@ -14866,7 +14887,7 @@
|
|
|
14866
14887
|
formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : "hidden"
|
|
14867
14888
|
).style("shape-rendering", "crispEdges").style(
|
|
14868
14889
|
"stroke",
|
|
14869
|
-
formatOptions.yAxisLabel.
|
|
14890
|
+
formatOptions.yAxisLabel.yAxisColor
|
|
14870
14891
|
).attr("stroke-width", formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness);
|
|
14871
14892
|
} catch (error) {
|
|
14872
14893
|
throw error;
|
|
@@ -14939,9 +14960,12 @@
|
|
|
14939
14960
|
"visibility",
|
|
14940
14961
|
formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : formatOptions.plotArea.gridLinesVertical ? "visible" : "hidden"
|
|
14941
14962
|
);
|
|
14942
|
-
YaxisG.select(".domain").style("shape-rendering", "crispEdges").
|
|
14963
|
+
YaxisG.select(".domain").style("shape-rendering", "crispEdges").attr(
|
|
14964
|
+
"stroke-width",
|
|
14965
|
+
formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
|
|
14966
|
+
).style(
|
|
14943
14967
|
"stroke",
|
|
14944
|
-
formatOptions.xAxisLabel.
|
|
14968
|
+
formatOptions.xAxisLabel.xAxisColor
|
|
14945
14969
|
);
|
|
14946
14970
|
} catch (e) {
|
|
14947
14971
|
throw e;
|
|
@@ -15437,7 +15461,7 @@
|
|
|
15437
15461
|
svg,
|
|
15438
15462
|
seriesData,
|
|
15439
15463
|
7,
|
|
15440
|
-
height -
|
|
15464
|
+
height - 35,
|
|
15441
15465
|
width - 10,
|
|
15442
15466
|
30,
|
|
15443
15467
|
position,
|
|
@@ -16914,10 +16938,10 @@
|
|
|
16914
16938
|
return yScale(0);
|
|
16915
16939
|
}).attr("height", 0).attr("fill", data2.properties.color).attr(
|
|
16916
16940
|
"stroke-dasharray",
|
|
16917
|
-
(d) =>
|
|
16918
|
-
).attr("stroke-width", (d) => `${
|
|
16941
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
16942
|
+
).attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
16919
16943
|
"stroke",
|
|
16920
|
-
(d) => data2.properties.stackBorderStyle
|
|
16944
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
16921
16945
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
16922
16946
|
"visibility",
|
|
16923
16947
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17625,9 +17649,9 @@
|
|
|
17625
17649
|
}).attr("height", (d) => {
|
|
17626
17650
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17627
17651
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
17628
|
-
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) =>
|
|
17652
|
+
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
17629
17653
|
"stroke",
|
|
17630
|
-
(d) => data2.properties.stackBorderStyle
|
|
17654
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
17631
17655
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
17632
17656
|
"visibility",
|
|
17633
17657
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17889,12 +17913,12 @@
|
|
|
17889
17913
|
(sdata) => sdata.legend === d.key
|
|
17890
17914
|
);
|
|
17891
17915
|
const props = seriesData[seriesIndex]?.properties;
|
|
17892
|
-
return props?.stackBorderStyle
|
|
17916
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
17893
17917
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
17894
17918
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17895
17919
|
(sdata) => sdata.legend === d.key
|
|
17896
17920
|
);
|
|
17897
|
-
return seriesData[seriesIndex]?.properties.stackBorderStyle
|
|
17921
|
+
return seriesData[seriesIndex]?.properties.stackBorderStyle == 2 ? "5,3" : "0";
|
|
17898
17922
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
17899
17923
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17900
17924
|
(sdata) => sdata.legend === d.key
|
|
@@ -18498,10 +18522,10 @@
|
|
|
18498
18522
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
18499
18523
|
}).attr("fill", data2.properties.color).attr(
|
|
18500
18524
|
"stroke-dasharray",
|
|
18501
|
-
(d) =>
|
|
18502
|
-
).attr("stroke-width", (
|
|
18525
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
18526
|
+
).attr("stroke-width", () => `${data2.properties.stackBorderWidth}px`).attr(
|
|
18503
18527
|
"stroke",
|
|
18504
|
-
(
|
|
18528
|
+
() => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
18505
18529
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
18506
18530
|
"visibility",
|
|
18507
18531
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -18981,16 +19005,16 @@
|
|
|
18981
19005
|
return props?.color || "gray";
|
|
18982
19006
|
}).attr("stroke", (d, i, nodes) => {
|
|
18983
19007
|
const { props } = getPropsForRect(nodes, i);
|
|
18984
|
-
return props?.stackBorderStyle
|
|
19008
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
18985
19009
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
18986
19010
|
const { props } = getPropsForRect(nodes, i);
|
|
18987
|
-
return props?.stackBorderStyle
|
|
19011
|
+
return props?.stackBorderStyle == 2 ? "5,3" : "0";
|
|
18988
19012
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
18989
19013
|
const { props } = getPropsForRect(nodes, i);
|
|
18990
19014
|
return (props?.stackBorderWidth || 0) + "px";
|
|
18991
19015
|
}).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("visibility", (d, i, nodes) => {
|
|
18992
19016
|
const { props } = getPropsForRect(nodes, i);
|
|
18993
|
-
return d.data[d.key]
|
|
19017
|
+
return d.data[d.key] == 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
18994
19018
|
}).on("mousemove", (event2, d) => {
|
|
18995
19019
|
showTooltipOnMouseMove(
|
|
18996
19020
|
[
|
|
@@ -21360,7 +21384,7 @@
|
|
|
21360
21384
|
xAxis,
|
|
21361
21385
|
dimensionHeightWidthArray,
|
|
21362
21386
|
height,
|
|
21363
|
-
|
|
21387
|
+
innerWidth2 / xScale.length,
|
|
21364
21388
|
isDateType,
|
|
21365
21389
|
innerWidth2,
|
|
21366
21390
|
innerHeight2,
|
|
@@ -22989,6 +23013,9 @@
|
|
|
22989
23013
|
filteredDimension = fDimension;
|
|
22990
23014
|
visibleBars = fVisibleBars;
|
|
22991
23015
|
createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
|
|
23016
|
+
if (formatOptions.xAxisLabel.hideZeroValues) {
|
|
23017
|
+
filteredDimension = filteredDimension.filter((d) => totalValueMap.get(d) !== 0);
|
|
23018
|
+
}
|
|
22992
23019
|
drawColumnChart();
|
|
22993
23020
|
};
|
|
22994
23021
|
const drawColumnChart = () => {
|
|
@@ -53979,14 +54006,15 @@
|
|
|
53979
54006
|
const WaterfallChart = ({
|
|
53980
54007
|
isDateType,
|
|
53981
54008
|
formatOptions,
|
|
53982
|
-
data
|
|
54009
|
+
data,
|
|
54010
|
+
isAdvancedAnalyticsWaterFall = false
|
|
53983
54011
|
}) => {
|
|
53984
54012
|
const chartId = crypto.randomUUID?.();
|
|
53985
54013
|
let columnWidth = 0;
|
|
53986
54014
|
let colorScale;
|
|
53987
54015
|
const chartType = chartTypes.WaterfallChart;
|
|
53988
54016
|
const svgRef = require$$0$1.useRef();
|
|
53989
|
-
const isAdvancedWaterfall =
|
|
54017
|
+
const isAdvancedWaterfall = isAdvancedAnalyticsWaterFall ?? false;
|
|
53990
54018
|
const seriesData = isAdvancedWaterfall ? [] : generalizedChartData(data.ChartData, data.DimensionList);
|
|
53991
54019
|
const dimensionList = data.DimensionList;
|
|
53992
54020
|
const barChart = false;
|
|
@@ -54642,13 +54670,14 @@
|
|
|
54642
54670
|
};
|
|
54643
54671
|
const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
|
|
54644
54672
|
const mapAdvancedWaterfallData = (rawData) => {
|
|
54645
|
-
|
|
54646
|
-
|
|
54647
|
-
|
|
54648
|
-
|
|
54649
|
-
|
|
54650
|
-
|
|
54651
|
-
|
|
54673
|
+
const tempRawDataForAAWaterfallChart = rawData[0].Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : rawData;
|
|
54674
|
+
return tempRawDataForAAWaterfallChart.map((d) => ({
|
|
54675
|
+
xKey: d.Column1 || (d.Dimension || d.Legend),
|
|
54676
|
+
base: toNumber(d.Column3 || d.Total),
|
|
54677
|
+
up: toNumber(d.Column4 || d.Up),
|
|
54678
|
+
down: toNumber(d.Column5 || d.Down),
|
|
54679
|
+
total: toNumber(d.Column6 || d.total),
|
|
54680
|
+
dimensionTotal: toNumber(d.Column2 || d.Base)
|
|
54652
54681
|
}));
|
|
54653
54682
|
};
|
|
54654
54683
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -55203,7 +55232,8 @@
|
|
|
55203
55232
|
columnWidth,
|
|
55204
55233
|
isReportEditable,
|
|
55205
55234
|
isAdvanceAnalyticsChart,
|
|
55206
|
-
barChart
|
|
55235
|
+
barChart,
|
|
55236
|
+
isAdvanceAnalyticsChart
|
|
55207
55237
|
);
|
|
55208
55238
|
};
|
|
55209
55239
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|