@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.
Files changed (55) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/dist/index.d.ts +859 -0
  3. package/lib/VegaDeclarativeChart.js +1 -0
  4. package/lib/VegaDeclarativeChart.js.map +1 -0
  5. package/lib/components/LineChart/LineChart.js +47 -7
  6. package/lib/components/LineChart/LineChart.js.map +1 -1
  7. package/lib/components/ScatterChart/ScatterChart.js +12 -12
  8. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  9. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js +405 -0
  10. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
  11. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +20 -0
  12. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
  13. package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +415 -0
  14. package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
  15. package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +537 -0
  16. package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
  17. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3279 -0
  18. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
  19. package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js +28 -0
  20. package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
  21. package/lib/components/VegaDeclarativeChart/index.js +1 -0
  22. package/lib/components/VegaDeclarativeChart/index.js.map +1 -0
  23. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +5 -2
  24. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  25. package/lib/index.js +1 -0
  26. package/lib/index.js.map +1 -1
  27. package/lib/utilities/utilities.js +41 -0
  28. package/lib/utilities/utilities.js.map +1 -1
  29. package/lib-commonjs/VegaDeclarativeChart.js +6 -0
  30. package/lib-commonjs/VegaDeclarativeChart.js.map +1 -0
  31. package/lib-commonjs/components/LineChart/LineChart.js +46 -6
  32. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  33. package/lib-commonjs/components/ScatterChart/ScatterChart.js +11 -11
  34. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  35. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js +274 -0
  36. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
  37. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +35 -0
  38. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
  39. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +412 -0
  40. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
  41. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +533 -0
  42. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
  43. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3214 -0
  44. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
  45. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js +31 -0
  46. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
  47. package/lib-commonjs/components/VegaDeclarativeChart/index.js +6 -0
  48. package/lib-commonjs/components/VegaDeclarativeChart/index.js.map +1 -0
  49. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -1
  50. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  51. package/lib-commonjs/index.js +1 -0
  52. package/lib-commonjs/index.js.map +1 -1
  53. package/lib-commonjs/utilities/utilities.js +33 -0
  54. package/lib-commonjs/utilities/utilities.js.map +1 -1
  55. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './HorizontalBarChart';\nexport * from './DonutChart';\nexport * from './Legends';\nexport * from './LineChart';\nexport * from './VerticalBarChart';\nexport * from './VerticalStackedBarChart';\nexport * from './GroupedVerticalBarChart';\nexport * from './CartesianChart';\nexport * from './types/index';\nexport * from './Sparkline';\nexport * from './ScatterChart';\nexport * from './GaugeChart';\nexport * from './utilities/colors';\nexport * from './Popover';\nexport * from './ResponsiveContainer';\nexport * from './DeclarativeChart';\nexport * from './AreaChart';\nexport * from './HorizontalBarChartWithAxis';\nexport * from './HeatMapChart';\nexport * from './SankeyChart';\nexport * from './FunnelChart';\nexport * from './GanttChart';\nexport * from './ChartTable';\nexport * from './AnnotationOnlyChart';\nexport * from './PolarChart';\n"],"names":[],"mappings":";;;;;uBAAc,uBAAuB;uBACvB,eAAe;uBACf,YAAY;uBACZ,cAAc;uBACd,qBAAqB;uBACrB,4BAA4B;uBAC5B,4BAA4B;uBAC5B,mBAAmB;uBACnB,gBAAgB;uBAChB,cAAc;uBACd,iBAAiB;uBACjB,eAAe;uBACf,qBAAqB;uBACrB,YAAY;uBACZ,wBAAwB;uBACxB,qBAAqB;uBACrB,cAAc;uBACd,+BAA+B;uBAC/B,iBAAiB;uBACjB,gBAAgB;uBAChB,gBAAgB;uBAChB,eAAe;uBACf,eAAe;uBACf,wBAAwB;uBACxB,eAAe"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './HorizontalBarChart';\nexport * from './DonutChart';\nexport * from './Legends';\nexport * from './LineChart';\nexport * from './VerticalBarChart';\nexport * from './VerticalStackedBarChart';\nexport * from './GroupedVerticalBarChart';\nexport * from './CartesianChart';\nexport * from './types/index';\nexport * from './Sparkline';\nexport * from './ScatterChart';\nexport * from './GaugeChart';\nexport * from './utilities/colors';\nexport * from './Popover';\nexport * from './ResponsiveContainer';\nexport * from './DeclarativeChart';\nexport * from './AreaChart';\nexport * from './HorizontalBarChartWithAxis';\nexport * from './HeatMapChart';\nexport * from './SankeyChart';\nexport * from './FunnelChart';\nexport * from './GanttChart';\nexport * from './ChartTable';\nexport * from './AnnotationOnlyChart';\nexport * from './PolarChart';\nexport * from './VegaDeclarativeChart';\n"],"names":[],"mappings":";;;;;uBAAc,uBAAuB;uBACvB,eAAe;uBACf,YAAY;uBACZ,cAAc;uBACd,qBAAqB;uBACrB,4BAA4B;uBAC5B,4BAA4B;uBAC5B,mBAAmB;uBACnB,gBAAgB;uBAChB,cAAc;uBACd,iBAAiB;uBACjB,eAAe;uBACf,qBAAqB;uBACrB,YAAY;uBACZ,wBAAwB;uBACxB,qBAAqB;uBACrB,cAAc;uBACd,+BAA+B;uBAC/B,iBAAiB;uBACjB,gBAAgB;uBAChB,gBAAgB;uBAChB,eAAe;uBACf,eAAe;uBACf,wBAAwB;uBACxB,eAAe;uBACf,yBAAyB"}
