@redsift/charts 8.0.1 → 8.0.3

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 (217) hide show
  1. package/{dist/index.d.ts → index.d.ts} +8 -0
  2. package/{dist/index.js → index.js} +97 -28
  3. package/index.js.map +1 -0
  4. package/package.json +3 -2
  5. package/coverage/clover.xml +0 -1070
  6. package/coverage/coverage-final.json +0 -60
  7. package/coverage/lcov-report/ChartEmptyState/ChartEmptyState.tsx.html +0 -679
  8. package/coverage/lcov-report/ChartEmptyState/index.html +0 -146
  9. package/coverage/lcov-report/ChartEmptyState/index.ts.html +0 -91
  10. package/coverage/lcov-report/ChartEmptyState/styles.ts.html +0 -184
  11. package/coverage/lcov-report/HorizontalBarChart/HorizontalBarChart.tsx.html +0 -775
  12. package/coverage/lcov-report/HorizontalBarChart/HorizontalBarChartAxisBottom.tsx.html +0 -259
  13. package/coverage/lcov-report/HorizontalBarChart/HorizontalBarChartBar.tsx.html +0 -421
  14. package/coverage/lcov-report/HorizontalBarChart/index.html +0 -191
  15. package/coverage/lcov-report/HorizontalBarChart/index.ts.html +0 -94
  16. package/coverage/lcov-report/HorizontalBarChart/styles.ts.html +0 -451
  17. package/coverage/lcov-report/HorizontalBarChart/types.ts.html +0 -433
  18. package/coverage/lcov-report/PieChart/PieChart.tsx.html +0 -1105
  19. package/coverage/lcov-report/PieChart/PieChartArc.tsx.html +0 -412
  20. package/coverage/lcov-report/PieChart/index.html +0 -176
  21. package/coverage/lcov-report/PieChart/index.ts.html +0 -94
  22. package/coverage/lcov-report/PieChart/styles.ts.html +0 -616
  23. package/coverage/lcov-report/PieChart/types.ts.html +0 -472
  24. package/coverage/lcov-report/PieChart.tsx.html +0 -1045
  25. package/coverage/lcov-report/PieChartArc.tsx.html +0 -271
  26. package/coverage/lcov-report/StaticPieChart.tsx.html +0 -286
  27. package/coverage/lcov-report/base.css +0 -224
  28. package/coverage/lcov-report/block-navigation.js +0 -87
  29. package/coverage/lcov-report/components/Arc/Arc.tsx.html +0 -304
  30. package/coverage/lcov-report/components/Arc/index.html +0 -146
  31. package/coverage/lcov-report/components/Arc/index.ts.html +0 -94
  32. package/coverage/lcov-report/components/Arc/styles.ts.html +0 -208
  33. package/coverage/lcov-report/components/Arcs/Arcs.tsx.html +0 -427
  34. package/coverage/lcov-report/components/Arcs/index.html +0 -146
  35. package/coverage/lcov-report/components/Arcs/index.ts.html +0 -94
  36. package/coverage/lcov-report/components/Arcs/styles.ts.html +0 -106
  37. package/coverage/lcov-report/components/Axis/Axis.tsx.html +0 -754
  38. package/coverage/lcov-report/components/Axis/computeTicks.ts.html +0 -481
  39. package/coverage/lcov-report/components/Axis/index.html +0 -176
  40. package/coverage/lcov-report/components/Axis/index.ts.html +0 -94
  41. package/coverage/lcov-report/components/Axis/styles.ts.html +0 -148
  42. package/coverage/lcov-report/components/Axis/types.ts.html +0 -253
  43. package/coverage/lcov-report/components/Bar/Bar.tsx.html +0 -421
  44. package/coverage/lcov-report/components/Bar/index.html +0 -161
  45. package/coverage/lcov-report/components/Bar/index.ts.html +0 -94
  46. package/coverage/lcov-report/components/Bar/styles.ts.html +0 -247
  47. package/coverage/lcov-report/components/Bar/types.ts.html +0 -178
  48. package/coverage/lcov-report/components/BarChart/BarChart.tsx.html +0 -355
  49. package/coverage/lcov-report/components/BarChart/EmptyBarChart.tsx.html +0 -259
  50. package/coverage/lcov-report/components/BarChart/LoadingBarChart.tsx.html +0 -145
  51. package/coverage/lcov-report/components/BarChart/RenderedBarChart.tsx.html +0 -496
  52. package/coverage/lcov-report/components/BarChart/index.html +0 -206
  53. package/coverage/lcov-report/components/BarChart/index.ts.html +0 -94
  54. package/coverage/lcov-report/components/BarChart/styles.ts.html +0 -190
  55. package/coverage/lcov-report/components/BarChart/utils.ts.html +0 -145
  56. package/coverage/lcov-report/components/ChartContainer/ChartContainer.tsx.html +0 -433
  57. package/coverage/lcov-report/components/ChartContainer/index.html +0 -146
  58. package/coverage/lcov-report/components/ChartContainer/index.ts.html +0 -94
  59. package/coverage/lcov-report/components/ChartContainer/intl/index.html +0 -116
  60. package/coverage/lcov-report/components/ChartContainer/intl/index.ts.html +0 -106
  61. package/coverage/lcov-report/components/ChartContainer/styles.ts.html +0 -211
  62. package/coverage/lcov-report/components/DataPoint/DataPoint.tsx.html +0 -442
  63. package/coverage/lcov-report/components/DataPoint/index.html +0 -146
  64. package/coverage/lcov-report/components/DataPoint/index.ts.html +0 -94
  65. package/coverage/lcov-report/components/DataPoint/styles.ts.html +0 -109
  66. package/coverage/lcov-report/components/Dot/Dot.tsx.html +0 -232
  67. package/coverage/lcov-report/components/Dot/index.html +0 -146
  68. package/coverage/lcov-report/components/Dot/index.ts.html +0 -94
  69. package/coverage/lcov-report/components/Dot/styles.ts.html +0 -184
  70. package/coverage/lcov-report/components/Legend/Legend.tsx.html +0 -268
  71. package/coverage/lcov-report/components/Legend/index.html +0 -146
  72. package/coverage/lcov-report/components/Legend/index.ts.html +0 -94
  73. package/coverage/lcov-report/components/Legend/styles.ts.html +0 -130
  74. package/coverage/lcov-report/components/LegendItem/LegendItem.tsx.html +0 -403
  75. package/coverage/lcov-report/components/LegendItem/index.html +0 -146
  76. package/coverage/lcov-report/components/LegendItem/index.ts.html +0 -94
  77. package/coverage/lcov-report/components/LegendItem/styles.ts.html +0 -205
  78. package/coverage/lcov-report/components/PieChart/EmptyPieChart.tsx.html +0 -343
  79. package/coverage/lcov-report/components/PieChart/LoadingPieChart.tsx.html +0 -145
  80. package/coverage/lcov-report/components/PieChart/PieChart.tsx.html +0 -388
  81. package/coverage/lcov-report/components/PieChart/RenderedPieChart.tsx.html +0 -571
  82. package/coverage/lcov-report/components/PieChart/index.html +0 -221
  83. package/coverage/lcov-report/components/PieChart/index.ts.html +0 -94
  84. package/coverage/lcov-report/components/PieChart/styles.ts.html +0 -376
  85. package/coverage/lcov-report/components/PieChart/types.ts.html +0 -352
  86. package/coverage/lcov-report/components/PieChart/utils.ts.html +0 -199
  87. package/coverage/lcov-report/components/ScatterPlot/EmptyScatterPlot.tsx.html +0 -295
  88. package/coverage/lcov-report/components/ScatterPlot/LoadingScatterPlot.tsx.html +0 -145
  89. package/coverage/lcov-report/components/ScatterPlot/RenderedScatterPlot.tsx.html +0 -910
  90. package/coverage/lcov-report/components/ScatterPlot/ScatterPlot.tsx.html +0 -379
  91. package/coverage/lcov-report/components/ScatterPlot/index.html +0 -221
  92. package/coverage/lcov-report/components/ScatterPlot/index.ts.html +0 -94
  93. package/coverage/lcov-report/components/ScatterPlot/styles.ts.html +0 -196
  94. package/coverage/lcov-report/components/ScatterPlot/types.ts.html +0 -376
  95. package/coverage/lcov-report/components/ScatterPlot/utils.ts.html +0 -388
  96. package/coverage/lcov-report/favicon.png +0 -0
  97. package/coverage/lcov-report/hooks/index.html +0 -176
  98. package/coverage/lcov-report/hooks/index.ts.html +0 -97
  99. package/coverage/lcov-report/hooks/useBrush.tsx.html +0 -430
  100. package/coverage/lcov-report/hooks/useColor.tsx.html +0 -163
  101. package/coverage/lcov-report/hooks/useFormatCategoricalData.tsx.html +0 -289
  102. package/coverage/lcov-report/hooks/useZoom.tsx.html +0 -235
  103. package/coverage/lcov-report/index.html +0 -311
  104. package/coverage/lcov-report/index.ts.html +0 -94
  105. package/coverage/lcov-report/prettify.css +0 -1
  106. package/coverage/lcov-report/prettify.js +0 -2
  107. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  108. package/coverage/lcov-report/sorter.js +0 -196
  109. package/coverage/lcov-report/styles.ts.html +0 -631
  110. package/coverage/lcov-report/types.ts.html +0 -457
  111. package/coverage/lcov.info +0 -2272
  112. package/dist/index.js.map +0 -1
  113. package/dist/package.json +0 -98
  114. package/index.ts +0 -1
  115. package/jest.config.js +0 -3
  116. package/rollup.config.js +0 -13
  117. package/src/components/Arc/Arc.test.tsx +0 -92
  118. package/src/components/Arc/Arc.tsx +0 -73
  119. package/src/components/Arc/index.ts +0 -3
  120. package/src/components/Arc/styles.ts +0 -41
  121. package/src/components/Arc/types.ts +0 -18
  122. package/src/components/Arcs/Arcs.stories.tsx +0 -177
  123. package/src/components/Arcs/Arcs.tsx +0 -114
  124. package/src/components/Arcs/index.ts +0 -3
  125. package/src/components/Arcs/styles.ts +0 -7
  126. package/src/components/Arcs/types.ts +0 -26
  127. package/src/components/Axis/Axis.stories.tsx +0 -297
  128. package/src/components/Axis/Axis.tsx +0 -223
  129. package/src/components/Axis/computeTicks.ts +0 -132
  130. package/src/components/Axis/index.ts +0 -3
  131. package/src/components/Axis/styles.ts +0 -21
  132. package/src/components/Axis/types.ts +0 -56
  133. package/src/components/Bar/Bar.stories.tsx +0 -152
  134. package/src/components/Bar/Bar.test.tsx +0 -158
  135. package/src/components/Bar/Bar.tsx +0 -112
  136. package/src/components/Bar/index.ts +0 -3
  137. package/src/components/Bar/styles.ts +0 -54
  138. package/src/components/Bar/types.ts +0 -31
  139. package/src/components/BarChart/BarChart.stories.tsx +0 -80
  140. package/src/components/BarChart/BarChart.test.tsx +0 -189
  141. package/src/components/BarChart/BarChart.tsx +0 -90
  142. package/src/components/BarChart/EmptyBarChart.tsx +0 -58
  143. package/src/components/BarChart/LoadingBarChart.tsx +0 -20
  144. package/src/components/BarChart/RenderedBarChart.tsx +0 -137
  145. package/src/components/BarChart/__snapshots__/BarChart.test.tsx.snap +0 -6932
  146. package/src/components/BarChart/index.ts +0 -3
  147. package/src/components/BarChart/styles.ts +0 -35
  148. package/src/components/BarChart/types.ts +0 -58
  149. package/src/components/BarChart/utils.ts +0 -20
  150. package/src/components/ChartContainer/ChartContainer.stories.tsx +0 -81
  151. package/src/components/ChartContainer/ChartContainer.test.tsx +0 -75
  152. package/src/components/ChartContainer/ChartContainer.tsx +0 -116
  153. package/src/components/ChartContainer/index.ts +0 -3
  154. package/src/components/ChartContainer/intl/en-US.json +0 -3
  155. package/src/components/ChartContainer/intl/fr-FR.json +0 -3
  156. package/src/components/ChartContainer/intl/index.ts +0 -7
  157. package/src/components/ChartContainer/styles.ts +0 -42
  158. package/src/components/ChartContainer/types.ts +0 -24
  159. package/src/components/DataPoint/DataPoint.tsx +0 -119
  160. package/src/components/DataPoint/index.ts +0 -3
  161. package/src/components/DataPoint/styles.ts +0 -8
  162. package/src/components/DataPoint/types.ts +0 -33
  163. package/src/components/Dot/Dot.stories.tsx +0 -157
  164. package/src/components/Dot/Dot.test.tsx +0 -136
  165. package/src/components/Dot/Dot.tsx +0 -49
  166. package/src/components/Dot/index.ts +0 -3
  167. package/src/components/Dot/styles.ts +0 -33
  168. package/src/components/Dot/types.ts +0 -16
  169. package/src/components/Legend/Legend.stories.tsx +0 -108
  170. package/src/components/Legend/Legend.tsx +0 -61
  171. package/src/components/Legend/index.ts +0 -3
  172. package/src/components/Legend/styles.ts +0 -15
  173. package/src/components/Legend/types.ts +0 -27
  174. package/src/components/LegendItem/LegendItem.test.tsx +0 -69
  175. package/src/components/LegendItem/LegendItem.tsx +0 -106
  176. package/src/components/LegendItem/index.ts +0 -3
  177. package/src/components/LegendItem/styles.ts +0 -40
  178. package/src/components/LegendItem/types.ts +0 -30
  179. package/src/components/PieChart/EmptyPieChart.tsx +0 -86
  180. package/src/components/PieChart/LoadingPieChart.tsx +0 -20
  181. package/src/components/PieChart/PieChart.stories.tsx +0 -91
  182. package/src/components/PieChart/PieChart.test.tsx +0 -201
  183. package/src/components/PieChart/PieChart.tsx +0 -101
  184. package/src/components/PieChart/RenderedPieChart.tsx +0 -162
  185. package/src/components/PieChart/__snapshots__/PieChart.stories.storyshot +0 -7843
  186. package/src/components/PieChart/__snapshots__/PieChart.test.tsx.snap +0 -20540
  187. package/src/components/PieChart/index.ts +0 -3
  188. package/src/components/PieChart/styles.ts +0 -97
  189. package/src/components/PieChart/types.ts +0 -89
  190. package/src/components/PieChart/utils.ts +0 -38
  191. package/src/components/ScatterPlot/EmptyScatterPlot.tsx +0 -70
  192. package/src/components/ScatterPlot/LoadingScatterPlot.tsx +0 -20
  193. package/src/components/ScatterPlot/RenderedScatterPlot.tsx +0 -275
  194. package/src/components/ScatterPlot/ScatterPlot.stories.tsx +0 -95
  195. package/src/components/ScatterPlot/ScatterPlot.test.tsx +0 -44
  196. package/src/components/ScatterPlot/ScatterPlot.tsx +0 -98
  197. package/src/components/ScatterPlot/__snapshots__/ScatterPlot.test.tsx.snap +0 -88352
  198. package/src/components/ScatterPlot/index.ts +0 -3
  199. package/src/components/ScatterPlot/styles.ts +0 -37
  200. package/src/components/ScatterPlot/types.ts +0 -97
  201. package/src/components/ScatterPlot/utils.ts +0 -101
  202. package/src/config.ts +0 -10
  203. package/src/hooks/index.ts +0 -4
  204. package/src/hooks/useBrush.tsx +0 -115
  205. package/src/hooks/useColor.tsx +0 -26
  206. package/src/hooks/useFormatCategoricalData.tsx +0 -68
  207. package/src/hooks/useZoom.tsx +0 -50
  208. package/src/index.ts +0 -15
  209. package/src/scheme.ts +0 -221
  210. package/src/types/data.ts +0 -52
  211. package/src/types/index.ts +0 -5
  212. package/src/types/legend.ts +0 -19
  213. package/src/types/scale.ts +0 -79
  214. package/src/types/size.ts +0 -17
  215. package/src/types/theme.ts +0 -27
  216. package/tsconfig.json +0 -3
  217. /package/{dist/CONTRIBUTING.md → CONTRIBUTING.md} +0 -0
