@fluentui/react-charts 9.3.12 → 9.3.14
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/CHANGELOG.md +25 -2
- package/dist/index.d.ts +859 -0
- package/lib/VegaDeclarativeChart.js +1 -0
- package/lib/VegaDeclarativeChart.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +47 -7
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +12 -12
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js +405 -0
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +20 -0
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +415 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +537 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3279 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js +28 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/index.js +1 -0
- package/lib/components/VegaDeclarativeChart/index.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +5 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utilities/utilities.js +41 -0
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/VegaDeclarativeChart.js +6 -0
- package/lib-commonjs/VegaDeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +46 -6
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +11 -11
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js +274 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +35 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +412 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +533 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3214 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js +31 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/index.js +6 -0
- package/lib-commonjs/components/VegaDeclarativeChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +33 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +3 -3
|
@@ -1715,6 +1715,41 @@ export const getScatterXDomainExtent = (points, scaleType)=>{
|
|
|
1715
1715
|
xMax
|
|
1716
1716
|
];
|
|
1717
1717
|
};
|
|
1718
|
+
/**
|
|
1719
|
+
* Calculates the radius for a marker/circle in scatter and line charts.
|
|
1720
|
+
* Handles both continuous (numeric/date) and categorical (string) axes.
|
|
1721
|
+
*
|
|
1722
|
+
* @param pointMarkerSize - The marker size value for the current data point
|
|
1723
|
+
* @param minMarkerSize - The minimum marker size across all data points
|
|
1724
|
+
* @param maxMarkerSize - The maximum marker size across all data points
|
|
1725
|
+
* @param extraMaxPixels - The maximum available pixels for markers (from getRangeForScatterMarkerSize)
|
|
1726
|
+
* @param isContinuousXY - Whether both X and Y axes are continuous (not string-based)
|
|
1727
|
+
* @param isActive - Whether the current point is active/hovered
|
|
1728
|
+
* @param defaultRadius - Default radius when no marker size is specified (default: 3.5)
|
|
1729
|
+
* @param activeRadius - Radius when the point is active (default: 5.5)
|
|
1730
|
+
* @param minRadius - Minimum radius to ensure markers are visible (default: 4)
|
|
1731
|
+
* @returns The calculated radius in pixels
|
|
1732
|
+
*/ export const calculateMarkerRadius = ({ pointMarkerSize, minMarkerSize, maxMarkerSize, extraMaxPixels, isContinuousXY, isActive = false, defaultRadius = 3.5, activeRadius = 5.5, minRadius = 4 })=>{
|
|
1733
|
+
const minPixel = 4;
|
|
1734
|
+
const maxPixel = 16;
|
|
1735
|
+
// If no marker size is specified, use default or active radius
|
|
1736
|
+
if (!pointMarkerSize) {
|
|
1737
|
+
return isActive ? activeRadius : defaultRadius;
|
|
1738
|
+
}
|
|
1739
|
+
let radius;
|
|
1740
|
+
if (isContinuousXY && maxMarkerSize !== 0) {
|
|
1741
|
+
// For continuous axes: scale markers based on available space
|
|
1742
|
+
radius = maxMarkerSize < extraMaxPixels ? pointMarkerSize : pointMarkerSize / maxMarkerSize * extraMaxPixels;
|
|
1743
|
+
} else if (!isContinuousXY && maxMarkerSize !== minMarkerSize) {
|
|
1744
|
+
// For categorical axes: normalize to pixel range [minPixel, maxPixel]
|
|
1745
|
+
radius = minPixel + (pointMarkerSize - minMarkerSize) / (maxMarkerSize - minMarkerSize) * (maxPixel - minPixel);
|
|
1746
|
+
} else {
|
|
1747
|
+
// Fallback to default/active radius
|
|
1748
|
+
return isActive ? activeRadius : defaultRadius;
|
|
1749
|
+
}
|
|
1750
|
+
// Ensure minimum radius for visibility
|
|
1751
|
+
return Math.max(radius, minRadius);
|
|
1752
|
+
};
|
|
1718
1753
|
export const getRangeForScatterMarkerSize = ({ data, xScale, yScalePrimary, yScaleSecondary, useSecondaryYScale, xScaleType, yScaleType: primaryYScaleType, secondaryYScaleType })=>{
|
|
1719
1754
|
// Note: This function is executed after the scale is created, so the actual padding can be
|
|
1720
1755
|
// obtained by calculating the difference between the respective minimums or maximums of the
|
|
@@ -1956,3 +1991,9 @@ const truncateTextToFitWidth = (text, maxWidth, measure)=>{
|
|
|
1956
1991
|
}
|
|
1957
1992
|
return text.slice(0, lo) + '...';
|
|
1958
1993
|
};
|
|
1994
|
+
export function isSafeUrl(href) {
|
|
1995
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(href)) {
|
|
1996
|
+
return /^https?:/i.test(href);
|
|
1997
|
+
}
|
|
1998
|
+
return true;
|
|
1999
|
+
}
|