@fluentui/react-charting 5.23.58 → 5.23.60

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 (186) hide show
  1. package/CHANGELOG.json +55 -1
  2. package/CHANGELOG.md +24 -2
  3. package/dist/react-charting.d.ts +26 -1
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +6 -0
  7. package/lib/components/AreaChart/AreaChart.base.d.ts +3 -1
  8. package/lib/components/AreaChart/AreaChart.base.js +8 -2
  9. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  10. package/lib/components/DeclarativeChart/DeclarativeChart.d.ts +1 -1
  11. package/lib/components/DeclarativeChart/DeclarativeChart.js +35 -12
  12. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  13. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
  14. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  15. package/lib/components/DeclarativeChart/index.d.ts +0 -1
  16. package/lib/components/DeclarativeChart/index.js.map +1 -1
  17. package/lib/components/DonutChart/DonutChart.base.d.ts +3 -1
  18. package/lib/components/DonutChart/DonutChart.base.js +8 -2
  19. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  20. package/lib/components/GaugeChart/GaugeChart.base.d.ts +3 -1
  21. package/lib/components/GaugeChart/GaugeChart.base.js +7 -1
  22. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  23. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +3 -1
  24. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +7 -1
  25. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  26. package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +3 -1
  27. package/lib/components/HeatMapChart/HeatMapChart.base.js +8 -2
  28. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  29. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
  30. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +7 -1
  31. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  32. package/lib/components/Legends/Legends.base.d.ts +8 -2
  33. package/lib/components/Legends/Legends.base.js +12 -1
  34. package/lib/components/Legends/Legends.base.js.map +1 -1
  35. package/lib/components/Legends/Legends.styles.d.ts +8 -0
  36. package/lib/components/Legends/Legends.styles.js +21 -8
  37. package/lib/components/Legends/Legends.styles.js.map +1 -1
  38. package/lib/components/Legends/Legends.types.d.ts +15 -1
  39. package/lib/components/Legends/Legends.types.js.map +1 -1
  40. package/lib/components/LineChart/LineChart.base.d.ts +11 -1
  41. package/lib/components/LineChart/LineChart.base.js +101 -23
  42. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  43. package/lib/components/LineChart/LineChart.types.d.ts +5 -0
  44. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  45. package/lib/components/SankeyChart/SankeyChart.base.d.ts +2 -1
  46. package/lib/components/SankeyChart/SankeyChart.base.js +4 -0
  47. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  48. package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +3 -1
  49. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +7 -1
  50. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  51. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -1
  52. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +7 -1
  53. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  54. package/lib/index.d.ts +2 -2
  55. package/lib/index.js.map +1 -1
  56. package/lib/types/IDataPoint.d.ts +14 -0
  57. package/lib/types/IDataPoint.js.map +1 -1
  58. package/lib/utilities/image-export-utils.d.ts +13 -0
  59. package/lib/{components/DeclarativeChart/imageExporter.js → utilities/image-export-utils.js} +65 -63
  60. package/lib/utilities/image-export-utils.js.map +1 -0
  61. package/lib/utilities/utilities.d.ts +2 -0
  62. package/lib/utilities/utilities.js +44 -0
  63. package/lib/utilities/utilities.js.map +1 -1
  64. package/lib-amd/components/AreaChart/AreaChart.base.d.ts +3 -1
  65. package/lib-amd/components/AreaChart/AreaChart.base.js +7 -2
  66. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  67. package/lib-amd/components/DeclarativeChart/DeclarativeChart.d.ts +1 -1
  68. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +36 -12
  69. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  70. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
  71. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  72. package/lib-amd/components/DeclarativeChart/index.d.ts +0 -1
  73. package/lib-amd/components/DeclarativeChart/index.js.map +1 -1
  74. package/lib-amd/components/DonutChart/DonutChart.base.d.ts +3 -1
  75. package/lib-amd/components/DonutChart/DonutChart.base.js +7 -2
  76. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  77. package/lib-amd/components/GaugeChart/GaugeChart.base.d.ts +3 -1
  78. package/lib-amd/components/GaugeChart/GaugeChart.base.js +7 -2
  79. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  80. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +3 -1
  81. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +7 -2
  82. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  83. package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +3 -1
  84. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +7 -2
  85. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  86. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
  87. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +7 -2
  88. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  89. package/lib-amd/components/Legends/Legends.base.d.ts +8 -2
  90. package/lib-amd/components/Legends/Legends.base.js +12 -2
  91. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  92. package/lib-amd/components/Legends/Legends.styles.d.ts +8 -0
  93. package/lib-amd/components/Legends/Legends.styles.js +22 -9
  94. package/lib-amd/components/Legends/Legends.styles.js.map +1 -1
  95. package/lib-amd/components/Legends/Legends.types.d.ts +15 -1
  96. package/lib-amd/components/Legends/Legends.types.js.map +1 -1
  97. package/lib-amd/components/LineChart/LineChart.base.d.ts +11 -1
  98. package/lib-amd/components/LineChart/LineChart.base.js +100 -24
  99. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  100. package/lib-amd/components/LineChart/LineChart.types.d.ts +5 -0
  101. package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
  102. package/lib-amd/components/SankeyChart/SankeyChart.base.d.ts +2 -1
  103. package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -1
  104. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  105. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +3 -1
  106. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +7 -2
  107. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  108. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -1
  109. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +7 -2
  110. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  111. package/lib-amd/index.d.ts +2 -2
  112. package/lib-amd/index.js.map +1 -1
  113. package/lib-amd/types/IDataPoint.d.ts +14 -0
  114. package/lib-amd/types/IDataPoint.js.map +1 -1
  115. package/lib-amd/utilities/image-export-utils.d.ts +13 -0
  116. package/lib-amd/{components/DeclarativeChart/imageExporter.js → utilities/image-export-utils.js} +69 -67
  117. package/lib-amd/utilities/image-export-utils.js.map +1 -0
  118. package/lib-amd/utilities/utilities.d.ts +2 -0
  119. package/lib-amd/utilities/utilities.js +47 -2
  120. package/lib-amd/utilities/utilities.js.map +1 -1
  121. package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +3 -1
  122. package/lib-commonjs/components/AreaChart/AreaChart.base.js +7 -1
  123. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  124. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.d.ts +1 -1
  125. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +35 -12
  126. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  127. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
  128. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  129. package/lib-commonjs/components/DeclarativeChart/index.d.ts +0 -1
  130. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
  131. package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +3 -1
  132. package/lib-commonjs/components/DonutChart/DonutChart.base.js +7 -1
  133. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  134. package/lib-commonjs/components/GaugeChart/GaugeChart.base.d.ts +3 -1
  135. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +7 -1
  136. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  137. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +3 -1
  138. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +7 -1
  139. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  140. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +3 -1
  141. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +7 -1
  142. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  143. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
  144. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +7 -1
  145. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  146. package/lib-commonjs/components/Legends/Legends.base.d.ts +8 -2
  147. package/lib-commonjs/components/Legends/Legends.base.js +12 -1
  148. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  149. package/lib-commonjs/components/Legends/Legends.styles.d.ts +8 -0
  150. package/lib-commonjs/components/Legends/Legends.styles.js +22 -9
  151. package/lib-commonjs/components/Legends/Legends.styles.js.map +1 -1
  152. package/lib-commonjs/components/Legends/Legends.types.d.ts +15 -1
  153. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  154. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +11 -1
  155. package/lib-commonjs/components/LineChart/LineChart.base.js +101 -23
  156. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  157. package/lib-commonjs/components/LineChart/LineChart.types.d.ts +5 -0
  158. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  159. package/lib-commonjs/components/SankeyChart/SankeyChart.base.d.ts +2 -1
  160. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -0
  161. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  162. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +3 -1
  163. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +7 -1
  164. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  165. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -1
  166. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +7 -1
  167. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  168. package/lib-commonjs/index.d.ts +2 -2
  169. package/lib-commonjs/index.js.map +1 -1
  170. package/lib-commonjs/types/IDataPoint.d.ts +14 -0
  171. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  172. package/lib-commonjs/utilities/image-export-utils.d.ts +13 -0
  173. package/lib-commonjs/{components/DeclarativeChart/imageExporter.js → utilities/image-export-utils.js} +70 -67
  174. package/lib-commonjs/utilities/image-export-utils.js.map +1 -0
  175. package/lib-commonjs/utilities/utilities.d.ts +2 -0
  176. package/lib-commonjs/utilities/utilities.js +47 -1
  177. package/lib-commonjs/utilities/utilities.js.map +1 -1
  178. package/package.json +4 -4
  179. package/src/components/Legends/Legends.types.ts +20 -1
  180. package/src/components/LineChart/LineChart.types.ts +6 -0
  181. package/lib/components/DeclarativeChart/imageExporter.d.ts +0 -10
  182. package/lib/components/DeclarativeChart/imageExporter.js.map +0 -1
  183. package/lib-amd/components/DeclarativeChart/imageExporter.d.ts +0 -10
  184. package/lib-amd/components/DeclarativeChart/imageExporter.js.map +0 -1
  185. package/lib-commonjs/components/DeclarativeChart/imageExporter.d.ts +0 -10
  186. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Legends.styles.js","sourceRoot":"../src/","sources":["components/Legends/Legends.styles.ts"],"names":[],"mappings":";;;;IAGO,IAAM,SAAS,GAAG,UAAC,KAAwB;;QACxC,IAAA,SAAS,GAA4C,KAAK,UAAjD,EAAE,KAAK,GAAqC,KAAK,MAA1C,EAAE,KAAmC,KAAK,uBAAV,EAA9B,sBAAsB,mBAAG,KAAK,KAAA,CAAW;QAC7D,IAAA,KAAqB,KAAM,EAAzB,OAAO,aAAA,EAAE,KAAK,WAAW,CAAC;QACl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;gBACX,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;gBACd,eAAe,EAAE,KAAM,CAAC,cAAc,CAAC,gBAAgB;gBACvD,WAAW,EAAE,KAAK;gBAClB,MAAM,EAAE,WAAW;gBACnB,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK;aACnE;YACD,2BAA2B,EAAE;gBAC3B,IAAA,uBAAa,EAAC,KAAM,EAAE,OAAO,CAAC;oDAE5B,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,CAAC,QAAQ,IAClC,KAAK,CAAC,KAAK,KACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,KAAK;aAEjB;YACD,aAAa,EAAE;gBACb,OAAO,EAAE,KAAK;aACf;YACD,kBAAkB,EAAE;gBAClB,eAAe,EAAE;oBACf,IAAI,EAAE,CAAC,IAAA,uBAAa,EAAC,KAAM,EAAE,OAAO,CAAC,CAAC;iBACvC;aACF;SACF,CAAC;IACJ,CAAC,CAAC;IAlHW,QAAA,SAAS,aAkHpB","sourcesContent":["import { ILegendsStyles, ILegendStyleProps } from './Legends.types';\nimport { HighContrastSelector, getFocusStyle, IGetFocusStylesOptions, IStyle } from '@fluentui/react/lib/Styling';\n\nexport const getStyles = (props: ILegendStyleProps): ILegendsStyles => {\n const { className, theme, isLineLegendInBarChart = false } = props;\n const { palette, fonts } = theme!;\n const options: IGetFocusStylesOptions = {\n inset: undefined,\n position: undefined,\n highContrastStyle: {\n outlineColor: theme!.semanticColors.focusBorder,\n },\n borderColor: 'transparent',\n outlineColor: undefined,\n };\n return {\n root: [\n {\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n margin: '-8px 0 0 -8px',\n },\n className,\n ],\n legend: [\n getFocusStyle(theme!, options),\n {\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n border: 'none',\n padding: '8px',\n background: 'none',\n textTransform: 'capitalize',\n },\n ],\n rect: {\n selectors: {\n [HighContrastSelector]: {\n content: `linear-gradient(to right, ${props.colorOnSelectedState}, ${props.colorOnSelectedState})`,\n opacity: props.colorOnSelectedState === theme!.semanticColors.buttonBackground ? '0.6' : '',\n },\n },\n width: '12px',\n height: isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: props.stripePattern ? '' : props.colorOnSelectedState,\n marginRight: '8px',\n border: '1px solid',\n borderColor: props.borderColor ? props.borderColor : theme?.semanticColors.buttonBorder,\n content: props.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${props.colorOnSelectedState} 1px, ${props.colorOnSelectedState} 4px)`\n : '',\n },\n shape: [\n {\n marginRight: '8px',\n },\n ],\n triangle: {\n width: '0',\n height: '0',\n borderLeft: '6px solid transparent',\n borderRight: '6px solid transparent',\n borderTop: '10.4px solid',\n borderTopColor: props.colorOnSelectedState,\n marginRight: '8px',\n opacity:\n props.colorOnSelectedState === theme!.semanticColors.buttonBackground\n ? '0.6'\n : props.opacity\n ? props.opacity\n : '',\n selectors: {\n [HighContrastSelector]: {\n border: '0px',\n height: '10.4px',\n width: '10.4px',\n clipPath: 'polygon(50% 100%, 0 0, 100% 0)',\n backgroundImage: `linear-gradient(to right, ${props.colorOnSelectedState}, ${props.colorOnSelectedState})`,\n } as IStyle,\n },\n },\n text: {\n ...fonts.small,\n lineHeight: '16px',\n color: theme?.semanticColors.bodyText,\n opacity: props.colorOnSelectedState === theme!.semanticColors.buttonBackground ? '0.67' : '',\n },\n hoverChange: {\n width: '12px',\n height: '12px',\n backgroundColor: theme!.semanticColors.buttonBackground,\n marginRight: '8px',\n border: '1px solid',\n borderColor: props.borderColor ? props.borderColor : palette.black,\n },\n overflowIndicationTextStyle: [\n getFocusStyle(theme!, options),\n {\n cursor: 'pointer',\n color: theme?.semanticColors.bodyText,\n ...fonts.small,\n lineHeight: '16px',\n padding: '8px',\n },\n ],\n hoverCardRoot: {\n padding: '8px',\n },\n subComponentStyles: {\n hoverCardStyles: {\n host: [getFocusStyle(theme!, options)],\n },\n },\n };\n};\n"]}
1
+ {"version":3,"file":"Legends.styles.js","sourceRoot":"../src/","sources":["components/Legends/Legends.styles.ts"],"names":[],"mappings":";;;;IAGA,gEAAgE;IACnD,QAAA,2BAA2B,GAAG,CAAC,CAAC;IAChC,QAAA,6BAA6B,GAAG,EAAE,CAAC;IACnC,QAAA,cAAc,GAAG,CAAC,CAAC;IACnB,QAAA,aAAa,GAAG,EAAE,CAAC;IACnB,QAAA,mBAAmB,GAAG,CAAC,CAAC;IACrC,IAAM,gCAAgC,GAAG,EAAE,CAAC;IAC5C,iGAAiG;IACjG,uGAAuG;IACvG,gCAAgC;IACnB,QAAA,iBAAiB,GAAG,gCAAgC,GAAG,2BAAmB,CAAC;IAC3E,QAAA,uBAAuB,GAAG,CAAC,CAAC;IAC5B,QAAA,4BAA4B,GAAG,IAAI,CAAC;IAE1C,IAAM,SAAS,GAAG,UAAC,KAAwB;;QACxC,IAAA,SAAS,GAA4C,KAAK,UAAjD,EAAE,KAAK,GAAqC,KAAK,MAA1C,EAAE,KAAmC,KAAK,uBAAV,EAA9B,sBAAsB,mBAAG,KAAK,KAAA,CAAW;QAC7D,IAAA,KAAqB,KAAM,EAAzB,OAAO,aAAA,EAAE,KAAK,WAAW,CAAC;QAClC,IAAM,OAAO,GAA2B;YACtC,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,SAAS;YACnB,iBAAiB,EAAE;gBACjB,YAAY,EAAE,KAAM,CAAC,cAAc,CAAC,WAAW;aAChD;YACD,WAAW,EAAE,aAAa;YAC1B,YAAY,EAAE,SAAS;SACxB,CAAC;QACF,OAAO;YACL,IAAI,EAAE;gBACJ;oBACE,UAAU,EAAE,QAAQ;oBACpB,KAAK,EAAE,MAAM;oBACb,UAAU,EAAE,QAAQ;oBACpB,MAAM,EAAE,eAAe;iBACxB;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,CAAC,KAAK;aACnE;YACD,2BAA2B,EAAE;gBAC3B,IAAA,uBAAa,EAAC,KAAM,EAAE,OAAO,CAAC;oDAE5B,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,CAAC,QAAQ,IAClC,KAAK,CAAC,KAAK,KACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,UAAG,sBAAc,OAAI;aAEjC;YACD,aAAa,EAAE;gBACb,OAAO,EAAE,KAAK;aACf;YACD,kBAAkB,EAAE;gBAClB,eAAe,EAAE;oBACf,IAAI,EAAE,CAAC,IAAA,uBAAa,EAAC,KAAM,EAAE,OAAO,CAAC,CAAC;iBACvC;aACF;SACF,CAAC;IACJ,CAAC,CAAC;IAnHW,QAAA,SAAS,aAmHpB","sourcesContent":["import { ILegendsStyles, ILegendStyleProps } from './Legends.types';\nimport { HighContrastSelector, getFocusStyle, IGetFocusStylesOptions, IStyle } from '@fluentui/react/lib/Styling';\n\n// Constants needed to create legends using SVG for image export\nexport const LEGEND_CONTAINER_MARGIN_TOP = 8;\nexport const LEGEND_CONTAINER_MARGIN_START = 12;\nexport const LEGEND_PADDING = 8;\nexport const LEGEND_HEIGHT = 32;\nexport const LEGEND_SHAPE_BORDER = 1;\nconst LEGEND_SHAPE_SIZE_WITHOUT_BORDER = 12;\n// SVG strokes are drawn centered around the path, with half of the stroke width extending inward\n// (overlapping the fill area) and half outward. To ensure the filled area maintains its intended size,\n// expand the shape accordingly.\nexport const LEGEND_SHAPE_SIZE = LEGEND_SHAPE_SIZE_WITHOUT_BORDER + LEGEND_SHAPE_BORDER;\nexport const LEGEND_SHAPE_MARGIN_END = 8;\nexport const INACTIVE_LEGEND_TEXT_OPACITY = 0.67;\n\nexport const getStyles = (props: ILegendStyleProps): ILegendsStyles => {\n const { className, theme, isLineLegendInBarChart = false } = props;\n const { palette, fonts } = theme!;\n const options: IGetFocusStylesOptions = {\n inset: undefined,\n position: undefined,\n highContrastStyle: {\n outlineColor: theme!.semanticColors.focusBorder,\n },\n borderColor: 'transparent',\n outlineColor: undefined,\n };\n return {\n root: [\n {\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n margin: '-8px 0 0 -8px',\n },\n className,\n ],\n legend: [\n getFocusStyle(theme!, options),\n {\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n border: 'none',\n padding: `${LEGEND_PADDING}px`,\n background: 'none',\n textTransform: 'capitalize',\n },\n ],\n rect: {\n selectors: {\n [HighContrastSelector]: {\n content: `linear-gradient(to right, ${props.colorOnSelectedState}, ${props.colorOnSelectedState})`,\n opacity: props.colorOnSelectedState === theme!.semanticColors.buttonBackground ? '0.6' : '',\n },\n },\n width: `${LEGEND_SHAPE_SIZE_WITHOUT_BORDER}px`,\n height: isLineLegendInBarChart ? '4px' : `${LEGEND_SHAPE_SIZE_WITHOUT_BORDER}px`,\n backgroundColor: props.stripePattern ? '' : props.colorOnSelectedState,\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n border: `${LEGEND_SHAPE_BORDER}px solid`,\n borderColor: props.borderColor ? props.borderColor : theme?.semanticColors.buttonBorder,\n content: props.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${props.colorOnSelectedState} 1px, ${props.colorOnSelectedState} 4px)`\n : '',\n },\n shape: [\n {\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n },\n ],\n triangle: {\n width: '0',\n height: '0',\n borderLeft: '6px solid transparent',\n borderRight: '6px solid transparent',\n borderTop: '10.4px solid',\n borderTopColor: props.colorOnSelectedState,\n marginRight: '8px',\n opacity:\n props.colorOnSelectedState === theme!.semanticColors.buttonBackground\n ? '0.6'\n : props.opacity\n ? props.opacity\n : '',\n selectors: {\n [HighContrastSelector]: {\n border: '0px',\n height: '10.4px',\n width: '10.4px',\n clipPath: 'polygon(50% 100%, 0 0, 100% 0)',\n backgroundImage: `linear-gradient(to right, ${props.colorOnSelectedState}, ${props.colorOnSelectedState})`,\n } as IStyle,\n },\n },\n text: {\n ...fonts.small,\n lineHeight: '16px',\n color: theme?.semanticColors.bodyText,\n opacity:\n props.colorOnSelectedState === theme!.semanticColors.buttonBackground ? `${INACTIVE_LEGEND_TEXT_OPACITY}` : '',\n },\n hoverChange: {\n width: '12px',\n height: '12px',\n backgroundColor: theme!.semanticColors.buttonBackground,\n marginRight: '8px',\n border: '1px solid',\n borderColor: props.borderColor ? props.borderColor : palette.black,\n },\n overflowIndicationTextStyle: [\n getFocusStyle(theme!, options),\n {\n cursor: 'pointer',\n color: theme?.semanticColors.bodyText,\n ...fonts.small,\n lineHeight: '16px',\n padding: `${LEGEND_PADDING}px`,\n },\n ],\n hoverCardRoot: {\n padding: '8px',\n },\n subComponentStyles: {\n hoverCardStyles: {\n host: [getFocusStyle(theme!, options)],\n },\n },\n };\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ITheme, IStyle } from '@fluentui/react/lib/Styling';
3
- import { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
3
+ import { IRefObject, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
4
4
  import { IHoverCardStyleProps, IHoverCardStyles } from '@fluentui/react/lib/HoverCard';
5
5
  import { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';
6
6
  import { IFocusZoneProps } from '@fluentui/react-focus';
@@ -234,6 +234,10 @@ export interface ILegendsProps {
234
234
  * The shape for the legend.
235
235
  */
236
236
  shape?: LegendShape;
237
+ /**
238
+ * Callback to access the public methods and properties of the component.
239
+ */
240
+ ref?: IRefObject<ILegendContainer>;
237
241
  }
238
242
  /**
239
243
  * @public
@@ -243,3 +247,13 @@ export interface ILegendsProps {
243
247
  * {@docCategory Legends}
244
248
  */
245
249
  export type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;
250
+ /**
251
+ * {@docCategory Legends}
252
+ */
253
+ export interface ILegendContainer {
254
+ toSVG: (svgWidth: number, isRTL?: boolean) => {
255
+ node: SVGGElement | null;
256
+ width: number;
257
+ height: number;
258
+ };
259
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Legends.types.js","sourceRoot":"../src/","sources":["components/Legends/Legends.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IHoverCardStyleProps, IHoverCardStyles } from '@fluentui/react/lib/HoverCard';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\nexport interface ILegendOverflowData {\n primary: ILegend[];\n\n overflow?: ILegend[];\n}\n\n/**\n * @public\n * {@docCategory Legends}\n */\nexport interface ILegendSubComponentStyles {\n hoverCardStyles: IStyleFunctionOrObject<IHoverCardStyleProps, IHoverCardStyles>;\n}\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface ILegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root: IStyle;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend: IStyle;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect: IStyle;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape: IStyle;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle: IStyle;\n\n /**\n * Style for the legend text\n */\n text: IStyle;\n\n /**\n * Style for the legend text\n */\n hoverChange: IStyle;\n\n /**\n * Style for the text that indicates the no.of legends that are in hovercard due to lack of space\n */\n overflowIndicationTextStyle: IStyle;\n\n /**\n * Style for the overflow container\n */\n hoverCardRoot: IStyle;\n\n /**\n * sub component styles\n */\n subComponentStyles: ILegendSubComponentStyles;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface ILegend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface ILegendStyleProps {\n theme?: ITheme;\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface ILegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: ILegend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ILegendStyleProps, ILegendsStyles>;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * props for the overflow set component\n */\n overflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * focus zone props in hover card\n */\n focusZonePropsInHoverCard?: IFocusZoneProps;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Defines the function that is executed upon hiding of hover card\n * make sure to send prop when the prop is canSelectMultipleLegends is set to true\n * and empty the selected state legends\n */\n onLegendHoverCardLeave?: VoidFunction;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: ILegend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n}\n\n/**\n * @public\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n"]}
1
+ {"version":3,"file":"Legends.types.js","sourceRoot":"../src/","sources":["components/Legends/Legends.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IRefObject, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IHoverCardStyleProps, IHoverCardStyles } from '@fluentui/react/lib/HoverCard';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\nexport interface ILegendOverflowData {\n primary: ILegend[];\n\n overflow?: ILegend[];\n}\n\n/**\n * @public\n * {@docCategory Legends}\n */\nexport interface ILegendSubComponentStyles {\n hoverCardStyles: IStyleFunctionOrObject<IHoverCardStyleProps, IHoverCardStyles>;\n}\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface ILegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root: IStyle;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend: IStyle;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect: IStyle;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape: IStyle;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle: IStyle;\n\n /**\n * Style for the legend text\n */\n text: IStyle;\n\n /**\n * Style for the legend text\n */\n hoverChange: IStyle;\n\n /**\n * Style for the text that indicates the no.of legends that are in hovercard due to lack of space\n */\n overflowIndicationTextStyle: IStyle;\n\n /**\n * Style for the overflow container\n */\n hoverCardRoot: IStyle;\n\n /**\n * sub component styles\n */\n subComponentStyles: ILegendSubComponentStyles;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface ILegend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface ILegendStyleProps {\n theme?: ITheme;\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface ILegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: ILegend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ILegendStyleProps, ILegendsStyles>;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * props for the overflow set component\n */\n overflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * focus zone props in hover card\n */\n focusZonePropsInHoverCard?: IFocusZoneProps;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Defines the function that is executed upon hiding of hover card\n * make sure to send prop when the prop is canSelectMultipleLegends is set to true\n * and empty the selected state legends\n */\n onLegendHoverCardLeave?: VoidFunction;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: ILegend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n\n /**\n * Callback to access the public methods and properties of the component.\n */\n ref?: IRefObject<ILegendContainer>;\n}\n\n/**\n * @public\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n\n/**\n * {@docCategory Legends}\n */\nexport interface ILegendContainer {\n toSVG: (\n svgWidth: number,\n isRTL?: boolean,\n ) => {\n node: SVGGElement | null;\n width: number;\n height: number;\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { IAccessibilityProps, IBasestate, ILineChartProps, ILineChartPoints, ICustomizedCalloutData, IColorFillBarsProps, ILineChartDataPoint } from '../../index';
3
- import { IChart } from '../../types/index';
3
+ import { IChart, IImageExportOptions } from '../../types/index';
4
4
  type LineChartDataWithIndex = ILineChartPoints & {
5
5
  index: number;
6
6
  };
@@ -41,13 +41,21 @@ export declare class LineChartBase extends React.Component<ILineChartProps, ILin
41
41
  private _emptyChartId;
42
42
  private _isRTL;
43
43
  private _cartesianChartRef;
44
+ private _legendsRef;
45
+ private _xMin;
46
+ private _yMin;
47
+ private _xMax;
48
+ private _xPadding;
49
+ private _yPadding;
44
50
  constructor(props: ILineChartProps);
45
51
  componentDidUpdate(prevProps: ILineChartProps): void;
46
52
  render(): JSX.Element;
47
53
  get chartContainer(): HTMLElement | null;
54
+ toImage: (opts?: IImageExportOptions) => Promise<string>;
48
55
  private _getDomainNRangeValues;
49
56
  private _injectIndexPropertyInLineChartData;
50
57
  private _getCustomizedCallout;
58
+ private _getNumericMinMaxOfY;
51
59
  private _getMargins;
52
60
  private _initializeLineChartData;
53
61
  private _handleSingleLegendSelectionAction;
@@ -57,6 +65,7 @@ export declare class LineChartBase extends React.Component<ILineChartProps, ILin
57
65
  private _getBoxWidthOfShape;
58
66
  private _getPath;
59
67
  private _getPointFill;
68
+ private _getRangeForScatterMarkerSize;
60
69
  private _createLines;
61
70
  private _createColorFillBars;
62
71
  private _getStripePattern;
@@ -89,6 +98,7 @@ export declare class LineChartBase extends React.Component<ILineChartProps, ILin
89
98
  private _noLegendHighlighted;
90
99
  private _getColorFillBarOpacity;
91
100
  private _getAriaLabel;
101
+ private _getDomainNRangeValuesWithPadding;
92
102
  private _isChartEmpty;
93
103
  private _getChartTitle;
94
104
  }
@@ -1,4 +1,4 @@
1
- define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../Legends/index", "d3-shape", "@fluentui/react/lib/Utilities", "../../index", "@fluentui/react/lib/Callout", "./eventAnnotation/EventAnnotation", "../../utilities/index"], function (require, exports, tslib_1, React, d3_selection_1, d3_array_1, index_1, d3_shape_1, Utilities_1, index_2, Callout_1, EventAnnotation_1, index_3) {
1
+ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../Legends/index", "d3-shape", "d3-array", "@fluentui/react/lib/Utilities", "../../index", "@fluentui/react/lib/Callout", "./eventAnnotation/EventAnnotation", "../../utilities/index", "../../utilities/image-export-utils"], function (require, exports, tslib_1, React, d3_selection_1, d3_array_1, index_1, d3_shape_1, d3_array_2, Utilities_1, index_2, Callout_1, EventAnnotation_1, index_3, image_export_utils_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.LineChartBase = void 0;
@@ -52,9 +52,21 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
52
52
  _this_1._yAxisScale = '';
53
53
  _this_1.eventLabelHeight = 36;
54
54
  _this_1._isRTL = (0, Utilities_1.getRTL)();
55
+ _this_1._xMin = Number.NEGATIVE_INFINITY;
56
+ _this_1._yMin = Number.NEGATIVE_INFINITY;
57
+ _this_1._xMax = Number.POSITIVE_INFINITY;
58
+ _this_1._xPadding = 0;
59
+ _this_1._yPadding = 0;
60
+ _this_1.toImage = function (opts) {
61
+ var _a, _b;
62
+ return (0, image_export_utils_1.toImage)((_a = _this_1._cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer, (_b = _this_1._legendsRef.current) === null || _b === void 0 ? void 0 : _b.toSVG, _this_1._isRTL, opts);
63
+ };
55
64
  _this_1._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
56
65
  var domainNRangeValue;
57
- if (xAxisType === index_3.XAxisTypes.NumericAxis) {
66
+ if (_this_1.props.lineMode === 'scatter' && xAxisType === index_3.XAxisTypes.NumericAxis) {
67
+ domainNRangeValue = _this_1._getDomainNRangeValuesWithPadding(points, margins, width, isRTL);
68
+ }
69
+ else if (xAxisType === index_3.XAxisTypes.NumericAxis) {
58
70
  domainNRangeValue = (0, index_3.domainRangeOfNumericForAreaChart)(points, margins, width, isRTL);
59
71
  }
60
72
  else if (xAxisType === index_3.XAxisTypes.DateAxis) {
@@ -98,6 +110,18 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
98
110
  ? _this_1.props.onRenderCalloutPerDataPoint(_this_1.state.dataPointCalloutProps)
99
111
  : null;
100
112
  };
113
+ _this_1._getNumericMinMaxOfY = function (points) {
114
+ // eslint-disable-next-line @typescript-eslint/no-shadow
115
+ var _a = (0, index_3.findNumericMinMaxOfY)(points), startValue = _a.startValue, endValue = _a.endValue;
116
+ _this_1._yMin = startValue;
117
+ if (_this_1.props.lineMode === 'scatter') {
118
+ _this_1._yPadding = (endValue - startValue) * 0.1;
119
+ }
120
+ return {
121
+ startValue: startValue - _this_1._yPadding,
122
+ endValue: endValue + _this_1._yPadding,
123
+ };
124
+ };
101
125
  _this_1._getMargins = function (margins) {
102
126
  _this_1.margins = margins;
103
127
  };
@@ -541,6 +565,34 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
541
565
  var yValue = point.yAxisCalloutData || point.y;
542
566
  return ((_a = point.callOutAccessibilityData) === null || _a === void 0 ? void 0 : _a.ariaLabel) || "".concat(xValue, ". ").concat(legend, ", ").concat(yValue, ".");
543
567
  };
568
+ _this_1._getDomainNRangeValuesWithPadding = function (points, margins, width, isRTL) {
569
+ _this_1._xMin = (0, d3_array_2.min)(points, function (point) {
570
+ return (0, d3_array_2.min)(point.data, function (item) { return item.x; });
571
+ });
572
+ _this_1._xMax = (0, d3_array_2.max)(points, function (point) {
573
+ return (0, d3_array_2.max)(point.data, function (item) {
574
+ return item.x;
575
+ });
576
+ });
577
+ if (_this_1.props.lineMode === 'scatter') {
578
+ _this_1._xPadding = (_this_1._xMax - _this_1._xMin) * 0.1;
579
+ }
580
+ var rStartValue = margins.left;
581
+ var rEndValue = width - margins.right;
582
+ return isRTL
583
+ ? {
584
+ dStartValue: _this_1._xMax + _this_1._xPadding,
585
+ dEndValue: _this_1._xMin - _this_1._xPadding,
586
+ rStartValue: rStartValue,
587
+ rEndValue: rEndValue,
588
+ }
589
+ : {
590
+ dStartValue: _this_1._xMin - _this_1._xPadding,
591
+ dEndValue: _this_1._xMax + _this_1._xPadding,
592
+ rStartValue: rStartValue,
593
+ rEndValue: rEndValue,
594
+ };
595
+ };
544
596
  _this_1._getChartTitle = function () {
545
597
  var _a = _this_1.props.data, chartTitle = _a.chartTitle, lineChartData = _a.lineChartData;
546
598
  return (chartTitle ? "".concat(chartTitle, ". ") : '') + "Line chart with ".concat((lineChartData === null || lineChartData === void 0 ? void 0 : lineChartData.length) || 0, " lines. ");
@@ -576,6 +628,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
576
628
  _this_1._firstRenderOptimization = true;
577
629
  _this_1._emptyChartId = (0, Utilities_1.getId)('_LineChart_empty');
578
630
  _this_1._cartesianChartRef = React.createRef();
631
+ _this_1._legendsRef = React.createRef();
579
632
  props.eventAnnotationProps &&
580
633
  props.eventAnnotationProps.labelHeight &&
581
634
  (_this_1.eventLabelHeight = props.eventAnnotationProps.labelHeight);
@@ -625,7 +678,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
625
678
  tickValues: tickValues,
626
679
  tickFormat: tickFormat,
627
680
  };
628
- return !this._isChartEmpty() ? (React.createElement(index_2.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: index_3.ChartTypes.LineChart, isCalloutForStack: true, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: index_3.createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: index_3.findNumericMinMaxOfY, getGraphData: this._initializeLineChartData, xAxisType: isXAxisDateType ? index_3.XAxisTypes.DateAxis : index_3.XAxisTypes.NumericAxis, customizedCallout: this._getCustomizedCallout(), getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: index_3.createStringYAxis, onChartMouseLeave: this._handleChartMouseLeave, enableFirstRenderOptimization: this.props.enablePerfOptimization && this._firstRenderOptimization, ref: this._cartesianChartRef,
681
+ return !this._isChartEmpty() ? (React.createElement(index_2.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: index_3.ChartTypes.LineChart, isCalloutForStack: true, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: index_3.createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: this._getNumericMinMaxOfY, getGraphData: this._initializeLineChartData, xAxisType: isXAxisDateType ? index_3.XAxisTypes.DateAxis : index_3.XAxisTypes.NumericAxis, customizedCallout: this._getCustomizedCallout(), getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: index_3.createStringYAxis, onChartMouseLeave: this._handleChartMouseLeave, enableFirstRenderOptimization: this.props.enablePerfOptimization && this._firstRenderOptimization, ref: this._cartesianChartRef,
629
682
  /* eslint-disable react/jsx-no-bind */
630
683
  // eslint-disable-next-line react/no-children-prop
631
684
  children: function (props) {
@@ -705,7 +758,14 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
705
758
  return legend;
706
759
  })
707
760
  : [];
708
- return (React.createElement(index_1.Legends, tslib_1.__assign({ legends: tslib_1.__spreadArray(tslib_1.__spreadArray([], legendDataItems, true), colorFillBarsLegendDataItems, true), enabledWrapLines: this.props.enabledLegendsWrapLines, overflowProps: this.props.legendsOverflowProps, focusZonePropsInHoverCard: this.props.focusZonePropsForLegendsInHoverCard, overflowText: this.props.legendsOverflowText }, (isLegendMultiSelectEnabled && { onLegendHoverCardLeave: this._onHoverCardHide }), this.props.legendProps)));
761
+ return (React.createElement(index_1.Legends, tslib_1.__assign({ legends: tslib_1.__spreadArray(tslib_1.__spreadArray([], legendDataItems, true), colorFillBarsLegendDataItems, true), enabledWrapLines: this.props.enabledLegendsWrapLines, overflowProps: this.props.legendsOverflowProps, focusZonePropsInHoverCard: this.props.focusZonePropsForLegendsInHoverCard, overflowText: this.props.legendsOverflowText }, (isLegendMultiSelectEnabled && { onLegendHoverCardLeave: this._onHoverCardHide }), this.props.legendProps, { ref: this._legendsRef })));
762
+ };
763
+ LineChartBase.prototype._getRangeForScatterMarkerSize = function () {
764
+ var extraXPixels = this._isRTL
765
+ ? this._xAxisScale(this._xMax - this._xPadding) - this._xAxisScale(this._xMax)
766
+ : this._xAxisScale(this._xMin + this._xPadding) - this._xAxisScale(this._xMin);
767
+ var extraYPixels = this._yAxisScale(this._yMin) - this._yAxisScale(this._yMin + this._yPadding);
768
+ return Math.min(extraXPixels, extraYPixels);
709
769
  };
710
770
  LineChartBase.prototype._createLines = function (xElement, containerHeight) {
711
771
  var _this_1 = this;
@@ -717,6 +777,12 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
717
777
  else {
718
778
  this._points = this._injectIndexPropertyInLineChartData(this.props.data.lineChartData);
719
779
  }
780
+ var extraMaxPixels = this.props.lineMode === 'scatter' ? this._getRangeForScatterMarkerSize() : 0;
781
+ var maxMarkerSize = (0, d3_array_2.max)(this._points, function (point) {
782
+ return (0, d3_array_2.max)(point.data, function (item) {
783
+ return item.markerSize;
784
+ });
785
+ });
720
786
  var _loop_1 = function (i) {
721
787
  var linesForLine = [];
722
788
  var bordersForLine = [];
@@ -730,7 +796,12 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
730
796
  var _2 = this_1._points[i].data[0], x1_1 = _2.x, y1 = _2.y, xAxisCalloutData_1 = _2.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _2.xAxisCalloutAccessibilityData;
731
797
  var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
732
798
  var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
733
- pointsForLine.push(React.createElement("circle", tslib_1.__assign({ id: circleId_1, key: circleId_1, r: activePoint === circleId_1 ? 5.5 : 3.5, cx: this_1._xAxisScale(x1_1), cy: this_1._yAxisScale(y1), fill: activePoint === circleId_1 ? theme.semanticColors.bodyBackground : lineColor, opacity: isLegendSelected ? 1 : 0.1, onMouseOver: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, strokeWidth: activePoint === circleId_1 ? DEFAULT_LINE_STROKE_SIZE : 0, stroke: activePoint === circleId_1 ? lineColor : '', role: "img", "aria-label": this_1._getAriaLabel(i, 0), "data-is-focusable": isLegendSelected, ref: function (e) {
799
+ var currentMarkerSize = this_1._points[i].data[0].markerSize;
800
+ pointsForLine.push(React.createElement("circle", tslib_1.__assign({ id: circleId_1, key: circleId_1, r: currentMarkerSize
801
+ ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize
802
+ : activePoint === circleId_1
803
+ ? 5.5
804
+ : 3.5, cx: this_1._xAxisScale(x1_1), cy: this_1._yAxisScale(y1), fill: activePoint === circleId_1 ? theme.semanticColors.bodyBackground : lineColor, opacity: isLegendSelected ? 1 : 0.1, onMouseOver: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, strokeWidth: activePoint === circleId_1 ? DEFAULT_LINE_STROKE_SIZE : 0, stroke: activePoint === circleId_1 ? lineColor : '', role: "img", "aria-label": this_1._getAriaLabel(i, 0), "data-is-focusable": isLegendSelected, ref: function (e) {
734
805
  _this_1._refCallback(e, circleId_1);
735
806
  }, onFocus: function () { return _this_1._handleFocus(circleId_1, x1_1, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[0].onDataPointClick))));
736
807
  }
@@ -786,7 +857,8 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
786
857
  var strokeWidth = ((_p = this_1._points[i].lineOptions) === null || _p === void 0 ? void 0 : _p.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
787
858
  var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
788
859
  var currentPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== circleId;
789
- pointsForLine.push(React.createElement("path", tslib_1.__assign({ id: circleId, key: circleId, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, onFocus: function () { return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, circleId, j, false), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) })));
860
+ var currentMarkerSize = this_1._points[i].data[j - 1].markerSize;
861
+ pointsForLine.push(this_1.props.lineMode === 'scatter' ? (React.createElement("circle", tslib_1.__assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x1), cy: this_1._yAxisScale(y1), "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, onFocus: function () { return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, circleId, j, false), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))) : (React.createElement("path", tslib_1.__assign({ id: circleId, key: circleId, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, onFocus: function () { return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, circleId, j, false), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))));
790
862
  if (j + 1 === this_1._points[i].data.length) {
791
863
  // If this is last point of the line segment.
792
864
  var lastCircleId_1 = "".concat(circleId).concat(j, "L");
@@ -794,30 +866,34 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
794
866
  var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
795
867
  path = this_1._getPath(this_1._xAxisScale(x2), this_1._yAxisScale(y2), lastCircleId_1, j, true, this_1._points[i].index);
796
868
  var _5 = this_1._points[i].data[j], lastCirlceXCallout_1 = _5.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _5.xAxisCalloutAccessibilityData;
869
+ currentMarkerSize = this_1._points[i].data[j].markerSize;
797
870
  pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(lastCircleId_1, "_container") },
798
- React.createElement("path", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, onFocus: function () {
871
+ this_1.props.lineMode === 'scatter' ? (React.createElement("circle", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x2), cy: this_1._yAxisScale(y2), "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, onFocus: function () {
872
+ return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
873
+ }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) }))) : (React.createElement("path", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, onFocus: function () {
799
874
  return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
800
- }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) })),
875
+ }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) }))),
801
876
  React.createElement("circle", { id: hiddenHoverCircleId, key: hiddenHoverCircleId, r: 8, cx: this_1._xAxisScale(x2), cy: this_1._yAxisScale(y2), opacity: 0, width: 0, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, strokeWidth: 0, focusable: false, onBlur: this_1._handleMouseOut })));
802
- /* eslint-enable react/jsx-no-bind */
803
877
  }
804
- if (isLegendSelected) {
805
- // don't draw line if it is in a gap
806
- if (!isInGap) {
807
- var lineBorderWidth = ((_q = this_1._points[i].lineOptions) === null || _q === void 0 ? void 0 : _q.lineBorderWidth)
808
- ? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
809
- : 0;
810
- if (lineBorderWidth > 0) {
811
- bordersForLine.push(React.createElement("line", { id: borderId, key: borderId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeLinecap: (_s = (_r = this_1._points[i].lineOptions) === null || _r === void 0 ? void 0 : _r.strokeLinecap) !== null && _s !== void 0 ? _s : 'round', strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth, stroke: ((_t = this_1._points[i].lineOptions) === null || _t === void 0 ? void 0 : _t.lineBorderColor) || theme.semanticColors.bodyBackground, opacity: 1 }));
878
+ if (this_1.props.lineMode !== 'scatter') {
879
+ if (isLegendSelected) {
880
+ // don't draw line if it is in a gap
881
+ if (!isInGap) {
882
+ var lineBorderWidth = ((_q = this_1._points[i].lineOptions) === null || _q === void 0 ? void 0 : _q.lineBorderWidth)
883
+ ? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
884
+ : 0;
885
+ if (lineBorderWidth > 0) {
886
+ bordersForLine.push(React.createElement("line", { id: borderId, key: borderId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeLinecap: (_s = (_r = this_1._points[i].lineOptions) === null || _r === void 0 ? void 0 : _r.strokeLinecap) !== null && _s !== void 0 ? _s : 'round', strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth, stroke: ((_t = this_1._points[i].lineOptions) === null || _t === void 0 ? void 0 : _t.lineBorderColor) || theme.semanticColors.bodyBackground, opacity: 1 }));
887
+ }
888
+ linesForLine.push(React.createElement("line", tslib_1.__assign({ id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeWidth: strokeWidth, ref: function (e) {
889
+ _this_1._refCallback(e, lineId);
890
+ }, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, stroke: lineColor, strokeLinecap: (_v = (_u = this_1._points[i].lineOptions) === null || _u === void 0 ? void 0 : _u.strokeLinecap) !== null && _v !== void 0 ? _v : 'round', strokeDasharray: (_w = this_1._points[i].lineOptions) === null || _w === void 0 ? void 0 : _w.strokeDasharray, strokeDashoffset: (_x = this_1._points[i].lineOptions) === null || _x === void 0 ? void 0 : _x.strokeDashoffset, opacity: 1 }, this_1._getClickHandler(this_1._points[i].onLineClick))));
812
891
  }
813
- linesForLine.push(React.createElement("line", tslib_1.__assign({ id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeWidth: strokeWidth, ref: function (e) {
814
- _this_1._refCallback(e, lineId);
815
- }, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, stroke: lineColor, strokeLinecap: (_v = (_u = this_1._points[i].lineOptions) === null || _u === void 0 ? void 0 : _u.strokeLinecap) !== null && _v !== void 0 ? _v : 'round', strokeDasharray: (_w = this_1._points[i].lineOptions) === null || _w === void 0 ? void 0 : _w.strokeDasharray, strokeDashoffset: (_x = this_1._points[i].lineOptions) === null || _x === void 0 ? void 0 : _x.strokeDashoffset, opacity: 1 }, this_1._getClickHandler(this_1._points[i].onLineClick))));
816
892
  }
817
- }
818
- else {
819
- if (!isInGap) {
820
- linesForLine.push(React.createElement("line", { id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeWidth: strokeWidth, stroke: lineColor, strokeLinecap: (_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.strokeLinecap) !== null && _z !== void 0 ? _z : 'round', strokeDasharray: (_0 = this_1._points[i].lineOptions) === null || _0 === void 0 ? void 0 : _0.strokeDasharray, strokeDashoffset: (_1 = this_1._points[i].lineOptions) === null || _1 === void 0 ? void 0 : _1.strokeDashoffset, opacity: 0.1 }));
893
+ else {
894
+ if (!isInGap) {
895
+ linesForLine.push(React.createElement("line", { id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeWidth: strokeWidth, stroke: lineColor, strokeLinecap: (_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.strokeLinecap) !== null && _z !== void 0 ? _z : 'round', strokeDasharray: (_0 = this_1._points[i].lineOptions) === null || _0 === void 0 ? void 0 : _0.strokeDasharray, strokeDashoffset: (_1 = this_1._points[i].lineOptions) === null || _1 === void 0 ? void 0 : _1.strokeDashoffset, opacity: 0.1 }));
896
+ }
821
897
  }
822
898
  }
823
899
  };