pace-chart-lib 1.0.8 → 1.0.10
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/HorizontalBarFamily/HorizontalHistogramChart.d.ts +2 -2
- package/dist/Components/Charts/Core/CommonFunctions.d.ts +2 -1
- package/dist/Components/Charts/Core/DefaultProperties.types.d.ts +1 -0
- package/dist/pace-chart-lib.es.js +266 -340
- package/dist/pace-chart-lib.umd.js +266 -340
- package/package.json +1 -1
|
@@ -11404,7 +11404,8 @@ const defaultChartFormatOptions = {
|
|
|
11404
11404
|
dataTableFontStyle: [],
|
|
11405
11405
|
dataTableNumberFormat: ",",
|
|
11406
11406
|
dataTableDecimalPrecision: "2",
|
|
11407
|
-
dataTableDisplayUnits: "None"
|
|
11407
|
+
dataTableDisplayUnits: "None",
|
|
11408
|
+
dataTableLabelColor: "#000000"
|
|
11408
11409
|
},
|
|
11409
11410
|
dataTableOuterBorder: {
|
|
11410
11411
|
borderButtonVisibility: true,
|
|
@@ -11730,8 +11731,8 @@ function calculateVerticalMargins(windowWidth, windowHeight, maxNumberForPrimary
|
|
|
11730
11731
|
xAxisObject,
|
|
11731
11732
|
isBarChart
|
|
11732
11733
|
);
|
|
11733
|
-
const legendPosition = formatOptions.legends.legendPosition;
|
|
11734
11734
|
const legendVisibility = formatOptions.legends.legendVisibility;
|
|
11735
|
+
const legendPosition = legendVisibility ? formatOptions.legends.legendPosition : staticLegendPosition.none;
|
|
11735
11736
|
const scrollHeightConstant = isScrollbarVisible ? 12 : 0;
|
|
11736
11737
|
const xAxisRelatedMargin = isBarChart ? metrics.yTitle + metrics.yLabel : metrics.xTitle + metrics.xLabel;
|
|
11737
11738
|
let top2 = 0;
|
|
@@ -13044,7 +13045,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13044
13045
|
let axis2 = d.x.axis;
|
|
13045
13046
|
return dataLabelsPositionForBarChartFamily(formatOptions, d.x.measure ? d.x.measure : 0, d.position, requiredXScale, minValue, void 0, chartType, isSensitivityChart, axis2);
|
|
13046
13047
|
} else if (chartType === actualChartTypes.column) {
|
|
13047
|
-
return xScale(d.x) + xScaleForLegends(d.currentLegend) - (columnWidth - xScaleForLegends.bandwidth()) / 2;
|
|
13048
|
+
return xScaleForLegends(d.currentLegend) ? xScale(d.x) + xScaleForLegends(d.currentLegend) - (columnWidth - xScaleForLegends.bandwidth()) / 2 : xScale(d.x);
|
|
13048
13049
|
} else {
|
|
13049
13050
|
return xScale(d.x);
|
|
13050
13051
|
}
|
|
@@ -13062,7 +13063,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13062
13063
|
} else {
|
|
13063
13064
|
if (barChart) {
|
|
13064
13065
|
let actualColWidth = chartType === actualChartTypes.tornadoChart || chartType === actualChartTypes.layeredBarChart ? xScaleForLegends.bandwidth() : -columnWidth;
|
|
13065
|
-
return (xScaleForLegends && xScaleForLegends(d.currentLegend) ? xScaleForLegends(d.currentLegend) : 0) + xScale(d.y)
|
|
13066
|
+
return (xScaleForLegends && xScaleForLegends(d.currentLegend) ? xScaleForLegends(d.currentLegend) + xScaleForLegends.bandwidth() / 2 : 0) + xScale(d.y) - 5;
|
|
13066
13067
|
} else
|
|
13067
13068
|
return dataLabelsPosition(
|
|
13068
13069
|
d.y.measure,
|
|
@@ -13612,7 +13613,7 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
|
|
|
13612
13613
|
parentTag.append("foreignObject").attr("x", (d) => 0).attr("y", tableStartY + yCordinate).attr("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).attr("height", cellHeight).style("justify-content", "center").append("xhtml:div").attr("class", "middlepart").style("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).style("height", `${cellHeight}px`).style("line-height", `${cellHeight}px`).style("border-width", (d, pos) => getBorderStyle(formatOptions, i, pos, dimensionCount, legendsCount, "width")).style("border-style", (d, pos) => getBorderStyle(formatOptions, i, pos, dimensionCount, legendsCount, "style")).style("border-color", (d, pos) => getBorderStyle(formatOptions, i, pos, dimensionCount, legendsCount, "color")).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-inline", "3px").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
|
|
13613
13614
|
"text-decoration",
|
|
13614
13615
|
fontStyle.includes("Underline") ? "Underline" : ""
|
|
13615
|
-
).style("color",
|
|
13616
|
+
).style("color", formatOptions.dataTableProperties.dataTableLabelColor).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").attr("title", (d) => getNumberWithFormat(
|
|
13616
13617
|
chartType.includes("100stack") ? d.TooltipMeasure / d.TotalMeasure : d.TooltipMeasure || d.value,
|
|
13617
13618
|
formatOptions.dataTableProperties.dataTableDisplayUnits,
|
|
13618
13619
|
formatOptions.dataTableProperties.dataTableNumberFormat,
|
|
@@ -14461,16 +14462,18 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
14461
14462
|
y: d.data.dimension,
|
|
14462
14463
|
x: d[1] > 0 ? d[1] : d[0],
|
|
14463
14464
|
prevValue: d[0] >= 0 ? d[0] : d[1],
|
|
14464
|
-
position: d.data.labelPosition,
|
|
14465
|
+
position: formatOptions.annotation.annotationPosition == "4" ? d.data.labelPosition : JSON.parse(formatOptions.annotation.annotationPosition),
|
|
14465
14466
|
currentLegend: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key,
|
|
14466
|
-
isVisible: true
|
|
14467
|
+
isVisible: true,
|
|
14468
|
+
hoverId: d.properties.alias ? getHoverId(d.properties.alias) : getHoverId(d.key)
|
|
14467
14469
|
} : {
|
|
14468
14470
|
x: d.data.dimension,
|
|
14469
14471
|
y: d[1] > 0 ? d[1] : d[0],
|
|
14470
14472
|
prevValue: d[0] >= 0 ? d[0] : d[1],
|
|
14471
|
-
position: d.data.labelPosition,
|
|
14473
|
+
position: formatOptions.annotation.annotationPosition == "4" ? d.data.labelPosition : JSON.parse(formatOptions.annotation.annotationPosition),
|
|
14472
14474
|
currentLegend: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key,
|
|
14473
|
-
isVisible: true
|
|
14475
|
+
isVisible: true,
|
|
14476
|
+
hoverId: d.properties.alias ? getHoverId(d.properties.alias) : getHoverId(d.key)
|
|
14474
14477
|
},
|
|
14475
14478
|
dx: 0,
|
|
14476
14479
|
dy: 0,
|
|
@@ -14592,7 +14595,7 @@ const appendAnnotations = (svg, formatOptions, margin, fontStyle, makeAnnotation
|
|
|
14592
14595
|
}
|
|
14593
14596
|
});
|
|
14594
14597
|
annotations.selectAll("text").append("text").style("fill", formatOptions.annotation.annotationColor !== "#ffffff" ? formatOptions.annotation.annotationColor : "none");
|
|
14595
|
-
annotations.selectAll("tspan").attr("hoverId", (d) => d.data.currentLegend.replaceAll(" ", "-")).style("visibility", (d) => parseFloat(d.data.y) == 0 && formatOptions.annotation.annotationHideZeroValues ? "hidden" : "visible");
|
|
14598
|
+
annotations.selectAll("tspan").attr("hoverId", (d) => d.data.hoverId ? d.data.hoverId : d.data.currentLegend.replaceAll(" ", "-")).style("visibility", (d) => parseFloat(d.data.y) == 0 && formatOptions.annotation.annotationHideZeroValues ? "hidden" : "visible");
|
|
14596
14599
|
return annotations;
|
|
14597
14600
|
};
|
|
14598
14601
|
const initXaxisBar = (formatOptions, gTag, yLabel, innerHeight2, innerWidth2, xAxisBottom) => {
|
|
@@ -14613,7 +14616,10 @@ const initXaxisBar = (formatOptions, gTag, yLabel, innerHeight2, innerWidth2, xA
|
|
|
14613
14616
|
"visibility",
|
|
14614
14617
|
formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : "hidden"
|
|
14615
14618
|
);
|
|
14616
|
-
xAxisG.select(".domain").
|
|
14619
|
+
xAxisG.select(".domain").attr(
|
|
14620
|
+
"visibility",
|
|
14621
|
+
formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : "hidden"
|
|
14622
|
+
).style("shape-rendering", "crispEdges").style(
|
|
14617
14623
|
"stroke",
|
|
14618
14624
|
formatOptions.yAxisLabel.yAxisColorInverted
|
|
14619
14625
|
).attr("stroke-width", formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness);
|
|
@@ -14625,7 +14631,7 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
|
|
|
14625
14631
|
try {
|
|
14626
14632
|
let fontStyle = formatOptions.xAxisLabel.xAxisLabelFontStyle;
|
|
14627
14633
|
let xaxisLabelPosition = parseInt(formatOptions.xAxisLabel.xAxisPosition);
|
|
14628
|
-
let responsiveDimList = responsiveXaxisLabel(dimensionList,
|
|
14634
|
+
let responsiveDimList = responsiveXaxisLabel(dimensionList, innerHeight2);
|
|
14629
14635
|
let labelWidth = formatOptions.xAxisLabel.labelTextWrap ? dimensionHeightWidthArray[3] + 10 < width * 0.1 ? dimensionHeightWidthArray[3] + 10 : width * 0.1 : formatOptions.xAxisLabel.xAxisLabelRotation == 0 ? columnWidth : dimensionHeightWidthArray[0] + 5;
|
|
14630
14636
|
let xLabelMargin = formatOptions.xAxisLabel.labelTextWrap ? xLabel : labelWidth;
|
|
14631
14637
|
let formatedResponsiveDimList = isDateType ? setDateFormats(
|
|
@@ -14996,8 +15002,9 @@ const fileName$b = "CommonFunctions.ts";
|
|
|
14996
15002
|
actualChartTypes.speedometerChart,
|
|
14997
15003
|
actualChartTypes.radialBarChart
|
|
14998
15004
|
];
|
|
14999
|
-
function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions,
|
|
15005
|
+
function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, inputSeries, chartId, legendShape) {
|
|
15000
15006
|
try {
|
|
15007
|
+
let seriesData = [...inputSeries].reverse();
|
|
15001
15008
|
let position = formatOptions.legends.legendPosition;
|
|
15002
15009
|
let horizontalLegendAlignment = formatOptions.legends.legendAlignmentTopBottom;
|
|
15003
15010
|
let verticalLegendAlignment = formatOptions.legends.legendAlignment;
|
|
@@ -15767,6 +15774,7 @@ const firstFunctionBeforeRender = (svgRef, formatOptions) => {
|
|
|
15767
15774
|
const marginCalculationsForChartsWithoutAxis = (chartFormatOptions, width, height, maxLegendDimensions, margins, isVennChart = false) => {
|
|
15768
15775
|
try {
|
|
15769
15776
|
let legendPosition = chartFormatOptions.legends.legendPosition;
|
|
15777
|
+
legendPosition = chartFormatOptions.legends.legendVisibility ? chartFormatOptions.legends.legendPosition : staticLegendPosition.none;
|
|
15770
15778
|
let width15Percent = width * 0.15 * 0.8;
|
|
15771
15779
|
let legendListWidth = isVennChart ? maxLegendDimensions[0] : width15Percent < maxLegendDimensions[0] + 15 ? width15Percent : maxLegendDimensions[0] + 15;
|
|
15772
15780
|
let chartTitleHeight = chartFormatOptions.chartTitle.chartTitleVisibility ? chartFormatOptions.chartTitle.dynamicTitleText.length !== 0 ? preCalculateTextDimensions(
|
|
@@ -15780,10 +15788,10 @@ const marginCalculationsForChartsWithoutAxis = (chartFormatOptions, width, heigh
|
|
|
15780
15788
|
).height : 5;
|
|
15781
15789
|
switch (legendPosition) {
|
|
15782
15790
|
case staticLegendPosition.none:
|
|
15783
|
-
margins.top = chartTitleHeight +
|
|
15784
|
-
margins.bottom =
|
|
15785
|
-
margins.right =
|
|
15786
|
-
margins.left =
|
|
15791
|
+
margins.top = chartTitleHeight + 10;
|
|
15792
|
+
margins.bottom = 15;
|
|
15793
|
+
margins.right = 15;
|
|
15794
|
+
margins.left = 15;
|
|
15787
15795
|
break;
|
|
15788
15796
|
case staticLegendPosition.top:
|
|
15789
15797
|
margins.top = chartTitleHeight + 50;
|
|
@@ -16086,6 +16094,13 @@ const connectorNumberFormat = (numerator, denominator, decimalValues, numberForm
|
|
|
16086
16094
|
} catch (e) {
|
|
16087
16095
|
}
|
|
16088
16096
|
};
|
|
16097
|
+
const getHoverId = (inputText) => {
|
|
16098
|
+
try {
|
|
16099
|
+
return inputText.includes("~$~") ? inputText.split("~$~")[1].replace(/ /g, "-") : inputText.replace(/ /g, "-");
|
|
16100
|
+
} catch (error) {
|
|
16101
|
+
return inputText;
|
|
16102
|
+
}
|
|
16103
|
+
};
|
|
16089
16104
|
const ColumnChart = ({
|
|
16090
16105
|
isDateType,
|
|
16091
16106
|
formatOptions,
|
|
@@ -16664,7 +16679,10 @@ const CustomColumnChart = ({
|
|
|
16664
16679
|
let stackChartData = [];
|
|
16665
16680
|
const chartType = actualChartTypes.customColumnChart;
|
|
16666
16681
|
const svgRef = useRef();
|
|
16667
|
-
const seriesData = generalizedChartData(
|
|
16682
|
+
const seriesData = generalizedChartData(
|
|
16683
|
+
data.ChartData,
|
|
16684
|
+
data.DimensionList
|
|
16685
|
+
);
|
|
16668
16686
|
const dimensionList = data.DimensionList;
|
|
16669
16687
|
const barChart = false;
|
|
16670
16688
|
let isSecondaryAxisDrawn = false;
|
|
@@ -17155,7 +17173,9 @@ const CustomColumnChart = ({
|
|
|
17155
17173
|
)
|
|
17156
17174
|
).tickSize(
|
|
17157
17175
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + 0 : 0 : 0
|
|
17158
|
-
).tickValues(
|
|
17176
|
+
).tickValues(
|
|
17177
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
17178
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
17159
17179
|
}
|
|
17160
17180
|
if (isSecondaryAxisDrawn) {
|
|
17161
17181
|
yAxisRight = axisRight(yScaleRight).tickFormat(
|
|
@@ -18142,7 +18162,7 @@ const StackColumnChart = ({
|
|
|
18142
18162
|
const seriesData = generalizedChartData(
|
|
18143
18163
|
data.ChartData,
|
|
18144
18164
|
data.DimensionList
|
|
18145
|
-
);
|
|
18165
|
+
)?.reverse();
|
|
18146
18166
|
const dimensionList = data.DimensionList;
|
|
18147
18167
|
const barChart = false;
|
|
18148
18168
|
const isSecondaryAxisDrawn = false;
|
|
@@ -18463,7 +18483,7 @@ const StackColumnChart = ({
|
|
|
18463
18483
|
let columnGroups = columns.selectAll(".column-group").data((d) => d);
|
|
18464
18484
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
18465
18485
|
"hoverId",
|
|
18466
|
-
(d) => d.
|
|
18486
|
+
(d) => d[0]?.properties.alias ? getHoverId(d[0]?.properties.alias) : getHoverId(d.key)
|
|
18467
18487
|
);
|
|
18468
18488
|
columnGroups = columnGroupsEnter.merge(columnGroups);
|
|
18469
18489
|
let rects = columnGroups.selectAll("rect").data((d) => d);
|
|
@@ -18515,14 +18535,14 @@ const StackColumnChart = ({
|
|
|
18515
18535
|
);
|
|
18516
18536
|
const dim = Array.isArray(d.data.dimension) && d.data.dimension.length ? d.data.dimension[0] : d.data.dimension;
|
|
18517
18537
|
gTag.select(`#dim-background-${dim}`).attr("visibility", "visible");
|
|
18518
|
-
let legend = d.
|
|
18538
|
+
let legend = d?.properties.alias ? getHoverId(d?.properties.alias) : getHoverId(d.key);
|
|
18519
18539
|
selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
18520
18540
|
selectAll('[hoverId="' + legend + '"]').classed("highlight", true).classed("unhighlight", false);
|
|
18521
18541
|
}).on("mouseout", (event2, d) => {
|
|
18522
18542
|
hideTooltipOnMouseOut();
|
|
18523
18543
|
const dim = Array.isArray(d.data.dimension) && d.data.dimension.length ? d.data.dimension[0] : d.data.dimension;
|
|
18524
18544
|
gTag.select(`#dim-background-${dim}`).attr("visibility", "hidden");
|
|
18525
|
-
let legend = d.
|
|
18545
|
+
let legend = d?.properties.alias ? getHoverId(d?.properties.alias) : getHoverId(d.key);
|
|
18526
18546
|
selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
18527
18547
|
selectAll('[hoverId="' + legend + '"]').classed("highlight", false).classed("unhighlight", false);
|
|
18528
18548
|
});
|
|
@@ -18862,7 +18882,7 @@ const NormalizedStackColumnChart = ({
|
|
|
18862
18882
|
const seriesData = generalizedChartData(
|
|
18863
18883
|
data.ChartData,
|
|
18864
18884
|
data.DimensionList
|
|
18865
|
-
);
|
|
18885
|
+
).reverse();
|
|
18866
18886
|
const dimensionList = data.DimensionList;
|
|
18867
18887
|
const barChart = false;
|
|
18868
18888
|
const isSecondaryAxisDrawn = false;
|
|
@@ -19885,7 +19905,7 @@ const setnumberOfBubbles = (svg, legendPosition, chartFormatOptions, height, wid
|
|
|
19885
19905
|
function logError$1(fileName2, functionName, error) {
|
|
19886
19906
|
console.error(`[${fileName2}] [${functionName}]`, error);
|
|
19887
19907
|
}
|
|
19888
|
-
const ColumnHistogramChart = ({
|
|
19908
|
+
const ColumnHistogramChart$1 = ({
|
|
19889
19909
|
isDateType,
|
|
19890
19910
|
formatOptions,
|
|
19891
19911
|
data
|
|
@@ -19894,7 +19914,7 @@ const ColumnHistogramChart = ({
|
|
|
19894
19914
|
const columnWidth = 0;
|
|
19895
19915
|
const chartType = actualChartTypes.columnHistogram;
|
|
19896
19916
|
const svgRef = useRef();
|
|
19897
|
-
const seriesData =
|
|
19917
|
+
const seriesData = data.ChartData;
|
|
19898
19918
|
const dimensionList = data.DimensionList;
|
|
19899
19919
|
const barChart = false;
|
|
19900
19920
|
const isSecondaryAxisDrawn = false;
|
|
@@ -20188,7 +20208,8 @@ const ColumnHistogramChart = ({
|
|
|
20188
20208
|
};
|
|
20189
20209
|
const initScale = () => {
|
|
20190
20210
|
xScale = linear$1().domain([chartJSON.xMin, chartJSON.xMax]).range([0, innerWidth2]);
|
|
20191
|
-
|
|
20211
|
+
const numberOfBins = periods.length > 0 ? periods : xScale.ticks(thresholds);
|
|
20212
|
+
let histogram = bin().value((d) => d).domain(xScale.domain()).thresholds(numberOfBins);
|
|
20192
20213
|
filteredData.forEach((d) => {
|
|
20193
20214
|
let tempArray = histogram(d.data.map((val) => val.value));
|
|
20194
20215
|
bins.push(tempArray);
|
|
@@ -20246,7 +20267,7 @@ const ColumnHistogramChart = ({
|
|
|
20246
20267
|
)
|
|
20247
20268
|
).tickSize(
|
|
20248
20269
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
|
|
20249
|
-
).
|
|
20270
|
+
).tickSizeOuter(0);
|
|
20250
20271
|
formatOptions.bins.binsCalculation === "Automatic" ? xAxis.ticks(thresholds) : xAxis.tickValues(periods).ticks(innerWidth2 / 50);
|
|
20251
20272
|
};
|
|
20252
20273
|
const getChartType = (lineData) => {
|
|
@@ -20278,6 +20299,7 @@ const ColumnHistogramChart = ({
|
|
|
20278
20299
|
event2
|
|
20279
20300
|
);
|
|
20280
20301
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
20302
|
+
gTag.selectAll(".parentGroup").raise();
|
|
20281
20303
|
};
|
|
20282
20304
|
const setSVGContainer = (margin2) => {
|
|
20283
20305
|
innerWidth2 = width - margin2.left - margin2.right;
|
|
@@ -20297,7 +20319,6 @@ const ColumnHistogramChart = ({
|
|
|
20297
20319
|
(d) => filteredDimension.includes(d.dimension)
|
|
20298
20320
|
)
|
|
20299
20321
|
);
|
|
20300
|
-
getXAxis();
|
|
20301
20322
|
svg2.append("rect").attr("x", margin2.left).attr("y", scrollbarY).attr("width", innerWidth22).attr("height", 8).attr("fill", "#ddd").attr("rx", 4);
|
|
20302
20323
|
const handleWidth = innerWidth22 * visibleBars / chartJSON.dimensionList.length;
|
|
20303
20324
|
const handle = svg2.append("rect").attr("x", margin2.left).attr("y", scrollbarY).attr("width", handleWidth).attr("height", 8).attr("fill", "#999").attr("rx", 4).style("cursor", "ew-resize").call(
|
|
@@ -20344,7 +20365,6 @@ const ColumnHistogramChart = ({
|
|
|
20344
20365
|
drawColumnChart();
|
|
20345
20366
|
};
|
|
20346
20367
|
const drawColumnChart = () => {
|
|
20347
|
-
getChartType();
|
|
20348
20368
|
initXaxis$1(
|
|
20349
20369
|
gTag,
|
|
20350
20370
|
chartJSON,
|
|
@@ -20361,6 +20381,7 @@ const ColumnHistogramChart = ({
|
|
|
20361
20381
|
innerHeight2,
|
|
20362
20382
|
filteredDimension
|
|
20363
20383
|
);
|
|
20384
|
+
getChartType();
|
|
20364
20385
|
};
|
|
20365
20386
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
20366
20387
|
"svg",
|
|
@@ -20932,7 +20953,7 @@ const StackLineChart = ({
|
|
|
20932
20953
|
const seriesData = generalizedChartData(
|
|
20933
20954
|
data.ChartData,
|
|
20934
20955
|
data.DimensionList
|
|
20935
|
-
);
|
|
20956
|
+
)?.reverse() || [];
|
|
20936
20957
|
const dimensionList = data.DimensionList;
|
|
20937
20958
|
const barChart = false;
|
|
20938
20959
|
const isSecondaryAxisDrawn = false;
|
|
@@ -21472,7 +21493,7 @@ const NormalisedStackLineChart = ({
|
|
|
21472
21493
|
const seriesData = generalizedChartData(
|
|
21473
21494
|
data.ChartData,
|
|
21474
21495
|
data.DimensionList
|
|
21475
|
-
);
|
|
21496
|
+
)?.reverse() || [];
|
|
21476
21497
|
const dimensionList = data.DimensionList;
|
|
21477
21498
|
const barChart = false;
|
|
21478
21499
|
const isSecondaryAxisDrawn = false;
|
|
@@ -21774,7 +21795,7 @@ const NormalisedStackLineChart = ({
|
|
|
21774
21795
|
const lineGenerator = line$1().x(
|
|
21775
21796
|
(d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
|
|
21776
21797
|
).y((d) => d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0])).curve(getCurveType(formatOptions));
|
|
21777
|
-
let lines = gTag.selectAll(".parentGroup").data([stackChartData
|
|
21798
|
+
let lines = gTag.selectAll(".parentGroup").data([stackChartData]);
|
|
21778
21799
|
lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
|
|
21779
21800
|
let lineGroups = lines.selectAll(".line-group").data((d) => d);
|
|
21780
21801
|
let lineGroupsEnter = lineGroups.enter().append("g").attr("class", (d) => "line-group " + d.key.replace(/ /g, "-"));
|
|
@@ -22472,7 +22493,7 @@ const StackHorizontalChart = ({
|
|
|
22472
22493
|
const seriesData = generalizedChartData(
|
|
22473
22494
|
data.ChartData,
|
|
22474
22495
|
data.DimensionList
|
|
22475
|
-
);
|
|
22496
|
+
)?.reverse();
|
|
22476
22497
|
const dimensionList = data.DimensionList;
|
|
22477
22498
|
const barChart = true;
|
|
22478
22499
|
const isSecondaryAxisDrawn = false;
|
|
@@ -23162,7 +23183,7 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
23162
23183
|
let columnWidth = 0;
|
|
23163
23184
|
const chartType = actualChartTypes.stackBar100;
|
|
23164
23185
|
const svgRef = useRef();
|
|
23165
|
-
const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
|
|
23186
|
+
const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse();
|
|
23166
23187
|
const dimensionList = data.DimensionList;
|
|
23167
23188
|
const barChart = true;
|
|
23168
23189
|
const isSecondaryAxisDrawn = false;
|
|
@@ -23316,6 +23337,7 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
23316
23337
|
margin,
|
|
23317
23338
|
yTitle,
|
|
23318
23339
|
yLabel,
|
|
23340
|
+
void 0,
|
|
23319
23341
|
xTitle,
|
|
23320
23342
|
xLabel
|
|
23321
23343
|
);
|
|
@@ -23455,7 +23477,7 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
23455
23477
|
filteredDimension.forEach((dim) => {
|
|
23456
23478
|
gTag.append("rect").attr("id", `dim-background-${dim}`).attr("class", "dimension-background").attr("y", yScale(dim) - yScale.bandwidth() / 2).attr("height", yScale.bandwidth()).attr("x", 0).attr("width", innerWidth2).attr("fill", "#E5E5E5").attr("visibility", "hidden").lower();
|
|
23457
23479
|
});
|
|
23458
|
-
let columns = gTag.selectAll(".parentGroup").data([stackChartData
|
|
23480
|
+
let columns = gTag.selectAll(".parentGroup").data([stackChartData]);
|
|
23459
23481
|
columns = columns.enter().append("g").attr("class", "columns parentGroup").merge(columns);
|
|
23460
23482
|
let columnGroups = columns.selectAll(".column-group").data((d) => d);
|
|
23461
23483
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
@@ -24295,26 +24317,28 @@ const LayeredHorizontalBarChart = ({
|
|
|
24295
24317
|
}
|
|
24296
24318
|
) });
|
|
24297
24319
|
};
|
|
24298
|
-
const
|
|
24320
|
+
const ColumnHistogramChart = ({
|
|
24299
24321
|
isDateType,
|
|
24300
24322
|
formatOptions,
|
|
24301
24323
|
data
|
|
24302
24324
|
}) => {
|
|
24303
24325
|
const chartId = crypto.randomUUID();
|
|
24304
|
-
|
|
24305
|
-
const chartType = actualChartTypes.
|
|
24326
|
+
const columnWidth = 0;
|
|
24327
|
+
const chartType = actualChartTypes.columnHistogram;
|
|
24306
24328
|
const svgRef = useRef();
|
|
24307
|
-
const seriesData =
|
|
24329
|
+
const seriesData = data.ChartData;
|
|
24308
24330
|
const dimensionList = data.DimensionList;
|
|
24309
|
-
const barChart =
|
|
24310
|
-
|
|
24331
|
+
const barChart = false;
|
|
24332
|
+
const isSecondaryAxisDrawn = false;
|
|
24311
24333
|
const isNormalizedChart = false;
|
|
24312
24334
|
let customYaxisMinValue = parseFloat(formatOptions.yAxisLabel.yAxisMinText);
|
|
24313
24335
|
let customYaxisMaxValue = parseFloat(formatOptions.yAxisLabel.yAxisMaxText);
|
|
24314
|
-
let
|
|
24336
|
+
let customXaxisMinValue = parseFloat(formatOptions.xAxisLabel.xAxisMinText);
|
|
24337
|
+
let customXaxisMaxValue = parseFloat(formatOptions.xAxisLabel.xAxisMaxText);
|
|
24338
|
+
parseFloat(
|
|
24315
24339
|
formatOptions.secondaryYAxisLabel.secondaryYAxisMinText
|
|
24316
24340
|
);
|
|
24317
|
-
|
|
24341
|
+
parseFloat(
|
|
24318
24342
|
formatOptions.secondaryYAxisLabel.secondaryYAxisMaxText
|
|
24319
24343
|
);
|
|
24320
24344
|
let margin;
|
|
@@ -24331,21 +24355,21 @@ const HorizontalHistogramChart = ({
|
|
|
24331
24355
|
let maxNumberForSecondaryAxis;
|
|
24332
24356
|
let innerWidth2;
|
|
24333
24357
|
let innerHeight2;
|
|
24358
|
+
let thresholds;
|
|
24359
|
+
let periods = [];
|
|
24360
|
+
let bins = [];
|
|
24334
24361
|
let width;
|
|
24335
24362
|
let height;
|
|
24336
24363
|
let dataTable;
|
|
24337
24364
|
let dataTableHeight;
|
|
24338
24365
|
let svg;
|
|
24339
24366
|
let gTag;
|
|
24340
|
-
let
|
|
24341
|
-
let
|
|
24342
|
-
let
|
|
24343
|
-
let xScaleTop;
|
|
24367
|
+
let yScaleLeft;
|
|
24368
|
+
let xScale;
|
|
24369
|
+
let xScaleForLegends;
|
|
24344
24370
|
let calculatedRange;
|
|
24345
|
-
let
|
|
24346
|
-
let
|
|
24347
|
-
let xAxisTop;
|
|
24348
|
-
let yAxis;
|
|
24371
|
+
let yAxisLeft;
|
|
24372
|
+
let xAxis;
|
|
24349
24373
|
let filteredDimension;
|
|
24350
24374
|
let filteredData = [];
|
|
24351
24375
|
let scrollPosition = 0;
|
|
@@ -24366,12 +24390,12 @@ const HorizontalHistogramChart = ({
|
|
|
24366
24390
|
};
|
|
24367
24391
|
useEffect(() => {
|
|
24368
24392
|
try {
|
|
24369
|
-
|
|
24393
|
+
createColumnChart();
|
|
24370
24394
|
} catch (error) {
|
|
24371
|
-
logError$2("
|
|
24395
|
+
logError$2("Columnchart", "createColumnChart", error);
|
|
24372
24396
|
}
|
|
24373
24397
|
}, [formatOptions]);
|
|
24374
|
-
const
|
|
24398
|
+
const createColumnChart = () => {
|
|
24375
24399
|
({ formatOptions, svg, width, height } = firstFunctionBeforeRender$1(
|
|
24376
24400
|
svgRef,
|
|
24377
24401
|
formatOptions
|
|
@@ -24409,8 +24433,7 @@ const HorizontalHistogramChart = ({
|
|
|
24409
24433
|
chartJSON.yMaxRight,
|
|
24410
24434
|
isSecondaryAxisDrawn,
|
|
24411
24435
|
isNormalizedChart,
|
|
24412
|
-
isDateType
|
|
24413
|
-
barChart
|
|
24436
|
+
isDateType
|
|
24414
24437
|
));
|
|
24415
24438
|
setSVGContainer(margin);
|
|
24416
24439
|
({ dataTable, dataTableHeight } = dataTablePreCalculation(
|
|
@@ -24437,33 +24460,17 @@ const HorizontalHistogramChart = ({
|
|
|
24437
24460
|
innerHeight2,
|
|
24438
24461
|
chartType
|
|
24439
24462
|
);
|
|
24463
|
+
binsCalculation();
|
|
24440
24464
|
initScale();
|
|
24441
24465
|
initAxis();
|
|
24442
|
-
|
|
24443
|
-
formatOptions,
|
|
24466
|
+
initYaxis$1(
|
|
24444
24467
|
gTag,
|
|
24445
|
-
|
|
24446
|
-
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
xScaleBottom,
|
|
24451
|
-
chartJSON.yMaxLeft,
|
|
24452
|
-
filteredDimension,
|
|
24453
|
-
chartType,
|
|
24454
|
-
isDateType,
|
|
24455
|
-
width,
|
|
24456
|
-
dimensionHeightWidthArray,
|
|
24457
|
-
columnWidth
|
|
24468
|
+
formatOptions,
|
|
24469
|
+
dataTableHeight,
|
|
24470
|
+
yLabel,
|
|
24471
|
+
yAxisLeft,
|
|
24472
|
+
innerHeight2
|
|
24458
24473
|
);
|
|
24459
|
-
if (isSecondaryAxisDrawn) {
|
|
24460
|
-
initXaxisTop(
|
|
24461
|
-
formatOptions,
|
|
24462
|
-
gTag,
|
|
24463
|
-
secondaryYLabel,
|
|
24464
|
-
xAxisTop
|
|
24465
|
-
);
|
|
24466
|
-
}
|
|
24467
24474
|
horizontalScrollBar2(seriesData, height, svg, margin, innerWidth2);
|
|
24468
24475
|
if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
|
|
24469
24476
|
if (formatOptions.xAxisLabel.xAxisPosition != "1")
|
|
@@ -24474,9 +24481,9 @@ const HorizontalHistogramChart = ({
|
|
|
24474
24481
|
gTag,
|
|
24475
24482
|
dataTable,
|
|
24476
24483
|
columnWidth,
|
|
24477
|
-
|
|
24478
|
-
|
|
24479
|
-
|
|
24484
|
+
yScaleLeft,
|
|
24485
|
+
xScale,
|
|
24486
|
+
xScaleForLegends,
|
|
24480
24487
|
void 0,
|
|
24481
24488
|
void 0,
|
|
24482
24489
|
dataTableHeight,
|
|
@@ -24544,117 +24551,109 @@ const HorizontalHistogramChart = ({
|
|
|
24544
24551
|
const preProcessChartData = () => {
|
|
24545
24552
|
const allChartData = [];
|
|
24546
24553
|
const legendList = [];
|
|
24547
|
-
let
|
|
24554
|
+
let cumulativeDataPoints = [];
|
|
24548
24555
|
let yMaxLeft = -Infinity;
|
|
24549
24556
|
let yMinLeft = Infinity;
|
|
24550
|
-
let yMaxRight = -Infinity;
|
|
24551
|
-
let yMinRight = Infinity;
|
|
24552
24557
|
seriesData.forEach((series) => {
|
|
24553
24558
|
legendList.push(series.legend);
|
|
24554
24559
|
series.data.forEach((point2) => {
|
|
24555
24560
|
allChartData.push(point2);
|
|
24556
|
-
|
|
24557
|
-
|
|
24558
|
-
yMaxRight = Math.max(yMaxRight, point2.value);
|
|
24559
|
-
yMinRight = Math.min(yMinRight, point2.value);
|
|
24560
|
-
} else {
|
|
24561
|
-
yMaxLeft = Math.max(yMaxLeft, point2.value);
|
|
24562
|
-
yMinLeft = Math.min(yMinLeft, point2.value);
|
|
24563
|
-
}
|
|
24561
|
+
yMaxLeft = Math.max(yMaxLeft, point2.value);
|
|
24562
|
+
yMinLeft = Math.min(yMinLeft, point2.value);
|
|
24564
24563
|
});
|
|
24565
24564
|
});
|
|
24566
24565
|
chartJSON.chartData = allChartData;
|
|
24567
24566
|
chartJSON.legendList = legendList;
|
|
24568
24567
|
chartJSON.yMaxLeft = yMaxLeft;
|
|
24569
24568
|
chartJSON.yMinLeft = yMinLeft > 0 ? 0 : yMinLeft;
|
|
24570
|
-
chartJSON.yMaxRight = yMaxRight;
|
|
24571
|
-
chartJSON.yMinRight = yMinRight;
|
|
24572
|
-
formatedDimensionList = isDateType ? setDateFormats(
|
|
24573
|
-
formatOptions.xAxisLabel.xAxisNumberFormat,
|
|
24574
|
-
chartJSON.dimensionList
|
|
24575
|
-
).map((d) => d) : chartJSON.dimensionList;
|
|
24576
|
-
chartJSON.dimensionList.forEach((dim, i) => {
|
|
24577
|
-
chartJSON.formattedDimensionListMap.set(dim, formatedDimensionList[i]);
|
|
24578
|
-
});
|
|
24579
24569
|
filteredData = JSON.parse(JSON.stringify(seriesData));
|
|
24580
|
-
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
|
|
24584
|
-
|
|
24585
|
-
|
|
24586
|
-
|
|
24587
|
-
|
|
24588
|
-
if (formatOptions.plotArea.hideZeroValues) {
|
|
24589
|
-
chartJSON.hideZeroValues = true;
|
|
24590
|
-
}
|
|
24570
|
+
filteredData.forEach(
|
|
24571
|
+
(d) => d.data.forEach((j) => cumulativeDataPoints.push(j.value))
|
|
24572
|
+
);
|
|
24573
|
+
let yMin = customYaxisMinValue || customYaxisMinValue == 0 ? customYaxisMinValue : 0;
|
|
24574
|
+
let yMax = customYaxisMaxValue || customYaxisMaxValue == 0 ? customYaxisMaxValue : filteredData[0]?.data?.length;
|
|
24575
|
+
chartJSON.yMaxLeft = parseFloat((yMin + "").length > (yMax + "").length ? yMin + "" : yMax + "");
|
|
24576
|
+
chartJSON.xMax = max$2(cumulativeDataPoints);
|
|
24577
|
+
chartJSON.xMin = min$2(cumulativeDataPoints);
|
|
24591
24578
|
};
|
|
24592
|
-
const
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
24600
|
-
|
|
24601
|
-
|
|
24602
|
-
chartJSON.yMaxLeft = yAxisLabelArray[yAxisLabelArray.length - 1];
|
|
24603
|
-
chartJSON.yMinLeft = yAxisLabelArray[0];
|
|
24604
|
-
{
|
|
24605
|
-
xScaleBottom = linear$1().domain([
|
|
24606
|
-
chartJSON.yMinLeft >= 0 ? customYaxisMinValue !== void 0 && !Number.isNaN(customYaxisMinValue) ? customYaxisMinValue : 0 : chartJSON.yMinLeft < 0 ? chartJSON.yMinLeft * 1.1 : chartJSON.yMinLeft * 0.9,
|
|
24607
|
-
chartJSON.yMaxLeft <= 0 ? 0 : customYaxisMaxValue !== void 0 && !Number.isNaN(customYaxisMaxValue) ? customYaxisMaxValue : chartJSON.yMaxLeft * 1.1
|
|
24608
|
-
]).range([
|
|
24609
|
-
0,
|
|
24610
|
-
dataTableHeight > 0 ? innerWidth2 - dataTableHeight : innerWidth2
|
|
24611
|
-
]);
|
|
24579
|
+
const binsCalculation = () => {
|
|
24580
|
+
switch (formatOptions.bins.binsCalculation) {
|
|
24581
|
+
case "Automatic":
|
|
24582
|
+
thresholds = innerWidth2 / 50;
|
|
24583
|
+
break;
|
|
24584
|
+
case "Number of Bins":
|
|
24585
|
+
calculatingPeriodsWithBins(false);
|
|
24586
|
+
break;
|
|
24587
|
+
case "Bin Width":
|
|
24588
|
+
calculatingPeriodsWithBins(true);
|
|
24612
24589
|
}
|
|
24613
|
-
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24618
|
-
|
|
24619
|
-
|
|
24620
|
-
|
|
24590
|
+
};
|
|
24591
|
+
const calculatingPeriodsWithBins = (isWithWidth) => {
|
|
24592
|
+
filteredData.forEach(
|
|
24593
|
+
(d) => d.data.sort(function(a2, b) {
|
|
24594
|
+
return a2.value - b.value;
|
|
24595
|
+
})
|
|
24596
|
+
);
|
|
24597
|
+
let range2 = chartJSON.xMax - chartJSON.xMin;
|
|
24598
|
+
let tempPeriod;
|
|
24599
|
+
if (isWithWidth) {
|
|
24600
|
+
parseFloat(formatOptions.bins.binsCalculationValue) <= 2 && (formatOptions.bins.binsCalculationValue = "3");
|
|
24601
|
+
tempPeriod = range2 / parseFloat(formatOptions.bins.binsCalculationValue);
|
|
24602
|
+
} else {
|
|
24603
|
+
parseFloat(formatOptions.bins.binsCalculationValue) <= 1 && (formatOptions.bins.binsCalculationValue = "1");
|
|
24604
|
+
tempPeriod = range2 / parseFloat(formatOptions.bins.binsCalculationValue);
|
|
24621
24605
|
}
|
|
24622
|
-
|
|
24623
|
-
if (
|
|
24624
|
-
|
|
24625
|
-
|
|
24626
|
-
|
|
24627
|
-
|
|
24628
|
-
|
|
24629
|
-
|
|
24630
|
-
|
|
24631
|
-
)
|
|
24632
|
-
|
|
24633
|
-
|
|
24634
|
-
|
|
24606
|
+
let currentElement = chartJSON.xMin;
|
|
24607
|
+
if (isWithWidth) {
|
|
24608
|
+
periods = [currentElement];
|
|
24609
|
+
while (currentElement < chartJSON.xMax) {
|
|
24610
|
+
currentElement += tempPeriod;
|
|
24611
|
+
periods.push(currentElement);
|
|
24612
|
+
}
|
|
24613
|
+
} else {
|
|
24614
|
+
periods = [currentElement];
|
|
24615
|
+
while (Math.round(currentElement) < Math.round(chartJSON.xMax)) {
|
|
24616
|
+
currentElement += tempPeriod;
|
|
24617
|
+
periods.push(Math.round(currentElement));
|
|
24618
|
+
}
|
|
24635
24619
|
}
|
|
24636
|
-
getYScale();
|
|
24637
24620
|
};
|
|
24638
|
-
const
|
|
24639
|
-
|
|
24640
|
-
|
|
24641
|
-
|
|
24621
|
+
const initScale = () => {
|
|
24622
|
+
xScale = linear$1().domain([chartJSON.xMin, chartJSON.xMax]).range([0, innerWidth2]);
|
|
24623
|
+
const numberOfBins = periods.length > 0 ? periods : xScale.ticks(thresholds);
|
|
24624
|
+
let histogram = bin().value((d) => d).domain(xScale.domain()).thresholds(numberOfBins);
|
|
24625
|
+
filteredData.forEach((d) => {
|
|
24626
|
+
let tempArray = histogram(d.data.map((val) => val.value));
|
|
24627
|
+
bins.push(tempArray);
|
|
24628
|
+
});
|
|
24629
|
+
filteredData.forEach(
|
|
24630
|
+
(d, i) => bins[i].forEach((j) => {
|
|
24631
|
+
j["name"] = d.properties["legend"];
|
|
24632
|
+
j["color"] = d.properties["color"];
|
|
24633
|
+
j["opacity"] = d.properties["opacity"];
|
|
24634
|
+
})
|
|
24642
24635
|
);
|
|
24643
|
-
|
|
24636
|
+
let cumulativeLength = [];
|
|
24637
|
+
bins.forEach((d) => d.forEach((j) => cumulativeLength.push(j.length)));
|
|
24638
|
+
chartJSON.yMaxLeft = max$2(cumulativeLength);
|
|
24639
|
+
chartJSON.yMinLeft = min$2(cumulativeLength);
|
|
24640
|
+
yScaleLeft = linear$1().range([innerHeight2, 0]).domain([customYaxisMinValue || customYaxisMinValue == 0 ? customYaxisMinValue : 0, customYaxisMaxValue || customYaxisMaxValue == 0 ? customYaxisMaxValue : chartJSON.yMaxLeft + 0.2 * chartJSON.yMaxLeft]);
|
|
24644
24641
|
};
|
|
24645
24642
|
const initAxis = () => {
|
|
24646
|
-
|
|
24643
|
+
getXAxis();
|
|
24647
24644
|
{
|
|
24648
24645
|
let responsiveLablesObj = responsiveYaxisLabel$1(
|
|
24649
|
-
|
|
24646
|
+
chartJSON.yMaxLeft,
|
|
24650
24647
|
chartJSON.yMinLeft,
|
|
24651
24648
|
innerHeight2,
|
|
24652
24649
|
formatOptions,
|
|
24653
24650
|
chartJSON,
|
|
24654
24651
|
customYaxisMinValue,
|
|
24655
|
-
customYaxisMaxValue
|
|
24652
|
+
customYaxisMaxValue,
|
|
24653
|
+
false,
|
|
24654
|
+
innerWidth2
|
|
24656
24655
|
);
|
|
24657
|
-
|
|
24656
|
+
yAxisLeft = axisLeft(yScaleLeft).tickFormat(
|
|
24658
24657
|
(d) => getNumberWithFormat(
|
|
24659
24658
|
d,
|
|
24660
24659
|
formatOptions.yAxisLabel.yAxisDisplayUnits,
|
|
@@ -24662,116 +24661,57 @@ const HorizontalHistogramChart = ({
|
|
|
24662
24661
|
formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
|
|
24663
24662
|
)
|
|
24664
24663
|
).tickSize(
|
|
24665
|
-
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -
|
|
24664
|
+
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + 0 : 0 : 0
|
|
24666
24665
|
).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
24667
24666
|
}
|
|
24668
|
-
if (isSecondaryAxisDrawn) {
|
|
24669
|
-
xAxisTop = axisTop(xScaleTop).tickFormat(
|
|
24670
|
-
(d) => getNumberWithFormat(
|
|
24671
|
-
d,
|
|
24672
|
-
formatOptions.secondaryYAxisLabel.secondaryYAxisDisplayUnits,
|
|
24673
|
-
formatOptions.secondaryYAxisLabel.secondaryYAxisNumberFormat,
|
|
24674
|
-
formatOptions.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision
|
|
24675
|
-
)
|
|
24676
|
-
).tickValues(
|
|
24677
|
-
responsiveSecondaryYaxisLabel(
|
|
24678
|
-
secondaryCustomYaxisMaxValue ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight,
|
|
24679
|
-
chartJSON.yMinRight,
|
|
24680
|
-
formatOptions,
|
|
24681
|
-
chartJSON
|
|
24682
|
-
).secondaryYAxisLabelArray
|
|
24683
|
-
).ticks(
|
|
24684
|
-
responsiveSecondaryYaxisLabel(
|
|
24685
|
-
secondaryCustomYaxisMaxValue ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight,
|
|
24686
|
-
chartJSON.yMinRight,
|
|
24687
|
-
formatOptions,
|
|
24688
|
-
chartJSON
|
|
24689
|
-
).secondaryCustomTickValue ?? innerHeight2 / 30
|
|
24690
|
-
).tickSize(
|
|
24691
|
-
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
|
|
24692
|
-
).tickPadding(8).tickSizeOuter(0);
|
|
24693
|
-
}
|
|
24694
24667
|
};
|
|
24695
|
-
const
|
|
24696
|
-
|
|
24668
|
+
const getXAxis = () => {
|
|
24669
|
+
let xaxisLabelPosition = parseInt(formatOptions.xAxisLabel.xAxisPosition);
|
|
24670
|
+
let labelArray = responsiveXaxisLabelForNumericValue(chartJSON.xMax, chartJSON.xMin, innerWidth2, formatOptions, customXaxisMinValue, customXaxisMaxValue, innerHeight2, false).xAxisLabelArray;
|
|
24671
|
+
labelArray.shift();
|
|
24672
|
+
xAxis = (xaxisLabelPosition == 1 ? axisTop(xScale) : axisBottom(xScale)).tickFormat(
|
|
24673
|
+
(d) => getNumberWithFormat(
|
|
24674
|
+
d,
|
|
24675
|
+
formatOptions.xAxisLabel.xAxisDisplayUnits,
|
|
24676
|
+
formatOptions.xAxisLabel.xAxisNumberFormat,
|
|
24677
|
+
formatOptions.xAxisLabel.xAxisLabelDecimalPrecision,
|
|
24678
|
+
false
|
|
24679
|
+
)
|
|
24680
|
+
).tickSize(
|
|
24697
24681
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
|
|
24698
|
-
).tickSizeOuter(0)
|
|
24682
|
+
).tickSizeOuter(0);
|
|
24683
|
+
formatOptions.bins.binsCalculation === "Automatic" ? xAxis.ticks(thresholds) : xAxis.tickValues(periods).ticks(innerWidth2 / 50);
|
|
24699
24684
|
};
|
|
24700
24685
|
const getChartType = (lineData) => {
|
|
24701
|
-
|
|
24702
|
-
|
|
24703
|
-
|
|
24704
|
-
|
|
24705
|
-
|
|
24706
|
-
|
|
24707
|
-
|
|
24708
|
-
|
|
24709
|
-
|
|
24710
|
-
|
|
24711
|
-
|
|
24712
|
-
|
|
24713
|
-
|
|
24714
|
-
|
|
24715
|
-
|
|
24716
|
-
|
|
24717
|
-
|
|
24718
|
-
|
|
24719
|
-
|
|
24720
|
-
|
|
24721
|
-
|
|
24722
|
-
|
|
24723
|
-
|
|
24724
|
-
|
|
24686
|
+
gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(bins).enter().append("g").selectAll("rect").data((d) => d).enter().append("rect").attr("class", "rect").attr("stroke", formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderColor).attr(
|
|
24687
|
+
"stroke-width",
|
|
24688
|
+
formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderThickness
|
|
24689
|
+
).attr(
|
|
24690
|
+
"stroke-opacity",
|
|
24691
|
+
formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderOpacity
|
|
24692
|
+
).attr("x", 1).attr("transform", function(d) {
|
|
24693
|
+
return "translate(" + xScale(d.x0) + "," + (yScaleLeft(d.length) > 0 ? yScaleLeft(d.length) : 0) + ")";
|
|
24694
|
+
}).attr("width", function(d) {
|
|
24695
|
+
return xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth) < 0 ? 0 : xScale(d.x1) - xScale(d.x0) - parseFloat(formatOptions.bins.binsGapWidth);
|
|
24696
|
+
}).attr("height", function(d) {
|
|
24697
|
+
return innerHeight2 - yScaleLeft(d.length);
|
|
24698
|
+
}).style("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
24699
|
+
showTooltipOnMouseMove(
|
|
24700
|
+
[
|
|
24701
|
+
{
|
|
24702
|
+
key: formatOptions.xAxisTitle.xAxisTitleText.includes("~$~") ? formatOptions.xAxisTitle.xAxisTitleText.split("~$~")[1] : formatOptions.xAxisTitle.xAxisTitleText,
|
|
24703
|
+
value: `${d["x0"]}-${d["x1"]}`
|
|
24704
|
+
},
|
|
24705
|
+
{
|
|
24706
|
+
key: formatOptions.yAxisTitle.yAxisTitleText,
|
|
24707
|
+
value: getNumberWithFormat(formatOptions.toolTip.toolTipNumberFormat == ",.0%" ? Math.abs(d.length / filteredData[0].data.length) : d.length, formatOptions.toolTip.toolTipDisplayUnits, formatOptions.toolTip.toolTipNumberFormat, formatOptions.toolTip.toolTipDecimalPrecision, false)
|
|
24708
|
+
}
|
|
24709
|
+
],
|
|
24710
|
+
formatOptions,
|
|
24711
|
+
event2
|
|
24725
24712
|
);
|
|
24726
|
-
|
|
24727
|
-
|
|
24728
|
-
return d.value > 0 ? requiredXScale(0) : requiredXScale(d.value);
|
|
24729
|
-
}).attr("width", (d) => {
|
|
24730
|
-
const requiredXScale = data2.properties.axis === "Primary" ? xScaleBottom : xScaleTop;
|
|
24731
|
-
const requiredCustomValue = data2.properties.axis === "Primary" ? customYaxisMaxValue : secondaryCustomYaxisMaxValue;
|
|
24732
|
-
return d.value > 0 ? requiredCustomValue && d.value > requiredCustomValue ? requiredXScale(requiredCustomValue) - requiredXScale(0) : requiredXScale(d.value) - requiredXScale(0) : Math.abs(requiredXScale(0) - requiredXScale(d.value));
|
|
24733
|
-
}).attr("fill", data2.properties.color).attr(
|
|
24734
|
-
"stroke-dasharray",
|
|
24735
|
-
(d) => d.stackBorderStyle === 2 ? "5,3" : "0"
|
|
24736
|
-
).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
|
|
24737
|
-
"stroke",
|
|
24738
|
-
(d) => data2.properties.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderStyle : "none"
|
|
24739
|
-
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
24740
|
-
"visibility",
|
|
24741
|
-
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
24742
|
-
).on("mousemove", (event2, d) => {
|
|
24743
|
-
showTooltipOnMouseMove(
|
|
24744
|
-
[
|
|
24745
|
-
{
|
|
24746
|
-
key: formatOptions.xAxisTitle.xAxisTitleText.includes("~$~") ? formatOptions.xAxisTitle.xAxisTitleText.split("~$~")[1] : formatOptions.xAxisTitle.xAxisTitleText,
|
|
24747
|
-
value: chartJSON.formattedDimensionListMap.get(
|
|
24748
|
-
Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
|
|
24749
|
-
)
|
|
24750
|
-
},
|
|
24751
|
-
{
|
|
24752
|
-
key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
|
|
24753
|
-
value: getNumberWithFormat(
|
|
24754
|
-
[
|
|
24755
|
-
actualChartTypes.stackLine100,
|
|
24756
|
-
actualChartTypes.stackArea100,
|
|
24757
|
-
""
|
|
24758
|
-
].includes(chartType) ? d[1] - d[0] : d.value,
|
|
24759
|
-
formatOptions.toolTip.toolTipDisplayUnits,
|
|
24760
|
-
formatOptions.toolTip.toolTipNumberFormat,
|
|
24761
|
-
formatOptions.toolTip.toolTipDecimalPrecision
|
|
24762
|
-
)
|
|
24763
|
-
},
|
|
24764
|
-
{
|
|
24765
|
-
key: "Legend",
|
|
24766
|
-
value: d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend
|
|
24767
|
-
}
|
|
24768
|
-
],
|
|
24769
|
-
formatOptions,
|
|
24770
|
-
event2
|
|
24771
|
-
);
|
|
24772
|
-
}).on("mouseout", hideTooltipOnMouseOut);
|
|
24773
|
-
columnGroups.exit().remove();
|
|
24774
|
-
});
|
|
24713
|
+
}).on("mouseout", hideTooltipOnMouseOut);
|
|
24714
|
+
gTag.selectAll(".parentGroup").raise();
|
|
24775
24715
|
};
|
|
24776
24716
|
const setSVGContainer = (margin2) => {
|
|
24777
24717
|
innerWidth2 = width - margin2.left - margin2.right;
|
|
@@ -24785,14 +24725,12 @@ const HorizontalHistogramChart = ({
|
|
|
24785
24725
|
scrollPosition,
|
|
24786
24726
|
scrollPosition + visibleBars
|
|
24787
24727
|
);
|
|
24788
|
-
getYScale();
|
|
24789
24728
|
filteredData = JSON.parse(JSON.stringify(seriesData2));
|
|
24790
24729
|
filteredData.forEach(
|
|
24791
24730
|
(data2, i) => filteredData[i].data = data2.data.filter(
|
|
24792
24731
|
(d) => filteredDimension.includes(d.dimension)
|
|
24793
24732
|
)
|
|
24794
24733
|
);
|
|
24795
|
-
getYAxis();
|
|
24796
24734
|
svg2.append("rect").attr("x", margin2.left).attr("y", scrollbarY).attr("width", innerWidth22).attr("height", 8).attr("fill", "#ddd").attr("rx", 4);
|
|
24797
24735
|
const handleWidth = innerWidth22 * visibleBars / chartJSON.dimensionList.length;
|
|
24798
24736
|
const handle = svg2.append("rect").attr("x", margin2.left).attr("y", scrollbarY).attr("width", handleWidth).attr("height", 8).attr("fill", "#999").attr("rx", 4).style("cursor", "ew-resize").call(
|
|
@@ -24809,14 +24747,13 @@ const HorizontalHistogramChart = ({
|
|
|
24809
24747
|
scrollPosition,
|
|
24810
24748
|
scrollPosition + visibleBars
|
|
24811
24749
|
);
|
|
24812
|
-
getYScale();
|
|
24813
24750
|
filteredData = JSON.parse(JSON.stringify(seriesData2));
|
|
24814
24751
|
filteredData.forEach(
|
|
24815
24752
|
(data2, i) => filteredData[i].data = data2.data.filter(
|
|
24816
24753
|
(d) => filteredDimension.includes(d.dimension)
|
|
24817
24754
|
)
|
|
24818
24755
|
);
|
|
24819
|
-
|
|
24756
|
+
getXAxis();
|
|
24820
24757
|
drawColumnChart();
|
|
24821
24758
|
})
|
|
24822
24759
|
);
|
|
@@ -24827,57 +24764,36 @@ const HorizontalHistogramChart = ({
|
|
|
24827
24764
|
scrollPosition = Math.max(0, Math.min(scrollPosition, scrollMax));
|
|
24828
24765
|
const x2 = margin2.left + (innerWidth22 - handleWidth) * scrollPosition / scrollMax;
|
|
24829
24766
|
handle.attr("x", x2);
|
|
24830
|
-
getYScale();
|
|
24831
24767
|
filteredData = JSON.parse(JSON.stringify(seriesData2));
|
|
24832
24768
|
filteredData.forEach(
|
|
24833
24769
|
(data2, i) => filteredData[i].data = data2.data.filter(
|
|
24834
24770
|
(d) => filteredDimension.includes(d.dimension)
|
|
24835
24771
|
)
|
|
24836
24772
|
);
|
|
24837
|
-
|
|
24773
|
+
getXAxis();
|
|
24838
24774
|
drawColumnChart();
|
|
24839
24775
|
});
|
|
24840
24776
|
}
|
|
24841
24777
|
drawColumnChart();
|
|
24842
24778
|
};
|
|
24843
24779
|
const drawColumnChart = () => {
|
|
24844
|
-
|
|
24845
|
-
initXaxisBar(
|
|
24846
|
-
formatOptions,
|
|
24780
|
+
initXaxis$1(
|
|
24847
24781
|
gTag,
|
|
24848
|
-
|
|
24849
|
-
|
|
24850
|
-
innerWidth2,
|
|
24851
|
-
xAxisBottom
|
|
24852
|
-
);
|
|
24853
|
-
commonAnnotations(
|
|
24854
|
-
filteredData,
|
|
24855
|
-
yScale,
|
|
24856
|
-
xScaleBottom,
|
|
24857
|
-
xScaleTop,
|
|
24858
|
-
// need to pass secondary axis scale if secondary axis is drawn
|
|
24859
|
-
margin,
|
|
24860
|
-
d3Annotation,
|
|
24861
|
-
[],
|
|
24862
|
-
//this.labelExcludeList,
|
|
24863
|
-
[],
|
|
24864
|
-
//this.individualLabelColor,
|
|
24865
|
-
[],
|
|
24866
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
24782
|
+
chartJSON,
|
|
24783
|
+
xLabel,
|
|
24867
24784
|
formatOptions,
|
|
24868
|
-
|
|
24785
|
+
dataTableHeight,
|
|
24786
|
+
yScaleLeft,
|
|
24787
|
+
xAxis,
|
|
24788
|
+
dimensionHeightWidthArray,
|
|
24869
24789
|
height,
|
|
24870
|
-
|
|
24790
|
+
columnWidth,
|
|
24791
|
+
isDateType,
|
|
24871
24792
|
innerWidth2,
|
|
24872
|
-
filteredDimension,
|
|
24873
24793
|
innerHeight2,
|
|
24874
|
-
|
|
24875
|
-
svg,
|
|
24876
|
-
yScaleLegends,
|
|
24877
|
-
columnWidth,
|
|
24878
|
-
false,
|
|
24879
|
-
barChart
|
|
24794
|
+
filteredDimension
|
|
24880
24795
|
);
|
|
24796
|
+
getChartType();
|
|
24881
24797
|
};
|
|
24882
24798
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24883
24799
|
"svg",
|
|
@@ -25424,7 +25340,7 @@ const StackAreaChart = ({
|
|
|
25424
25340
|
const seriesData = generalizedChartData(
|
|
25425
25341
|
data.ChartData,
|
|
25426
25342
|
data.DimensionList
|
|
25427
|
-
);
|
|
25343
|
+
)?.reverse() || [];
|
|
25428
25344
|
const dimensionList = data.DimensionList;
|
|
25429
25345
|
const barChart = false;
|
|
25430
25346
|
const isSecondaryAxisDrawn = false;
|
|
@@ -25777,7 +25693,7 @@ const StackAreaChart = ({
|
|
|
25777
25693
|
).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(0)).defined(
|
|
25778
25694
|
(d) => d.data.hideZero ? Boolean(d.data.key) : true
|
|
25779
25695
|
).curve(getCurveType(formatOptions));
|
|
25780
|
-
let areas = gTag.selectAll(".lineGroup").data([stackChartData
|
|
25696
|
+
let areas = gTag.selectAll(".lineGroup").data([stackChartData]);
|
|
25781
25697
|
let focus = gTag.append("g").attr("class", "focusClass");
|
|
25782
25698
|
areas = areas.enter().append("g").attr("class", "areas lineGroup").merge(areas);
|
|
25783
25699
|
let areaGroups = areas.selectAll(".area-group").data((d) => d);
|
|
@@ -25992,7 +25908,7 @@ const NormalizedStackAreaChart = ({
|
|
|
25992
25908
|
const seriesData = generalizedChartData(
|
|
25993
25909
|
data.ChartData,
|
|
25994
25910
|
data.DimensionList
|
|
25995
|
-
);
|
|
25911
|
+
)?.reverse() || [];
|
|
25996
25912
|
const dimensionList = data.DimensionList;
|
|
25997
25913
|
const barChart = false;
|
|
25998
25914
|
const isSecondaryAxisDrawn = false;
|
|
@@ -26306,13 +26222,13 @@ const NormalizedStackAreaChart = ({
|
|
|
26306
26222
|
});
|
|
26307
26223
|
const columnGenerator = area().x(
|
|
26308
26224
|
(d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
|
|
26309
|
-
).y0(() => yScaleLeft(0)).y1((d) => yScaleLeft(d[1])).defined((d) => d.data.hideZero ? Boolean(d[0]) : true).curve(curveLinear$1);
|
|
26225
|
+
).y0((d) => yScaleLeft(d[0])).y1((d) => yScaleLeft(d[1])).defined((d) => d.data.hideZero ? Boolean(d[0]) : true).curve(curveLinear$1);
|
|
26310
26226
|
const columnGeneratorStart = area().x(
|
|
26311
26227
|
(d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
|
|
26312
|
-
).y0(() => yScaleLeft(0)).y1(() => yScaleLeft(
|
|
26228
|
+
).y0((d) => yScaleLeft(d[0])).y1((d) => yScaleLeft(d[1])).defined(
|
|
26313
26229
|
(d) => d.data.hideZero ? Boolean(d.data.key) : true
|
|
26314
26230
|
).curve(getCurveType(formatOptions));
|
|
26315
|
-
let areas = gTag.selectAll(".lineGroup").data([stackChartData
|
|
26231
|
+
let areas = gTag.selectAll(".lineGroup").data([stackChartData]);
|
|
26316
26232
|
let focus = gTag.append("g").attr("class", "focusClass");
|
|
26317
26233
|
areas = areas.enter().append("g").attr("class", "areas lineGroup").merge(areas);
|
|
26318
26234
|
let areaGroups = areas.selectAll(".area-group").data((d) => d);
|
|
@@ -26700,7 +26616,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
26700
26616
|
};
|
|
26701
26617
|
const defineChartRadius = () => {
|
|
26702
26618
|
try {
|
|
26703
|
-
radius = Math.min(innerHeight2 * 0.
|
|
26619
|
+
radius = Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5);
|
|
26704
26620
|
outsideDataLabelFlag ? radius = radius * 0.9 : null;
|
|
26705
26621
|
} catch (error) {
|
|
26706
26622
|
logError$2(fileName$8, "defineChartRadius", error);
|
|
@@ -26774,16 +26690,20 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
26774
26690
|
return "";
|
|
26775
26691
|
}
|
|
26776
26692
|
};
|
|
26777
|
-
const getDataLabelTransformString = (d) => {
|
|
26693
|
+
const getDataLabelTransformString = (d, isSingleDataLabel) => {
|
|
26778
26694
|
try {
|
|
26779
|
-
|
|
26780
|
-
|
|
26781
|
-
|
|
26782
|
-
|
|
26783
|
-
|
|
26784
|
-
|
|
26785
|
-
|
|
26786
|
-
|
|
26695
|
+
if (isSingleDataLabel) {
|
|
26696
|
+
return `translate(0 0)`;
|
|
26697
|
+
} else {
|
|
26698
|
+
const midAngle = (d.startAngle + d.endAngle) / 2;
|
|
26699
|
+
const x2 = Math.cos(midAngle - Math.PI / 2) * (radius * 0.65);
|
|
26700
|
+
const y2 = Math.sin(midAngle - Math.PI / 2) * (radius * 0.65);
|
|
26701
|
+
let rotate = midAngle * 180 / Math.PI % 360;
|
|
26702
|
+
let angle = 0;
|
|
26703
|
+
rotate > 180 && rotate < 360 ? angle = 90 : angle = -90;
|
|
26704
|
+
rotate += angle;
|
|
26705
|
+
return `translate(${x2},${y2}) rotate(${rotate})`;
|
|
26706
|
+
}
|
|
26787
26707
|
} catch (error) {
|
|
26788
26708
|
logError$2(fileName$8, "getDataLabelTransformString", error);
|
|
26789
26709
|
return "";
|
|
@@ -26792,6 +26712,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
26792
26712
|
const drawPieDataLabels = () => {
|
|
26793
26713
|
try {
|
|
26794
26714
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
26715
|
+
const isSingleDataLabel = pieChartData && pieChartData.length === 1;
|
|
26795
26716
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
26796
26717
|
pieChartData.filter(
|
|
26797
26718
|
(d) => d.data.properties.dataLabelPosition == "1"
|
|
@@ -26810,7 +26731,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
26810
26731
|
).attr(
|
|
26811
26732
|
"font-family",
|
|
26812
26733
|
(d) => d.data.properties?.labelFont ?? "Helvetica"
|
|
26813
|
-
).attr("transform", (d) => getDataLabelTransformString(d)).attr("dy", "-0.35em").attr("text-anchor", "middle").attr("alignment-baseline", "middle").text((d) => {
|
|
26734
|
+
).attr("transform", (d) => getDataLabelTransformString(d, isSingleDataLabel)).attr("visibility", (d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible").attr("dy", "-0.35em").attr("text-anchor", "middle").attr("alignment-baseline", "middle").text((d) => {
|
|
26814
26735
|
const { plotArea } = chartFormatOptions;
|
|
26815
26736
|
if (plotArea.dataLabelName) {
|
|
26816
26737
|
return d.data.legend;
|
|
@@ -26835,10 +26756,10 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
26835
26756
|
).attr(
|
|
26836
26757
|
"font-family",
|
|
26837
26758
|
(d) => d.data.properties?.valueFont ?? "Helvetica"
|
|
26838
|
-
).attr("transform", (d) => getDataLabelTransformString(d)).attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr("dy", "1.00em").text((d) => {
|
|
26759
|
+
).attr("transform", (d) => getDataLabelTransformString(d, isSingleDataLabel)).attr("visibility", (d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible").attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr("dy", chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "0").text((d) => {
|
|
26839
26760
|
if (chartFormatOptions.plotArea.dataLabelValue) {
|
|
26840
26761
|
const dataValue = d.data.data[0].value;
|
|
26841
|
-
if (chartFormatOptions.plotArea.
|
|
26762
|
+
if (chartFormatOptions.plotArea.dataLabelValue && dataValue !== void 0) {
|
|
26842
26763
|
if (chartFormatOptions.plotArea.dataLabelNumberFormat === ",.0%") {
|
|
26843
26764
|
return (Math.abs(dataValue / pieTotalValue) * 100).toFixed(
|
|
26844
26765
|
convertStringToNumber(
|
|
@@ -27047,7 +26968,7 @@ const DonutChart = ({
|
|
|
27047
26968
|
};
|
|
27048
26969
|
const defineChartRadius = () => {
|
|
27049
26970
|
try {
|
|
27050
|
-
radius = Math.min(innerHeight2 * 0.
|
|
26971
|
+
radius = Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5);
|
|
27051
26972
|
outsideDataLabelFlag ? radius = radius * 0.9 : null;
|
|
27052
26973
|
innerRadius = Math.min(
|
|
27053
26974
|
convertStringToNumber(chartFormatOptions.plotArea.innerRadius) / 100 * radius,
|
|
@@ -27137,17 +27058,21 @@ const DonutChart = ({
|
|
|
27137
27058
|
return "";
|
|
27138
27059
|
}
|
|
27139
27060
|
};
|
|
27140
|
-
const getDataLabelTransformString = (d) => {
|
|
27061
|
+
const getDataLabelTransformString = (d, isSingleDataLabel) => {
|
|
27141
27062
|
try {
|
|
27142
|
-
|
|
27143
|
-
|
|
27144
|
-
|
|
27145
|
-
|
|
27146
|
-
|
|
27147
|
-
|
|
27148
|
-
|
|
27149
|
-
|
|
27150
|
-
|
|
27063
|
+
if (isSingleDataLabel) {
|
|
27064
|
+
return `translate(0 0)`;
|
|
27065
|
+
} else {
|
|
27066
|
+
const midAngle = (d.startAngle + d.endAngle) / 2;
|
|
27067
|
+
const labelRadius = (innerRadius + radius) / 2;
|
|
27068
|
+
const x2 = Math.cos(midAngle - Math.PI / 2) * labelRadius;
|
|
27069
|
+
const y2 = Math.sin(midAngle - Math.PI / 2) * labelRadius;
|
|
27070
|
+
let rotate = midAngle * 180 / Math.PI % 360;
|
|
27071
|
+
let angle = 0;
|
|
27072
|
+
rotate > 180 && rotate < 360 ? angle = 90 : angle = -90;
|
|
27073
|
+
rotate += angle;
|
|
27074
|
+
return `translate(${x2},${y2}) rotate(${rotate})`;
|
|
27075
|
+
}
|
|
27151
27076
|
} catch (error) {
|
|
27152
27077
|
logError$2(fileName$7, "getDataLabelTransformString", error);
|
|
27153
27078
|
return "";
|
|
@@ -27156,6 +27081,7 @@ const DonutChart = ({
|
|
|
27156
27081
|
const drawDonutDataLabels = () => {
|
|
27157
27082
|
try {
|
|
27158
27083
|
if (chartFormatOptions.plotArea.dataLabels) {
|
|
27084
|
+
const isSingleDataLabel = pieChartData && pieChartData.length === 1;
|
|
27159
27085
|
chartAreaTagG.append("g").attr("class", "parentGroup").attr("transform", `${getPiePosition()}`).attr("pointer-events", "none").attr("text-anchor", "middle").selectAll("text").data(
|
|
27160
27086
|
pieChartData.filter(
|
|
27161
27087
|
(d) => d.data.properties.dataLabelPosition == "1"
|
|
@@ -27174,7 +27100,7 @@ const DonutChart = ({
|
|
|
27174
27100
|
).attr(
|
|
27175
27101
|
"font-family",
|
|
27176
27102
|
(d) => d.data.properties?.labelFont ?? "Helvetica"
|
|
27177
|
-
).attr("transform", (d) => getDataLabelTransformString(d)).attr("dy", "-0.35em").attr("text-anchor", "middle").attr("alignment-baseline", "middle").text((d) => {
|
|
27103
|
+
).attr("transform", (d) => getDataLabelTransformString(d, isSingleDataLabel)).attr("visibility", (d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible").attr("dy", "-0.35em").attr("text-anchor", "middle").attr("alignment-baseline", "middle").text((d) => {
|
|
27178
27104
|
const { plotArea } = chartFormatOptions;
|
|
27179
27105
|
if (plotArea.dataLabelName) {
|
|
27180
27106
|
return d.data.legend;
|
|
@@ -27199,10 +27125,10 @@ const DonutChart = ({
|
|
|
27199
27125
|
).attr(
|
|
27200
27126
|
"font-family",
|
|
27201
27127
|
(d) => d.data.properties?.valueFont ?? "Helvetica"
|
|
27202
|
-
).attr("transform", (d) => getDataLabelTransformString(d)).attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr("dy", "1.00em").text((d) => {
|
|
27128
|
+
).attr("transform", (d) => getDataLabelTransformString(d, isSingleDataLabel)).attr("visibility", (d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible").attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr("dy", chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "0").text((d) => {
|
|
27203
27129
|
if (chartFormatOptions.plotArea.dataLabelValue) {
|
|
27204
27130
|
const dataValue = d.data.data[0].value;
|
|
27205
|
-
if (chartFormatOptions.plotArea.
|
|
27131
|
+
if (chartFormatOptions.plotArea.dataLabelValue && dataValue !== void 0) {
|
|
27206
27132
|
if (chartFormatOptions.plotArea.dataLabelNumberFormat === ",.0%") {
|
|
27207
27133
|
return (Math.abs(dataValue / pieTotalValue) * 100).toFixed(
|
|
27208
27134
|
convertStringToNumber(
|
|
@@ -54391,11 +54317,11 @@ export {
|
|
|
54391
54317
|
AreaChart,
|
|
54392
54318
|
BubbleChart,
|
|
54393
54319
|
ColumnChart,
|
|
54394
|
-
ColumnHistogramChart,
|
|
54320
|
+
ColumnHistogramChart$1 as ColumnHistogramChart,
|
|
54395
54321
|
CustomColumnChart,
|
|
54396
54322
|
DonutChart,
|
|
54397
54323
|
HorizontalBarChart,
|
|
54398
|
-
HorizontalHistogramChart,
|
|
54324
|
+
ColumnHistogramChart as HorizontalHistogramChart,
|
|
54399
54325
|
LayeredColumnChart,
|
|
54400
54326
|
LayeredHorizontalBarChart,
|
|
54401
54327
|
LineChart,
|