@fluentui/react-charts 0.0.0-nightly-20260112-0407.1 → 0.0.0-nightly-20260114-0406.1

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 (143) hide show
  1. package/CHANGELOG.md +13 -13
  2. package/dist/index.d.ts +360 -0
  3. package/lib/PolarChart.js +1 -0
  4. package/lib/PolarChart.js.map +1 -0
  5. package/lib/components/ChartTable/ChartTable.js +21 -7
  6. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  7. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  8. package/lib/components/ChartTable/useChartTableStyles.styles.js +24 -3
  9. package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  10. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +14 -2
  11. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  12. package/lib/components/CommonComponents/CartesianChart.js +5 -3
  13. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  14. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  15. package/lib/components/DeclarativeChart/DeclarativeChart.js +33 -29
  16. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  17. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +250 -153
  18. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  19. package/lib/components/DonutChart/DonutChart.js +14 -4
  20. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  21. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  22. package/lib/components/DonutChart/useDonutChartStyles.styles.js +25 -5
  23. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  24. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +16 -5
  25. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  26. package/lib/components/FunnelChart/FunnelChart.js +13 -4
  27. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  28. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  29. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +26 -4
  30. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  31. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +15 -3
  32. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  33. package/lib/components/GaugeChart/GaugeChart.js +6 -5
  34. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  35. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  36. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +31 -19
  37. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  38. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +23 -18
  39. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  40. package/lib/components/PolarChart/PolarChart.js +576 -0
  41. package/lib/components/PolarChart/PolarChart.js.map +1 -0
  42. package/lib/components/PolarChart/PolarChart.types.js +1 -0
  43. package/lib/components/PolarChart/PolarChart.types.js.map +1 -0
  44. package/lib/components/PolarChart/PolarChart.utils.js +174 -0
  45. package/lib/components/PolarChart/PolarChart.utils.js.map +1 -0
  46. package/lib/components/PolarChart/index.js +2 -0
  47. package/lib/components/PolarChart/index.js.map +1 -0
  48. package/lib/components/PolarChart/usePolarChartStyles.styles.js +72 -0
  49. package/lib/components/PolarChart/usePolarChartStyles.styles.js.map +1 -0
  50. package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js +61 -0
  51. package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -0
  52. package/lib/components/SankeyChart/SankeyChart.js +13 -3
  53. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  54. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  55. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +23 -6
  56. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  57. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +15 -5
  58. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  59. package/lib/index.js +1 -0
  60. package/lib/index.js.map +1 -1
  61. package/lib/types/DataPoint.js +1 -1
  62. package/lib/types/DataPoint.js.map +1 -1
  63. package/lib/utilities/ChartTitle.js +33 -0
  64. package/lib/utilities/ChartTitle.js.map +1 -0
  65. package/lib/utilities/Common.styles.js +73 -1
  66. package/lib/utilities/Common.styles.js.map +1 -1
  67. package/lib/utilities/Common.styles.raw.js +70 -0
  68. package/lib/utilities/Common.styles.raw.js.map +1 -1
  69. package/lib/utilities/index.js +1 -0
  70. package/lib/utilities/index.js.map +1 -1
  71. package/lib/utilities/utilities.js +2 -2
  72. package/lib/utilities/utilities.js.map +1 -1
  73. package/lib-commonjs/PolarChart.js +6 -0
  74. package/lib-commonjs/PolarChart.js.map +1 -0
  75. package/lib-commonjs/components/ChartTable/ChartTable.js +21 -7
  76. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  77. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  78. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +34 -3
  79. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  80. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +14 -2
  81. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  82. package/lib-commonjs/components/CommonComponents/CartesianChart.js +4 -2
  83. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  84. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  85. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +59 -56
  86. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  87. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +256 -156
  88. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  89. package/lib-commonjs/components/DonutChart/DonutChart.js +13 -3
  90. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  91. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  92. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +31 -4
  93. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  94. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +15 -4
  95. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  96. package/lib-commonjs/components/FunnelChart/FunnelChart.js +12 -3
  97. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  98. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  99. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +36 -4
  100. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  101. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +15 -3
  102. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  103. package/lib-commonjs/components/GaugeChart/GaugeChart.js +5 -4
  104. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  105. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  106. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +39 -18
  107. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  108. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +23 -18
  109. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  110. package/lib-commonjs/components/PolarChart/PolarChart.js +586 -0
  111. package/lib-commonjs/components/PolarChart/PolarChart.js.map +1 -0
  112. package/lib-commonjs/components/PolarChart/PolarChart.types.js +6 -0
  113. package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +1 -0
  114. package/lib-commonjs/components/PolarChart/PolarChart.utils.js +204 -0
  115. package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +1 -0
  116. package/lib-commonjs/components/PolarChart/index.js +7 -0
  117. package/lib-commonjs/components/PolarChart/index.js.map +1 -0
  118. package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js +107 -0
  119. package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js.map +1 -0
  120. package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js +75 -0
  121. package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -0
  122. package/lib-commonjs/components/SankeyChart/SankeyChart.js +13 -3
  123. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  124. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  125. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +28 -4
  126. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  127. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +14 -3
  128. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  129. package/lib-commonjs/index.js +1 -0
  130. package/lib-commonjs/index.js.map +1 -1
  131. package/lib-commonjs/types/DataPoint.js +1 -1
  132. package/lib-commonjs/types/DataPoint.js.map +1 -1
  133. package/lib-commonjs/utilities/ChartTitle.js +41 -0
  134. package/lib-commonjs/utilities/ChartTitle.js.map +1 -0
  135. package/lib-commonjs/utilities/Common.styles.js +69 -0
  136. package/lib-commonjs/utilities/Common.styles.js.map +1 -1
  137. package/lib-commonjs/utilities/Common.styles.raw.js +69 -0
  138. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
  139. package/lib-commonjs/utilities/index.js +1 -0
  140. package/lib-commonjs/utilities/index.js.map +1 -1
  141. package/lib-commonjs/utilities/utilities.js +6 -0
  142. package/lib-commonjs/utilities/utilities.js.map +1 -1
  143. package/package.json +10 -10
