pace-chart-lib 1.0.10 → 1.0.12
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.
|
@@ -11602,7 +11602,7 @@ function computeMarginMetrics(windowWidth, windowHeight, maxNumberForPrimaryAxis
|
|
|
11602
11602
|
"Helvetica"
|
|
11603
11603
|
)[1] : 0;
|
|
11604
11604
|
yTitle = yTitle > width * 0.1 ? width * 0.1 : yTitle;
|
|
11605
|
-
let yLabel = formatOptions.yAxisLabel.yAxisLabelVisibility ? responsiveYaxisMargin(maxNumberForPrimaryAxis, yMaxLeft, formatOptions, false, isNormalizedChart) : getYAxisLabel(formatOptions, max$2(legendList, (d) => d?.length || 0) || 0);
|
|
11605
|
+
let yLabel = formatOptions.yAxisLabel.yAxisLabelVisibility ? responsiveYaxisMargin(maxNumberForPrimaryAxis, yMaxLeft, formatOptions, false, isNormalizedChart) + 10 : getYAxisLabel(formatOptions, max$2(legendList, (d) => d?.length || 0) || 0) + 10;
|
|
11606
11606
|
yLabel += 8;
|
|
11607
11607
|
let secondaryYLabel = formatOptions.secondaryYAxisLabel.secondaryYAxisLabelVisibility ? responsiveYaxisMargin(
|
|
11608
11608
|
maxNumberForSecondaryAxis,
|
|
@@ -15514,11 +15514,11 @@ const drawChartTitle = (chartSvg, chartTitleHeight, chartTitleWidth, chartFormat
|
|
|
15514
15514
|
chartFormatOptions.chartTitle.chartTitleVisibility ? "visible" : "hidden"
|
|
15515
15515
|
).attr("transform", `translate(2,2)`).attr("class", "chartTitle").attr("width", chartTitleWidth).attr("height", chartTitleHeight + "px");
|
|
15516
15516
|
if (chartFormatOptions.chartTitle.dynamicTitleText.length !== 0) {
|
|
15517
|
-
object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", chartFormatOptions.chartTitle.chartTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
|
|
15517
|
+
object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", chartFormatOptions.chartTitle.chartTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").style("overflow", "visible").style("line-height", "1.3em").html(
|
|
15518
15518
|
chartFormatOptions.chartTitle.chartTitleHTML ? chartFormatOptions.chartTitle.chartTitleHTML : chartFormatOptions.chartTitle.chartTitleText
|
|
15519
15519
|
);
|
|
15520
15520
|
} else {
|
|
15521
|
-
object2.append("xhtml:div").style("white-space", "pre").style("user-select", "none").style("text-overflow", "ellipsis").style("overflow", "
|
|
15521
|
+
object2.append("xhtml:div").style("white-space", "pre").style("user-select", "none").style("text-overflow", "ellipsis").style("overflow", "visible").style("line-height", "1.3em").attr("class", "chartTiltle").attr("id", "chartTitleId").style("text-anchor", "start").style("color", "rgba(119,119,119)").style("font-size", "16px").style(
|
|
15522
15522
|
"font-family",
|
|
15523
15523
|
chartFormatOptions.chartTitle.chartTitleFontFamily
|
|
15524
15524
|
).attr("title", chartFormatOptions.chartTitle.chartTitleText).html(chartFormatOptions.chartTitle.chartTitleText);
|
|
@@ -15564,14 +15564,14 @@ const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPositio
|
|
|
15564
15564
|
if (chartFormatOptions.legends.onHoverEffect) {
|
|
15565
15565
|
selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
15566
15566
|
selectAll(
|
|
15567
|
-
'[hoverId="' + this.textContent.replace(/ /g, "-") + '"]'
|
|
15567
|
+
'[hoverId="' + ((this.textContent.match(/\(([^)]+)\)/) || [])[1] || this.textContent).replace(/ /g, "-") + '"]'
|
|
15568
15568
|
).classed("highlight", true).classed("unhighlight", false);
|
|
15569
15569
|
}
|
|
15570
15570
|
}).on("mouseout", function(d2) {
|
|
15571
15571
|
if (chartFormatOptions.legends.onHoverEffect) {
|
|
15572
15572
|
selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
15573
15573
|
selectAll(
|
|
15574
|
-
'[hoverId="' + this.textContent.replace(/ /g, "-") + '"]'
|
|
15574
|
+
'[hoverId="' + ((this.textContent.match(/\(([^)]+)\)/) || [])[1] || this.textContent).replace(/ /g, "-") + '"]'
|
|
15575
15575
|
).classed("highlight", false).classed("unhighlight", false);
|
|
15576
15576
|
}
|
|
15577
15577
|
});
|
|
@@ -19905,7 +19905,7 @@ const setnumberOfBubbles = (svg, legendPosition, chartFormatOptions, height, wid
|
|
|
19905
19905
|
function logError$1(fileName2, functionName, error) {
|
|
19906
19906
|
console.error(`[${fileName2}] [${functionName}]`, error);
|
|
19907
19907
|
}
|
|
19908
|
-
const ColumnHistogramChart
|
|
19908
|
+
const ColumnHistogramChart = ({
|
|
19909
19909
|
isDateType,
|
|
19910
19910
|
formatOptions,
|
|
19911
19911
|
data
|
|
@@ -24317,7 +24317,7 @@ const LayeredHorizontalBarChart = ({
|
|
|
24317
24317
|
}
|
|
24318
24318
|
) });
|
|
24319
24319
|
};
|
|
24320
|
-
const
|
|
24320
|
+
const HorizontalHistogramChart = ({
|
|
24321
24321
|
isDateType,
|
|
24322
24322
|
formatOptions,
|
|
24323
24323
|
data
|
|
@@ -24390,12 +24390,12 @@ const ColumnHistogramChart = ({
|
|
|
24390
24390
|
};
|
|
24391
24391
|
useEffect(() => {
|
|
24392
24392
|
try {
|
|
24393
|
-
|
|
24393
|
+
createHorizontalChart();
|
|
24394
24394
|
} catch (error) {
|
|
24395
|
-
logError$2("
|
|
24395
|
+
logError$2("HorizontalHistogramChart", "createHorizontalChart", error);
|
|
24396
24396
|
}
|
|
24397
24397
|
}, [formatOptions]);
|
|
24398
|
-
const
|
|
24398
|
+
const createHorizontalChart = () => {
|
|
24399
24399
|
({ formatOptions, svg, width, height } = firstFunctionBeforeRender$1(
|
|
24400
24400
|
svgRef,
|
|
24401
24401
|
formatOptions
|
|
@@ -24444,25 +24444,28 @@ const ColumnHistogramChart = ({
|
|
|
24444
24444
|
seriesData,
|
|
24445
24445
|
chartJSON.dimensionList
|
|
24446
24446
|
));
|
|
24447
|
-
initSvg$1(
|
|
24448
|
-
// for svg creation
|
|
24449
|
-
svg,
|
|
24450
|
-
width,
|
|
24451
|
-
height,
|
|
24452
|
-
formatOptions
|
|
24453
|
-
);
|
|
24447
|
+
initSvg$1(svg, width, height, formatOptions);
|
|
24454
24448
|
gTag = initChartArea$1(svg, margin);
|
|
24455
|
-
initPlotArea(
|
|
24449
|
+
initPlotArea(gTag, formatOptions, dataTableHeight, innerWidth2, innerHeight2, chartType);
|
|
24450
|
+
binsCalculation();
|
|
24451
|
+
initScale();
|
|
24452
|
+
initAxis();
|
|
24453
|
+
initXaxis$1(
|
|
24456
24454
|
gTag,
|
|
24455
|
+
chartJSON,
|
|
24456
|
+
xLabel,
|
|
24457
24457
|
formatOptions,
|
|
24458
24458
|
dataTableHeight,
|
|
24459
|
+
yScaleLeft,
|
|
24460
|
+
xAxis,
|
|
24461
|
+
dimensionHeightWidthArray,
|
|
24462
|
+
height,
|
|
24463
|
+
columnWidth,
|
|
24464
|
+
isDateType,
|
|
24459
24465
|
innerWidth2,
|
|
24460
24466
|
innerHeight2,
|
|
24461
|
-
|
|
24467
|
+
filteredDimension
|
|
24462
24468
|
);
|
|
24463
|
-
binsCalculation();
|
|
24464
|
-
initScale();
|
|
24465
|
-
initAxis();
|
|
24466
24469
|
initYaxis$1(
|
|
24467
24470
|
gTag,
|
|
24468
24471
|
formatOptions,
|
|
@@ -24579,7 +24582,7 @@ const ColumnHistogramChart = ({
|
|
|
24579
24582
|
const binsCalculation = () => {
|
|
24580
24583
|
switch (formatOptions.bins.binsCalculation) {
|
|
24581
24584
|
case "Automatic":
|
|
24582
|
-
thresholds =
|
|
24585
|
+
thresholds = innerHeight2 / 50;
|
|
24583
24586
|
break;
|
|
24584
24587
|
case "Number of Bins":
|
|
24585
24588
|
calculatingPeriodsWithBins(false);
|
|
@@ -24589,11 +24592,7 @@ const ColumnHistogramChart = ({
|
|
|
24589
24592
|
}
|
|
24590
24593
|
};
|
|
24591
24594
|
const calculatingPeriodsWithBins = (isWithWidth) => {
|
|
24592
|
-
filteredData.forEach(
|
|
24593
|
-
(d) => d.data.sort(function(a2, b) {
|
|
24594
|
-
return a2.value - b.value;
|
|
24595
|
-
})
|
|
24596
|
-
);
|
|
24595
|
+
filteredData.forEach((d) => d.data.sort((a2, b) => a2.value - b.value));
|
|
24597
24596
|
let range2 = chartJSON.xMax - chartJSON.xMin;
|
|
24598
24597
|
let tempPeriod;
|
|
24599
24598
|
if (isWithWidth) {
|
|
@@ -24619,9 +24618,9 @@ const ColumnHistogramChart = ({
|
|
|
24619
24618
|
}
|
|
24620
24619
|
};
|
|
24621
24620
|
const initScale = () => {
|
|
24622
|
-
|
|
24623
|
-
const numberOfBins = periods.length > 0 ? periods :
|
|
24624
|
-
let histogram = bin().value((d) => d).domain(
|
|
24621
|
+
yScaleLeft = linear$1().domain([chartJSON.xMin, chartJSON.xMax]).range([innerHeight2, 0]);
|
|
24622
|
+
const numberOfBins = periods.length > 0 ? periods : yScaleLeft.ticks(thresholds);
|
|
24623
|
+
let histogram = bin().value((d) => d).domain(yScaleLeft.domain()).thresholds(numberOfBins);
|
|
24625
24624
|
filteredData.forEach((d) => {
|
|
24626
24625
|
let tempArray = histogram(d.data.map((val) => val.value));
|
|
24627
24626
|
bins.push(tempArray);
|
|
@@ -24637,23 +24636,26 @@ const ColumnHistogramChart = ({
|
|
|
24637
24636
|
bins.forEach((d) => d.forEach((j) => cumulativeLength.push(j.length)));
|
|
24638
24637
|
chartJSON.yMaxLeft = max$2(cumulativeLength);
|
|
24639
24638
|
chartJSON.yMinLeft = min$2(cumulativeLength);
|
|
24640
|
-
|
|
24639
|
+
xScale = linear$1().domain([
|
|
24640
|
+
customXaxisMinValue || customXaxisMinValue == 0 ? customXaxisMinValue : 0,
|
|
24641
|
+
customXaxisMaxValue || customXaxisMaxValue == 0 ? customXaxisMaxValue : chartJSON.yMaxLeft + 0.2 * chartJSON.yMaxLeft
|
|
24642
|
+
]).range([0, innerWidth2]);
|
|
24641
24643
|
};
|
|
24642
24644
|
const initAxis = () => {
|
|
24643
|
-
|
|
24645
|
+
getYAxis();
|
|
24644
24646
|
{
|
|
24645
|
-
let
|
|
24647
|
+
let responsiveLabelsObj = responsiveYaxisLabel$1(
|
|
24646
24648
|
chartJSON.yMaxLeft,
|
|
24647
24649
|
chartJSON.yMinLeft,
|
|
24648
|
-
|
|
24650
|
+
innerWidth2,
|
|
24649
24651
|
formatOptions,
|
|
24650
24652
|
chartJSON,
|
|
24651
24653
|
customYaxisMinValue,
|
|
24652
24654
|
customYaxisMaxValue,
|
|
24653
24655
|
false,
|
|
24654
|
-
|
|
24656
|
+
innerHeight2
|
|
24655
24657
|
);
|
|
24656
|
-
|
|
24658
|
+
xAxis = axisBottom(xScale).tickFormat(
|
|
24657
24659
|
(d) => getNumberWithFormat(
|
|
24658
24660
|
d,
|
|
24659
24661
|
formatOptions.yAxisLabel.yAxisDisplayUnits,
|
|
@@ -24661,15 +24663,14 @@ const ColumnHistogramChart = ({
|
|
|
24661
24663
|
formatOptions.yAxisLabel.yAxisLabelDecimalPrecision
|
|
24662
24664
|
)
|
|
24663
24665
|
).tickSize(
|
|
24664
|
-
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -
|
|
24665
|
-
).tickValues(
|
|
24666
|
+
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerHeight2 + 0 : 0 : 0
|
|
24667
|
+
).tickValues(responsiveLabelsObj.autoLabelFlag ? void 0 : responsiveLabelsObj.yAxisLabelArray).ticks(responsiveLabelsObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
24666
24668
|
}
|
|
24667
24669
|
};
|
|
24668
|
-
const
|
|
24669
|
-
let
|
|
24670
|
-
let labelArray = responsiveXaxisLabelForNumericValue(chartJSON.xMax, chartJSON.xMin, innerWidth2, formatOptions, customXaxisMinValue, customXaxisMaxValue, innerHeight2, false).xAxisLabelArray;
|
|
24670
|
+
const getYAxis = () => {
|
|
24671
|
+
let labelArray = responsiveXaxisLabelForNumericValue(chartJSON.xMax, chartJSON.xMin, innerHeight2, formatOptions, customXaxisMinValue, customXaxisMaxValue, innerWidth2, false).xAxisLabelArray;
|
|
24671
24672
|
labelArray.shift();
|
|
24672
|
-
|
|
24673
|
+
yAxisLeft = axisLeft(yScaleLeft).tickFormat(
|
|
24673
24674
|
(d) => getNumberWithFormat(
|
|
24674
24675
|
d,
|
|
24675
24676
|
formatOptions.xAxisLabel.xAxisDisplayUnits,
|
|
@@ -24678,32 +24679,29 @@ const ColumnHistogramChart = ({
|
|
|
24678
24679
|
false
|
|
24679
24680
|
)
|
|
24680
24681
|
).tickSize(
|
|
24681
|
-
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ?
|
|
24682
|
+
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -innerWidth2 : 0 : 0
|
|
24682
24683
|
).tickSizeOuter(0);
|
|
24683
|
-
formatOptions.bins.binsCalculation === "Automatic" ?
|
|
24684
|
+
formatOptions.bins.binsCalculation === "Automatic" ? yAxisLeft.ticks(thresholds) : yAxisLeft.tickValues(periods).ticks(innerHeight2 / 50);
|
|
24684
24685
|
};
|
|
24685
24686
|
const getChartType = (lineData) => {
|
|
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
|
-
|
|
24688
|
-
|
|
24689
|
-
|
|
24690
|
-
|
|
24691
|
-
|
|
24692
|
-
|
|
24693
|
-
|
|
24694
|
-
|
|
24695
|
-
|
|
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) => {
|
|
24687
|
+
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("stroke-width", formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderThickness).attr("stroke-opacity", formatOptions.bins.binsBorderVisibility && formatOptions.bins.binsBorderOpacity).attr("x", 0).attr("y", (d) => {
|
|
24688
|
+
const y02 = yScaleLeft(d.x0);
|
|
24689
|
+
const y12 = yScaleLeft(d.x1);
|
|
24690
|
+
return Math.min(y02, y12);
|
|
24691
|
+
}).attr("height", (d) => {
|
|
24692
|
+
const y02 = yScaleLeft(d.x0);
|
|
24693
|
+
const y12 = yScaleLeft(d.x1);
|
|
24694
|
+
const gap = parseFloat(formatOptions.bins.binsGapWidth) || 0;
|
|
24695
|
+
return Math.max(1, Math.abs(y12 - y02) - gap);
|
|
24696
|
+
}).attr("width", (d) => xScale(d.length)).style("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("opacity", formatOptions.bins.binsFillOpacity).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
24699
24697
|
showTooltipOnMouseMove(
|
|
24700
24698
|
[
|
|
24701
24699
|
{
|
|
24702
|
-
key: formatOptions.
|
|
24700
|
+
key: formatOptions.yAxisTitle.yAxisTitleText,
|
|
24703
24701
|
value: `${d["x0"]}-${d["x1"]}`
|
|
24704
24702
|
},
|
|
24705
24703
|
{
|
|
24706
|
-
key: formatOptions.
|
|
24704
|
+
key: formatOptions.xAxisTitle.xAxisTitleText,
|
|
24707
24705
|
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
24706
|
}
|
|
24709
24707
|
],
|
|
@@ -24753,7 +24751,7 @@ const ColumnHistogramChart = ({
|
|
|
24753
24751
|
(d) => filteredDimension.includes(d.dimension)
|
|
24754
24752
|
)
|
|
24755
24753
|
);
|
|
24756
|
-
|
|
24754
|
+
getYAxis();
|
|
24757
24755
|
drawColumnChart();
|
|
24758
24756
|
})
|
|
24759
24757
|
);
|
|
@@ -24770,35 +24768,20 @@ const ColumnHistogramChart = ({
|
|
|
24770
24768
|
(d) => filteredDimension.includes(d.dimension)
|
|
24771
24769
|
)
|
|
24772
24770
|
);
|
|
24773
|
-
|
|
24771
|
+
getYAxis();
|
|
24774
24772
|
drawColumnChart();
|
|
24775
24773
|
});
|
|
24776
24774
|
}
|
|
24777
24775
|
drawColumnChart();
|
|
24778
24776
|
};
|
|
24779
24777
|
const drawColumnChart = () => {
|
|
24780
|
-
|
|
24781
|
-
gTag,
|
|
24782
|
-
chartJSON,
|
|
24783
|
-
xLabel,
|
|
24784
|
-
formatOptions,
|
|
24785
|
-
dataTableHeight,
|
|
24786
|
-
yScaleLeft,
|
|
24787
|
-
xAxis,
|
|
24788
|
-
dimensionHeightWidthArray,
|
|
24789
|
-
height,
|
|
24790
|
-
columnWidth,
|
|
24791
|
-
isDateType,
|
|
24792
|
-
innerWidth2,
|
|
24793
|
-
innerHeight2,
|
|
24794
|
-
filteredDimension
|
|
24795
|
-
);
|
|
24778
|
+
initYaxis$1(gTag, formatOptions, dataTableHeight, yLabel, yAxisLeft, innerHeight2);
|
|
24796
24779
|
getChartType();
|
|
24797
24780
|
};
|
|
24798
24781
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24799
24782
|
"svg",
|
|
24800
24783
|
{
|
|
24801
|
-
className: "
|
|
24784
|
+
className: "className",
|
|
24802
24785
|
ref: svgRef,
|
|
24803
24786
|
id: chartId,
|
|
24804
24787
|
style: { width: "100%", height: "100%" }
|
|
@@ -26670,7 +26653,9 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
26670
26653
|
},
|
|
26671
26654
|
{ key: "Legend", value: d.currentTarget.__data__.data.legend }
|
|
26672
26655
|
],
|
|
26673
|
-
chartFormatOptions
|
|
26656
|
+
chartFormatOptions,
|
|
26657
|
+
void 0,
|
|
26658
|
+
d.currentTarget.__data__.data.properties
|
|
26674
26659
|
);
|
|
26675
26660
|
}).on("mouseout.text", () => {
|
|
26676
26661
|
hideTooltipOnMouseOut();
|
|
@@ -27034,7 +27019,9 @@ const DonutChart = ({
|
|
|
27034
27019
|
},
|
|
27035
27020
|
{ key: "Legend", value: d.currentTarget.__data__.data.legend }
|
|
27036
27021
|
],
|
|
27037
|
-
chartFormatOptions
|
|
27022
|
+
chartFormatOptions,
|
|
27023
|
+
void 0,
|
|
27024
|
+
d.currentTarget.__data__.data.properties
|
|
27038
27025
|
);
|
|
27039
27026
|
}).on("mouseout.text", () => hideTooltipOnMouseOut()).on("mouseout.arc", function() {
|
|
27040
27027
|
if (enableTransition) ;
|
|
@@ -27111,7 +27098,7 @@ const DonutChart = ({
|
|
|
27111
27098
|
pieChartData.filter(
|
|
27112
27099
|
(d) => d.data.properties.dataLabelPosition == "1"
|
|
27113
27100
|
)
|
|
27114
|
-
).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr("fill", (d) => d.data.properties?.
|
|
27101
|
+
).enter().append("text").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).attr("font-size", (d) => d.data.properties?.valueFontSize ?? 11).attr("fill", (d) => d.data.properties?.lableFontColor ?? "#000000").attr(
|
|
27115
27102
|
"font-style",
|
|
27116
27103
|
(d) => d.data.properties?.valueFontStyle?.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
|
|
27117
27104
|
).attr(
|
|
@@ -27192,69 +27179,7 @@ const DonutChart = ({
|
|
|
27192
27179
|
const textWidth = 80;
|
|
27193
27180
|
const xOffset = midangle < Math.PI ? 0 : -textWidth;
|
|
27194
27181
|
return radius * 1.1 * (midangle < Math.PI ? 1 : -1) + xOffset;
|
|
27195
|
-
}).attr("y", (d) => outerRadius.centroid(d)[1] - 30).append("xhtml:div").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).style("display", "flex").style("flex-direction", "column").style("justify-content", "center").style("align-items", "center").style("height", "60px")
|
|
27196
|
-
try {
|
|
27197
|
-
let value2 = d.data.data[0].value.toString();
|
|
27198
|
-
if (d.data.data[0].value !== void 0) {
|
|
27199
|
-
value2 = chartFormatOptions.plotArea.dataLabelNumberFormat === ",.0%" ? (Math.abs(d.data.data[0].value / pieTotalValue) * 100).toFixed(
|
|
27200
|
-
convertStringToNumber(
|
|
27201
|
-
chartFormatOptions.plotArea.dataLabelDecimalPrecision
|
|
27202
|
-
)
|
|
27203
|
-
) + "%" : getNumberWithFormatFunction(
|
|
27204
|
-
chartFormatOptions.plotArea.plotAreaDisplayUnits,
|
|
27205
|
-
chartFormatOptions.plotArea.dataLabelNumberFormat,
|
|
27206
|
-
chartFormatOptions.plotArea.dataLabelDecimalPrecision
|
|
27207
|
-
)(d.data.data[0].value);
|
|
27208
|
-
}
|
|
27209
|
-
let htmlString = "";
|
|
27210
|
-
if (chartFormatOptions.plotArea.dataLabelName) {
|
|
27211
|
-
htmlString += `<span style="
|
|
27212
|
-
font-size: ${d.data.properties.labelFontSize}px;
|
|
27213
|
-
color: ${d.data.properties.labelFontColor};
|
|
27214
|
-
font-style: ${d.data.properties.labelFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
|
|
27215
|
-
text-decoration: ${d.data.properties.labelFontStyle.includes(
|
|
27216
|
-
fontStyleOptions.underline
|
|
27217
|
-
) ? fontStyleOptions.underline : ""};
|
|
27218
|
-
font-weight: ${d.data.properties.labelFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : ""};
|
|
27219
|
-
font-family: ${d.data.properties.labelFont};
|
|
27220
|
-
display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
|
|
27221
|
-
${d.data.legend}
|
|
27222
|
-
</span>`;
|
|
27223
|
-
}
|
|
27224
|
-
if (chartFormatOptions.plotArea.dataLabelValue && d.data.data[0].value !== void 0) {
|
|
27225
|
-
htmlString += `<span style="
|
|
27226
|
-
font-size: ${d.data.properties.valueFontSize}px;
|
|
27227
|
-
color: ${d.data.properties.valueFontColor};
|
|
27228
|
-
font-style: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
|
|
27229
|
-
text-decoration: ${d.data.properties.valueFontStyle.includes(
|
|
27230
|
-
fontStyleOptions.underline
|
|
27231
|
-
) ? fontStyleOptions.underline : ""};
|
|
27232
|
-
font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
|
|
27233
|
-
font-family: ${d.data.properties.valueFont};
|
|
27234
|
-
display: block;">
|
|
27235
|
-
${value2}
|
|
27236
|
-
</span>`;
|
|
27237
|
-
}
|
|
27238
|
-
if (chartFormatOptions.plotArea.plotAreaAbsoluteValue && d.data[0].value !== void 0) {
|
|
27239
|
-
htmlString += `<span style="
|
|
27240
|
-
font-size: ${d.data.properties.valueFontSize}px;
|
|
27241
|
-
color: ${d.data.properties.valueFontColor};
|
|
27242
|
-
font-style: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""};
|
|
27243
|
-
text-decoration: ${d.data.properties.valueFontStyle.includes(
|
|
27244
|
-
fontStyleOptions.underline
|
|
27245
|
-
) ? fontStyleOptions.underline : ""};
|
|
27246
|
-
font-weight: ${d.data.properties.valueFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"};
|
|
27247
|
-
font-family: ${d.data.properties.valueFont};
|
|
27248
|
-
display: block;">
|
|
27249
|
-
${format(".2s")(d.data[0].value)}
|
|
27250
|
-
</span>`;
|
|
27251
|
-
}
|
|
27252
|
-
return htmlString;
|
|
27253
|
-
} catch (error) {
|
|
27254
|
-
logError$2(fileName$7, "drawDonutDataLabels", error);
|
|
27255
|
-
return "";
|
|
27256
|
-
}
|
|
27257
|
-
});
|
|
27182
|
+
}).attr("y", (d) => outerRadius.centroid(d)[1] - 30).append("xhtml:div").attr("hoverId", (d) => d.data.legend.replace(/ /g, "-")).style("display", "flex").style("flex-direction", "column").style("justify-content", "center").style("align-items", "center").style("height", "60px");
|
|
27258
27183
|
}
|
|
27259
27184
|
} catch (error) {
|
|
27260
27185
|
logError$2(fileName$7, "drawDonutDataLabels", error);
|
|
@@ -27452,7 +27377,9 @@ const Treemap = ({ data, formatOptions, chartId }) => {
|
|
|
27452
27377
|
)(data2.data.data[1].value)
|
|
27453
27378
|
} : ""
|
|
27454
27379
|
],
|
|
27455
|
-
chartFormatOptions
|
|
27380
|
+
chartFormatOptions,
|
|
27381
|
+
void 0,
|
|
27382
|
+
d.currentTarget.__data__.data.properties
|
|
27456
27383
|
);
|
|
27457
27384
|
}).on("mouseout", () => hideTooltipOnMouseOut());
|
|
27458
27385
|
leaf.append("clipPath").attr("id", (d, i) => `clip-${i}-${chartId}`).append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
|
|
@@ -27635,7 +27562,9 @@ const PieofPie = ({
|
|
|
27635
27562
|
},
|
|
27636
27563
|
{ key: "Legend", value: d.currentTarget.__data__.data.legend }
|
|
27637
27564
|
],
|
|
27638
|
-
chartFormatOptions
|
|
27565
|
+
chartFormatOptions,
|
|
27566
|
+
void 0,
|
|
27567
|
+
d.currentTarget.__data__.data.properties
|
|
27639
27568
|
);
|
|
27640
27569
|
}).on("mouseout.text", () => {
|
|
27641
27570
|
hideTooltipOnMouseOut();
|
|
@@ -27701,7 +27630,9 @@ const PieofPie = ({
|
|
|
27701
27630
|
},
|
|
27702
27631
|
{ key: "Legend", value: d.currentTarget.__data__.data.legend }
|
|
27703
27632
|
],
|
|
27704
|
-
chartFormatOptions
|
|
27633
|
+
chartFormatOptions,
|
|
27634
|
+
void 0,
|
|
27635
|
+
d.currentTarget.__data__.data.properties
|
|
27705
27636
|
);
|
|
27706
27637
|
}).on("mouseout.text", () => {
|
|
27707
27638
|
hideTooltipOnMouseOut();
|
|
@@ -28037,13 +27968,13 @@ const PyramidChart = ({
|
|
|
28037
27968
|
${centerX + bottomWidth / 2},${yBottom}
|
|
28038
27969
|
${centerX - bottomWidth / 2},${yBottom}
|
|
28039
27970
|
`
|
|
28040
|
-
).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function() {
|
|
27971
|
+
).attr("fill", d.properties.color || "#4cb2ff").on("mousemove", function(d2) {
|
|
28041
27972
|
try {
|
|
28042
27973
|
showTooltipOnMouseMove(
|
|
28043
27974
|
[
|
|
28044
27975
|
{
|
|
28045
|
-
key:
|
|
28046
|
-
value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ?
|
|
27976
|
+
key: d2.legend,
|
|
27977
|
+
value: chartFormatOptions.toolTip.toolTipNumberFormat == ",.0%" ? d2.data[0].value ? (Math.abs(d2.data[0].value / pyramidTotalValue) * 100).toFixed(
|
|
28047
27978
|
convertStringToNumber(
|
|
28048
27979
|
chartFormatOptions.toolTip.toolTipDecimalPrecision
|
|
28049
27980
|
)
|
|
@@ -28051,10 +27982,12 @@ const PyramidChart = ({
|
|
|
28051
27982
|
"None",
|
|
28052
27983
|
chartFormatOptions.toolTip.toolTipNumberFormat,
|
|
28053
27984
|
chartFormatOptions.toolTip.toolTipDecimalPrecision
|
|
28054
|
-
)(
|
|
27985
|
+
)(d2.data[0].value)
|
|
28055
27986
|
}
|
|
28056
27987
|
],
|
|
28057
|
-
chartFormatOptions
|
|
27988
|
+
chartFormatOptions,
|
|
27989
|
+
void 0,
|
|
27990
|
+
d2.currentTarget.__data__.data.properties
|
|
28058
27991
|
);
|
|
28059
27992
|
select$2(this).style("opacity", 0.8).style("stroke", chartFormatOptions.chartArea.chartAreaColor).style("stroke-width", "3px");
|
|
28060
27993
|
} catch (error) {
|
|
@@ -28386,7 +28319,9 @@ const ProgressChart = ({
|
|
|
28386
28319
|
)(maxValue)
|
|
28387
28320
|
}
|
|
28388
28321
|
],
|
|
28389
|
-
chartFormatOptions
|
|
28322
|
+
chartFormatOptions,
|
|
28323
|
+
void 0,
|
|
28324
|
+
d.currentTarget.__data__.data.properties
|
|
28390
28325
|
);
|
|
28391
28326
|
} catch (error) {
|
|
28392
28327
|
logError$2(
|
|
@@ -28839,7 +28774,9 @@ const Speedometer = ({
|
|
|
28839
28774
|
)(data[index2].data[0].value)
|
|
28840
28775
|
}
|
|
28841
28776
|
],
|
|
28842
|
-
chartFormatOptions
|
|
28777
|
+
chartFormatOptions,
|
|
28778
|
+
void 0,
|
|
28779
|
+
d.currentTarget.__data__.data.properties
|
|
28843
28780
|
);
|
|
28844
28781
|
}).on("mouseout", () => {
|
|
28845
28782
|
hideTooltipOnMouseOut();
|
|
@@ -29204,7 +29141,9 @@ const RadialBarChart = ({
|
|
|
29204
29141
|
},
|
|
29205
29142
|
{ key: "Legend", value: d.properties.alias }
|
|
29206
29143
|
],
|
|
29207
|
-
chartFormatOptions
|
|
29144
|
+
chartFormatOptions,
|
|
29145
|
+
void 0,
|
|
29146
|
+
d.properties
|
|
29208
29147
|
);
|
|
29209
29148
|
}).on("mouseout", () => {
|
|
29210
29149
|
hideTooltipOnMouseOut();
|
|
@@ -29765,7 +29704,9 @@ const WordCloud = ({ data, formatOptions, chartId }) => {
|
|
|
29765
29704
|
value: totalMeasureValue
|
|
29766
29705
|
}
|
|
29767
29706
|
],
|
|
29768
|
-
chartFormatOptions
|
|
29707
|
+
chartFormatOptions,
|
|
29708
|
+
void 0,
|
|
29709
|
+
d.properties
|
|
29769
29710
|
);
|
|
29770
29711
|
} catch (error) {
|
|
29771
29712
|
logError$2(fileName$2, "draw-mousemove", error);
|
|
@@ -33234,7 +33175,9 @@ const VennChart = ({
|
|
|
33234
33175
|
)(d.size)
|
|
33235
33176
|
}
|
|
33236
33177
|
],
|
|
33237
|
-
chartFormatOptions
|
|
33178
|
+
chartFormatOptions,
|
|
33179
|
+
void 0,
|
|
33180
|
+
d.properties
|
|
33238
33181
|
);
|
|
33239
33182
|
let selection2 = select$2(this).transition("tooltip").duration(10);
|
|
33240
33183
|
selection2.selectAll("path").style("stroke-dasharray", "5,5").style("stroke-opacity", 1).style("stroke", "black");
|
|
@@ -33983,7 +33926,9 @@ const SankeyChart = ({
|
|
|
33983
33926
|
)(d.value)
|
|
33984
33927
|
}
|
|
33985
33928
|
],
|
|
33986
|
-
chartFormatOptions
|
|
33929
|
+
chartFormatOptions,
|
|
33930
|
+
void 0,
|
|
33931
|
+
d.currentTarget.__data__.data.properties
|
|
33987
33932
|
);
|
|
33988
33933
|
}
|
|
33989
33934
|
chartAreaTagG.selectAll(".sankey-nodes").style("fill-opacity", 0.1).style("stroke", "none");
|
|
@@ -34052,7 +33997,7 @@ const SankeyChart = ({
|
|
|
34052
33997
|
showTooltipOnMouseMove(
|
|
34053
33998
|
[
|
|
34054
33999
|
{
|
|
34055
|
-
key: d.source.name + "→" + d.target.name,
|
|
34000
|
+
key: d.source.name.split("~$~")[1] + "→" + d.target.name.split("~$~")[1],
|
|
34056
34001
|
value: getNumberWithFormatFunction(
|
|
34057
34002
|
"None",
|
|
34058
34003
|
chartFormatOptions.toolTip.toolTipNumberFormat,
|
|
@@ -34060,7 +34005,9 @@ const SankeyChart = ({
|
|
|
34060
34005
|
)(d.value)
|
|
34061
34006
|
}
|
|
34062
34007
|
],
|
|
34063
|
-
chartFormatOptions
|
|
34008
|
+
chartFormatOptions,
|
|
34009
|
+
void 0,
|
|
34010
|
+
{ markerColor: d.source.color, markerShape: "circle" }
|
|
34064
34011
|
);
|
|
34065
34012
|
}
|
|
34066
34013
|
} catch (error) {
|
|
@@ -49518,7 +49465,9 @@ const Maps = ({
|
|
|
49518
49465
|
},
|
|
49519
49466
|
...keyValueObject
|
|
49520
49467
|
],
|
|
49521
|
-
chartFormatOptions
|
|
49468
|
+
chartFormatOptions,
|
|
49469
|
+
void 0,
|
|
49470
|
+
d.currentTarget.__data__.data.properties
|
|
49522
49471
|
);
|
|
49523
49472
|
}
|
|
49524
49473
|
}).on("mouseout", (event2, d) => {
|
|
@@ -49628,7 +49577,9 @@ const Maps = ({
|
|
|
49628
49577
|
)(d.properties.data?.data[1]?.value)
|
|
49629
49578
|
}
|
|
49630
49579
|
],
|
|
49631
|
-
chartFormatOptions
|
|
49580
|
+
chartFormatOptions,
|
|
49581
|
+
void 0,
|
|
49582
|
+
d.currentTarget.__data__.data.properties
|
|
49632
49583
|
);
|
|
49633
49584
|
select$2(this).style(
|
|
49634
49585
|
"r",
|
|
@@ -53602,25 +53553,30 @@ const WaterfallChart = ({
|
|
|
53602
53553
|
barGroups = barGroupsEnter.merge(barGroups);
|
|
53603
53554
|
let rects = barGroups.selectAll("rect").data((d) => d, (d) => d.key || d.Key);
|
|
53604
53555
|
const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr("class", (d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")).attr("x", (d) => xScale(d.data.dimension || d.data.legend)).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0).attr("width", xScale.bandwidth()).attr("visibility", (d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible").style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
53605
|
-
showTooltipOnMouseMove(
|
|
53606
|
-
|
|
53607
|
-
|
|
53608
|
-
|
|
53609
|
-
|
|
53610
|
-
|
|
53611
|
-
|
|
53612
|
-
|
|
53613
|
-
d.key === "
|
|
53614
|
-
|
|
53615
|
-
|
|
53616
|
-
|
|
53617
|
-
|
|
53618
|
-
|
|
53619
|
-
|
|
53620
|
-
|
|
53621
|
-
|
|
53622
|
-
|
|
53623
|
-
|
|
53556
|
+
showTooltipOnMouseMove(
|
|
53557
|
+
[
|
|
53558
|
+
{
|
|
53559
|
+
key: d.key === "dimensionTotal" ? "Dimension" : formatOptions.xAxisTitle.xAxisTitleText,
|
|
53560
|
+
value: chartJSON.formattedDimensionListMap.get(d.data.dimension)
|
|
53561
|
+
},
|
|
53562
|
+
{
|
|
53563
|
+
key: formatOptions.yAxisTitle.yAxisTitleText,
|
|
53564
|
+
value: (d.key === "up" ? "+" : d.key === "down" ? "-" : "") + getNumberWithFormat(
|
|
53565
|
+
d.key === "dimensionTotal" ? d.data.dimensionTotal : d[1] - d[0],
|
|
53566
|
+
formatOptions.toolTip.toolTipDisplayUnits,
|
|
53567
|
+
formatOptions.toolTip.toolTipNumberFormat,
|
|
53568
|
+
formatOptions.toolTip.toolTipDecimalPrecision
|
|
53569
|
+
)
|
|
53570
|
+
},
|
|
53571
|
+
{
|
|
53572
|
+
key: "Legend",
|
|
53573
|
+
value: d.Key ? d.Key.includes("~$~") ? d.Key.split("~$~")[1] : d.Key : d.data.legend ? d.data.legend.includes("~$~") ? d.data.legend.split("~$~")[1] : d.data.legend : "Total"
|
|
53574
|
+
}
|
|
53575
|
+
],
|
|
53576
|
+
formatOptions,
|
|
53577
|
+
void 0,
|
|
53578
|
+
d.currentTarget.__data__.data.properties
|
|
53579
|
+
);
|
|
53624
53580
|
}).on("mouseout", () => {
|
|
53625
53581
|
hideTooltipOnMouseOut();
|
|
53626
53582
|
});
|
|
@@ -54185,14 +54141,19 @@ const TornadoChart = ({
|
|
|
54185
54141
|
...child,
|
|
54186
54142
|
parentProperties: d.properties
|
|
54187
54143
|
}))).enter().append("rect").attr("class", "rect").attr("y", (d) => d.dimension ? yScaleLeft(d.dimension) : yScaleLeft("defaultEntry")).attr("x", (d) => xScale(Math.min(0, d.value))).attr("stroke-dasharray", (d) => d.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => d.stackBorderWidth + "px").attr("stroke", (d) => d.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.stackBorderColor : "none").style("shape-rendering", "crispEdges").attr("width", (d) => d.value ? Math.abs(xScale(d.value) - xScale(0)) : 0).attr("height", yScaleLeft.bandwidth()).style("fill", (d) => d.parentProperties.color).attr("opacity", 1).on("mousemove", (event2, d) => {
|
|
54188
|
-
showTooltipOnMouseMove(
|
|
54189
|
-
|
|
54190
|
-
|
|
54191
|
-
|
|
54192
|
-
|
|
54193
|
-
|
|
54194
|
-
|
|
54195
|
-
|
|
54144
|
+
showTooltipOnMouseMove(
|
|
54145
|
+
[
|
|
54146
|
+
{ key: "Measure", value: d.legend },
|
|
54147
|
+
{ key: "Legend", value: d.dimension },
|
|
54148
|
+
{
|
|
54149
|
+
key: "Value",
|
|
54150
|
+
value: d.value < 0 ? getNumberWithFormat(-d.value, formatOptions.toolTip.toolTipDisplayUnits, formatOptions.toolTip.toolTipNumberFormat, formatOptions.toolTip.toolTipDecimalPrecision, true) : getNumberWithFormat(d.value, formatOptions.toolTip.toolTipDisplayUnits, formatOptions.toolTip.toolTipNumberFormat, formatOptions.toolTip.toolTipDecimalPrecision, true)
|
|
54151
|
+
}
|
|
54152
|
+
],
|
|
54153
|
+
formatOptions,
|
|
54154
|
+
void 0,
|
|
54155
|
+
d.currentTarget.__data__.data.properties
|
|
54156
|
+
);
|
|
54196
54157
|
}).on("mouseout", () => {
|
|
54197
54158
|
hideTooltipOnMouseOut();
|
|
54198
54159
|
});
|
|
@@ -54317,11 +54278,11 @@ export {
|
|
|
54317
54278
|
AreaChart,
|
|
54318
54279
|
BubbleChart,
|
|
54319
54280
|
ColumnChart,
|
|
54320
|
-
ColumnHistogramChart
|
|
54281
|
+
ColumnHistogramChart,
|
|
54321
54282
|
CustomColumnChart,
|
|
54322
54283
|
DonutChart,
|
|
54323
54284
|
HorizontalBarChart,
|
|
54324
|
-
|
|
54285
|
+
HorizontalHistogramChart,
|
|
54325
54286
|
LayeredColumnChart,
|
|
54326
54287
|
LayeredHorizontalBarChart,
|
|
54327
54288
|
LineChart,
|