@mui/x-charts 8.14.1 → 8.16.0

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 (264) hide show
  1. package/BarChart/BarChart.js +8 -0
  2. package/BarChart/BarChart.plugins.d.ts +2 -1
  3. package/BarChart/BarChart.plugins.js +2 -1
  4. package/BarChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  5. package/BarChart/seriesConfig/index.js +2 -0
  6. package/BarChart/seriesConfig/tooltipPosition.d.ts +3 -0
  7. package/BarChart/seriesConfig/tooltipPosition.js +67 -0
  8. package/BarChart/useBarChartProps.js +4 -2
  9. package/BarChart/useBarPlotData.d.ts +17 -2
  10. package/BarChart/useBarPlotData.js +59 -34
  11. package/CHANGELOG.md +207 -0
  12. package/ChartContainer/ChartContainer.js +8 -0
  13. package/ChartContainer/useChartContainerProps.js +4 -2
  14. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -1
  15. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -1
  16. package/ChartsBrushOverlay/ChartsBrushOverlay.classes.d.ts +12 -0
  17. package/ChartsBrushOverlay/ChartsBrushOverlay.classes.js +9 -0
  18. package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +6 -0
  19. package/ChartsBrushOverlay/ChartsBrushOverlay.js +102 -0
  20. package/ChartsBrushOverlay/index.d.ts +4 -0
  21. package/ChartsBrushOverlay/index.js +19 -0
  22. package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  23. package/ChartsReferenceLine/ChartsXReferenceLine.js +13 -8
  24. package/ChartsReferenceLine/ChartsYReferenceLine.js +13 -8
  25. package/ChartsReferenceLine/common.d.ts +3 -1
  26. package/ChartsReferenceLine/common.js +3 -1
  27. package/ChartsTooltip/ChartsTooltip.js +9 -0
  28. package/ChartsTooltip/ChartsTooltipContainer.d.ts +9 -0
  29. package/ChartsTooltip/ChartsTooltipContainer.js +67 -23
  30. package/ChartsTooltip/useItemTooltip.js +7 -14
  31. package/ChartsWrapper/ChartsWrapper.js +2 -1
  32. package/ChartsXAxis/getVisibleLabels.js +45 -25
  33. package/ChartsXAxis/useAxisTicksProps.d.ts +81 -81
  34. package/ChartsYAxis/useAxisTicksProps.d.ts +81 -81
  35. package/LineChart/LineChart.js +8 -0
  36. package/LineChart/LineChart.plugins.d.ts +2 -1
  37. package/LineChart/LineChart.plugins.js +2 -1
  38. package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  39. package/LineChart/seriesConfig/index.js +2 -0
  40. package/LineChart/seriesConfig/tooltipPosition.d.ts +3 -0
  41. package/LineChart/seriesConfig/tooltipPosition.js +33 -0
  42. package/LineChart/useLineChartProps.js +4 -2
  43. package/PieChart/seriesConfig/getSeriesWithDefaultValues.js +5 -6
  44. package/PieChart/seriesConfig/index.js +2 -0
  45. package/PieChart/seriesConfig/seriesProcessor.js +2 -1
  46. package/PieChart/seriesConfig/tooltipPosition.d.ts +3 -0
  47. package/PieChart/seriesConfig/tooltipPosition.js +75 -0
  48. package/RadarChart/RadarChart.plugins.d.ts +2 -2
  49. package/RadarChart/RadarChart.plugins.js +1 -1
  50. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +1 -1
  51. package/RadarChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  52. package/ScatterChart/ScatterChart.js +8 -0
  53. package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
  54. package/ScatterChart/ScatterChart.plugins.js +2 -1
  55. package/ScatterChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  56. package/ScatterChart/seriesConfig/index.js +2 -0
  57. package/ScatterChart/seriesConfig/tooltipPosition.d.ts +3 -0
  58. package/ScatterChart/seriesConfig/tooltipPosition.js +33 -0
  59. package/ScatterChart/useScatterChartProps.js +5 -3
  60. package/SparkLineChart/SparkLineChart.js +8 -0
  61. package/context/ChartProvider/ChartProvider.js +1 -1
  62. package/esm/BarChart/BarChart.js +8 -0
  63. package/esm/BarChart/BarChart.plugins.d.ts +2 -1
  64. package/esm/BarChart/BarChart.plugins.js +2 -1
  65. package/esm/BarChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  66. package/esm/BarChart/seriesConfig/index.js +2 -0
  67. package/esm/BarChart/seriesConfig/tooltipPosition.d.ts +3 -0
  68. package/esm/BarChart/seriesConfig/tooltipPosition.js +61 -0
  69. package/esm/BarChart/useBarChartProps.js +4 -2
  70. package/esm/BarChart/useBarPlotData.d.ts +17 -2
  71. package/esm/BarChart/useBarPlotData.js +58 -34
  72. package/esm/ChartContainer/ChartContainer.js +8 -0
  73. package/esm/ChartContainer/useChartContainerProps.js +4 -2
  74. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +1 -2
  75. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +1 -2
  76. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.classes.d.ts +12 -0
  77. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.classes.js +2 -0
  78. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +6 -0
  79. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.js +95 -0
  80. package/esm/ChartsBrushOverlay/index.d.ts +4 -0
  81. package/esm/ChartsBrushOverlay/index.js +2 -0
  82. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  83. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +14 -9
  84. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +14 -9
  85. package/esm/ChartsReferenceLine/common.d.ts +3 -1
  86. package/esm/ChartsReferenceLine/common.js +2 -0
  87. package/esm/ChartsTooltip/ChartsTooltip.js +9 -0
  88. package/esm/ChartsTooltip/ChartsTooltipContainer.d.ts +9 -0
  89. package/esm/ChartsTooltip/ChartsTooltipContainer.js +68 -24
  90. package/esm/ChartsTooltip/useItemTooltip.js +9 -16
  91. package/esm/ChartsWrapper/ChartsWrapper.js +2 -1
  92. package/esm/ChartsXAxis/getVisibleLabels.js +45 -25
  93. package/esm/ChartsXAxis/useAxisTicksProps.d.ts +81 -81
  94. package/esm/ChartsYAxis/useAxisTicksProps.d.ts +81 -81
  95. package/esm/LineChart/LineChart.js +8 -0
  96. package/esm/LineChart/LineChart.plugins.d.ts +2 -1
  97. package/esm/LineChart/LineChart.plugins.js +2 -1
  98. package/esm/LineChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  99. package/esm/LineChart/seriesConfig/index.js +2 -0
  100. package/esm/LineChart/seriesConfig/tooltipPosition.d.ts +3 -0
  101. package/esm/LineChart/seriesConfig/tooltipPosition.js +27 -0
  102. package/esm/LineChart/useLineChartProps.js +4 -2
  103. package/esm/PieChart/seriesConfig/getSeriesWithDefaultValues.js +5 -6
  104. package/esm/PieChart/seriesConfig/index.js +2 -0
  105. package/esm/PieChart/seriesConfig/seriesProcessor.js +2 -1
  106. package/esm/PieChart/seriesConfig/tooltipPosition.d.ts +3 -0
  107. package/esm/PieChart/seriesConfig/tooltipPosition.js +69 -0
  108. package/esm/RadarChart/RadarChart.plugins.d.ts +2 -2
  109. package/esm/RadarChart/RadarChart.plugins.js +1 -1
  110. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +1 -1
  111. package/esm/RadarChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  112. package/esm/ScatterChart/ScatterChart.js +8 -0
  113. package/esm/ScatterChart/ScatterChart.plugins.d.ts +2 -1
  114. package/esm/ScatterChart/ScatterChart.plugins.js +2 -1
  115. package/esm/ScatterChart/seriesConfig/getSeriesWithDefaultValues.js +3 -3
  116. package/esm/ScatterChart/seriesConfig/index.js +2 -0
  117. package/esm/ScatterChart/seriesConfig/tooltipPosition.d.ts +3 -0
  118. package/esm/ScatterChart/seriesConfig/tooltipPosition.js +27 -0
  119. package/esm/ScatterChart/useScatterChartProps.js +5 -3
  120. package/esm/SparkLineChart/SparkLineChart.js +8 -0
  121. package/esm/context/ChartProvider/ChartProvider.js +1 -1
  122. package/esm/hooks/index.d.ts +2 -1
  123. package/esm/hooks/index.js +2 -1
  124. package/esm/hooks/useBrush.d.ts +18 -0
  125. package/esm/hooks/useBrush.js +16 -0
  126. package/esm/hooks/useFocusedItem.d.ts +1 -1
  127. package/esm/hooks/useInteractionItemProps.js +6 -2
  128. package/esm/index.d.ts +2 -1
  129. package/esm/index.js +2 -1
  130. package/esm/internals/configInit.d.ts +1 -1
  131. package/esm/internals/domUtils.d.ts +9 -4
  132. package/esm/internals/domUtils.js +115 -52
  133. package/esm/internals/getScale.js +1 -1
  134. package/esm/internals/index.d.ts +3 -1
  135. package/esm/internals/index.js +3 -1
  136. package/esm/internals/isCartesian.d.ts +3 -2
  137. package/esm/internals/isCartesian.js +3 -0
  138. package/esm/internals/plugins/allPlugins.d.ts +4 -3
  139. package/esm/internals/plugins/allPlugins.js +2 -1
  140. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +19 -10
  141. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +6 -4
  142. package/esm/internals/plugins/featurePlugins/useChartBrush/index.d.ts +3 -0
  143. package/esm/internals/plugins/featurePlugins/useChartBrush/index.js +3 -0
  144. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.d.ts +3 -0
  145. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +126 -0
  146. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +82 -0
  147. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +75 -0
  148. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.types.d.ts +81 -0
  149. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
  150. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
  151. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +2 -1
  152. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +8 -3
  153. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +1 -1
  154. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +3 -1
  155. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +4 -4
  156. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +13 -6
  157. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +2 -0
  158. package/esm/internals/plugins/featurePlugins/useChartInteraction/index.d.ts +1 -0
  159. package/esm/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -1
  160. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +2 -1
  161. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +1 -1
  162. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +5 -1
  163. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +14 -0
  164. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +40 -0
  165. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +3 -0
  166. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +4 -0
  167. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +5 -4
  168. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +8 -4
  169. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +21 -3
  170. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +13 -6
  171. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +4 -3
  172. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +1 -1
  173. package/esm/internals/plugins/models/seriesConfig/index.d.ts +1 -0
  174. package/esm/internals/plugins/models/seriesConfig/index.js +1 -0
  175. package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
  176. package/esm/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +24 -0
  177. package/esm/internals/plugins/utils/selectors.d.ts +1 -1
  178. package/esm/internals/scales/index.d.ts +3 -0
  179. package/esm/internals/scales/index.js +3 -0
  180. package/esm/internals/scales/scaleBand.d.ts +25 -0
  181. package/esm/internals/scales/scaleBand.js +159 -0
  182. package/esm/internals/scales/scalePoint.d.ts +25 -0
  183. package/esm/internals/scales/scalePoint.js +41 -0
  184. package/esm/internals/scales/scaleSymlog.d.ts +38 -0
  185. package/esm/internals/{symlogScale.js → scales/scaleSymlog.js} +40 -2
  186. package/esm/locales/elGR.js +97 -99
  187. package/esm/models/seriesType/common.d.ts +3 -2
  188. package/esm/tests/constants.js +1 -0
  189. package/hooks/index.d.ts +2 -1
  190. package/hooks/index.js +12 -0
  191. package/hooks/useBrush.d.ts +18 -0
  192. package/hooks/useBrush.js +21 -0
  193. package/hooks/useFocusedItem.d.ts +1 -1
  194. package/hooks/useInteractionItemProps.js +6 -2
  195. package/index.d.ts +2 -1
  196. package/index.js +13 -1
  197. package/internals/configInit.d.ts +1 -1
  198. package/internals/domUtils.d.ts +9 -4
  199. package/internals/domUtils.js +119 -54
  200. package/internals/getScale.js +2 -2
  201. package/internals/index.d.ts +3 -1
  202. package/internals/index.js +24 -0
  203. package/internals/isCartesian.d.ts +3 -2
  204. package/internals/isCartesian.js +4 -0
  205. package/internals/plugins/allPlugins.d.ts +4 -3
  206. package/internals/plugins/allPlugins.js +2 -1
  207. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +19 -10
  208. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +6 -4
  209. package/internals/plugins/featurePlugins/useChartBrush/index.d.ts +3 -0
  210. package/internals/plugins/featurePlugins/useChartBrush/index.js +38 -0
  211. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.d.ts +3 -0
  212. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +134 -0
  213. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +82 -0
  214. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +82 -0
  215. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.types.d.ts +81 -0
  216. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.types.js +5 -0
  217. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
  218. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
  219. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +2 -1
  220. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +8 -3
  221. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +3 -3
  222. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +3 -1
  223. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +4 -4
  224. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +13 -6
  225. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +2 -0
  226. package/internals/plugins/featurePlugins/useChartInteraction/index.d.ts +1 -0
  227. package/internals/plugins/featurePlugins/useChartInteraction/index.js +12 -0
  228. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +2 -1
  229. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +1 -1
  230. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +5 -1
  231. package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +14 -0
  232. package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +46 -0
  233. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +3 -0
  234. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +10 -0
  235. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +5 -4
  236. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +7 -4
  237. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +21 -3
  238. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +14 -7
  239. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +4 -3
  240. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +3 -3
  241. package/internals/plugins/models/seriesConfig/index.d.ts +1 -0
  242. package/internals/plugins/models/seriesConfig/index.js +11 -0
  243. package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
  244. package/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +24 -0
  245. package/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.js +5 -0
  246. package/internals/plugins/utils/selectors.d.ts +1 -1
  247. package/internals/scales/index.d.ts +3 -0
  248. package/internals/scales/index.js +38 -0
  249. package/internals/scales/scaleBand.d.ts +25 -0
  250. package/internals/scales/scaleBand.js +167 -0
  251. package/internals/scales/scalePoint.d.ts +25 -0
  252. package/internals/scales/scalePoint.js +46 -0
  253. package/internals/scales/scaleSymlog.d.ts +38 -0
  254. package/internals/{symlogScale.js → scales/scaleSymlog.js} +39 -2
  255. package/locales/elGR.js +97 -99
  256. package/models/seriesType/common.d.ts +3 -2
  257. package/package.json +4 -4
  258. package/tests/constants.js +7 -0
  259. package/esm/internals/Flatbush.bench.js +0 -42
  260. package/esm/internals/symlogScale.d.ts +0 -2
  261. package/internals/Flatbush.bench.js +0 -44
  262. package/internals/symlogScale.d.ts +0 -2
  263. /package/esm/internals/{Flatbush.bench.d.ts → plugins/featurePlugins/useChartBrush/useChartBrush.types.js} +0 -0
  264. /package/{internals/Flatbush.bench.d.ts → esm/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.js} +0 -0