@@ -10,6 +10,9 @@ function _export(target, all) {
10
10
  });
11
11
  }
12
12
  _export(exports, {
13
+ DEFAULT_POLAR_SUBPLOT: function() {
14
+ return DEFAULT_POLAR_SUBPLOT;
15
+ },
13
16
  NON_PLOT_KEY_PREFIX: function() {
14
17
  return NON_PLOT_KEY_PREFIX;
15
18
  },
@@ -43,9 +46,6 @@ _export(exports, {
43
46
  normalizeObjectArrayForGVBC: function() {
44
47
  return normalizeObjectArrayForGVBC;
45
48
  },
46
- projectPolarToCartesian: function() {
47
- return projectPolarToCartesian;
48
- },
49
49
  resolveXAxisPoint: function() {
50
50
  return resolveXAxisPoint;
51
51
  },
@@ -82,6 +82,9 @@ _export(exports, {
82
82
  transformPlotlyJsonToLineChartProps: function() {
83
83
  return transformPlotlyJsonToLineChartProps;
84
84
  },
85
+ transformPlotlyJsonToPolarChartProps: function() {
86
+ return transformPlotlyJsonToPolarChartProps;
87
+ },
85
88
  transformPlotlyJsonToSankeyProps: function() {
86
89
  return transformPlotlyJsonToSankeyProps;
87
90
  },
@@ -147,12 +150,37 @@ const dashOptions = {
147
150
  }
148
151
  };
149
152
  function getTitles(layout) {
150
- var _layout_title, _layout_xaxis, _layout_xaxis1, _layout_xaxis_title, _layout_xaxis2, _layout_yaxis, _layout_yaxis1, _layout_yaxis_title, _layout_yaxis2;
151
- var _layout_title_text, _layout_xaxis_title_text, _layout_yaxis_title_text;
153
+ var _layout_xaxis, _layout_xaxis1, _layout_xaxis_title, _layout_xaxis2, _layout_yaxis, _layout_yaxis1, _layout_yaxis_title, _layout_yaxis2;
154
+ const titleObj = layout === null || layout === void 0 ? void 0 : layout.title;
155
+ var _titleObj_text;
156
+ const chartTitle = typeof titleObj === 'string' ? titleObj : (_titleObj_text = titleObj === null || titleObj === void 0 ? void 0 : titleObj.text) !== null && _titleObj_text !== void 0 ? _titleObj_text : '';
157
+ const titleFont = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.font : undefined;
158
+ const titleXAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.xanchor : undefined;
159
+ const titleYAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.yanchor : undefined;
160
+ const titlePad = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.pad : undefined;
161
+ const titleStyles = {
162
+ ...titleFont ? {
163
+ titleFont
164
+ } : {},
165
+ ...titleXAnchor ? {
166
+ titleXAnchor
167
+ } : {},
168
+ ...titleYAnchor ? {
169
+ titleYAnchor
170
+ } : {},
171
+ ...titlePad ? {
172
+ titlePad
173
+ } : {}
174
+ };
175
+ var _layout_xaxis_title_text, _layout_yaxis_title_text;
152
176
  const titles = {
153
- chartTitle: typeof (layout === null || layout === void 0 ? void 0 : layout.title) === 'string' ? layout.title : (_layout_title_text = layout === null || layout === void 0 ? void 0 : (_layout_title = layout.title) === null || _layout_title === void 0 ? void 0 : _layout_title.text) !== null && _layout_title_text !== void 0 ? _layout_title_text : '',
177
+ chartTitle,
178
+ ...Object.keys(titleStyles).length > 0 ? {
179
+ titleStyles
180
+ } : {},
154
181
  xAxisTitle: typeof (layout === null || layout === void 0 ? void 0 : (_layout_xaxis = layout.xaxis) === null || _layout_xaxis === void 0 ? void 0 : _layout_xaxis.title) === 'string' ? layout === null || layout === void 0 ? void 0 : (_layout_xaxis1 = layout.xaxis) === null || _layout_xaxis1 === void 0 ? void 0 : _layout_xaxis1.title : (_layout_xaxis_title_text = layout === null || layout === void 0 ? void 0 : (_layout_xaxis2 = layout.xaxis) === null || _layout_xaxis2 === void 0 ? void 0 : (_layout_xaxis_title = _layout_xaxis2.title) === null || _layout_xaxis_title === void 0 ? void 0 : _layout_xaxis_title.text) !== null && _layout_xaxis_title_text !== void 0 ? _layout_xaxis_title_text : '',
155
- yAxisTitle: typeof (layout === null || layout === void 0 ? void 0 : (_layout_yaxis = layout.yaxis) === null || _layout_yaxis === void 0 ? void 0 : _layout_yaxis.title) === 'string' ? layout === null || layout === void 0 ? void 0 : (_layout_yaxis1 = layout.yaxis) === null || _layout_yaxis1 === void 0 ? void 0 : _layout_yaxis1.title : (_layout_yaxis_title_text = layout === null || layout === void 0 ? void 0 : (_layout_yaxis2 = layout.yaxis) === null || _layout_yaxis2 === void 0 ? void 0 : (_layout_yaxis_title = _layout_yaxis2.title) === null || _layout_yaxis_title === void 0 ? void 0 : _layout_yaxis_title.text) !== null && _layout_yaxis_title_text !== void 0 ? _layout_yaxis_title_text : ''
182
+ yAxisTitle: typeof (layout === null || layout === void 0 ? void 0 : (_layout_yaxis = layout.yaxis) === null || _layout_yaxis === void 0 ? void 0 : _layout_yaxis.title) === 'string' ? layout === null || layout === void 0 ? void 0 : (_layout_yaxis1 = layout.yaxis) === null || _layout_yaxis1 === void 0 ? void 0 : _layout_yaxis1.title : (_layout_yaxis_title_text = layout === null || layout === void 0 ? void 0 : (_layout_yaxis2 = layout.yaxis) === null || _layout_yaxis2 === void 0 ? void 0 : (_layout_yaxis_title = _layout_yaxis2.title) === null || _layout_yaxis_title === void 0 ? void 0 : _layout_yaxis_title.text) !== null && _layout_yaxis_title_text !== void 0 ? _layout_yaxis_title_text : '',
183
+ xAxisAnnotation: chartTitle
156
184
  };
157
185
  return titles;
158
186
  }
@@ -1119,7 +1147,7 @@ const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayT
1119
1147
  const donutMarginHorizontal = hideLabels ? 0 : 80;
1120
1148
  const donutMarginVertical = 40 + (hideLabels ? 0 : 40);
1121
1149
  const innerRadius = firstData.hole ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2) : _utilities.MIN_DONUT_RADIUS;
1122
- const { chartTitle } = getTitles(input.layout);
1150
+ const { chartTitle, titleStyles } = getTitles(input.layout);
1123
1151
  // Build anticlockwise order by keeping the first item, reversing the rest
1124
1152
  const legends = Object.keys(mapLegendToDataPoint);
1125
1153
  const reorderedEntries = legends.length > 1 ? [
@@ -1151,7 +1179,8 @@ const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayT
1151
1179
  'percent+label'
1152
1180
  ].includes(firstData.textinfo) : true,
1153
1181
  roundCorners: true,
1154
- order: 'sorted'
1182
+ order: 'sorted',
1183
+ ...titleStyles
1155
1184
  };
1156
1185
  };
1157
1186
  const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
@@ -2152,7 +2181,7 @@ const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap, colorwa
2152
2181
  };
2153
2182
  };