@@ -402,6 +402,8 @@ interface ChartContainerProps extends Omit<ComponentProps<'div'>, 'title'>, Styl
402
402
  chartProps?: ComponentProps<'div'>;
403
403
  /** Ref to the chart. */
404
404
  chartRef?: RefObject<HTMLDivElement>;
405
+ /** Description. */
406
+ description?: string;
405
407
  /** Id. */
406
408
  id?: string;
407
409
  /** Method called when the Reset button is displayed (defines whether or not the button should be displayed). */
@@ -659,6 +661,8 @@ interface ScatterPlotProps extends ChartContainerProps {
659
661
  dotRole?: DotProps['role'];
660
662
  /** Component to use if the chart is empty (replacing the default one). */
661
663
  emptyComponent?: ReactNode;
664
+ /** Whether the Control Keys panel is displayed or not. */
665
+ hideControlKeyPanel?: boolean;
662
666
  /** Whether the scatter plot dots are selectable using brush or not. */
663
667
  isBrushable?: boolean;
664
668
  /** Method to determine whether a dot is selected or not. */
@@ -689,8 +693,12 @@ interface ScatterPlotProps extends ChartContainerProps {
689
693
  variant?: ScatterPlotVariant;
690
694
  /** X axis variant. */
691
695
  xAxisVariant?: AxisVariant;
696
+ /** X axis placement. */
697
+ xAxisPlacement?: 'bottom' | 'top' | 'both';
692
698
  /** Y axis variant. */
693
699
  yAxisVariant?: AxisVariant;
700
+ /** Y axis placement. */
701
+ yAxisPlacement?: 'right' | 'left' | 'both';
694
702
  }
695
703
  type StyledScatterPlotProps = ScatterPlotProps & {};
696
704
 
@@ -1,11 +1,11 @@
1
1
  import { brush, select, scaleOrdinal, zoom, interpolateRound, interpolate as interpolate$1, scaleLinear, sum, arc, pie, min, extent, descending, scaleSqrt, max } from 'd3';
2
- import { RedsiftDataVizColorBlueDefault, RedsiftDataVizColorGreyDark, RedsiftDataVizColorGreenDefault, RedsiftDataVizColorPinkDefault, RedsiftDataVizColorAquaDefault, RedsiftDataVizColorBrownDefault, RedsiftDataVizColorRedDefault, RedsiftDataVizColorYellowDefault, RedsiftDataVizColorPurpleDefault, RedsiftDataVizColorOrangeDefault, RedsiftDataVizColorGreyDefault, RedsiftDataVizColorGreenDark, RedsiftDataVizColorPinkDark, RedsiftDataVizColorAquaDark, RedsiftDataVizColorBrownDark, RedsiftDataVizColorRedDark, RedsiftDataVizColorYellowDark, RedsiftDataVizColorPurpleDark, RedsiftDataVizColorOrangeDark, RedsiftDataVizColorBlueDark, RedsiftDataVizColorGreenDarker, RedsiftDataVizColorPinkDarker, RedsiftDataVizColorAquaDarker, RedsiftDataVizColorBrownDarker, RedsiftDataVizColorRedDarker, RedsiftDataVizColorYellowDarker, RedsiftDataVizColorPurpleDarker, RedsiftDataVizColorOrangeDarker, RedsiftDataVizColorBlueDarker, RedsiftDataVizColorGreyDarker, RedsiftDataVizColorGreenDarkerer, RedsiftDataVizColorPinkDarkerer, RedsiftDataVizColorAquaDarkerer, RedsiftDataVizColorBrownDarkerer, RedsiftDataVizColorRedDarkerer, RedsiftDataVizColorYellowDarkerer, RedsiftDataVizColorPurpleDarkerer, RedsiftDataVizColorOrangeDarkerer, RedsiftDataVizColorBlueDarkerer, RedsiftDataVizColorGreyDarkerer, RedsiftDataVizColorGreenLight, RedsiftDataVizColorPinkLight, RedsiftDataVizColorAquaLight, RedsiftDataVizColorBrownLight, RedsiftDataVizColorRedLight, RedsiftDataVizColorYellowLight, RedsiftDataVizColorPurpleLight, RedsiftDataVizColorOrangeLight, RedsiftDataVizColorBlueLight, RedsiftDataVizColorGreyLight, RedsiftDataVizColorGreenLighter, RedsiftDataVizColorPinkLighter, RedsiftDataVizColorAquaLighter, RedsiftDataVizColorBrownLighter, RedsiftDataVizColorRedLighter, RedsiftDataVizColorYellowLighter, RedsiftDataVizColorPurpleLighter, RedsiftDataVizColorOrangeLighter, RedsiftDataVizColorBlueLighter, RedsiftDataVizColorGreyLighter, RedsiftDataVizColorGreenLighterer, RedsiftDataVizColorPinkLighterer, RedsiftDataVizColorAquaLighterer, RedsiftDataVizColorBrownLighterer, RedsiftDataVizColorRedLighterer, RedsiftDataVizColorYellowLighterer, RedsiftDataVizColorPurpleLighterer, RedsiftDataVizColorOrangeLighterer, RedsiftDataVizColorBlueLighterer, RedsiftDataVizColorGreyLighterer, Text, Number as Number$1, baseStyling, focusRing, Flexbox, warnIfNoAccessibleLabelFound, Heading, Button } from '@redsift/design-system';
2
+ import { RedsiftDataVizColorBlueDefault, RedsiftDataVizColorGreyDark, RedsiftDataVizColorGreenDefault, RedsiftDataVizColorPinkDefault, RedsiftDataVizColorAquaDefault, RedsiftDataVizColorBrownDefault, RedsiftDataVizColorRedDefault, RedsiftDataVizColorYellowDefault, RedsiftDataVizColorPurpleDefault, RedsiftDataVizColorOrangeDefault, RedsiftDataVizColorGreyDefault, RedsiftDataVizColorGreenDark, RedsiftDataVizColorPinkDark, RedsiftDataVizColorAquaDark, RedsiftDataVizColorBrownDark, RedsiftDataVizColorRedDark, RedsiftDataVizColorYellowDark, RedsiftDataVizColorPurpleDark, RedsiftDataVizColorOrangeDark, RedsiftDataVizColorBlueDark, RedsiftDataVizColorGreenDarker, RedsiftDataVizColorPinkDarker, RedsiftDataVizColorAquaDarker, RedsiftDataVizColorBrownDarker, RedsiftDataVizColorRedDarker, RedsiftDataVizColorYellowDarker, RedsiftDataVizColorPurpleDarker, RedsiftDataVizColorOrangeDarker, RedsiftDataVizColorBlueDarker, RedsiftDataVizColorGreyDarker, RedsiftDataVizColorGreenDarkerer, RedsiftDataVizColorPinkDarkerer, RedsiftDataVizColorAquaDarkerer, RedsiftDataVizColorBrownDarkerer, RedsiftDataVizColorRedDarkerer, RedsiftDataVizColorYellowDarkerer, RedsiftDataVizColorPurpleDarkerer, RedsiftDataVizColorOrangeDarkerer, RedsiftDataVizColorBlueDarkerer, RedsiftDataVizColorGreyDarkerer, RedsiftDataVizColorGreenLight, RedsiftDataVizColorPinkLight, RedsiftDataVizColorAquaLight, RedsiftDataVizColorBrownLight, RedsiftDataVizColorRedLight, RedsiftDataVizColorYellowLight, RedsiftDataVizColorPurpleLight, RedsiftDataVizColorOrangeLight, RedsiftDataVizColorBlueLight, RedsiftDataVizColorGreyLight, RedsiftDataVizColorGreenLighter, RedsiftDataVizColorPinkLighter, RedsiftDataVizColorAquaLighter, RedsiftDataVizColorBrownLighter, RedsiftDataVizColorRedLighter, RedsiftDataVizColorYellowLighter, RedsiftDataVizColorPurpleLighter, RedsiftDataVizColorOrangeLighter, RedsiftDataVizColorBlueLighter, RedsiftDataVizColorGreyLighter, RedsiftDataVizColorGreenLighterer, RedsiftDataVizColorPinkLighterer, RedsiftDataVizColorAquaLighterer, RedsiftDataVizColorBrownLighterer, RedsiftDataVizColorRedLighterer, RedsiftDataVizColorYellowLighterer, RedsiftDataVizColorPurpleLighterer, RedsiftDataVizColorOrangeLighterer, RedsiftDataVizColorBlueLighterer, RedsiftDataVizColorGreyLighterer, Text, Number as Number$1, baseStyling, focusRing, Flexbox, warnIfNoAccessibleLabelFound, Heading, Button, Icon } from '@redsift/design-system';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useEffect, useMemo, useState, useLayoutEffect, forwardRef, useCallback, useContext, useId } from 'react';
5
5
  import classNames from 'classnames';
