@fluentui/react-charting 5.24.2 → 5.24.4

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 (192) hide show
  1. package/CHANGELOG.json +79 -1
  2. package/CHANGELOG.md +28 -2
  3. package/dist/react-charting.d.ts +204 -38
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +65 -12
  7. package/lib/ScatterChart.d.ts +1 -0
  8. package/lib/ScatterChart.js +2 -0
  9. package/lib/ScatterChart.js.map +1 -0
  10. package/lib/components/AreaChart/AreaChart.base.d.ts +1 -0
  11. package/lib/components/AreaChart/AreaChart.base.js +4 -1
  12. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  13. package/lib/components/CommonComponents/CartesianChart.base.js +47 -11
  14. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  15. package/lib/components/CommonComponents/CartesianChart.styles.js +48 -26
  16. package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  17. package/lib/components/CommonComponents/CartesianChart.types.d.ts +33 -3
  18. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  19. package/lib/components/DeclarativeChart/DeclarativeChart.js +157 -78
  20. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  21. package/lib/components/DeclarativeChart/PlotlyColorAdapter.d.ts +2 -1
  22. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +9 -1
  23. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  24. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +28 -13
  25. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +317 -126
  26. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  27. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
  28. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +22 -3
  29. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  30. package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +7 -0
  31. package/lib/components/HeatMapChart/HeatMapChart.base.js +95 -37
  32. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  33. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -0
  34. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +24 -3
  35. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  36. package/lib/components/ScatterChart/ScatterChart.base.d.ts +7 -0
  37. package/lib/components/ScatterChart/ScatterChart.base.js +482 -0
  38. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -0
  39. package/lib/components/ScatterChart/ScatterChart.d.ts +7 -0
  40. package/lib/components/ScatterChart/ScatterChart.js +10 -0
  41. package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
  42. package/lib/components/ScatterChart/ScatterChart.styles.d.ts +2 -0
  43. package/lib/components/ScatterChart/ScatterChart.styles.js +19 -0
  44. package/lib/components/ScatterChart/ScatterChart.styles.js.map +1 -0
  45. package/lib/components/ScatterChart/ScatterChart.types.d.ts +47 -0
  46. package/lib/components/ScatterChart/ScatterChart.types.js +2 -0
  47. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
  48. package/lib/components/ScatterChart/index.d.ts +2 -0
  49. package/lib/components/ScatterChart/index.js +3 -0
  50. package/lib/components/ScatterChart/index.js.map +1 -0
  51. package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
  52. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +27 -6
  53. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  54. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
  55. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +48 -31
  56. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  57. package/lib/index.d.ts +3 -1
  58. package/lib/index.js +1 -0
  59. package/lib/index.js.map +1 -1
  60. package/lib/types/IDataPoint.d.ts +91 -11
  61. package/lib/types/IDataPoint.js.map +1 -1
  62. package/lib/utilities/SVGTooltipText.d.ts +4 -0
  63. package/lib/utilities/SVGTooltipText.js +1 -2
  64. package/lib/utilities/SVGTooltipText.js.map +1 -1
  65. package/lib/utilities/utilities.d.ts +32 -5
  66. package/lib/utilities/utilities.js +132 -2
  67. package/lib/utilities/utilities.js.map +1 -1
  68. package/lib-amd/ScatterChart.d.ts +1 -0
  69. package/lib-amd/ScatterChart.js +6 -0
  70. package/lib-amd/ScatterChart.js.map +1 -0
  71. package/lib-amd/components/AreaChart/AreaChart.base.d.ts +1 -0
  72. package/lib-amd/components/AreaChart/AreaChart.base.js +4 -1
  73. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  74. package/lib-amd/components/CommonComponents/CartesianChart.base.js +47 -11
  75. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  76. package/lib-amd/components/CommonComponents/CartesianChart.styles.js +48 -26
  77. package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  78. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +33 -3
  79. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  80. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +155 -78
  81. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  82. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.d.ts +2 -1
  83. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js +11 -2
  84. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  85. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +28 -13
  86. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +327 -134
  87. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  88. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
  89. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +21 -2
  90. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  91. package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +7 -0
  92. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +94 -36
  93. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  94. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -0
  95. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +23 -2
  96. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  97. package/lib-amd/components/ScatterChart/ScatterChart.base.d.ts +7 -0
  98. package/lib-amd/components/ScatterChart/ScatterChart.base.js +476 -0
  99. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -0
  100. package/lib-amd/components/ScatterChart/ScatterChart.d.ts +7 -0
  101. package/lib-amd/components/ScatterChart/ScatterChart.js +12 -0
  102. package/lib-amd/components/ScatterChart/ScatterChart.js.map +1 -0
  103. package/lib-amd/components/ScatterChart/ScatterChart.styles.d.ts +2 -0
  104. package/lib-amd/components/ScatterChart/ScatterChart.styles.js +23 -0
  105. package/lib-amd/components/ScatterChart/ScatterChart.styles.js.map +1 -0
  106. package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +47 -0
  107. package/lib-amd/components/ScatterChart/ScatterChart.types.js +5 -0
  108. package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -0
  109. package/lib-amd/components/ScatterChart/index.d.ts +2 -0
  110. package/lib-amd/components/ScatterChart/index.js +7 -0
  111. package/lib-amd/components/ScatterChart/index.js.map +1 -0
  112. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
  113. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +26 -5
  114. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  115. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
  116. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +47 -30
  117. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  118. package/lib-amd/index.d.ts +3 -1
  119. package/lib-amd/index.js +3 -2
  120. package/lib-amd/index.js.map +1 -1
  121. package/lib-amd/types/IDataPoint.d.ts +91 -11
  122. package/lib-amd/types/IDataPoint.js.map +1 -1
  123. package/lib-amd/utilities/SVGTooltipText.d.ts +4 -0
  124. package/lib-amd/utilities/SVGTooltipText.js +1 -2
  125. package/lib-amd/utilities/SVGTooltipText.js.map +1 -1
  126. package/lib-amd/utilities/utilities.d.ts +32 -5
  127. package/lib-amd/utilities/utilities.js +135 -2
  128. package/lib-amd/utilities/utilities.js.map +1 -1
  129. package/lib-commonjs/ScatterChart.d.ts +1 -0
  130. package/lib-commonjs/ScatterChart.js +5 -0
  131. package/lib-commonjs/ScatterChart.js.map +1 -0
  132. package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +1 -0
  133. package/lib-commonjs/components/AreaChart/AreaChart.base.js +4 -1
  134. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  135. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +47 -11
  136. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  137. package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +48 -26
  138. package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  139. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +33 -3
  140. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  141. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +157 -78
  142. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  143. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.d.ts +2 -1
  144. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +11 -2
  145. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  146. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +28 -13
  147. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +327 -134
  148. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  149. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
  150. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +21 -2
  151. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  152. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +7 -0
  153. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +94 -36
  154. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  155. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -0
  156. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +23 -2
  157. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  158. package/lib-commonjs/components/ScatterChart/ScatterChart.base.d.ts +7 -0
  159. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +485 -0
  160. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -0
  161. package/lib-commonjs/components/ScatterChart/ScatterChart.d.ts +7 -0
  162. package/lib-commonjs/components/ScatterChart/ScatterChart.js +13 -0
  163. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
  164. package/lib-commonjs/components/ScatterChart/ScatterChart.styles.d.ts +2 -0
  165. package/lib-commonjs/components/ScatterChart/ScatterChart.styles.js +23 -0
  166. package/lib-commonjs/components/ScatterChart/ScatterChart.styles.js.map +1 -0
  167. package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +47 -0
  168. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +3 -0
  169. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
  170. package/lib-commonjs/components/ScatterChart/index.d.ts +2 -0
  171. package/lib-commonjs/components/ScatterChart/index.js +6 -0
  172. package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
  173. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
  174. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +26 -5
  175. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  176. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
  177. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +47 -30
  178. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  179. package/lib-commonjs/index.d.ts +3 -1
  180. package/lib-commonjs/index.js +3 -1
  181. package/lib-commonjs/index.js.map +1 -1
  182. package/lib-commonjs/types/IDataPoint.d.ts +91 -11
  183. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  184. package/lib-commonjs/utilities/SVGTooltipText.d.ts +4 -0
  185. package/lib-commonjs/utilities/SVGTooltipText.js +1 -2
  186. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  187. package/lib-commonjs/utilities/utilities.d.ts +32 -5
  188. package/lib-commonjs/utilities/utilities.js +135 -2
  189. package/lib-commonjs/utilities/utilities.js.map +1 -1
  190. package/package.json +2 -2
  191. package/src/components/CommonComponents/CartesianChart.types.ts +45 -2
  192. package/src/components/ScatterChart/ScatterChart.types.ts +67 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;;IAMS,wHAAA,kBAAkB,OAAA;IAAE,+HAAA,yBAAyB,OAAA;IAE7C,wGAAA,UAAU,OAAA;IAWV,kGAAA,OAAO,OAAA;IAAE,gGAAA,KAAK,OAAA;IASd,sGAAA,SAAS,OAAA;IAAE,oGAAA,OAAO,OAAA;IAElB,sGAAA,SAAS,OAAA;IAET,oGAAA,QAAQ,OAAA;IAUR,uHAAA,oBAAoB,OAAA;IAAE,8HAAA,2BAA2B,OAAA;IAAE,kHAAA,eAAe,OAAA;IAElE,oHAAA,gBAAgB,OAAA;IAMhB,kIAAA,uBAAuB,OAAA;IAMvB,kIAAA,uBAAuB,OAAA;IASvB,gHAAA,cAAc,OAAA;IA0Cd,uGAAA,cAAc,OAAA;IAAE,gHAAA,uBAAuB,OAAA;IAEvC,4GAAA,YAAY,OAAA;IAQZ,0GAAA,WAAW,OAAA;IASX,6GAAA,gBAAgB,OAAA;IAAE,sGAAA,SAAS,OAAA;IAAE,yGAAA,YAAY,OAAA;IAEzC,sGAAA,SAAS,OAAA;IAET,wGAAA,UAAU,OAAA;IAMV,wIAAA,0BAA0B,OAAA;IAC1B,wGAAA,cAAc,OAAA;IAAE,2GAAA,iBAAiB,OAAA;IAAE,sGAAA,YAAY,OAAA;IAC/C,mHAAA,sBAAsB,OAAA;IAAE,iHAAA,oBAAoB,OAAA;IAAE,4GAAA,eAAe,OAAA;IAE7D,wGAAA,UAAU,OAAA;IAAE,+GAAA,iBAAiB,OAAA;IAAE,8GAAA,gBAAgB,OAAA;IAE/C,oHAAA,gBAAgB,OAAA;IAEhB,0HAAA,mBAAmB,OAAA;IAAE,8HAAA,uBAAuB,OAAA","sourcesContent":["export type {\n ChartDataMode,\n IHorizontalBarChartProps,\n IHorizontalBarChartStyleProps,\n IHorizontalBarChartStyles,\n} from './HorizontalBarChart';\nexport { HorizontalBarChart, HorizontalBarChartVariant } from './HorizontalBarChart';\nexport type { IDonutChart, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './DonutChart';\nexport { DonutChart } from './DonutChart';\nexport type {\n ILegend,\n ILegendOverflowData,\n ILegendStyleProps,\n ILegendSubComponentStyles,\n ILegendsProps,\n ILegendsStyles,\n IShapeProps,\n LegendShape,\n} from './Legends';\nexport { Legends, Shape } from './Legends';\nexport type {\n IColorFillBarData,\n IColorFillBarsProps,\n IEventsAnnotationProps,\n ILineChartProps,\n ILineChartStyleProps,\n ILineChartStyles,\n} from './LineChart';\nexport { LineChart, Textbox } from './LineChart';\nexport type { IAreaChartProps, IAreaChartStyleProps, IAreaChartStyles } from './AreaChart';\nexport { AreaChart } from './AreaChart';\nexport type { IPieChart, IPieChartProps, IPieChartStyleProps, IPieChartStyles } from './PieChart';\nexport { PieChart } from './PieChart';\nexport type {\n IMultiStackedBarChartProps,\n IMultiStackedBarChartStyleProps,\n IMultiStackedBarChartStyles,\n IStackedBarChart,\n IStackedBarChartProps,\n IStackedBarChartStyleProps,\n IStackedBarChartStyles,\n} from './StackedBarChart';\nexport { MultiStackedBarChart, MultiStackedBarChartVariant, StackedBarChart } from './StackedBarChart';\nexport type { IVerticalBarChartProps, IVerticalBarChartStyleProps, IVerticalBarChartStyles } from './VerticalBarChart';\nexport { VerticalBarChart } from './VerticalBarChart';\nexport type {\n IVerticalStackedBarChartProps,\n IVerticalStackedBarChartStyleProps,\n IVerticalStackedBarChartStyles,\n} from './VerticalStackedBarChart';\nexport { VerticalStackedBarChart } from './VerticalStackedBarChart';\nexport type {\n IGroupedVerticalBarChartProps,\n IGroupedVerticalBarChartStyleProps,\n IGroupedVerticalBarChartStyles,\n} from './GroupedVerticalBarChart';\nexport { GroupedVerticalBarChart } from './GroupedVerticalBarChart';\nexport type {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IChildProps,\n IModifiedCartesianChartProps,\n IYValueHover,\n} from './CartesianChart';\nexport { CartesianChart } from './CartesianChart';\nexport type {\n IAccessibilityProps,\n IBasestate,\n IChartDataPoint,\n IChartProps,\n ICustomizedCalloutData,\n ICustomizedCalloutDataPoint,\n IDataPoint,\n IGVBarChartSeriesPoint,\n IGVDataPoint,\n IGVForBarChart,\n IGVSingleDataPoint,\n IGroupedVerticalBarChartData,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IHorizontalBarChartWithAxisDataPoint,\n IHorizontalDataPoint,\n ILegendDataItem,\n ILineChartDataPoint,\n ILineChartGap,\n ILineChartLineOptions,\n ILineChartPoints,\n ILineDataInVerticalBarChart,\n ILineDataInVerticalStackedBarChart,\n IMargins,\n IRefArrayData,\n ISankeyChartData,\n IVSChartDataPoint,\n IVerticalBarChartDataPoint,\n IVerticalStackedBarDataPoint,\n IVerticalStackedChartProps,\n SLink,\n SNode,\n IChart,\n IImageExportOptions,\n} from './types/index';\nexport type {\n IChartHoverCardProps,\n IChartHoverCardStyleProps,\n IChartHoverCardStyles,\n} from './utilities/ChartHoverCard/index';\nexport { ChartHoverCard, getChartHoverCardStyles } from './utilities/ChartHoverCard/index';\nexport type { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart';\nexport { HeatMapChart } from './HeatMapChart';\nexport type {\n ISankeyChartAccessibilityProps,\n ISankeyChartProps,\n ISankeyChartStrings,\n ISankeyChartStyleProps,\n ISankeyChartStyles,\n} from './SankeyChart';\nexport { SankeyChart } from './SankeyChart';\nexport type {\n ITreeChartDataPoint,\n ITreeDataStructure,\n ITreeProps,\n ITreeState,\n ITreeStyleProps,\n ITreeStyles,\n} from './TreeChart';\nexport { NodesComposition, TreeChart, TreeTraverse } from './TreeChart';\nexport type { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from './Sparkline';\nexport { Sparkline } from './Sparkline';\nexport type { IChartTableProps, IChartTableStyleProps, IChartTableStyles } from './ChartTable';\nexport { ChartTable } from './ChartTable';\nexport type {\n IHorizontalBarChartWithAxisProps,\n IHorizontalBarChartWithAxisStyleProps,\n IHorizontalBarChartWithAxisStyles,\n} from './HorizontalBarChartWithAxis';\nexport { HorizontalBarChartWithAxis } from './HorizontalBarChartWithAxis';\nexport { DataVizPalette, getColorFromToken, getNextColor } from './utilities/colors';\nexport { DataVizGradientPalette, getGradientFromToken, getNextGradient } from './utilities/gradients';\nexport type { IGaugeChartProps, IGaugeChartSegment, IGaugeChartStyleProps, IGaugeChartStyles } from './GaugeChart';\nexport { GaugeChart, GaugeChartVariant, GaugeValueFormat } from './GaugeChart';\nexport type { DeclarativeChartProps, Schema, IDeclarativeChart } from './DeclarativeChart';\nexport { DeclarativeChart } from './DeclarativeChart';\nexport type { IResponsiveContainerProps, IResponsiveChildProps } from './ResponsiveContainer';\nexport { ResponsiveContainer, withResponsiveContainer } from './ResponsiveContainer';\n\nimport './version';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;;IAMS,wHAAA,kBAAkB,OAAA;IAAE,+HAAA,yBAAyB,OAAA;IAE7C,wGAAA,UAAU,OAAA;IAWV,kGAAA,OAAO,OAAA;IAAE,gGAAA,KAAK,OAAA;IASd,sGAAA,SAAS,OAAA;IAAE,oGAAA,OAAO,OAAA;IAClB,4GAAA,YAAY,OAAA;IAEZ,sGAAA,SAAS,OAAA;IAET,oGAAA,QAAQ,OAAA;IAUR,uHAAA,oBAAoB,OAAA;IAAE,8HAAA,2BAA2B,OAAA;IAAE,kHAAA,eAAe,OAAA;IAElE,oHAAA,gBAAgB,OAAA;IAMhB,kIAAA,uBAAuB,OAAA;IAMvB,kIAAA,uBAAuB,OAAA;IASvB,gHAAA,cAAc,OAAA;IA8Cd,uGAAA,cAAc,OAAA;IAAE,gHAAA,uBAAuB,OAAA;IAEvC,4GAAA,YAAY,OAAA;IAQZ,0GAAA,WAAW,OAAA;IASX,6GAAA,gBAAgB,OAAA;IAAE,sGAAA,SAAS,OAAA;IAAE,yGAAA,YAAY,OAAA;IAEzC,sGAAA,SAAS,OAAA;IAET,wGAAA,UAAU,OAAA;IAMV,wIAAA,0BAA0B,OAAA;IAC1B,wGAAA,cAAc,OAAA;IAAE,2GAAA,iBAAiB,OAAA;IAAE,sGAAA,YAAY,OAAA;IAC/C,mHAAA,sBAAsB,OAAA;IAAE,iHAAA,oBAAoB,OAAA;IAAE,4GAAA,eAAe,OAAA;IAE7D,wGAAA,UAAU,OAAA;IAAE,+GAAA,iBAAiB,OAAA;IAAE,8GAAA,gBAAgB,OAAA;IAE/C,oHAAA,gBAAgB,OAAA;IAEhB,0HAAA,mBAAmB,OAAA;IAAE,8HAAA,uBAAuB,OAAA","sourcesContent":["export type {\n ChartDataMode,\n IHorizontalBarChartProps,\n IHorizontalBarChartStyleProps,\n IHorizontalBarChartStyles,\n} from './HorizontalBarChart';\nexport { HorizontalBarChart, HorizontalBarChartVariant } from './HorizontalBarChart';\nexport type { IDonutChart, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './DonutChart';\nexport { DonutChart } from './DonutChart';\nexport type {\n ILegend,\n ILegendOverflowData,\n ILegendStyleProps,\n ILegendSubComponentStyles,\n ILegendsProps,\n ILegendsStyles,\n IShapeProps,\n LegendShape,\n} from './Legends';\nexport { Legends, Shape } from './Legends';\nexport type {\n IColorFillBarData,\n IColorFillBarsProps,\n IEventsAnnotationProps,\n ILineChartProps,\n ILineChartStyleProps,\n ILineChartStyles,\n} from './LineChart';\nexport { LineChart, Textbox } from './LineChart';\nexport { ScatterChart } from './ScatterChart';\nexport type { IAreaChartProps, IAreaChartStyleProps, IAreaChartStyles } from './AreaChart';\nexport { AreaChart } from './AreaChart';\nexport type { IPieChart, IPieChartProps, IPieChartStyleProps, IPieChartStyles } from './PieChart';\nexport { PieChart } from './PieChart';\nexport type {\n IMultiStackedBarChartProps,\n IMultiStackedBarChartStyleProps,\n IMultiStackedBarChartStyles,\n IStackedBarChart,\n IStackedBarChartProps,\n IStackedBarChartStyleProps,\n IStackedBarChartStyles,\n} from './StackedBarChart';\nexport { MultiStackedBarChart, MultiStackedBarChartVariant, StackedBarChart } from './StackedBarChart';\nexport type { IVerticalBarChartProps, IVerticalBarChartStyleProps, IVerticalBarChartStyles } from './VerticalBarChart';\nexport { VerticalBarChart } from './VerticalBarChart';\nexport type {\n IVerticalStackedBarChartProps,\n IVerticalStackedBarChartStyleProps,\n IVerticalStackedBarChartStyles,\n} from './VerticalStackedBarChart';\nexport { VerticalStackedBarChart } from './VerticalStackedBarChart';\nexport type {\n IGroupedVerticalBarChartProps,\n IGroupedVerticalBarChartStyleProps,\n IGroupedVerticalBarChartStyles,\n} from './GroupedVerticalBarChart';\nexport { GroupedVerticalBarChart } from './GroupedVerticalBarChart';\nexport type {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IChildProps,\n IModifiedCartesianChartProps,\n IYValueHover,\n} from './CartesianChart';\nexport { CartesianChart } from './CartesianChart';\nexport type {\n IAccessibilityProps,\n IBasestate,\n IChartDataPoint,\n IChartProps,\n ICustomizedCalloutData,\n ICustomizedCalloutDataPoint,\n IDataPoint,\n IGVBarChartSeriesPoint,\n IGVDataPoint,\n IGVForBarChart,\n IGVSingleDataPoint,\n IGroupedVerticalBarChartData,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IHorizontalBarChartWithAxisDataPoint,\n IHorizontalDataPoint,\n ILegendDataItem,\n ILineChartDataPoint,\n ILineChartGap,\n ILineChartLineOptions,\n ILineChartPoints,\n ILineDataInVerticalBarChart,\n ILineDataInVerticalStackedBarChart,\n IMargins,\n IRefArrayData,\n ISankeyChartData,\n IVSChartDataPoint,\n IVerticalBarChartDataPoint,\n IVerticalStackedBarDataPoint,\n IVerticalStackedChartProps,\n SLink,\n SNode,\n IChart,\n IImageExportOptions,\n IScatterChartPoints,\n IScatterChartDataPoint,\n IBaseDataPoint,\n AxisCategoryOrder,\n} from './types/index';\nexport type {\n IChartHoverCardProps,\n IChartHoverCardStyleProps,\n IChartHoverCardStyles,\n} from './utilities/ChartHoverCard/index';\nexport { ChartHoverCard, getChartHoverCardStyles } from './utilities/ChartHoverCard/index';\nexport type { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart';\nexport { HeatMapChart } from './HeatMapChart';\nexport type {\n ISankeyChartAccessibilityProps,\n ISankeyChartProps,\n ISankeyChartStrings,\n ISankeyChartStyleProps,\n ISankeyChartStyles,\n} from './SankeyChart';\nexport { SankeyChart } from './SankeyChart';\nexport type {\n ITreeChartDataPoint,\n ITreeDataStructure,\n ITreeProps,\n ITreeState,\n ITreeStyleProps,\n ITreeStyles,\n} from './TreeChart';\nexport { NodesComposition, TreeChart, TreeTraverse } from './TreeChart';\nexport type { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from './Sparkline';\nexport { Sparkline } from './Sparkline';\nexport type { IChartTableProps, IChartTableStyleProps, IChartTableStyles } from './ChartTable';\nexport { ChartTable } from './ChartTable';\nexport type {\n IHorizontalBarChartWithAxisProps,\n IHorizontalBarChartWithAxisStyleProps,\n IHorizontalBarChartWithAxisStyles,\n} from './HorizontalBarChartWithAxis';\nexport { HorizontalBarChartWithAxis } from './HorizontalBarChartWithAxis';\nexport { DataVizPalette, getColorFromToken, getNextColor } from './utilities/colors';\nexport { DataVizGradientPalette, getGradientFromToken, getNextGradient } from './utilities/gradients';\nexport type { IGaugeChartProps, IGaugeChartSegment, IGaugeChartStyleProps, IGaugeChartStyles } from './GaugeChart';\nexport { GaugeChart, GaugeChartVariant, GaugeValueFormat } from './GaugeChart';\nexport type { DeclarativeChartProps, Schema, IDeclarativeChart } from './DeclarativeChart';\nexport { DeclarativeChart } from './DeclarativeChart';\nexport type { IResponsiveContainerProps, IResponsiveChildProps } from './ResponsiveContainer';\nexport { ResponsiveContainer, withResponsiveContainer } from './ResponsiveContainer';\nexport type { IScatterChartProps, IScatterChartStyleProps, IScatterChartStyles } from './ScatterChart';\n\nimport './version';\n"]}
@@ -261,17 +261,7 @@ export interface ILineDataInVerticalBarChart {
261
261
  /**
262
262
  * {@docCategory IChartData}
263
263
  */
264
- export interface ILineChartDataPoint {
265
- /**
266
- * Independent value of the data point, rendered along the x-axis.
267
- * If x is a number, then each y-coordinate is plotted at its x-coordinate.
268
- * If data type on x is Date, then the data is spaced evenly by d3-scale
269
- */
270
- x: number | Date;
271
- /**
272
- * Dependent value of the data point, rendered along the y-axis.
273
- */
274
- y: number;
264
+ export interface IBaseDataPoint {
275
265
  /**
276
266
  * Defines the function that is executed on clicking line
277
267
  */
@@ -307,6 +297,21 @@ export interface ILineChartDataPoint {
307
297
  */
308
298
  text?: string;
309
299
  }
300
+ /**
301
+ * {@docCategory IChartData}
302
+ */
303
+ export interface ILineChartDataPoint extends IBaseDataPoint {
304
+ /**
305
+ * Independent value of the data point, rendered along the x-axis.
306
+ * If x is a number, then each y-coordinate is plotted at its x-coordinate.
307
+ * If data type on x is Date, then the data is spaced evenly by d3-scale
308
+ */
309
+ x: number | Date;
310
+ /**
311
+ * Dependent value of the data point, rendered along the y-axis.
312
+ */
313
+ y: number;
314
+ }
310
315
  /**
311
316
  * {@docCategory IChartData}
312
317
  */
@@ -439,6 +444,10 @@ export interface IChartProps {
439
444
  * data for the points in the line chart
440
445
  */
441
446
  lineChartData?: ILineChartPoints[];
447
+ /**
448
+ * data for the points in the scatter chart
449
+ */
450
+ scatterChartData?: IScatterChartPoints[];
442
451
  /**
443
452
  * data for the points in the line chart
444
453
  */
@@ -762,4 +771,75 @@ export interface IImageExportOptions {
762
771
  scale?: number;
763
772
  background?: string;
764
773
  }
774
+ /**
775
+ * {@docCategory IChartData}
776
+ * ScatterChartDataPoint interface.
777
+ */
778
+ export interface IScatterChartDataPoint extends IBaseDataPoint {
779
+ /**
780
+ * Independent value of the data point, rendered along the x-axis.
781
+ */
782
+ x: number | Date | string;
783
+ /**
784
+ * Dependent value of the data point, rendered along the y-axis.
785
+ */
786
+ y: number;
787
+ }
788
+ /**
789
+ * {@docCategory IChartData}
790
+ */
791
+ export interface IScatterChartPoints {
792
+ /**
793
+ * Legend text for the datapoint in the chart
794
+ */
795
+ legend: string;
796
+ /**
797
+ * The shape for the legend
798
+ * default: show the rect legend
799
+ */
800
+ legendShape?: LegendShape;
801
+ /**
802
+ * dataPoints for the line chart
803
+ */
804
+ data: IScatterChartDataPoint[];
805
+ /**
806
+ * color for the legend in the chart
807
+ */
808
+ color?: string;
809
+ /**
810
+ * opacity for chart fill color
811
+ */
812
+ opacity?: number;
813
+ /**
814
+ * hide dots for points that are not active
815
+ */
816
+ hideNonActiveDots?: boolean;
817
+ /**
818
+ * Defines the function that is executed on clicking this legend
819
+ */
820
+ onLegendClick?: (selectedLegend: string | null | string[]) => void;
821
+ /**
822
+ * Whether to use the secondary y scale or not
823
+ * False by default.
824
+ */
825
+ useSecondaryYScale?: boolean;
826
+ }
827
+ /**
828
+ * Specifies the ordering options for axis categories in Cartesian charts.
829
+ *
830
+ * - `'default'`: Uses the original order before custom ordering was supported.
831
+ * In some charts, this behaves the same as `'data'`.
832
+ * - `'data'`: Preserves the order of categories as provided in the input data.
833
+ * - `string[]`: Explicitly defines the custom order of categories as an array of category names.
834
+ * - `'category ascending' | 'category descending'`: Orders categories alphanumerically.
835
+ * - `'total ascending' | 'total descending'`: Orders categories by the total of their associated values.
836
+ * - `'min ascending' | 'min descending'`: Orders by the minimum value within each category.
837
+ * - `'max ascending' | 'max descending'`: Orders by the maximum value within each category.
838
+ * - `'sum ascending' | 'sum descending'`: Orders by the sum of values for each category (same as 'total').
839
+ * - `'mean ascending' | 'mean descending'`: Orders by the average of values in each category.
840
+ * - `'median ascending' | 'median descending'`: Orders by the median value of each category.
841
+ *
842
+ * {@docCategory CartesianChart}
843
+ */
844
+ export type AxisCategoryOrder = 'default' | 'data' | string[] | 'category ascending' | 'category descending' | 'total ascending' | 'total descending' | 'min ascending' | 'min descending' | 'max ascending' | 'max descending' | 'sum ascending' | 'sum descending' | 'mean ascending' | 'mean descending' | 'median ascending' | 'median descending';
765
845
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { SankeyLink, SankeyNode } from 'd3-sankey';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport { CurveFactory } from 'd3-shape';\n\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number | string;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number | string; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalStackedBarDataPoint extends Omit<IDataPoint, 'x'> {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n * If data type on x is Date, then the data is spaced evenly by d3-scale.\n */\n x: number | string | Date;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalBarChartWithAxisDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: number;\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface ILineChartLineOptions extends React.SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n\n /**\n * Defines the type of interpolation used to render the line.\n * @default 'linear'\n */\n curve?: 'linear' | 'natural' | 'step' | 'stepAfter' | 'stepBefore' | CurveFactory;\n\n /**\n * Defines the mode of points to be rendered.\n */\n mode?:\n | 'lines'\n | 'markers'\n | 'text'\n | 'lines+markers'\n | 'text+markers'\n | 'text+lines'\n | 'text+lines+markers'\n | 'none'\n | 'gauge'\n | 'number'\n | 'delta'\n | 'number+delta'\n | 'gauge+number'\n | 'gauge+number+delta'\n | 'gauge+delta'\n | 'markers+text';\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: React.SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: React.SVGProps<SVGLineElement>;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n /**\n * A unique identifier for this node.\n */\n nodeId: number | string;\n /**\n * The display name for this node in the UX.\n */\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface ISLinkExtra {\n /**\n * The index within `ISankeyChartData.nodes` of the source node.\n */\n source: number;\n /**\n * The index within `ISankeyChartData.nodes` of the target node.\n */\n target: number;\n /**\n * The weight of this link between the two nodes.\n */\n value: number;\n unnormalizedValue?: number;\n}\n\nexport type SNode = SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = SankeyLink<ISNodeExtra, ISLinkExtra>;\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string | Date;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalStackedBarChart {\n y: number | string;\n color: string;\n legend: string;\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n /**\n * Data to show in callout\n */\n data?: number | string;\n yAxisCalloutData?: string;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IChart {\n chartContainer: HTMLElement | null;\n toImage?: (opts?: IImageExportOptions) => Promise<string>;\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IImageExportOptions {\n width?: number;\n height?: number;\n scale?: number;\n background?: string;\n}\n"]}
1
+ {"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { SankeyLink, SankeyNode } from 'd3-sankey';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport { CurveFactory } from 'd3-shape';\n\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number | string;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number | string; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalStackedBarDataPoint extends Omit<IDataPoint, 'x'> {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n * If data type on x is Date, then the data is spaced evenly by d3-scale.\n */\n x: number | string | Date;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalBarChartWithAxisDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: number;\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IBaseDataPoint {\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartDataPoint extends IBaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface ILineChartLineOptions extends React.SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n\n /**\n * Defines the type of interpolation used to render the line.\n * @default 'linear'\n */\n curve?: 'linear' | 'natural' | 'step' | 'stepAfter' | 'stepBefore' | CurveFactory;\n\n /**\n * Defines the mode of points to be rendered.\n */\n mode?:\n | 'lines'\n | 'markers'\n | 'text'\n | 'lines+markers'\n | 'text+markers'\n | 'text+lines'\n | 'text+lines+markers'\n | 'none'\n | 'gauge'\n | 'number'\n | 'delta'\n | 'number+delta'\n | 'gauge+number'\n | 'gauge+number+delta'\n | 'gauge+delta'\n | 'markers+text';\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the scatter chart\n */\n scatterChartData?: IScatterChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: React.SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: React.SVGProps<SVGLineElement>;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n /**\n * A unique identifier for this node.\n */\n nodeId: number | string;\n /**\n * The display name for this node in the UX.\n */\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface ISLinkExtra {\n /**\n * The index within `ISankeyChartData.nodes` of the source node.\n */\n source: number;\n /**\n * The index within `ISankeyChartData.nodes` of the target node.\n */\n target: number;\n /**\n * The weight of this link between the two nodes.\n */\n value: number;\n unnormalizedValue?: number;\n}\n\nexport type SNode = SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = SankeyLink<ISNodeExtra, ISLinkExtra>;\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string | Date;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalStackedBarChart {\n y: number | string;\n color: string;\n legend: string;\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n /**\n * Data to show in callout\n */\n data?: number | string;\n yAxisCalloutData?: string;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IChart {\n chartContainer: HTMLElement | null;\n toImage?: (opts?: IImageExportOptions) => Promise<string>;\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IImageExportOptions {\n width?: number;\n height?: number;\n scale?: number;\n background?: string;\n}\n\n/**\n * {@docCategory IChartData}\n * ScatterChartDataPoint interface.\n */\nexport interface IScatterChartDataPoint extends IBaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n */\n x: number | Date | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IScatterChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: IScatterChartDataPoint[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * Specifies the ordering options for axis categories in Cartesian charts.\n *\n * - `'default'`: Uses the original order before custom ordering was supported.\n * In some charts, this behaves the same as `'data'`.\n * - `'data'`: Preserves the order of categories as provided in the input data.\n * - `string[]`: Explicitly defines the custom order of categories as an array of category names.\n * - `'category ascending' | 'category descending'`: Orders categories alphanumerically.\n * - `'total ascending' | 'total descending'`: Orders categories by the total of their associated values.\n * - `'min ascending' | 'min descending'`: Orders by the minimum value within each category.\n * - `'max ascending' | 'max descending'`: Orders by the maximum value within each category.\n * - `'sum ascending' | 'sum descending'`: Orders by the sum of values for each category (same as 'total').\n * - `'mean ascending' | 'mean descending'`: Orders by the average of values in each category.\n * - `'median ascending' | 'median descending'`: Orders by the median value of each category.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisCategoryOrder =\n | 'default'\n | 'data'\n | string[]\n | 'category ascending'\n | 'category descending'\n | 'total ascending'\n | 'total descending'\n | 'min ascending'\n | 'min descending'\n | 'max ascending'\n | 'max descending'\n | 'sum ascending'\n | 'sum descending'\n | 'mean ascending'\n | 'mean descending'\n | 'median ascending'\n | 'median descending';\n"]}
@@ -61,6 +61,10 @@ interface ISVGTooltipTextProps {
61
61
  * Prop to selectively display the tooltip background
62
62
  */
63
63
  showBackground?: boolean;
64
+ /**
65
+ * Prop to set classname
66
+ */
67
+ className?: string;
64
68
  }
65
69
  interface ISVGTooltipTextState {
66
70
  isTooltipVisible: boolean;
@@ -158,11 +158,10 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Tooltip", "
158
158
  onMouseLeave: this._onTooltipMouseLeave,
159
159
  }, onMouseEnter: this._onTooltipMouseEnter, onMouseLeave: this._onTooltipMouseLeave }, tooltipProps);
160
160
  var showTooltip = (!!this.props.isTooltipVisibleProp && this.state.isOverflowing && !!content) || (isTooltipVisible && !!content);
161
- var backgroundColor = this.props.theme ? this.props.theme.semanticColors.bodyBackground : undefined;
162
161
  var rectX = (typeof (textProps === null || textProps === void 0 ? void 0 : textProps.x) === 'number' ? textProps.x : 0) - (textWidth !== null && textWidth !== void 0 ? textWidth : 0) / 2 - PADDING;
163
162
  var rectY = (typeof (textProps === null || textProps === void 0 ? void 0 : textProps.y) === 'number' ? textProps.y : 0) - (textHeight !== null && textHeight !== void 0 ? textHeight : 0) / 2 - PADDING;
164
163
  return (React.createElement(React.Fragment, null,
165
- showBackground && (React.createElement("rect", { x: rectX, y: rectY, width: (textWidth !== null && textWidth !== void 0 ? textWidth : 0) + 2 * PADDING, height: (textHeight !== null && textHeight !== void 0 ? textHeight : 0) + 2 * PADDING, fill: backgroundColor, transform: textProps === null || textProps === void 0 ? void 0 : textProps.transform })),
164
+ showBackground && (React.createElement("rect", { x: rectX, y: rectY, width: (textWidth !== null && textWidth !== void 0 ? textWidth : 0) + 2 * PADDING, height: (textHeight !== null && textHeight !== void 0 ? textHeight : 0) + 2 * PADDING, transform: textProps === null || textProps === void 0 ? void 0 : textProps.transform, className: this.props.className })),
166
165
  React.createElement("text", tslib_1.__assign({}, textProps, { id: this._tooltipHostId, ref: this._tooltipHost, onFocusCapture: this._onTooltipFocus, onBlurCapture: this._onTooltipBlur, onMouseEnter: this._onTooltipMouseEnter, onMouseLeave: this._onTooltipMouseLeave, onKeyDown: this._onTooltipKeyDown, "data-is-focusable": shouldReceiveFocus && this.state.isOverflowing }), content),
167
166
  showTooltip && React.createElement(Tooltip_1.Tooltip, tslib_1.__assign({}, tooltipRenderProps))));
168
167
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SVGTooltipText.js","sourceRoot":"../src/","sources":["utilities/SVGTooltipText.tsx"],"names":[],"mappings":";;;;IAuFA,IAAM,OAAO,GAAG,CAAC,CAAC;IAElB;;;OAGG;IACH;QACU,0CAA2D;QAkBnE,wBAAY,KAA2B;YACrC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;YAVf,6CAA6C;YACrC,kBAAY,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;YAKjD,oBAAc,GAAG,IAAA,iBAAK,EAAC,cAAc,CAAC,CAAC;YAqFxC,UAAI,GAAG;gBACZ,KAAI,CAAC,cAAc,CAAC,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AS,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS,EAAE,CAAC;gBAC/F,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpB,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;QAEM,6CAAoB,GAA3B;YACE,IAAI,cAAc,CAAC,sBAAsB,IAAI,cAAc,CAAC,sBAAsB,KAAK,IAAI,EAAE,CAAC;gBAC5F,cAAc,CAAC,sBAAsB,GAAG,SAAS,CAAC;YACpD,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC;QA/Fa,2BAAY,GAAG;YAC3B,KAAK,EAAE,sBAAY,CAAC,MAAM;SAC3B,AAFyB,CAExB;QAyPJ,qBAAC;KAAA,AA/PD,CACU,KAAK,CAAC,SAAS,GA8PxB;IA/PY,wCAAc","sourcesContent":["import * as React from 'react';\nimport { ITooltipHost, ITooltipProps, Tooltip, TooltipDelay } from '@fluentui/react/lib/Tooltip';\nimport { Async, KeyCodes, getId, portalContainsElement } from '../Utilities';\nimport { ITheme } from '@fluentui/react';\n\ninterface ISVGTooltipTextProps {\n /**\n * Number of milliseconds to delay closing the tooltip, so that the user has time to hover over\n * the tooltip and interact with it. Hovering over the tooltip will count as hovering over the\n * host, so that the tooltip will stay open if the user is actively interacting with it.\n */\n closeDelay?: number;\n\n /**\n * Content to display in the Tooltip.\n */\n content?: string;\n\n /**\n * Length of delay before showing the tooltip on hover.\n * @defaultvalue TooltipDelay.medium\n */\n delay?: TooltipDelay;\n\n /**\n * Additional properties to pass through for Tooltip.\n */\n tooltipProps?: ITooltipProps;\n\n /**\n * Additional properties to pass through for SVG <text>.\n */\n textProps?: React.SVGAttributes<SVGTextElement>;\n\n /**\n * Max width of text\n */\n maxWidth?: number;\n\n /**\n * Max height of text\n */\n maxHeight?: number;\n\n /**\n * Pass false to make prevent the tooptip from receiving focus through keyboard\n * Eg: In Pie Chart, the focus should only land on the arcs and not on the text to\n * avoid repitition of the same datapoint\n * @defaultvalue true\n */\n shouldReceiveFocus?: boolean;\n\n /**\n * Pass true to show tooltip directly\n * Eg: In Pie Chart, the tooltip is shown when the arc is focussed, so the prop is set to true,\n * to directly show the tooltip from this component\n * @defaultvalue false\n */\n isTooltipVisibleProp?: boolean;\n\n /**\n * Function to wrap text within specified width and height\n * and return a boolean value indicating whether the text overflowed\n */\n wrapContent?: (content: string, id: string, maxWidth: number, maxHeight?: number) => boolean;\n\n /**\n * Theme provided by High Order Component\n */\n theme?: ITheme;\n\n /**\n * @default false\n * Prop to selectively display the tooltip background\n */\n showBackground?: boolean;\n}\n\ninterface ISVGTooltipTextState {\n isTooltipVisible: boolean;\n isOverflowing: boolean;\n textX?: number;\n textY?: number;\n textWidth?: number;\n textHeight?: number;\n}\n\nconst PADDING = 4;\n\n/**\n * Component to render an SVG text element with an optional tooltip.\n * The tooltip appears on hovering and focusing the element when its content overflows.\n */\nexport class SVGTooltipText\n extends React.Component<ISVGTooltipTextProps, ISVGTooltipTextState>\n implements ITooltipHost\n{\n public static defaultProps = {\n delay: TooltipDelay.medium,\n };\n\n private static _currentVisibleTooltip: ITooltipHost | undefined;\n\n /** The element that gets the hover events */\n private _tooltipHost = React.createRef<SVGTextElement>();\n\n private _async: Async;\n private _dismissTimerId: number;\n private _openTimerId: number;\n private _tooltipHostId = getId('tooltip-host');\n private _ignoreNextFocusEvent: boolean;\n\n constructor(props: ISVGTooltipTextProps) {\n super(props);\n\n this.state = {\n isTooltipVisible: false,\n isOverflowing: false,\n };\n\n this._async = new Async(this);\n }\n\n public render(): React.ReactNode {\n const { content, tooltipProps, textProps, shouldReceiveFocus = true, showBackground = false } = this.props;\n const { isTooltipVisible, textWidth, textHeight } = this.state;\n const tooltipRenderProps: ITooltipProps = {\n content,\n targetElement: this._getTargetElement(),\n calloutProps: {\n onDismiss: this._hideTooltip,\n onMouseEnter: this._onTooltipMouseEnter,\n onMouseLeave: this._onTooltipMouseLeave,\n },\n onMouseEnter: this._onTooltipMouseEnter,\n onMouseLeave: this._onTooltipMouseLeave,\n ...tooltipProps,\n };\n\n const showTooltip =\n (!!this.props.isTooltipVisibleProp && this.state.isOverflowing && !!content) || (isTooltipVisible && !!content);\n const backgroundColor = this.props.theme ? this.props.theme.semanticColors.bodyBackground : undefined;\n const rectX = (typeof textProps?.x === 'number' ? textProps.x : 0) - (textWidth ?? 0) / 2 - PADDING;\n const rectY = (typeof textProps?.y === 'number' ? textProps.y : 0) - (textHeight ?? 0) / 2 - PADDING;\n return (\n <>\n {showBackground && (\n <rect\n x={rectX}\n y={rectY}\n width={(textWidth ?? 0) + 2 * PADDING}\n height={(textHeight ?? 0) + 2 * PADDING}\n fill={backgroundColor}\n transform={textProps?.transform}\n />\n )}\n <text\n {...textProps}\n id={this._tooltipHostId}\n ref={this._tooltipHost}\n onFocusCapture={this._onTooltipFocus}\n onBlurCapture={this._onTooltipBlur}\n onMouseEnter={this._onTooltipMouseEnter}\n onMouseLeave={this._onTooltipMouseLeave}\n onKeyDown={this._onTooltipKeyDown}\n data-is-focusable={shouldReceiveFocus && this.state.isOverflowing}\n >\n {content}\n </text>\n {showTooltip && <Tooltip {...tooltipRenderProps} />}\n </>\n );\n }\n\n public componentDidMount(): void {\n this._wrapContent();\n this._measureText();\n }\n\n public componentDidUpdate(prevProps: Readonly<ISVGTooltipTextProps>): void {\n if (this.props.maxWidth !== prevProps.maxWidth || this.props.maxHeight !== prevProps.maxHeight) {\n this._wrapContent();\n this._measureText();\n }\n }\n\n public componentWillUnmount(): void {\n if (SVGTooltipText._currentVisibleTooltip && SVGTooltipText._currentVisibleTooltip === this) {\n SVGTooltipText._currentVisibleTooltip = undefined;\n }\n\n this._async.dispose();\n }\n\n public show = (): void => {\n this._toggleTooltip(true);\n };\n\n public dismiss = (): void => {\n this._hideTooltip();\n };\n\n private _measureText = (): void => {\n if (this._tooltipHost.current && typeof this._tooltipHost.current.getBBox === 'function') {\n const bbox = this._tooltipHost.current.getBBox();\n this.setState({\n textX: bbox.x,\n textY: bbox.y,\n textWidth: bbox.width,\n textHeight: bbox.height,\n });\n }\n };\n\n private _getTargetElement = (): HTMLElement | undefined => {\n if (!this._tooltipHost.current) {\n return undefined;\n }\n\n return this._tooltipHost.current as unknown as HTMLElement;\n };\n\n private _onTooltipFocus = (ev: React.FocusEvent<SVGElement>) => {\n if (this._ignoreNextFocusEvent) {\n this._ignoreNextFocusEvent = false;\n return;\n }\n\n this._onTooltipMouseEnter(ev);\n };\n\n private _onTooltipBlur = (ev: React.FocusEvent<SVGElement>) => {\n // The focused element gets a blur event when the document loses focus\n // (e.g. switching tabs in the browser), but we don't want to show the\n // tooltip again when the document gets focus back. Handle this case by\n // checking if the blurred element is still the document's activeElement,\n // and ignoring when it next gets focus back.\n // See https://github.com/microsoft/fluentui/issues/13541\n this._ignoreNextFocusEvent = document?.activeElement === ev.target;\n\n this._dismissTimerId = this._async.setTimeout(() => {\n this._hideTooltip();\n }, 0);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onTooltipMouseEnter = (ev: any): void => {\n const { delay } = this.props;\n\n if (SVGTooltipText._currentVisibleTooltip && SVGTooltipText._currentVisibleTooltip !== this) {\n SVGTooltipText._currentVisibleTooltip.dismiss();\n }\n SVGTooltipText._currentVisibleTooltip = this;\n\n if (!this.state.isOverflowing) {\n return;\n }\n\n if (ev.target && portalContainsElement(ev.target as HTMLElement, this._getTargetElement())) {\n // Do not show tooltip when target is inside a portal relative to TooltipHost.\n return;\n }\n\n this._clearDismissTimer();\n this._clearOpenTimer();\n\n if (delay !== TooltipDelay.zero) {\n const delayTime = this._getDelayTime(delay!); // non-null assertion because we set it in `defaultProps`\n\n this._openTimerId = this._async.setTimeout(() => {\n this._toggleTooltip(true);\n }, delayTime);\n } else {\n this._toggleTooltip(true);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onTooltipMouseLeave = (ev: any): void => {\n const { closeDelay } = this.props;\n\n this._clearDismissTimer();\n this._clearOpenTimer();\n\n if (closeDelay) {\n this._dismissTimerId = this._async.setTimeout(() => {\n this._toggleTooltip(false);\n }, closeDelay);\n } else {\n this._toggleTooltip(false);\n }\n\n if (SVGTooltipText._currentVisibleTooltip === this) {\n SVGTooltipText._currentVisibleTooltip = undefined;\n }\n };\n\n private _onTooltipKeyDown = (ev: React.KeyboardEvent<SVGElement>): void => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if ((ev.which === KeyCodes.escape || ev.ctrlKey) && this.state.isTooltipVisible) {\n this._hideTooltip();\n ev.stopPropagation();\n }\n };\n\n private _clearDismissTimer = (): void => {\n this._async.clearTimeout(this._dismissTimerId);\n };\n\n private _clearOpenTimer = (): void => {\n this._async.clearTimeout(this._openTimerId);\n };\n\n private _hideTooltip = (): void => {\n this._clearOpenTimer();\n this._clearDismissTimer();\n this._toggleTooltip(false);\n };\n\n private _toggleTooltip = (isTooltipVisible: boolean): void => {\n if (this.state.isTooltipVisible !== isTooltipVisible) {\n this.setState({ isTooltipVisible });\n }\n };\n\n private _getDelayTime = (delay: TooltipDelay): number => {\n switch (delay) {\n case TooltipDelay.medium:\n return 300;\n case TooltipDelay.long:\n return 500;\n default:\n return 0;\n }\n };\n\n private _wrapContent = () => {\n const { content, wrapContent, maxWidth = Number.POSITIVE_INFINITY, maxHeight } = this.props;\n\n let isOverflowing = false;\n if (content && wrapContent && wrapContent(content, this._tooltipHostId, maxWidth, maxHeight)) {\n isOverflowing = true;\n }\n\n if (this.state.isOverflowing !== isOverflowing) {\n this.setState({ isOverflowing });\n }\n };\n}\n"]}
1
+ {"version":3,"file":"SVGTooltipText.js","sourceRoot":"../src/","sources":["utilities/SVGTooltipText.tsx"],"names":[],"mappings":";;;;IA4FA,IAAM,OAAO,GAAG,CAAC,CAAC;IAElB;;;OAGG;IACH;QACU,0CAA2D;QAkBnE,wBAAY,KAA2B;YACrC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;YAVf,6CAA6C;Y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KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS,EAAE,CAAC;gBAC/F,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpB,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;QAEM,6CAAoB,GAA3B;YACE,IAAI,cAAc,CAAC,sBAAsB,IAAI,cAAc,CAAC,sBAAsB,KAAK,IAAI,EAAE,CAAC;gBAC5F,cAAc,CAAC,sBAAsB,GAAG,SAAS,CAAC;YACpD,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC;QA9Fa,2BAAY,GAAG;YAC3B,KAAK,EAAE,sBAAY,CAAC,MAAM;SAC3B,AAFyB,CAExB;QAwPJ,qBAAC;KAAA,AA9PD,CACU,KAAK,CAAC,SAAS,GA6PxB;IA9PY,wCAAc","sourcesContent":["import * as React from 'react';\nimport { ITooltipHost, ITooltipProps, Tooltip, TooltipDelay } from '@fluentui/react/lib/Tooltip';\nimport { Async, KeyCodes, getId, portalContainsElement } from '../Utilities';\nimport { ITheme } from '@fluentui/react';\n\ninterface ISVGTooltipTextProps {\n /**\n * Number of milliseconds to delay closing the tooltip, so that the user has time to hover over\n * the tooltip and interact with it. Hovering over the tooltip will count as hovering over the\n * host, so that the tooltip will stay open if the user is actively interacting with it.\n */\n closeDelay?: number;\n\n /**\n * Content to display in the Tooltip.\n */\n content?: string;\n\n /**\n * Length of delay before showing the tooltip on hover.\n * @defaultvalue TooltipDelay.medium\n */\n delay?: TooltipDelay;\n\n /**\n * Additional properties to pass through for Tooltip.\n */\n tooltipProps?: ITooltipProps;\n\n /**\n * Additional properties to pass through for SVG <text>.\n */\n textProps?: React.SVGAttributes<SVGTextElement>;\n\n /**\n * Max width of text\n */\n maxWidth?: number;\n\n /**\n * Max height of text\n */\n maxHeight?: number;\n\n /**\n * Pass false to make prevent the tooptip from receiving focus through keyboard\n * Eg: In Pie Chart, the focus should only land on the arcs and not on the text to\n * avoid repitition of the same datapoint\n * @defaultvalue true\n */\n shouldReceiveFocus?: boolean;\n\n /**\n * Pass true to show tooltip directly\n * Eg: In Pie Chart, the tooltip is shown when the arc is focussed, so the prop is set to true,\n * to directly show the tooltip from this component\n * @defaultvalue false\n */\n isTooltipVisibleProp?: boolean;\n\n /**\n * Function to wrap text within specified width and height\n * and return a boolean value indicating whether the text overflowed\n */\n wrapContent?: (content: string, id: string, maxWidth: number, maxHeight?: number) => boolean;\n\n /**\n * Theme provided by High Order Component\n */\n theme?: ITheme;\n\n /**\n * @default false\n * Prop to selectively display the tooltip background\n */\n showBackground?: boolean;\n\n /**\n * Prop to set classname\n */\n className?: string;\n}\n\ninterface ISVGTooltipTextState {\n isTooltipVisible: boolean;\n isOverflowing: boolean;\n textX?: number;\n textY?: number;\n textWidth?: number;\n textHeight?: number;\n}\n\nconst PADDING = 4;\n\n/**\n * Component to render an SVG text element with an optional tooltip.\n * The tooltip appears on hovering and focusing the element when its content overflows.\n */\nexport class SVGTooltipText\n extends React.Component<ISVGTooltipTextProps, ISVGTooltipTextState>\n implements ITooltipHost\n{\n public static defaultProps = {\n delay: TooltipDelay.medium,\n };\n\n private static _currentVisibleTooltip: ITooltipHost | undefined;\n\n /** The element that gets the hover events */\n private _tooltipHost = React.createRef<SVGTextElement>();\n\n private _async: Async;\n private _dismissTimerId: number;\n private _openTimerId: number;\n private _tooltipHostId = getId('tooltip-host');\n private _ignoreNextFocusEvent: boolean;\n\n constructor(props: ISVGTooltipTextProps) {\n super(props);\n\n this.state = {\n isTooltipVisible: false,\n isOverflowing: false,\n };\n\n this._async = new Async(this);\n }\n\n public render(): React.ReactNode {\n const { content, tooltipProps, textProps, shouldReceiveFocus = true, showBackground = false } = this.props;\n const { isTooltipVisible, textWidth, textHeight } = this.state;\n const tooltipRenderProps: ITooltipProps = {\n content,\n targetElement: this._getTargetElement(),\n calloutProps: {\n onDismiss: this._hideTooltip,\n onMouseEnter: this._onTooltipMouseEnter,\n onMouseLeave: this._onTooltipMouseLeave,\n },\n onMouseEnter: this._onTooltipMouseEnter,\n onMouseLeave: this._onTooltipMouseLeave,\n ...tooltipProps,\n };\n\n const showTooltip =\n (!!this.props.isTooltipVisibleProp && this.state.isOverflowing && !!content) || (isTooltipVisible && !!content);\n const rectX = (typeof textProps?.x === 'number' ? textProps.x : 0) - (textWidth ?? 0) / 2 - PADDING;\n const rectY = (typeof textProps?.y === 'number' ? textProps.y : 0) - (textHeight ?? 0) / 2 - PADDING;\n return (\n <>\n {showBackground && (\n <rect\n x={rectX}\n y={rectY}\n width={(textWidth ?? 0) + 2 * PADDING}\n height={(textHeight ?? 0) + 2 * PADDING}\n transform={textProps?.transform}\n className={this.props.className}\n />\n )}\n <text\n {...textProps}\n id={this._tooltipHostId}\n ref={this._tooltipHost}\n onFocusCapture={this._onTooltipFocus}\n onBlurCapture={this._onTooltipBlur}\n onMouseEnter={this._onTooltipMouseEnter}\n onMouseLeave={this._onTooltipMouseLeave}\n onKeyDown={this._onTooltipKeyDown}\n data-is-focusable={shouldReceiveFocus && this.state.isOverflowing}\n >\n {content}\n </text>\n {showTooltip && <Tooltip {...tooltipRenderProps} />}\n </>\n );\n }\n\n public componentDidMount(): void {\n this._wrapContent();\n this._measureText();\n }\n\n public componentDidUpdate(prevProps: Readonly<ISVGTooltipTextProps>): void {\n if (this.props.maxWidth !== prevProps.maxWidth || this.props.maxHeight !== prevProps.maxHeight) {\n this._wrapContent();\n this._measureText();\n }\n }\n\n public componentWillUnmount(): void {\n if (SVGTooltipText._currentVisibleTooltip && SVGTooltipText._currentVisibleTooltip === this) {\n SVGTooltipText._currentVisibleTooltip = undefined;\n }\n\n this._async.dispose();\n }\n\n public show = (): void => {\n this._toggleTooltip(true);\n };\n\n public dismiss = (): void => {\n this._hideTooltip();\n };\n\n private _measureText = (): void => {\n if (this._tooltipHost.current && typeof this._tooltipHost.current.getBBox === 'function') {\n const bbox = this._tooltipHost.current.getBBox();\n this.setState({\n textX: bbox.x,\n textY: bbox.y,\n textWidth: bbox.width,\n textHeight: bbox.height,\n });\n }\n };\n\n private _getTargetElement = (): HTMLElement | undefined => {\n if (!this._tooltipHost.current) {\n return undefined;\n }\n\n return this._tooltipHost.current as unknown as HTMLElement;\n };\n\n private _onTooltipFocus = (ev: React.FocusEvent<SVGElement>) => {\n if (this._ignoreNextFocusEvent) {\n this._ignoreNextFocusEvent = false;\n return;\n }\n\n this._onTooltipMouseEnter(ev);\n };\n\n private _onTooltipBlur = (ev: React.FocusEvent<SVGElement>) => {\n // The focused element gets a blur event when the document loses focus\n // (e.g. switching tabs in the browser), but we don't want to show the\n // tooltip again when the document gets focus back. Handle this case by\n // checking if the blurred element is still the document's activeElement,\n // and ignoring when it next gets focus back.\n // See https://github.com/microsoft/fluentui/issues/13541\n this._ignoreNextFocusEvent = document?.activeElement === ev.target;\n\n this._dismissTimerId = this._async.setTimeout(() => {\n this._hideTooltip();\n }, 0);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onTooltipMouseEnter = (ev: any): void => {\n const { delay } = this.props;\n\n if (SVGTooltipText._currentVisibleTooltip && SVGTooltipText._currentVisibleTooltip !== this) {\n SVGTooltipText._currentVisibleTooltip.dismiss();\n }\n SVGTooltipText._currentVisibleTooltip = this;\n\n if (!this.state.isOverflowing) {\n return;\n }\n\n if (ev.target && portalContainsElement(ev.target as HTMLElement, this._getTargetElement())) {\n // Do not show tooltip when target is inside a portal relative to TooltipHost.\n return;\n }\n\n this._clearDismissTimer();\n this._clearOpenTimer();\n\n if (delay !== TooltipDelay.zero) {\n const delayTime = this._getDelayTime(delay!); // non-null assertion because we set it in `defaultProps`\n\n this._openTimerId = this._async.setTimeout(() => {\n this._toggleTooltip(true);\n }, delayTime);\n } else {\n this._toggleTooltip(true);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onTooltipMouseLeave = (ev: any): void => {\n const { closeDelay } = this.props;\n\n this._clearDismissTimer();\n this._clearOpenTimer();\n\n if (closeDelay) {\n this._dismissTimerId = this._async.setTimeout(() => {\n this._toggleTooltip(false);\n }, closeDelay);\n } else {\n this._toggleTooltip(false);\n }\n\n if (SVGTooltipText._currentVisibleTooltip === this) {\n SVGTooltipText._currentVisibleTooltip = undefined;\n }\n };\n\n private _onTooltipKeyDown = (ev: React.KeyboardEvent<SVGElement>): void => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if ((ev.which === KeyCodes.escape || ev.ctrlKey) && this.state.isTooltipVisible) {\n this._hideTooltip();\n ev.stopPropagation();\n }\n };\n\n private _clearDismissTimer = (): void => {\n this._async.clearTimeout(this._dismissTimerId);\n };\n\n private _clearOpenTimer = (): void => {\n this._async.clearTimeout(this._openTimerId);\n };\n\n private _hideTooltip = (): void => {\n this._clearOpenTimer();\n this._clearDismissTimer();\n this._toggleTooltip(false);\n };\n\n private _toggleTooltip = (isTooltipVisible: boolean): void => {\n if (this.state.isTooltipVisible !== isTooltipVisible) {\n this.setState({ isTooltipVisible });\n }\n };\n\n private _getDelayTime = (delay: TooltipDelay): number => {\n switch (delay) {\n case TooltipDelay.medium:\n return 300;\n case TooltipDelay.long:\n return 500;\n default:\n return 0;\n }\n };\n\n private _wrapContent = () => {\n const { content, wrapContent, maxWidth = Number.POSITIVE_INFINITY, maxHeight } = this.props;\n\n let isOverflowing = false;\n if (content && wrapContent && wrapContent(content, this._tooltipHostId, maxWidth, maxHeight)) {\n isOverflowing = true;\n }\n\n if (this.state.isOverflowing !== isOverflowing) {\n this.setState({ isOverflowing });\n }\n };\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import { Axis as D3Axis } from 'd3-axis';
2
2
  import { TimeLocaleDefinition as d3TimeLocaleDefinition } from 'd3-time-format';
3
- import { IAccessibilityProps, IEventsAnnotationProps, ILineChartPoints, IDataPoint, IVerticalStackedBarDataPoint, IVerticalBarChartDataPoint, IHorizontalBarChartWithAxisDataPoint, ILineChartLineOptions } from '../index';
3
+ import { IAccessibilityProps, IEventsAnnotationProps, ILineChartPoints, IDataPoint, IVerticalStackedBarDataPoint, IVerticalBarChartDataPoint, IHorizontalBarChartWithAxisDataPoint, ILineChartLineOptions, AxisCategoryOrder } from '../index';
4
4
  import { CurveFactory } from 'd3-shape';
5
+ import { IScatterChartPoints } from '../types/IDataPoint';
5
6
  export declare const MIN_DOMAIN_MARGIN = 8;
6
7
  export declare const MIN_DONUT_RADIUS = 1;
7
8
  export type NumericAxis = D3Axis<number | {
@@ -15,7 +16,8 @@ export declare enum ChartTypes {
15
16
  VerticalStackedBarChart = 3,
16
17
  GroupedVerticalBarChart = 4,
17
18
  HeatMapChart = 5,
18
- HorizontalBarChartWithAxis = 6
19
+ HorizontalBarChartWithAxis = 6,
20
+ ScatterChart = 7
19
21
  }
20
22
  export declare enum XAxisTypes {
21
23
  NumericAxis = 0,
@@ -175,10 +177,10 @@ export declare const createStringYAxis: (yAxisParams: IYAxisParams, dataPoints:
175
177
  * This methos creates an object for those 2 charts.
176
178
  * @param values
177
179
  */
178
- export declare function calloutData(values: (ILineChartPoints & {
180
+ export declare function calloutData(values: ((ILineChartPoints | IScatterChartPoints) & {
179
181
  index?: number;
180
182
  })[]): {
181
- x: number;
183
+ x: string | number;
182
184
  values: {
183
185
  legend: string;
184
186
  y: number;
@@ -338,7 +340,7 @@ export declare function domainRageOfVerticalNumeric(points: IDataPoint[], margin
338
340
  * @param {ILineChartPoints[]} points
339
341
  * @returns {{ startValue: number; endValue: number }}
340
342
  */
341
- export declare function findNumericMinMaxOfY(points: ILineChartPoints[], yAxisType?: YAxisType, useSecondaryYScale?: boolean): {
343
+ export declare function findNumericMinMaxOfY(points: ILineChartPoints[] | IScatterChartPoints[], yAxisType?: YAxisType, useSecondaryYScale?: boolean): {
342
344
  startValue: number;
343
345
  endValue: number;
344
346
  };
@@ -439,4 +441,29 @@ export declare function resolveCSSVariables(chartContainer: HTMLElement, styleRu
439
441
  export declare function copyStyle(properties: string[] | Record<string, string>, fromEl: Element, toEl: Element): void;
440
442
  export declare const createMeasurementSpan: (text: string | number, className: string, parentElement?: HTMLElement | null) => HTMLElement;
441
443
  export declare function getCurveFactory(curve: ILineChartLineOptions['curve'], defaultFactory?: CurveFactory): CurveFactory;
444
+ /**
445
+ * Calculates Domain and range values for Date X axis for scatter chart.
446
+ * @export
447
+ * @param {LineChartPoints[]} points
448
+ * @param {IMargins} margins
449
+ * @param {number} width
450
+ * @param {boolean} isRTL
451
+ * @param {Date[] | number[]} tickValues
452
+ * @returns {IDomainNRange}
453
+ */
454
+ export declare function domainRangeOfDateForScatterChart(points: IScatterChartPoints[], margins: IMargins, width: number, isRTL: boolean, tickValues?: Date[]): IDomainNRange;
455
+ /**
456
+ * Calculates Domain and range values for Numeric X axis for scatter chart.
457
+ * @export
458
+ * @param {LineChartPoints[]} points
459
+ * @param {IMargins} margins
460
+ * @param {number} width
461
+ * @param {boolean} isRTL
462
+ * @returns {IDomainNRange}
463
+ */
464
+ export declare function domainRangeOfNumericForScatterChart(points: IScatterChartPoints[], margins: IMargins, width: number, isRTL: boolean): IDomainNRange;
442
465
  export declare const truncateString: (str: string, maxLength: number, ellipsis?: string) => string;
466
+ /**
467
+ * @see {@link https://github.com/plotly/plotly.js/blob/master/src/plots/plots.js#L3041}
468
+ */
469
+ export declare const sortAxisCategories: (categoryToValues: Record<string, number[]>, categoryOrder: AxisCategoryOrder | undefined) => string[];