2154
2183
  const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
2155
- var _input_layout_template_layout, _input_layout_template, _input_layout, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _node_label, _input_layout2, _input_layout3;
2184
+ var _input_layout_template_layout, _input_layout_template, _input_layout, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _node_label, _input_layout2, _input_layout3, _input_layout4;
2156
2185
  const { link, node } = input.data[0];
2157
2186
  var _link_value;
2158
2187
  const validLinks = ((_link_value = link === null || link === void 0 ? void 0 : link.value) !== null && _link_value !== void 0 ? _link_value : []).map((val, index)=>{
@@ -2194,7 +2223,7 @@ const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorway
2194
2223
  // ...(input.layout?.font?.size ? { fontSize: input.layout.font?.size } : {}),
2195
2224
  // },
2196
2225
  // };
2197
- const { chartTitle } = getTitles(input.layout);
2226
+ const { chartTitle, titleStyles } = getTitles(input.layout);
2198
2227
  var _input_layout_height;
2199
2228
  return {
2200
2229
  data: {
@@ -2202,7 +2231,11 @@ const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorway
2202
2231
  SankeyChartData: sankeyChartData
2203
2232
  },
2204
2233
  width: (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.width,
2205
- height: (_input_layout_height = (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 468
2234
+ height: (_input_layout_height = (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 468,
2235
+ // TODO
2236
+ // styles,
2237
+ hideLegend: isMultiPlot || ((_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : _input_layout4.showlegend) === false,
2238
+ ...titleStyles
2206
2239
  };
2207
2240
  };
2208
2241
  const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
@@ -2253,7 +2286,7 @@ const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayT
2253
2286
  const styles = {
2254
2287
  sublabel: sublabelColor
2255
2288
  };
2256
- const { chartTitle } = getTitles(input.layout);
2289
+ const { chartTitle, titleStyles } = getTitles(input.layout);
2257
2290
  var _firstData_value2, _input_layout_height;
2258
2291
  return {
2259
2292
  segments,
@@ -2274,7 +2307,8 @@ const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayT
2274
2307
  // styles,
2275
2308
  variant: ((_firstData_gauge9 = firstData.gauge) === null || _firstData_gauge9 === void 0 ? void 0 : (_firstData_gauge_steps1 = _firstData_gauge9.steps) === null || _firstData_gauge_steps1 === void 0 ? void 0 : _firstData_gauge_steps1.length) ? 'multiple-segments' : 'single-segment',
2276
2309
  styles,
2277
- roundCorners: true
2310
+ roundCorners: true,
2311
+ ...titleStyles
2278
2312
  };
2279
2313
  };
2280
2314
  const cleanText = (text)=>{
@@ -2417,13 +2451,16 @@ const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMap, colo
2417
2451
  },
2418
2452
  values: (_ref = (_tableHeader_values = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.values) !== null && _tableHeader_values !== void 0 ? _tableHeader_values : templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.values) !== null && _ref !== void 0 ? _ref : []
2419
2453
  };
2454
+ const { chartTitle, titleStyles } = getTitles(input.layout);
2420
2455
  var _tableData_header_values;
2421
2456
  return {
2422
2457
  headers: normalizeHeaders((_tableData_header_values = (_tableData_header = tableData.header) === null || _tableData_header === void 0 ? void 0 : _tableData_header.values) !== null && _tableData_header_values !== void 0 ? _tableData_header_values : [], header),
2423
2458
  rows,
2424
2459
  width: (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.width,
2425
2460
  height: (_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : _input_layout4.height,
2426
- styles
2461
+ styles,
2462
+ chartTitle,
2463
+ ...titleStyles
2427
2464
  };
2428
2465
  };
2429
2466
  function getCategoriesAndValues(series) {
@@ -2567,151 +2604,88 @@ const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, colorMap, col
2567
2604
  });
2568
2605
  });
2569
2606
  }
2607
+ const { chartTitle, titleStyles } = getTitles(input.layout);
2570
2608
  return {
2571
2609
  data: funnelData,
2610
+ chartTitle,
2572
2611
  width: (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width,
2573
2612
  height: (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height,
2574
2613
  orientation: ((_input_data_ = input.data[0]) === null || _input_data_ === void 0 ? void 0 : _input_data_.orientation) === 'v' ? 'horizontal' : 'vertical',
2575
- hideLegend: isMultiPlot || ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.showlegend) === false
2614
+ hideLegend: isMultiPlot || ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.showlegend) === false,
2615
+ ...titleStyles
2576
2616
  };
2577
2617
  };
2578
- const projectPolarToCartesian = (input)=>{
2618
+ const transformPlotlyJsonToPolarChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
2579
2619
  var _input_layout, _input_layout1;
2580
- const projection = {
2581
- ...input
2582
- };
2583
- // Find the global min and max radius across all series
2584
- let minRadius = 0;
2585
- let maxRadius = 0;
2586
- for(let sindex = 0; sindex < input.data.length; sindex++){
2587
- const rVals = input.data[sindex].r;
2588
- if (rVals && (0, _chartutilities.isArrayOrTypedArray)(rVals)) {
2589
- for(let ptindex = 0; ptindex < rVals.length; ptindex++){
2590
- if (!(0, _chartutilities.isInvalidValue)(rVals[ptindex])) {
2591
- minRadius = Math.min(minRadius, rVals[ptindex]);
2592
- maxRadius = Math.max(maxRadius, rVals[ptindex]);
2593
- }
2594
- }
2595
- }
2596
- }
2597
- // If there are negative radii, compute the shift
2598
- const radiusShift = minRadius < 0 ? -minRadius : 0;
2599
- // Collect all unique theta values from all scatterpolar series for equal spacing
2600
- const allThetaValues = new Set();
2601
- for(let sindex = 0; sindex < input.data.length; sindex++){
2602
- const series = input.data[sindex];
2603
- if (series.theta && (0, _chartutilities.isArrayOrTypedArray)(series.theta)) {
2604
- series.theta.forEach((theta)=>allThetaValues.add(String(theta)));
2605
- }
2606
- }
2607
- // Project all points and create a perfect square domain
2608
- const allX = [];
2609
- const allY = [];
2610
- let originX = null;
2611
- for(let sindex = 0; sindex < input.data.length; sindex++){
2612
- var _input_layout_polar_angularaxis, _input_layout_polar, _input_layout2, _input_layout_polar_angularaxis1, _input_layout_polar1, _input_layout3;
2613
- const series = input.data[sindex];
2614
- // If scatterpolar, set __axisLabel to all unique theta values for equal spacing
2615
- if ((0, _chartutilities.isArrayOrTypedArray)(series.theta)) {
2616
- series.__axisLabel = Array.from(allThetaValues);
2617
- }
2618
- series.x = [];
2619
- series.y = [];
2620
- const thetas = series.theta;
2621
- const rVals = series.r;
2622
- // Skip if rVals or thetas are not arrays
2623
- if (!(0, _chartutilities.isArrayOrTypedArray)(rVals) || !(0, _chartutilities.isArrayOrTypedArray)(thetas)) {
2624
- projection.data[sindex] = series;
2625
- continue;
2626
- }
2627
- // retrieve polar axis settings
2628
- const dirMultiplier = ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : (_input_layout_polar = _input_layout2.polar) === null || _input_layout_polar === void 0 ? void 0 : (_input_layout_polar_angularaxis = _input_layout_polar.angularaxis) === null || _input_layout_polar_angularaxis === void 0 ? void 0 : _input_layout_polar_angularaxis.direction) === 'clockwise' ? -1 : 1;
2629
- var _input_layout_polar_angularaxis_rotation;
2630
- const startAngleInRad = ((_input_layout_polar_angularaxis_rotation = (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : (_input_layout_polar1 = _input_layout3.polar) === null || _input_layout_polar1 === void 0 ? void 0 : (_input_layout_polar_angularaxis1 = _input_layout_polar1.angularaxis) === null || _input_layout_polar_angularaxis1 === void 0 ? void 0 : _input_layout_polar_angularaxis1.rotation) !== null && _input_layout_polar_angularaxis_rotation !== void 0 ? _input_layout_polar_angularaxis_rotation : 0) * Math.PI / 180;
2631
- // Compute tick positions if categorical
2632
- let uniqueTheta = [];
2633
- let categorical = false;
2634
- if (!(0, _chartutilities.isNumberArray)(thetas)) {
2635
- uniqueTheta = Array.from(new Set(thetas));
2636
- categorical = true;
2637
- }
2638
- for(let ptindex = 0; ptindex < rVals.length; ptindex++){
2639
- if ((0, _chartutilities.isInvalidValue)(thetas === null || thetas === void 0 ? void 0 : thetas[ptindex]) || (0, _chartutilities.isInvalidValue)(rVals === null || rVals === void 0 ? void 0 : rVals[ptindex])) {
2640
- continue;
2641
- }
2642
- // Map theta to angle in radians
2643
- let thetaRad;
2644
- if (categorical) {
2645
- const idx = uniqueTheta.indexOf(thetas[ptindex]);
2646
- const step = 2 * Math.PI / uniqueTheta.length;
2647
- thetaRad = startAngleInRad + dirMultiplier * idx * step;
2620
+ const polarData = [];
2621
+ const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
2622
+ const resolveRValue = getAxisValueResolver(getPolarAxis(input.data, 'r', input.layout)._type);
2623
+ input.data.forEach((series, index)=>{
2624
+ const legend = legends[index];
2625
+ if (series.type === 'scatterpolar') {
2626
+ var _series_line, _series_marker, _input_layout_template_layout, _input_layout_template, _input_layout, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _series_r;
2627
+ const isAreaTrace = series.fill === 'toself' || series.fill === 'tonext';
2628
+ const isLineTrace = typeof series.mode === 'undefined' ? true : series.mode.includes('lines');
2629
+ const colors = isAreaTrace ? series.fillcolor : isLineTrace ? (_series_line = series.line) === null || _series_line === void 0 ? void 0 : _series_line.color : (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color;
2630
+ const extractedColors = (0, _PlotlyColorAdapter.extractColor)((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, colorwayType, colors, colorMap, isDarkTheme);
2631
+ const seriesColor = (0, _PlotlyColorAdapter.resolveColor)(extractedColors, index, legend, colorMap, (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template1 = _input_layout1.template) === null || _input_layout_template1 === void 0 ? void 0 : (_input_layout_template_layout1 = _input_layout_template1.layout) === null || _input_layout_template_layout1 === void 0 ? void 0 : _input_layout_template_layout1.colorway, isDarkTheme);
2632
+ const seriesOpacity = (0, _PlotlyColorAdapter.getOpacity)(series, index);
2633
+ const finalSeriesColor = (0, _d3color.rgb)(seriesColor).copy({
2634
+ opacity: seriesOpacity
2635
+ }).formatHex8();
2636
+ const lineOptions = getLineOptions(series.line);
2637
+ const thetaUnit = series.thetaunit;
2638
+ const commonProps = {
2639
+ legend,
2640
+ legendShape: getLegendShape(series),
2641
+ color: finalSeriesColor,
2642
+ data: ((_series_r = series.r) === null || _series_r === void 0 ? void 0 : _series_r.map((r, rIndex)=>{
2643
+ var _series_theta, _series_marker, _series_marker1, _input_layout_template_layout, _input_layout_template, _input_layout;
2644
+ const theta = (_series_theta = series.theta) === null || _series_theta === void 0 ? void 0 : _series_theta[rIndex];
2645
+ const markerSize = Array.isArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.size) ? series.marker.size[rIndex] : (_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.size;
2646
+ const text = Array.isArray(series.text) ? series.text[rIndex] : series.text;
2647
+ const markerColor = (0, _PlotlyColorAdapter.resolveColor)(extractedColors, rIndex, legend, colorMap, (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, isDarkTheme);
2648
+ const markerOpacity = (0, _PlotlyColorAdapter.getOpacity)(series, rIndex);
2649
+ if ((0, _chartutilities.isInvalidValue)(resolveRValue(r)) || (0, _chartutilities.isInvalidValue)(theta)) {
2650
+ return;
2651
+ }
2652
+ return {
2653
+ r: resolveRValue(r),
2654
+ theta: typeof theta === 'number' ? thetaUnit === 'radians' ? theta * 180 / Math.PI : thetaUnit === 'gradians' ? theta * 0.9 : theta : theta,
2655
+ color: markerColor ? (0, _d3color.rgb)(markerColor).copy({
2656
+ opacity: markerOpacity
2657
+ }).formatHex8() : finalSeriesColor,
2658
+ ...typeof markerSize !== 'undefined' ? {
2659
+ markerSize
2660
+ } : {},
2661
+ ...typeof text !== 'undefined' ? {
2662
+ text
2663
+ } : {}
2664
+ };
2665
+ }).filter((item)=>typeof item !== 'undefined')) || []
2666
+ };
2667
+ if (isAreaTrace || isLineTrace) {
2668
+ polarData.push({
2669
+ type: isAreaTrace ? 'areapolar' : 'linepolar',
2670
+ ...commonProps,
2671
+ lineOptions
2672
+ });
2648
2673
  } else {
2649
- thetaRad = startAngleInRad + dirMultiplier * (thetas[ptindex] * Math.PI / 180);
2650
- }
2651
- // Shift only the polar origin (not the cartesian)
2652
- const rawRadius = rVals[ptindex];
2653
- const polarRadius = rawRadius + radiusShift; // Only for projection
2654
- // Calculate cartesian coordinates (with shifted polar origin)
2655
- const x = polarRadius * Math.cos(thetaRad);
2656
- const y = polarRadius * Math.sin(thetaRad);
2657
- // Calculate the cartesian coordinates of the original polar origin (0,0)
2658
- // This is the point that should be mapped to (0,0) in cartesian coordinates
2659
- if (sindex === 0 && ptindex === 0) {
2660
- // For polar origin (r=0, θ=0), cartesian coordinates are (0,0)
2661
- // But since we shifted the radius by radiusShift, the cartesian origin is at (radiusShift, 0)
2662
- originX = radiusShift;
2663
- }
2664
- series.x.push(x);
2665
- series.y.push(y);
2666
- allX.push(x);
2667
- allY.push(y);
2668
- }
2669
- // Map text to each data point for downstream chart rendering
2670
- if (series.x && series.y) {
2671
- series.data = series.x.map((xVal, idx)=>({
2672
- x: xVal,
2673
- y: series.y[idx],
2674
- ...series.text ? {
2675
- text: series.text[idx]
2676
- } : {}
2677
- }));
2678
- }
2679
- projection.data[sindex] = series;
2680
- }
2681
- // 7. Recenter all cartesian coordinates
2682
- if (originX !== null) {
2683
- for(let sindex = 0; sindex < projection.data.length; sindex++){
2684
- const series = projection.data[sindex];
2685
- if (series.x && series.y) {
2686
- series.x = series.x.map((v)=>v - originX);
2674
+ polarData.push({
2675
+ type: 'scatterpolar',
2676
+ ...commonProps
2677
+ });
2687
2678
  }
2688
2679
  }
2689
- // Also recenter allX for normalization
2690
- for(let i = 0; i < allX.length; i++){
2691
- allX[i] = allX[i] - originX;
2692
- }
2693
- }
2694
- // 8. Find the maximum absolute value among all x and y
2695
- let maxAbs = Math.max(...allX.map(Math.abs), ...allY.map(Math.abs));
2696
- maxAbs = maxAbs === 0 ? 1 : maxAbs;
2697
- // 9. Rescale all points so that the largest |x| or |y| is 0.5
2698
- for(let sindex = 0; sindex < projection.data.length; sindex++){
2699
- const series = projection.data[sindex];
2700
- if (series.x && series.y) {
2701
- series.x = series.x.map((v)=>v / (2 * maxAbs));
2702
- series.y = series.y.map((v)=>v / (2 * maxAbs));
2703
- }
2704
- }
2705
- // 10. Customize layout for perfect square with absolute positioning
2706
- const size = ((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width) || ((_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) || 500;
2707
- projection.layout = {
2708
- ...projection.layout,
2709
- width: size,
2710
- height: size
2680
+ });
2681
+ var _input_layout_height;
2682
+ return {
2683
+ data: polarData,
2684
+ width: (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width,
2685
+ height: (_input_layout_height = (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 400,
2686
+ hideLegend,
2687
+ ...getPolarAxisProps(input.data, input.layout)
2711
2688
  };
2712
- // Attach originX as custom properties
2713
- projection.layout.__polarOriginX = originX !== null && originX !== void 0 ? originX : undefined;
2714
- return projection;
2715
2689
  };
2716
2690
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2717
2691
  function isPlainObject(obj) {
@@ -3024,7 +2998,8 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
3024
2998
  const xAxisLayout = layout[key];
3025
2999
  const domainXInfo = {
3026
3000
  start: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[0] : 0,
3027
- end: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[1] : 1
3001
+ end: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[1] : 1,
3002
+ cellName: `x${domainX.length === 0 ? '' : domainX.length + 1}`
3028
3003
  };
3029
3004
  domainX.push(domainXInfo);
3030
3005
  } else if (key.startsWith('yaxis')) {
@@ -3047,7 +3022,8 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
3047
3022
  const yAxisLayout = layout[key];
3048
3023
  const domainYInfo = {
3049
3024
  start: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[0] : 0,
3050
- end: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[1] : 1
3025
+ end: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[1] : 1,
3026
+ cellName: `x${domainY.length === 0 ? '' : domainY.length + 1}`
3051
3027
  };
3052
3028
  domainY.push(domainYInfo);
3053
3029
  }
@@ -3060,11 +3036,13 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
3060
3036
  const series = schema === null || schema === void 0 ? void 0 : (_schema_data = schema.data) === null || _schema_data === void 0 ? void 0 : _schema_data[index];
3061
3037
  const domainXInfo = {
3062
3038
  start: ((_series_domain = series.domain) === null || _series_domain === void 0 ? void 0 : _series_domain.x) ? series.domain.x[0] : 0,
3063
- end: ((_series_domain1 = series.domain) === null || _series_domain1 === void 0 ? void 0 : _series_domain1.x) ? series.domain.x[1] : 1
3039
+ end: ((_series_domain1 = series.domain) === null || _series_domain1 === void 0 ? void 0 : _series_domain1.x) ? series.domain.x[1] : 1,
3040
+ cellName: `${NON_PLOT_KEY_PREFIX}${domainX.length - cartesianDomains + 1}`
3064
3041
  };
3065
3042
  const domainYInfo = {
3066
3043
  start: ((_series_domain2 = series.domain) === null || _series_domain2 === void 0 ? void 0 : _series_domain2.y) ? series.domain.y[0] : 0,
3067
- end: ((_series_domain3 = series.domain) === null || _series_domain3 === void 0 ? void 0 : _series_domain3.y) ? series.domain.y[1] : 1
3044
+ end: ((_series_domain3 = series.domain) === null || _series_domain3 === void 0 ? void 0 : _series_domain3.y) ? series.domain.y[1] : 1,
3045
+ cellName: `${NON_PLOT_KEY_PREFIX}${domainY.length - cartesianDomains + 1}`
3068
3046
  };
3069
3047
  domainX.push(domainXInfo);
3070
3048
  domainY.push(domainYInfo);
@@ -3072,6 +3050,24 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
3072
3050
  });
3073
3051
  if (layout !== undefined && layout !== null && Object.keys(layout).length > 0) {
3074
3052
  var _layout_annotations;
3053
+ Object.keys(layout !== null && layout !== void 0 ? layout : {}).forEach((key)=>{
3054
+ if (key.startsWith('polar')) {
3055
+ var _polarLayout_domain, _polarLayout_domain1, _polarLayout_domain2, _polarLayout_domain3;
3056
+ const polarLayout = layout[key];
3057
+ const domainXInfo = {
3058
+ start: ((_polarLayout_domain = polarLayout.domain) === null || _polarLayout_domain === void 0 ? void 0 : _polarLayout_domain.x) ? polarLayout.domain.x[0] : 0,
3059
+ end: ((_polarLayout_domain1 = polarLayout.domain) === null || _polarLayout_domain1 === void 0 ? void 0 : _polarLayout_domain1.x) ? polarLayout.domain.x[1] : 1,
3060
+ cellName: key
3061
+ };
3062
+ const domainYInfo = {
3063
+ start: ((_polarLayout_domain2 = polarLayout.domain) === null || _polarLayout_domain2 === void 0 ? void 0 : _polarLayout_domain2.y) ? polarLayout.domain.y[0] : 0,
3064
+ end: ((_polarLayout_domain3 = polarLayout.domain) === null || _polarLayout_domain3 === void 0 ? void 0 : _polarLayout_domain3.y) ? polarLayout.domain.y[1] : 1,
3065
+ cellName: key
3066
+ };
3067
+ domainX.push(domainXInfo);
3068
+ domainY.push(domainYInfo);
3069
+ }
3070
+ });
3075
3071
  (_layout_annotations = layout.annotations) === null || _layout_annotations === void 0 ? void 0 : _layout_annotations.forEach((annotation)=>{
3076
3072
  const xMatches = domainX.flatMap((interval, idx)=>(annotation === null || annotation === void 0 ? void 0 : annotation.x) >= interval.start && (annotation === null || annotation === void 0 ? void 0 : annotation.x) <= interval.end ? [
3077
3073
  idx
@@ -3100,7 +3096,6 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
3100
3096
  const sortedXStart = Array.from(uniqueXIntervals.values()).map((interval)=>interval.start).sort();
3101
3097
  templateColumns = `repeat(${sortedXStart.length}, 1fr)`;
3102
3098
  domainX.forEach((interval, index)=>{
3103
- const cellName = index >= cartesianDomains ? `${NON_PLOT_KEY_PREFIX}${index - cartesianDomains + 1}` : `x${index === 0 ? '' : index + 1}`;
3104
3099
  const columnIndex = sortedXStart.findIndex((start)=>start === interval.start);
3105
3100
  const columnNumber = columnIndex + 1; // Column numbers are 1-based
3106
3101
  const annotationProps = annotations[index];
@@ -3115,7 +3110,7 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
3115
3110
  end: 1
3116
3111
  }
3117
3112
  };
3118
- gridLayout[cellName] = row;
3113
+ gridLayout[interval.cellName] = row;
3119
3114
  });
3120
3115
  }
3121
3116
  if (domainY.length > 0) {
@@ -3130,12 +3125,11 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
3130
3125
  const numberOfRows = sortedYStart.length;
3131
3126
  templateRows = `repeat(${numberOfRows}, 1fr)`;
3132
3127
  domainY.forEach((interval, index)=>{
3133
- const cellName = index >= cartesianDomains ? `${NON_PLOT_KEY_PREFIX}${index - cartesianDomains + 1}` : `x${index === 0 ? '' : index + 1}`;
3134
3128
  const rowIndex = sortedYStart.findIndex((start)=>start === interval.start);
3135
3129
  const rowNumber = numberOfRows - rowIndex; // Rows are 1-based and we need to reverse the order for CSS grid
3136
3130
  const annotationProps = annotations[index];
3137
3131
  const yAnnotation = annotationProps === null || annotationProps === void 0 ? void 0 : annotationProps.yAnnotation;
3138
- const cell = gridLayout[cellName];
3132
+ const cell = gridLayout[interval.cellName];
3139
3133
  if (cell !== undefined) {
3140
3134
  cell.row = rowNumber;
3141
3135
  cell.yAnnotation = yAnnotation;
@@ -3467,3 +3461,109 @@ const getAxisValueResolver = (axType, dateParser)=>{
3467
3461
  }
3468
3462
  return new Date(value);
3469
3463
  };
3464
+ const POLAR_AXIS_BY_DATA_KEY = {
3465
+ r: 'radialAxis',
3466
+ theta: 'angularAxis'
3467
+ };
3468
+ const DEFAULT_POLAR_SUBPLOT = 'polar';
3469
+ const getPolarLayout = (trace, layout)=>{
3470
+ const subplotId = (trace === null || trace === void 0 ? void 0 : trace.subplot) || DEFAULT_POLAR_SUBPLOT;
3471
+ return layout === null || layout === void 0 ? void 0 : layout[subplotId];
3472
+ };
3473
+ const getValidAxisValues = (data, dataKey)=>{
3474
+ const values = [];
3475
+ data.forEach((series)=>{
3476
+ if ((0, _chartutilities.isArrayOrTypedArray)(series[dataKey])) {
3477
+ series[dataKey].forEach((val)=>{
3478
+ if (!(0, _chartutilities.isInvalidValue)(val)) {
3479
+ values.push(val);
3480
+ }
3481
+ });
3482
+ }
3483
+ });
3484
+ return values;
3485
+ };
3486
+ const getPolarAxisType = (data, dataKey, declaredType)=>{
3487
+ if ([
3488
+ 'linear',
3489
+ 'log',
3490
+ 'date',
3491
+ 'category'
3492
+ ].includes(declaredType !== null && declaredType !== void 0 ? declaredType : '')) {
3493
+ return declaredType;
3494
+ }
3495
+ const values = getValidAxisValues(data, dataKey);
3496
+ if ((0, _chartutilities.isNumberArray)(values) && !(0, _chartutilities.isYearArray)(values)) {
3497
+ return 'linear';
3498
+ }
3499
+ if ((0, _chartutilities.isDateArray)(values)) {
3500
+ return 'date';
3501
+ }
3502
+ return 'category';
3503
+ };
3504
+ const getPolarAxis = (data, dataKey, layout)=>{
3505
+ const polarLayout = getPolarLayout(data[0], layout);
3506
+ const ax = polarLayout === null || polarLayout === void 0 ? void 0 : polarLayout[POLAR_AXIS_BY_DATA_KEY[dataKey].toLowerCase()];
3507
+ return {
3508
+ ...ax,
3509
+ _dataKey: dataKey,
3510
+ _type: getPolarAxisType(data, dataKey, ax === null || ax === void 0 ? void 0 : ax.type)
3511
+ };
3512
+ };
3513
+ const getPolarAxisTickProps = (data, ax)=>{
3514
+ const props = {};
3515
+ if ((!ax.tickmode || ax.tickmode === 'array') && (0, _chartutilities.isArrayOrTypedArray)(ax.tickvals)) {
3516
+ const tickValues = ax._type === 'date' ? ax.tickvals.map((v)=>new Date(v)) : ax.tickvals;
3517
+ props.tickValues = tickValues;
3518
+ props.tickText = ax.ticktext;
3519
+ return props;
3520
+ }
3521
+ if ((!ax.tickmode || ax.tickmode === 'linear') && ax.dtick) {
3522
+ const dtick = plotlyDtick(ax.dtick, ax._type);
3523
+ const tick0 = plotlyTick0(ax.tick0, ax._type, dtick);
3524
+ props.tickStep = dtick;
3525
+ props.tick0 = tick0;
3526
+ return props;
3527
+ }
3528
+ if ((!ax.tickmode || ax.tickmode === 'auto') && typeof ax.nticks === 'number' && ax.nticks >= 0) {
3529
+ props.tickCount = ax.nticks;
3530
+ }
3531
+ return props;
3532
+ };
3533
+ const getPolarAxisCategoryOrder = (data, ax)=>{
3534
+ if (ax._type !== 'category') {
3535
+ return 'data';
3536
+ }
3537
+ const isValidArray = (0, _chartutilities.isArrayOrTypedArray)(ax.categoryarray) && ax.categoryarray.length > 0;
3538
+ if (isValidArray && (!ax.categoryorder || ax.categoryorder === 'array')) {
3539
+ return ax.categoryarray;
3540
+ }
3541
+ if (!ax.categoryorder || ax.categoryorder === 'trace' || ax.categoryorder === 'array') {
3542
+ const values = getValidAxisValues(data, ax._dataKey);
3543
+ const categoriesInTraceOrder = Array.from(new Set(values));
3544
+ return ax.autorange === 'reversed' ? categoriesInTraceOrder.reverse() : categoriesInTraceOrder;
3545
+ }
3546
+ return ax.categoryorder;
3547
+ };
3548
+ const getPolarAxisProps = (data, layout)=>{
3549
+ const props = {};
3550
+ Object.keys(POLAR_AXIS_BY_DATA_KEY).forEach((dataKey)=>{
3551
+ const propName = POLAR_AXIS_BY_DATA_KEY[dataKey];
3552
+ const ax = getPolarAxis(data, dataKey, layout);
3553
+ props[propName] = {
3554
+ scaleType: ax._type === 'log' ? 'log' : 'default',
3555
+ categoryOrder: getPolarAxisCategoryOrder(data, ax),
3556
+ tickFormat: ax.tickformat,
3557
+ ...getPolarAxisTickProps(data, ax),
3558
+ ...(0, _chartutilities.isArrayOrTypedArray)(ax.range) ? {
3559
+ rangeStart: ax.range[0],
3560
+ rangeEnd: ax.range[1]
3561
+ } : {}
3562
+ };
3563
+ if (propName === 'angularAxis') {
3564
+ props[propName].unit = ax.thetaunit;
3565
+ props.direction = ax.direction;
3566
+ }
3567
+ });
3568
+ return props;
3569
+ };