6
6
  import { unstable_batchedUpdates } from 'react-dom';
7
7
  import styled, { css } from 'styled-components';
8
- import { Tooltip } from '@redsift/popovers';
8
+ import { Tooltip, Popover } from '@redsift/popovers';
9
9
  import { useLocalizedStringFormatter } from 'react-aria';
10
10
 
11
11
  const getRoundedIntermediaryPoint = (selection, scaleX, scaleY) => {
@@ -4794,9 +4794,10 @@ const StyledChartContainerCaption = styled.p`
4794
4794
  font-size: var(--redsift-typography-caption-font-size);
4795
4795
  font-weight: var(--redsift-typography-caption-font-weight);
4796
4796
  line-height: var(--redsift-typography-caption-line-height);
4797
+ margin: 8px;
4797
4798
  `;
4798
4799
 
4799
- const _excluded$f = ["aria-label", "aria-labelledby", "caption", "chartProps", "chartRef", "children", "className", "id", "title", "onReset"];
4800
+ const _excluded$f = ["aria-label", "aria-labelledby", "description", "chartProps", "chartRef", "children", "className", "id", "title", "onReset"];
4800
4801
  const COMPONENT_NAME$6 = 'ChartContainer';
4801
4802
  const CLASSNAME$6 = 'redsift-chart-container';
4802
4803
  const DEFAULT_PROPS$6 = {};
@@ -4804,7 +4805,7 @@ const ChartContainer = /*#__PURE__*/forwardRef((props, ref) => {
4804
4805
  const {
4805
4806
  'aria-label': propsAriaLabel,
4806
4807
  'aria-labelledby': propsAriaLabelledby,
4807
- caption,
4808
+ description,
4808
4809
  chartProps,
4809
4810
  chartRef,
4810
4811
  children,
@@ -4835,14 +4836,16 @@ const ChartContainer = /*#__PURE__*/forwardRef((props, ref) => {
4835
4836
  color: "question",
4836
4837
  variant: "unstyled",
4837
4838
  onClick: onReset
4838
- }, stringFormatter.format('reset')) : null) : null, children ? /*#__PURE__*/React__default.createElement("div", _extends({}, chartProps, {
4839
+ }, stringFormatter.format('reset')) : null) : null, /*#__PURE__*/React__default.createElement(Flexbox, {
4840
+ flexDirection: "column"
4841
+ }, children ? /*#__PURE__*/React__default.createElement("div", _extends({}, chartProps, {
4839
4842
  ref: chartRef,
4840
4843
  className: `${ChartContainer.className}__content`,
4841
4844
  "aria-label": ariaLabel,
4842
4845
  "aria-labelledby": ariaLabelledby
4843
- }), children) : null, caption ? /*#__PURE__*/React__default.createElement(StyledChartContainerCaption, {
4844
- className: `${ChartContainer.className}__caption`
4845
- }, caption) : null);
4846
+ }), children) : null, description ? /*#__PURE__*/React__default.createElement(StyledChartContainerCaption, {
4847
+ className: `${ChartContainer.className}__description`
4848
+ }, description) : null));
4846
4849
  });