@@ -1,11 +1,14 @@
1
+ import { isFocusableSeriesType } from "./isFocusableSeriesType.js";
2
+
1
3
  /**
2
4
  * Returns the next series type and id that contains some data.
3
5
  * Returns `null` if no other series have data.
4
6
  */
5
7
  export function getNextSeriesWithData(series, type, seriesId) {
6
- const startingTypeIndex = type !== undefined && series[type] ? Object.keys(series).indexOf(type) : 0;
8
+ const seriesType = Object.keys(series);
9
+ const startingTypeIndex = type !== undefined && series[type] ? seriesType.indexOf(type) : 0;
7
10
  const currentSeriesIndex = type !== undefined && seriesId !== undefined && series[type] && series[type].series[seriesId] ? series[type].seriesOrder.indexOf(seriesId) : -1;
8
- const typesAvailable = Object.keys(series).filter(t => t !== 'sankey');
11
+ const typesAvailable = seriesType.filter(isFocusableSeriesType);
9
12
 
10
13
  // Loop over all series types starting with the current seriesType
11
14
  for (let typeGap = 0; typeGap < typesAvailable.length; typeGap += 1) {
@@ -44,9 +47,10 @@ export function getNextSeriesWithData(series, type, seriesId) {
44
47
  * Returns `null` if no other series have data.
45
48
  */
46
49
  export function getPreviousSeriesWithData(series, type, seriesId) {
47
- const startingTypeIndex = type !== undefined && series[type] ? Object.keys(series).indexOf(type) : 0;
50
+ const seriesType = Object.keys(series);
51
+ const startingTypeIndex = type !== undefined && series[type] ? seriesType.indexOf(type) : 0;
48
52
  const startingSeriesIndex = type !== undefined && seriesId !== undefined && series[type] && series[type].series[seriesId] ? series[type].seriesOrder.indexOf(seriesId) : 1;
49
- const typesAvailable = Object.keys(series).filter(t => t !== 'sankey');
53
+ const typesAvailable = seriesType.filter(isFocusableSeriesType);
50
54
 
51
55
  // Loop over all series types starting with the current seriesType
52
56
  for (let typeGap = 0; typeGap < typesAvailable.length; typeGap += 1) {
@@ -9,7 +9,7 @@ export declare const selectorChartsFocusedSeriesType: import("reselect").Selecto
9
9
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
10
10
  } & {
11
11
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
12
- }, keyof import("../../../index.js").ChartsSeriesConfig | undefined, any[]>;
12
+ }, "line" | "bar" | "scatter" | "pie" | undefined, any[]>;
13
13
  export declare const selectorChartsFocusedSeriesId: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState> & {
14
14
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
15
15
  } & {
@@ -40,6 +40,24 @@ export declare const selectorChartsKeyboardItem: import("reselect").Selector<imp
40
40
  } & {
41
41
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
42
42
  }, {
43
+ type: "line";
43
44
  seriesId: SeriesId;
44
- dataIndex: number | undefined;
45
- } | null, any[]>;
45
+ dataIndex: number;
46
+ } | {
47
+ type: "bar";
48
+ seriesId: SeriesId;
49
+ dataIndex: number;
50
+ } | {
51
+ type: "scatter";
52
+ seriesId: SeriesId;
53
+ dataIndex: number;
54
+ } | {
55
+ type: "pie";
56
+ seriesId: SeriesId;
57
+ dataIndex: number;
58
+ } | null, any[]>;
59
+ export declare const selectorChartsKeyboardItemIsDefined: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState> & {
60
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
61
+ } & {
62
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
63
+ }, boolean, any[]>;
@@ -31,12 +31,19 @@ const createSelectAxisHighlight = direction => (type, seriesId, dataIndex, axis,
31
31
  };
32
32
  export const selectorChartsKeyboardXAxisIndex = createSelector([selectorChartsFocusedSeriesType, selectorChartsFocusedSeriesId, selectorChartsFocusedDataIndex, selectorChartXAxis, selectorChartSeriesProcessed], createSelectAxisHighlight('x'));
33
33
  export const selectorChartsKeyboardYAxisIndex = createSelector([selectorChartsFocusedSeriesType, selectorChartsFocusedSeriesId, selectorChartsFocusedDataIndex, selectorChartYAxis, selectorChartSeriesProcessed], createSelectAxisHighlight('y'));
34
- export const selectorChartsKeyboardItem = createSelector([selectorChartsFocusedSeriesType, selectorChartsFocusedSeriesId, selectorChartsFocusedDataIndex], function selectorChartsKeyboardItem(seriesType, seriesId, dataIndex) {
35
- if (seriesId === undefined) {
34
+ export const selectorChartsKeyboardItem = createSelector([selectKeyboardNavigation], function selectorChartsKeyboardItem(keyboardState) {
35
+ if (keyboardState?.item == null) {
36
36
  return null;
37
37
  }
38
- return {
39
- seriesId,
40
- dataIndex: seriesType === 'line' ? undefined : dataIndex
41
- };
38
+ const {
39
+ type,
40
+ seriesId
41
+ } = keyboardState.item;
42
+ if (type === undefined || seriesId === undefined) {
43
+ return null;
44
+ }
45
+ return keyboardState.item;
46
+ });
47
+ export const selectorChartsKeyboardItemIsDefined = createSelector([selectorChartsFocusedSeriesType, selectorChartsFocusedSeriesId, selectorChartsFocusedDataIndex], function selectorChartsKeyboardItemIsDefined(seriesType, seriesId, dataIndex) {
48
+ return seriesId !== undefined && dataIndex !== undefined;
42
49
  });
@@ -4,11 +4,11 @@ import { SeriesId } from "../../../../models/seriesType/common.js";
4
4
  import { UseChartInteractionSignature } from "../useChartInteraction/index.js";
5
5
  import { UseChartHighlightSignature } from "../useChartHighlight/index.js";
6
6
  export interface UseChartKeyboardNavigationInstance {}
7
- type SeriesItemIdentifier = {
7
+ type SeriesItemIdentifier<SeriesType extends ChartSeriesType = FocusableSeriesTypes> = SeriesType extends FocusableSeriesTypes ? {
8
8
  /**
9
9
  * The type of the series
10
10
  */
11
- type: ChartSeriesType;
11
+ type: SeriesType;
12
12
  /**
13
13
  * The id of the series with focus.
14
14
  */
@@ -17,7 +17,8 @@ type SeriesItemIdentifier = {
17
17
  * The index of the data point with focus.
18
18
  */
19
19
  dataIndex: number;
20
- };
20
+ } : never;
21
+ export type FocusableSeriesTypes = 'bar' | 'line' | 'scatter' | 'pie';
21
22
  export interface UseChartKeyboardNavigationState {
22
23
  keyboardNavigation: {
23
24
  item: null | SeriesItemIdentifier;
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { scaleBand, scalePoint } from '@mui/x-charts-vendor/d3-scale';
3
2
  import { isBandScaleConfig, isPointScaleConfig, isContinuousScaleConfig } from "../../../../models/axis.js";
4
3
  import { getColorScale, getOrdinalColorScale } from "../../../colorScale.js";
5
4
  import { getDefaultTickNumber, getTickNumber, scaleTickNumberByRange } from "../../../ticks.js";
@@ -8,6 +7,7 @@ import { isDateData, createDateFormatter } from "../../../dateHelpers.js";
8
7
  import { getAxisExtremum } from "./getAxisExtremum.js";
9
8
  import { deg2rad } from "../../../angleConversion.js";
10
9
  import { getAxisTriggerTooltip } from "./getAxisTriggerTooltip.js";
10
+ import { scaleBand, scalePoint } from "../../../scales/index.js";
11
11
  function getRange(drawingArea, axisDirection, axis) {
12
12
  if (axisDirection === 'rotation') {
13
13
  if (axis.scaleType === 'point') {
@@ -4,5 +4,6 @@ export * from "./polarExtremumGetter.types.js";
4
4
  export * from "./seriesConfig.types.js";
5
5
  export * from "./seriesProcessor.types.js";
6
6
  export * from "./tooltipGetter.types.js";
7
+ export * from "./tooltipItemPositionGetter.types.js";
7
8
  export * from "./legendGetter.types.js";
8
9
  export * from "./getSeriesWithDefaultValues.types.js";
@@ -4,5 +4,6 @@ export * from "./polarExtremumGetter.types.js";
4
4
  export * from "./seriesConfig.types.js";
5
5
  export * from "./seriesProcessor.types.js";
6
6
  export * from "./tooltipGetter.types.js";
7
+ export * from "./tooltipItemPositionGetter.types.js";
7
8
  export * from "./legendGetter.types.js";
8
9
  export * from "./getSeriesWithDefaultValues.types.js";
@@ -6,11 +6,13 @@ import type { LegendGetter } from "./legendGetter.types.js";
6
6
  import type { AxisTooltipGetter, TooltipGetter } from "./tooltipGetter.types.js";
7
7
  import { PolarExtremumGetter } from "./polarExtremumGetter.types.js";
8
8
  import { GetSeriesWithDefaultValues } from "./getSeriesWithDefaultValues.types.js";
9
+ import { TooltipItemPositionGetter } from "./tooltipItemPositionGetter.types.js";
9
10
  export type ChartSeriesTypeConfig<TSeriesType extends ChartSeriesType> = {
10
11
  seriesProcessor: SeriesProcessor<TSeriesType>;
11
12
  colorProcessor: ColorProcessor<TSeriesType>;
12
13
  legendGetter: LegendGetter<TSeriesType>;
13
14
  tooltipGetter: TooltipGetter<TSeriesType>;
15
+ tooltipItemPositionGetter?: TooltipItemPositionGetter<TSeriesType>;
14
16
  getSeriesWithDefaultValues: GetSeriesWithDefaultValues<TSeriesType>;
15
17
  } & (TSeriesType extends CartesianChartSeriesType ? {
16
18
  xExtremumGetter: CartesianExtremumGetter<TSeriesType>;
@@ -0,0 +1,24 @@
1
+ import type { ChartItemIdentifierWithData, ChartSeriesType } from "../../../../models/seriesType/config.js";
2
+ import { ChartsRotationAxisProps, ChartsRadiusAxisProps, PolarAxisDefaultized, ComputedXAxis, ComputedYAxis } from "../../../../models/axis.js";
3
+ import { ChartDrawingArea } from "../../../../hooks/useDrawingArea.js";
4
+ import { ProcessedSeries } from "../../corePlugins/useChartSeries/index.js";
5
+ export interface TooltipPositionGetterAxesConfig {
6
+ x?: ComputedXAxis;
7
+ y?: ComputedYAxis;
8
+ rotation?: PolarAxisDefaultized<any, any, ChartsRotationAxisProps>;
9
+ radius?: PolarAxisDefaultized<any, any, ChartsRadiusAxisProps>;
10
+ }
11
+ export type TooltipItemPositionGetter<TSeriesType extends ChartSeriesType> = (params: {
12
+ series: ProcessedSeries<TSeriesType>;
13
+ axesConfig: TooltipPositionGetterAxesConfig;
14
+ drawingArea: ChartDrawingArea;
15
+ identifier: ChartItemIdentifierWithData<TSeriesType> | null;
16
+ /**
17
+ * The preferred placement of the tooltip related to the element.
18
+ * @default 'top'
19
+ */
20
+ placement: 'top' | 'bottom' | 'left' | 'right';
21
+ }) => {
22
+ x: number;
23
+ y: number;
24
+ } | null;
@@ -1,6 +1,6 @@
1
1
  import { SelectorArray, Combiner, Selector, GetStateFromSelectors, GetParamsFromSelectors, CreateSelectorOptions } from 'reselect';
2
2
  import { ChartAnyPluginSignature, ChartState, ChartStateCacheKey } from "../models/index.js";
3
- export type ChartRootSelector<TSignature extends ChartAnyPluginSignature> = Selector<ChartState<[TSignature]>, TSignature['state'][keyof TSignature['state']]>;
3
+ export type ChartRootSelector<TSignature extends ChartAnyPluginSignature, T extends keyof TSignature['state'] = keyof TSignature['state']> = Selector<ChartState<[TSignature]>, TSignature['state'][T]>;
4
4
  export type ChartOptionalRootSelector<TSignature extends ChartAnyPluginSignature> = Selector<ChartState<[], [TSignature]>, TSignature['state'][keyof TSignature['state']] | undefined>;
5
5
  export type ChartsSelector<Signatures extends readonly ChartAnyPluginSignature[] = [], OptionalSignatures extends readonly ChartAnyPluginSignature[] = [], Result = unknown, Args extends readonly any[] = []> = Selector<ChartState<Signatures, OptionalSignatures>, Result, Args>;
6
6
  type InterruptRecursion = NonNullable<unknown>;
@@ -0,0 +1,3 @@
1
+ export * from "./scaleBand.js";
2
+ export * from "./scalePoint.js";
3
+ export * from "./scaleSymlog.js";
@@ -0,0 +1,3 @@
1
+ export * from "./scaleBand.js";
2
+ export * from "./scalePoint.js";
3
+ export * from "./scaleSymlog.js";
@@ -0,0 +1,25 @@
1
+ import type { NumberValue, ScaleBand } from '@mui/x-charts-vendor/d3-scale';
2
+ export declare function keyof(value: any): string | number;
3
+ /**
4
+ * Constructs a new band scale with the specified range, no padding, no rounding and center alignment.
5
+ * The domain defaults to the empty domain.
6
+ * If range is not specified, it defaults to the unit range [0, 1].
7
+ *
8
+ * The generic corresponds to the data type of domain elements.
9
+ *
10
+ * @param range A two-element array of numeric values.
11
+ */
12
+ export declare function scaleBand<Domain extends {
13
+ toString(): string;
14
+ } = string>(range?: Iterable<NumberValue>): ScaleBand<Domain>;
15
+ /**
16
+ * Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment.
17
+ *
18
+ * The generic corresponds to the data type of domain elements.
19
+ *
20
+ * @param domain Array of domain values.
21
+ * @param range A two-element array of numeric values.
22
+ */
23
+ export declare function scaleBand<Domain extends {
24
+ toString(): string;
25
+ }>(domain: Iterable<Domain>, range: Iterable<NumberValue>): ScaleBand<Domain>;
@@ -0,0 +1,159 @@
1
+ /* eslint-disable func-names */
2
+ // Adapted from d3-scale v4.0.2
3
+ // https://github.com/d3/d3-scale/blob/d6904a4bde09e16005e0ad8ca3e25b10ce54fa0d/src/band.js
4
+ import { InternMap, range as sequence } from '@mui/x-charts-vendor/d3-array';
5
+ export function keyof(value) {
6
+ if (Array.isArray(value)) {
7
+ return JSON.stringify(value);
8
+ }
9
+ if (typeof value === 'object' && value !== null) {
10
+ return value.valueOf();
11
+ }
12
+ return value;
13
+ }
14
+
15
+ /**
16
+ * Constructs a new band scale with the specified range, no padding, no rounding and center alignment.
17
+ * The domain defaults to the empty domain.
18
+ * If range is not specified, it defaults to the unit range [0, 1].
19
+ *
20
+ * The generic corresponds to the data type of domain elements.
21
+ *
22
+ * @param range A two-element array of numeric values.
23
+ */
24
+
25
+ /**
26
+ * Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment.
27
+ *
28
+ * The generic corresponds to the data type of domain elements.
29
+ *
30
+ * @param domain Array of domain values.
31
+ * @param range A two-element array of numeric values.
32
+ */
33
+
34
+ export function scaleBand(...args) {
35
+ // @ts-expect-error, InternMap accepts two arguments, but its types are set as Map, which doesn't.
36
+ let index = new InternMap(undefined, keyof);
37
+ let domain = [];
38
+ let ordinalRange = [];
39
+ let r0 = 0;
40
+ let r1 = 1;
41
+ let step;
42
+ let bandwidth;
43
+ let isRound = false;
44
+ let paddingInner = 0;
45
+ let paddingOuter = 0;
46
+ let align = 0.5;
47
+ const scale = d => {
48
+ const i = index.get(d);
49
+ if (i === undefined) {
50
+ return undefined;
51
+ }
52
+ return ordinalRange[i % ordinalRange.length];
53
+ };
54
+ const rescale = () => {
55
+ const n = domain.length;
56
+ const reverse = r1 < r0;
57
+ const start = reverse ? r1 : r0;
58
+ const stop = reverse ? r0 : r1;
59
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
60
+ if (isRound) {
61
+ step = Math.floor(step);
62
+ }
63
+ const adjustedStart = start + (stop - start - step * (n - paddingInner)) * align;
64
+ bandwidth = step * (1 - paddingInner);
65
+ const finalStart = isRound ? Math.round(adjustedStart) : adjustedStart;
66
+ const finalBandwidth = isRound ? Math.round(bandwidth) : bandwidth;
67
+ bandwidth = finalBandwidth;
68
+ const values = sequence(n).map(i => finalStart + step * i);
69
+ ordinalRange = reverse ? values.reverse() : values;
70
+ return scale;
71
+ };
72
+ scale.domain = function (_) {
73
+ if (!arguments.length) {
74
+ return domain.slice();
75
+ }
76
+ domain = [];
77
+ // @ts-expect-error, InternMap accepts two arguments.
78
+ index = new InternMap(undefined, keyof);
79
+ for (const value of _) {
80
+ if (index.has(value)) {
81
+ continue;
82
+ }
83
+ index.set(value, domain.push(value) - 1);
84
+ }
85
+ return rescale();
86
+ };
87
+ scale.range = function (_) {
88
+ if (!arguments.length) {
89
+ return [r0, r1];
90
+ }
91
+ const [v0, v1] = _;
92
+ r0 = +v0;
93
+ r1 = +v1;
94
+ return rescale();
95
+ };
96
+ scale.rangeRound = function (_) {
97
+ const [v0, v1] = _;
98
+ r0 = +v0;
99
+ r1 = +v1;
100
+ isRound = true;
101
+ return rescale();
102
+ };
103
+ scale.bandwidth = function () {
104
+ return bandwidth;
105
+ };
106
+ scale.step = function () {
107
+ return step;
108
+ };
109
+ scale.round = function (_) {
110
+ if (!arguments.length) {
111
+ return isRound;
112
+ }
113
+ isRound = !!_;
114
+ return rescale();
115
+ };
116
+ scale.padding = function (_) {
117
+ if (!arguments.length) {
118
+ return paddingInner;
119
+ }
120
+ paddingInner = Math.min(1, paddingOuter = +_);
121
+ return rescale();
122
+ };
123
+ scale.paddingInner = function (_) {
124
+ if (!arguments.length) {
125
+ return paddingInner;
126
+ }
127
+ paddingInner = Math.min(1, _);
128
+ return rescale();
129
+ };
130
+ scale.paddingOuter = function (_) {
131
+ if (!arguments.length) {
132
+ return paddingOuter;
133
+ }
134
+ paddingOuter = +_;
135
+ return rescale();
136
+ };
137
+ scale.align = function (_) {
138
+ if (!arguments.length) {
139
+ return align;
140
+ }
141
+ align = Math.max(0, Math.min(1, _));
142
+ return rescale();
143
+ };
144
+ scale.copy = () => {
145
+ return scaleBand(domain, [r0, r1]).round(isRound).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
146
+ };
147
+
148
+ // Initialize from arguments
149
+ const [arg0, arg1] = args;
150
+ if (args.length > 1) {
151
+ scale.domain(arg0);
152
+ scale.range(arg1);
153
+ } else if (arg0) {
154
+ scale.range(arg0);
155
+ } else {
156
+ rescale();
157
+ }
158
+ return scale;
159
+ }
@@ -0,0 +1,25 @@
1
+ import type { NumberValue, ScalePoint } from '@mui/x-charts-vendor/d3-scale';
2
+ /**
3
+ * Constructs a new point scale with the specified range, no padding, no rounding and center alignment.
4
+ * The domain defaults to the empty domain.
5
+ * If range is not specified, it defaults to the unit range [0, 1].
6
+ *
7
+ * The generic corresponds to the data type of domain elements.
8
+ *
9
+ * @param range A two-element array of numeric values.
10
+ */
11
+ export declare function scalePoint<Domain extends {
12
+ toString(): string;
13
+ } = string>(range?: Iterable<NumberValue>): ScalePoint<Domain>;
14
+ /**
15
+ * Constructs a new point scale with the specified domain and range, no padding, no rounding and center alignment.
16
+ * The domain defaults to the empty domain.
17
+ *
18
+ * The generic corresponds to the data type of domain elements.
19
+ *
20
+ * @param domain Array of domain values.
21
+ * @param range A two-element array of numeric values.
22
+ */
23
+ export declare function scalePoint<Domain extends {
24
+ toString(): string;
25
+ }>(domain: Iterable<Domain>, range: Iterable<NumberValue>): ScalePoint<Domain>;
@@ -0,0 +1,41 @@
1
+ import { scaleBand } from "./scaleBand.js";
2
+
3
+ /**
4
+ * Constructs a new point scale with the specified range, no padding, no rounding and center alignment.
5
+ * The domain defaults to the empty domain.
6
+ * If range is not specified, it defaults to the unit range [0, 1].
7
+ *
8
+ * The generic corresponds to the data type of domain elements.
9
+ *
10
+ * @param range A two-element array of numeric values.
11
+ */
12
+
13
+ /**
14
+ * Constructs a new point scale with the specified domain and range, no padding, no rounding and center alignment.
15
+ * The domain defaults to the empty domain.
16
+ *
17
+ * The generic corresponds to the data type of domain elements.
18
+ *
19
+ * @param domain Array of domain values.
20
+ * @param range A two-element array of numeric values.
21
+ */
22
+
23
+ export function scalePoint(...args) {
24
+ // ScalePoint is essentially ScaleBand with paddingInner(1)
25
+ const scale = scaleBand(...args).paddingInner(1);
26
+
27
+ // Remove paddingInner method and make padding alias to paddingOuter
28
+ const originalCopy = scale.copy;
29
+ scale.padding = scale.paddingOuter;
30
+ delete scale.paddingInner;
31
+ delete scale.paddingOuter;
32
+ scale.copy = () => {
33
+ const copied = originalCopy();
34
+ copied.padding = copied.paddingOuter;
35
+ delete copied.paddingInner;
36
+ delete copied.paddingOuter;
37
+ copied.copy = scale.copy;
38
+ return copied;
39
+ };
40
+ return scale;
41
+ }
@@ -0,0 +1,38 @@
1
+ import { NumberValue, ScaleSymLog } from '@mui/x-charts-vendor/d3-scale';
2
+ /**
3
+ * Constructs a new continuous scale with the specified range, the constant 1, the default interpolator and clamping disabled.
4
+ * The domain defaults to [0, 1].
5
+ * If range is not specified, it defaults to [0, 1].
6
+ *
7
+ * The first generic corresponds to the data type of the range elements.
8
+ * The second generic corresponds to the data type of the output elements generated by the scale.
9
+ * The third generic corresponds to the data type of the unknown value.
10
+ *
11
+ * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and
12
+ * convert the interpolated range element to a corresponding output element.
13
+ *
14
+ * The range must be set in accordance with the range element type.
15
+ *
16
+ * The interpolator factory may be set using the interpolate(...) method of the scale.
17
+ *
18
+ * @param range Array of range values.
19
+ */
20
+ export declare function scaleSymlog<Range = number, Output = Range, Unknown = never>(range?: Iterable<Range>): ScaleSymLog<Range, Output, Unknown>;
21
+ /**
22
+ * Constructs a new continuous scale with the specified domain and range, the constant 1, the default interpolator and clamping disabled.
23
+ *
24
+ * The first generic corresponds to the data type of the range elements.
25
+ * The second generic corresponds to the data type of the output elements generated by the scale.
26
+ * The third generic corresponds to the data type of the unknown value.
27
+ *
28
+ * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and
29
+ * convert the interpolated range element to a corresponding output element.
30
+ *
31
+ * The range must be set in accordance with the range element type.
32
+ *
33
+ * The interpolator factory may be set using the interpolate(...) method of the scale.
34
+ *
35
+ * @param domain Array of numeric domain values.
36
+ * @param range Array of range values.
37
+ */
38
+ export declare function scaleSymlog<Range, Output = Range, Unknown = never>(domain: Iterable<NumberValue>, range: Iterable<Range>): ScaleSymLog<Range, Output, Unknown>;
@@ -1,6 +1,44 @@
1
1
  import { scaleSymlog as originalScaleSymlog, scaleLog, scaleLinear } from '@mui/x-charts-vendor/d3-scale';
2
- export function scaleSymlog(_domain, _range) {
3
- const scale = originalScaleSymlog(_domain, _range);
2
+
3
+ /**
4
+ * Constructs a new continuous scale with the specified range, the constant 1, the default interpolator and clamping disabled.
5
+ * The domain defaults to [0, 1].
6
+ * If range is not specified, it defaults to [0, 1].
7
+ *
8
+ * The first generic corresponds to the data type of the range elements.
9
+ * The second generic corresponds to the data type of the output elements generated by the scale.
10
+ * The third generic corresponds to the data type of the unknown value.
11
+ *
12
+ * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and
13
+ * convert the interpolated range element to a corresponding output element.
14
+ *
15
+ * The range must be set in accordance with the range element type.
16
+ *
17
+ * The interpolator factory may be set using the interpolate(...) method of the scale.
18
+ *
19
+ * @param range Array of range values.
20
+ */
21
+
22
+ /**
23
+ * Constructs a new continuous scale with the specified domain and range, the constant 1, the default interpolator and clamping disabled.
24
+ *
25
+ * The first generic corresponds to the data type of the range elements.
26
+ * The second generic corresponds to the data type of the output elements generated by the scale.
27
+ * The third generic corresponds to the data type of the unknown value.
28
+ *
29
+ * If range element and output element type differ, the interpolator factory used with the scale must match this behavior and
30
+ * convert the interpolated range element to a corresponding output element.
31
+ *
32
+ * The range must be set in accordance with the range element type.
33
+ *
34
+ * The interpolator factory may be set using the interpolate(...) method of the scale.
35
+ *
36
+ * @param domain Array of numeric domain values.
37
+ * @param range Array of range values.
38
+ */
39
+
40
+ export function scaleSymlog(...args) {
41
+ const scale = originalScaleSymlog(...args);
4
42
  const originalTicks = scale.ticks;
5
43
  const {
6
44
  negativeScale,