@@ -58,6 +58,9 @@ _export(exports, {
58
58
  calculateLongestLabelWidth: function() {
59
59
  return calculateLongestLabelWidth;
60
60
  },
61
+ calculateMarkerRadius: function() {
62
+ return calculateMarkerRadius;
63
+ },
61
64
  calculatePrecision: function() {
62
65
  return calculatePrecision;
63
66
  },
@@ -202,6 +205,9 @@ _export(exports, {
202
205
  isPlottable: function() {
203
206
  return isPlottable;
204
207
  },
208
+ isSafeUrl: function() {
209
+ return isSafeUrl;
210
+ },
205
211
  isScalePaddingDefined: function() {
206
212
  return isScalePaddingDefined;
207
213
  },
@@ -1759,6 +1765,27 @@ const getScatterXDomainExtent = (points, scaleType)=>{
1759
1765
  xMax
1760
1766
  ];
1761
1767
  };
1768
+ const calculateMarkerRadius = ({ pointMarkerSize, minMarkerSize, maxMarkerSize, extraMaxPixels, isContinuousXY, isActive = false, defaultRadius = 3.5, activeRadius = 5.5, minRadius = 4 })=>{
1769
+ const minPixel = 4;
1770
+ const maxPixel = 16;
1771
+ // If no marker size is specified, use default or active radius
1772
+ if (!pointMarkerSize) {
1773
+ return isActive ? activeRadius : defaultRadius;
1774
+ }
1775
+ let radius;
1776
+ if (isContinuousXY && maxMarkerSize !== 0) {
1777
+ // For continuous axes: scale markers based on available space
1778
+ radius = maxMarkerSize < extraMaxPixels ? pointMarkerSize : pointMarkerSize / maxMarkerSize * extraMaxPixels;
1779
+ } else if (!isContinuousXY && maxMarkerSize !== minMarkerSize) {
1780
+ // For categorical axes: normalize to pixel range [minPixel, maxPixel]
1781
+ radius = minPixel + (pointMarkerSize - minMarkerSize) / (maxMarkerSize - minMarkerSize) * (maxPixel - minPixel);
1782
+ } else {
1783
+ // Fallback to default/active radius
1784
+ return isActive ? activeRadius : defaultRadius;
1785
+ }
1786
+ // Ensure minimum radius for visibility
1787
+ return Math.max(radius, minRadius);
1788
+ };
1762
1789
  const getRangeForScatterMarkerSize = ({ data, xScale, yScalePrimary, yScaleSecondary, useSecondaryYScale, xScaleType, yScaleType: primaryYScaleType, secondaryYScaleType })=>{
1763
1790
  // Note: This function is executed after the scale is created, so the actual padding can be
1764
1791
  // obtained by calculating the difference between the respective minimums or maximums of the
@@ -1990,3 +2017,9 @@ const truncateTextToFitWidth = (text, maxWidth, measure)=>{
1990
2017
  }
1991
2018
  return text.slice(0, lo) + '...';
1992
2019
  };
2020
+ function isSafeUrl(href) {
2021
+ if (/^[a-z][a-z0-9+.-]*:/i.test(href)) {
2022
+ return /^https?:/i.test(href);
2023
+ }
2024
+ return true;
2025
+ }