4847
4850
  ChartContainer.className = CLASSNAME$6;
4848
4851
  ChartContainer.defaultProps = DEFAULT_PROPS$6;
@@ -6068,13 +6071,20 @@ const EmptyScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6068
6071
  })))));
6069
6072
  });
6070
6073
 
6071
- const _excluded$1 = ["isBrushable", "className", "data", "dotRole", "id", "isDotSelected", "labelDecorator", "labelVariant", "legendProps", "onBrush", "onBrushEnd", "onDotClick", "size", "theme", "tooltipVariant", "variant", "xAxisVariant", "yAxisVariant"];
6074
+ // Material Design Icons v7.2.96
6075
+ var mdiChevronDown = "M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z";
6076
+ var mdiChevronRight = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";
6077
+ var mdiMouse = "M11,1.07C7.05,1.56 4,4.92 4,9H11M4,15A8,8 0 0,0 12,23A8,8 0 0,0 20,15V11H4M13,1.07V9H20C20,4.92 16.94,1.56 13,1.07Z";
6078
+
6079
+ const _excluded$1 = ["isBrushable", "caption", "className", "data", "dotRole", "hideControlKeyPanel", "id", "isDotSelected", "labelDecorator", "labelVariant", "legendProps", "onBrush", "onBrushEnd", "onDotClick", "size", "theme", "tooltipVariant", "variant", "xAxisVariant", "xAxisPlacement", "yAxisVariant", "yAxisPlacement"];
6072
6080
  const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6073
6081
  const {
6074
6082
  isBrushable,
6083
+ caption,
6075
6084
  className,
6076
6085
  data: propsData,
6077
6086
  dotRole,
6087
+ hideControlKeyPanel,
6078
6088
  id,
6079
6089
  isDotSelected,
6080
6090
  labelDecorator,
@@ -6088,7 +6098,9 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6088
6098
  tooltipVariant,
6089
6099
  variant,
6090
6100
  xAxisVariant,
6091
- yAxisVariant
6101
+ xAxisPlacement,
6102
+ yAxisVariant,
6103
+ yAxisPlacement
6092
6104
  } = props,
6093
6105
  forwardedProps = _objectWithoutProperties(props, _excluded$1);
6094
6106
  const cache = useRef();
@@ -6100,10 +6112,10 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6100
6112
  const width = chartDimensions.width;
6101
6113
  const height = chartDimensions.height;
6102
6114
  const margins = {
6103
- top: 16,
6104
- left: 48,
6105
- right: 16,
6106
- bottom: 48
6115
+ top: xAxisVariant === AxisVariant.default || xAxisVariant === AxisVariant.tickValue ? 24 : 8,
6116
+ left: yAxisVariant === AxisVariant.default || yAxisVariant === AxisVariant.tickValue ? 48 : 8,
6117
+ right: yAxisVariant === AxisVariant.default || yAxisVariant === AxisVariant.tickValue ? 48 : 8,
6118
+ bottom: xAxisVariant === AxisVariant.default || xAxisVariant === AxisVariant.tickValue ? 24 : 8
6107
6119
  };
6108
6120
  const chartHeight = height - margins.top - margins.bottom;
6109
6121
  const chartWidth = width - margins.left - margins.right;
@@ -6174,11 +6186,50 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6174
6186
  if (countsByCategory && !legendWidth.current) {
6175
6187
  legendWidth.current = `${Math.max(...countsByCategory.map(d => d.key.length + String(d.value).length)) * 8 + 32}px`;
6176
6188
  }
6189
+ const [isKeyPanelOpen, setIsKeyPanelOpen] = useState(false);
6177
6190
  return /*#__PURE__*/React__default.createElement(StyledScatterPlot, _extends({}, forwardedProps, {
6178
6191
  id: id,
6179
6192
  className: className,
6180
6193
  ref: ref
6181
- }), /*#__PURE__*/React__default.createElement("svg", {
6194
+ }), /*#__PURE__*/React__default.createElement(Flexbox, {
6195
+ flexDirection: "column",
6196
+ alignItems: "center",
6197
+ gap: "8"
6198
+ }, !hideControlKeyPanel ? /*#__PURE__*/React__default.createElement(Flexbox, {
6199
+ width: width,
6200
+ position: "absolute"
6201
+ }, /*#__PURE__*/React__default.createElement(Flexbox, {
6202
+ flexDirection: "column",
6203
+ alignItems: "flex-end",
6204
+ position: "absolute",
6205
+ top: `${margins.top + 16}px`,
6206
+ right: `${margins.right + 16}px`
6207
+ }, /*#__PURE__*/React__default.createElement(Popover, {
6208
+ placement: "bottom-end",
6209
+ isOpen: isKeyPanelOpen,
6210
+ onOpen: setIsKeyPanelOpen
6211
+ }, /*#__PURE__*/React__default.createElement(Popover.Trigger, null, /*#__PURE__*/React__default.createElement(Button, {
6212
+ variant: "secondary",
6213
+ rightIcon: isKeyPanelOpen ? mdiChevronDown : mdiChevronRight,
6214
+ color: "question",
6215
+ style: {
6216
+ border: '1px solid var(--redsift-color-neutral-midgrey)'
6217
+ }
6218
+ }, /*#__PURE__*/React__default.createElement(Icon, {
6219
+ icon: mdiMouse
6220
+ }))), /*#__PURE__*/React__default.createElement(Popover.Content, {
6221
+ flexDirection: "column",
6222
+ alignItems: "flex-start"
6223
+ }, /*#__PURE__*/React__default.createElement(Text, {
6224
+ margin: "8px 16px 0",
6225
+ fontSize: "13px"
6226
+ }, "Zoom - Mouse wheel"), /*#__PURE__*/React__default.createElement(Text, {
6227
+ margin: "0 16px",
6228
+ fontSize: "13px"
6229
+ }, "Pan - Left click and drag"), /*#__PURE__*/React__default.createElement(Text, {
6230
+ margin: "0 16px 8px",
6231
+ fontSize: "13px"
6232
+ }, "Select - Hold shift, left click and drag"))))) : null, /*#__PURE__*/React__default.createElement("svg", {
6182
6233
  ref: svgRef,
6183
6234
  width: width,
6184
6235
  height: height
@@ -6219,23 +6270,41 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6219
6270
  });
6220
6271
  }))), /*#__PURE__*/React__default.createElement("g", {
6221
6272
  transform: `translate(${margins.left},${margins.top})`
6222
- }, /*#__PURE__*/React__default.createElement(Axis, {
6223
- position: "left",
6224
- length: chartHeight,
6225
- scale: scaleY,
6273
+ }, ['bottom', 'both'].includes(xAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
6274
+ position: "bottom",
6275
+ length: chartWidth,
6276
+ scale: scaleX,
6226
6277
  x: 0,
6227
- y: 0,
6278
+ y: chartHeight,
6228
6279
  tickValues: 8,
6229
6280
  variant: xAxisVariant
6230
- }), /*#__PURE__*/React__default.createElement(Axis, {
6231
- position: "bottom",
6281
+ }) : null, ['top', 'both'].includes(xAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
6282
+ position: "top",
6232
6283
  length: chartWidth,
6233
6284
  scale: scaleX,
6234
6285
  x: 0,
6235
- y: chartHeight,
6286
+ y: 0,
6287
+ tickValues: 8,
6288
+ variant: xAxisVariant
6289
+ }) : null, ['left', 'both'].includes(yAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
6290
+ position: "left",
6291
+ length: chartHeight,
6292
+ scale: scaleY,
6293
+ x: 0,
6294
+ y: 0,
6236
6295
  tickValues: 8,
6237
6296
  variant: yAxisVariant
6238
- }))), hasCategory && labelVariant !== ScatterPlotLabelVariant.none ? /*#__PURE__*/React__default.createElement(Legend, _extends({
6297
+ }) : null, ['right', 'both'].includes(yAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
6298
+ position: "right",
6299
+ length: chartHeight,
6300
+ scale: scaleY,
6301
+ x: chartWidth,
6302
+ y: 0,
6303
+ tickValues: 8,
6304
+ variant: yAxisVariant
6305
+ }) : null)), /*#__PURE__*/React__default.createElement(StyledChartContainerCaption, {
6306
+ width: chartWidth - 48
6307
+ }, caption)), hasCategory && labelVariant !== ScatterPlotLabelVariant.none ? /*#__PURE__*/React__default.createElement(Legend, _extends({
6239
6308
  data: countsByCategory.map(d => _objectSpread2(_objectSpread2({}, d), {}, {
6240
6309
  color: colorScale === null || colorScale === void 0 ? void 0 : colorScale(d.key)
6241
6310
  })),
@@ -6248,6 +6317,7 @@ const _excluded = ["className", "data", "dotRole", "emptyComponent", "id", "isDo
6248
6317
  const COMPONENT_NAME = 'ScatterPlot';
6249
6318
  const CLASSNAME = 'redsift-scatterplot';
6250
6319
  const DEFAULT_PROPS = {
6320
+ hideControlKeyPanel: false,
6251
6321
  labelVariant: ScatterPlotLabelVariant.externalLabel,
6252
6322
  localeText: {
6253
6323
  emptyChartText: 'No Data'
@@ -6257,7 +6327,9 @@ const DEFAULT_PROPS = {
6257
6327
  tooltipVariant: TooltipVariant.none,
6258
6328
  variant: ScatterPlotVariant.default,
6259
6329
  xAxisVariant: AxisVariant.default,
6260
- yAxisVariant: AxisVariant.default
6330
+ xAxisPlacement: 'bottom',
6331
+ yAxisVariant: AxisVariant.default,
6332
+ yAxisPlacement: 'left'
6261
6333
  };
6262
6334
  const ScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6263
6335
  const {
@@ -6279,9 +6351,6 @@ const ScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
6279
6351
  } = props,
6280
6352
  forwardedProps = _objectWithoutProperties(props, _excluded);
6281
6353
  const id = propsId !== null && propsId !== void 0 ? propsId : useId();
6282
-
6283
- // console.log(propsData);
6284
-
6285
6354
  if (propsData === undefined || propsData === null) {
6286
6355
  return /*#__PURE__*/React__default.createElement(LoadingScatterPlot, _extends({
6287
6356
  id: id