@fluentui/react-charts 0.0.0-nightly-20251013-0407.1 → 0.0.0-nightly-20251015-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 (37) hide show
  1. package/CHANGELOG.md +15 -15
  2. package/dist/index.d.ts +7 -0
  3. package/lib/components/AreaChart/AreaChart.js +20 -24
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/DeclarativeChart/DeclarativeChart.js +15 -5
  6. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  7. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +63 -18
  8. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  9. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +80 -71
  10. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  11. package/lib/components/DonutChart/DonutChart.js +8 -4
  12. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  13. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  14. package/lib/components/LineChart/LineChart.js +70 -59
  15. package/lib/components/LineChart/LineChart.js.map +1 -1
  16. package/lib/components/ScatterChart/ScatterChart.js +7 -11
  17. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  18. package/lib/utilities/utilities.js +14 -8
  19. package/lib/utilities/utilities.js.map +1 -1
  20. package/lib-commonjs/components/AreaChart/AreaChart.js +19 -23
  21. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  22. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +15 -5
  23. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  24. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +65 -18
  25. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  26. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +80 -71
  27. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  28. package/lib-commonjs/components/DonutChart/DonutChart.js +8 -4
  29. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  30. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  31. package/lib-commonjs/components/LineChart/LineChart.js +69 -58
  32. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  33. package/lib-commonjs/components/ScatterChart/ScatterChart.js +6 -10
  34. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  35. package/lib-commonjs/utilities/utilities.js +17 -8
  36. package/lib-commonjs/utilities/utilities.js.map +1 -1
  37. package/package.json +12 -12
@@ -178,7 +178,7 @@ const getSecondaryYAxisValues = (data, layout, maxAllowedMinY, minAllowedMaxY)=>
178
178
  };
179
179
  export const _getGaugeAxisColor = (colorway, colorwayType, color, colorMap, isDarkTheme)=>{
180
180
  const extractedColors = extractColor(colorway, colorwayType, color, colorMap, isDarkTheme);
181
- return resolveColor(extractedColors, 0, '', colorMap, isDarkTheme);
181
+ return resolveColor(extractedColors, 0, '', colorMap, colorway, isDarkTheme);
182
182
  };
183
183
  export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNumber)=>{
184
184
  if (x === null || x === undefined) {
@@ -320,54 +320,41 @@ export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, co
320
320
  // extract colors for each series only once
321
321
  // use piecolorway if available
322
322
  // otherwise, default to colorway from template
323
- const colors = extractColor((_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.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, (_input_layout_piecolorway1 = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.piecolorway) !== null && _input_layout_piecolorway1 !== void 0 ? _input_layout_piecolorway1 : firstData === null || firstData === void 0 ? void 0 : (_firstData_marker = firstData.marker) === null || _firstData_marker === void 0 ? void 0 : _firstData_marker.colors, colorMap, isDarkTheme);
323
+ const colors = extractColor((_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.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, (_input_layout_piecolorway1 = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.piecolorway) !== null && _input_layout_piecolorway1 !== void 0 ? _input_layout_piecolorway1 : firstData === null || firstData === void 0 ? void 0 : (_firstData_marker = firstData.marker) === null || _firstData_marker === void 0 ? void 0 : _firstData_marker.colors, colorMap, isDarkTheme, true);
324
324
  const mapLegendToDataPoint = {};
325
- if (colors) {
326
- var _firstData_labels;
327
- (_firstData_labels = firstData.labels) === null || _firstData_labels === void 0 ? void 0 : _firstData_labels.forEach((label, index)=>{
328
- const value = getNumberAtIndexOrDefault(firstData.values, index);
329
- if (isInvalidValue(value) || value < 0) {
330
- return;
331
- }
332
- const legend = `${label}`;
333
- // resolve color for each legend from the extracted colors
334
- const color = resolveColor(colors, index, legend, colorMap, isDarkTheme);
325
+ // clear colorMap for donut chart to reassign colors as the colorMap initially gets assigned by
326
+ // getAllupLegendsProps function without sorting labels by value
327
+ colorMap.current.clear();
328
+ // Sort labels by value descending before mapping
329
+ if (firstData.labels && firstData.values) {
330
+ var _firstData_marker1;
331
+ const markerColors = ((_firstData_marker1 = firstData.marker) === null || _firstData_marker1 === void 0 ? void 0 : _firstData_marker1.colors) || undefined;
332
+ const hasMarkerColors = Array.isArray(markerColors) && markerColors.length >= firstData.labels.length;
333
+ const labelValuePairs = firstData.labels.map((label, index)=>({
334
+ label,
335
+ value: getNumberAtIndexOrDefault(firstData.values, index),
336
+ index,
337
+ color: hasMarkerColors ? markerColors[index] : undefined
338
+ }));
339
+ // Filter out invalid values
340
+ const validPairs = labelValuePairs.filter((pair)=>!isInvalidValue(pair.value));
341
+ // Sort descending by value; when marker colors are present, keep color attached to the label
342
+ validPairs.sort((a, b)=>b.value - a.value);
343
+ validPairs.forEach((pair, sortedIdx)=>{
344
+ var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1;
345
+ const legend = `${pair.label}`;
346
+ var _input_layout_piecolorway, _pair_color;
347
+ const color = (_pair_color = pair.color) !== null && _pair_color !== void 0 ? _pair_color : resolveColor(colors, sortedIdx, legend, colorMap, (_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.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, true);
335
348
  if (!mapLegendToDataPoint[legend]) {
336
349
  mapLegendToDataPoint[legend] = {
337
350
  legend,
338
- data: value,
351
+ data: pair.value,
339
352
  color
340
353
  };
341
354
  } else {
342
- mapLegendToDataPoint[legend].data += value;
355
+ mapLegendToDataPoint[legend].data += pair.value;
343
356
  }
344
357
  });
345
- } else {
346
- // Sort labels by value descending before mapping
347
- if (firstData.labels && firstData.values) {
348
- const labelValuePairs = firstData.labels.map((label, index)=>({
349
- label,
350
- value: getNumberAtIndexOrDefault(firstData.values, index),
351
- index
352
- }));
353
- // Filter out invalid values
354
- const validPairs = labelValuePairs.filter((pair)=>!isInvalidValue(pair.value));
355
- // Sort descending by value
356
- validPairs.sort((a, b)=>b.value - a.value);
357
- validPairs.forEach((pair, sortedIdx)=>{
358
- const legend = `${pair.label}`;
359
- const color = resolveColor(colors, sortedIdx, legend, colorMap, isDarkTheme);
360
- if (!mapLegendToDataPoint[legend]) {
361
- mapLegendToDataPoint[legend] = {
362
- legend,
363
- data: pair.value,
364
- color
365
- };
366
- } else {
367
- mapLegendToDataPoint[legend].data += pair.value;
368
- }
369
- });
370
- }
371
358
  }
372
359
  var _input_layout_width;
373
360
  const width = (_input_layout_width = (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.width) !== null && _input_layout_width !== void 0 ? _input_layout_width : 440;
@@ -382,10 +369,25 @@ export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, co
382
369
  const donutMarginVertical = 40 + (hideLabels ? 0 : 40);
383
370
  const innerRadius = firstData.hole ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2) : MIN_DONUT_RADIUS;
384
371
  const { chartTitle } = getTitles(input.layout);
372
+ // Build anticlockwise order by keeping the first item, reversing the rest
373
+ const legends = Object.keys(mapLegendToDataPoint);
374
+ const reorderedEntries = legends.length > 1 ? [
375
+ [
376
+ legends[0],
377
+ mapLegendToDataPoint[legends[0]]
378
+ ],
379
+ ...legends.slice(1).reverse().map((key)=>[
380
+ key,
381
+ mapLegendToDataPoint[key]
382
+ ])
383
+ ] : legends.map((key)=>[
384
+ key,
385
+ mapLegendToDataPoint[key]
386
+ ]);
385
387
  return {
386
388
  data: {
387
389
  chartTitle,
388
- chartData: Object.values(mapLegendToDataPoint)
390
+ chartData: reorderedEntries.map(([, v])=>v)
389
391
  },
390
392
  hideLegend: isMultiPlot || ((_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : _input_layout5.showlegend) === false,
391
393
  width: (_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : _input_layout6.width,
@@ -396,7 +398,8 @@ export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, co
396
398
  'percent',
397
399
  'label+percent'
398
400
  ].includes(firstData.textinfo) : true,
399
- roundCorners: true
401
+ roundCorners: true,
402
+ order: 'sorted'
400
403
  };
401
404
  };
402
405
  export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
@@ -425,7 +428,7 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
425
428
  const rangeXValues = series.x.slice(rangeStart, rangeEnd);
426
429
  const rangeYValues = series.y.slice(rangeStart, rangeEnd);
427
430
  rangeXValues.forEach((x, index2)=>{
428
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2;
431
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout;
429
432
  if (!mapXToDataPoints[x]) {
430
433
  mapXToDataPoints[x] = {
431
434
  xAxisPoint: resolveXAxisPoint(x, isXYearCategory, isXString, isXDate, isXNumber),
@@ -435,7 +438,7 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
435
438
  }
436
439
  const legend = legends[index1];
437
440
  // resolve color for each legend's bars from the colorscale or extracted colors
438
- const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index2 % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedBarColors, index2, legend, colorMap, isDarkTheme);
441
+ const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index2 % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedBarColors, index2, 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);
439
442
  const opacity = getOpacity(series, index2);
440
443
  const yVal = rangeYValues[index2];
441
444
  const yAxisCalloutData = getFormattedCalloutYData(yVal, yAxisTickFormat);
@@ -453,8 +456,8 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
453
456
  yMaxValue = Math.max(yMaxValue, yVal);
454
457
  }
455
458
  } else if (series.type === 'scatter' || !!fallbackVSBC) {
456
- var _series_mode;
457
- const lineColor = resolveColor(extractedLineColors, index1, legend, colorMap, isDarkTheme);
459
+ var _input_layout_template_layout1, _input_layout_template1, _input_layout1, _series_mode;
460
+ const lineColor = resolveColor(extractedLineColors, index1, 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);
458
461
  const lineOptions = !((_series_mode = series.mode) === null || _series_mode === void 0 ? void 0 : _series_mode.includes('text')) ? getLineOptions(series.line) : undefined;
459
462
  const legendShape = getLegendShape(series);
460
463
  var _rgb_copy_formatHex81;
@@ -561,10 +564,10 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
561
564
  };
562
565
  }
563
566
  if (series.type === 'bar') {
564
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2;
567
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _processedInput_layout_template_layout, _processedInput_layout_template, _processedInput_layout;
565
568
  const legend = legends[index1];
566
569
  // resolve color for each legend's bars from the colorscale or extracted colors
567
- const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index2 % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, index2, legend, colorMap, isDarkTheme);
570
+ const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index2 % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, index2, legend, colorMap, (_processedInput_layout = processedInput.layout) === null || _processedInput_layout === void 0 ? void 0 : (_processedInput_layout_template = _processedInput_layout.template) === null || _processedInput_layout_template === void 0 ? void 0 : (_processedInput_layout_template_layout = _processedInput_layout_template.layout) === null || _processedInput_layout_template_layout === void 0 ? void 0 : _processedInput_layout_template_layout.colorway, isDarkTheme);
568
571
  const opacity = getOpacity(series, index2);
569
572
  const yVal = series.y[index2];
570
573
  var _rgb_copy_formatHex8;
@@ -645,10 +648,10 @@ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colo
645
648
  return yVal;
646
649
  });
647
650
  xBins.forEach((bin, index)=>{
648
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2;
651
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout;
649
652
  const legend = legends[seriesIdx];
650
653
  // resolve color for each legend's bars from the colorscale or extracted colors
651
- const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, index, legend, colorMap, isDarkTheme);
654
+ const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, index, 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);
652
655
  const opacity = getOpacity(series, index);
653
656
  const yVal = calculateHistNorm(series.histnorm, y[index], total, isXString ? bin.length : getBinSize(bin));
654
657
  var _rgb_copy_formatHex8;
@@ -710,7 +713,7 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
710
713
  const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
711
714
  var shouldWrapLabels = false;
712
715
  const chartData = input.data.map((series, index)=>{
713
- var _series_mode, _series_line, _series_marker, _series_line1, _input_layout_template_layout, _input_layout_template, _input_layout, _series_mode1;
716
+ var _series_mode, _series_line, _series_marker, _series_line1, _input_layout_template_layout, _input_layout_template, _input_layout, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _series_mode1;
714
717
  const colors = isScatterMarkers ? (series === null || series === void 0 ? void 0 : (_series_mode = series.mode) === null || _series_mode === void 0 ? void 0 : _series_mode.includes('line')) ? (_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 : (_series_line1 = series.line) === null || _series_line1 === void 0 ? void 0 : _series_line1.color;
715
718
  // extract colors for each series only once
716
719
  const extractedColors = 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);
@@ -722,7 +725,7 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
722
725
  shouldWrapLabels = shouldWrapLabels || isXString && !isXDate;
723
726
  const legend = legends[index];
724
727
  // resolve color for each legend's lines from the extracted colors
725
- const seriesColor = resolveColor(extractedColors, index, legend, colorMap, isDarkTheme);
728
+ const seriesColor = 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);
726
729
  const seriesOpacity = getOpacity(series, index);
727
730
  mode = series.fill === 'tozeroy' ? 'tozeroy' : 'tonexty';
728
731
  // if mode contains 'text', we prioritize showing the text over curving the line
@@ -771,7 +774,8 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
771
774
  originXOffset: (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.__polarOriginX,
772
775
  direction: (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_polar = _input_layout1.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,
773
776
  rotation: (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : (_input_layout_polar1 = _input_layout2.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,
774
- axisLabel: series.__axisLabel ? series.__axisLabel : {}
777
+ axisLabel: series.__axisLabel ? series.__axisLabel : {},
778
+ fill: series.fill
775
779
  } : {}
776
780
  },
777
781
  useSecondaryYScale: usesSecondaryYScale(series, input.layout)
@@ -838,12 +842,12 @@ export const transformPlotlyJsonToHorizontalBarWithAxisProps = (input, isMultiPl
838
842
  const extractedColors = 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, (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color, colorMap, isDarkTheme);
839
843
  const legend = legends[index];
840
844
  return series.y.map((yValue, i)=>{
841
- var _series_x, _series_marker, _series_marker1, _series_marker_color, _series_marker2;
845
+ var _series_x, _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout;
842
846
  if (isInvalidValue((_series_x = series.x) === null || _series_x === void 0 ? void 0 : _series_x[i]) || isInvalidValue(yValue)) {
843
847
  return null;
844
848
  }
845
849
  // resolve color for each legend's bars from the colorscale or extracted colors
846
- const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[i % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, i, legend, colorMap, isDarkTheme);
850
+ const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[i % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, i, 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);
847
851
  const opacity = getOpacity(series, i);
848
852
  var _rgb_copy_formatHex8;
849
853
  return {
@@ -901,12 +905,12 @@ export const transformPlotlyJsonToGanttChartProps = (input, isMultiPlot, colorMa
901
905
  return isInvalidValue(value) ? 0 : isXDate ? +parseLocalDate(value) : +value;
902
906
  };
903
907
  return series.y.map((yVal, i)=>{
904
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _series_base, _series_x;
908
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout, _series_base, _series_x;
905
909
  if (isInvalidValue(yVal)) {
906
910
  return null;
907
911
  }
908
912
  // resolve color for each legend's bars from the colorscale or extracted colors
909
- const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[i % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, i, legend, colorMap, isDarkTheme);
913
+ const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[i % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, i, 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);
910
914
  const opacity = getOpacity(series, i);
911
915
  const base = convertXValueToNumber((_series_base = series.base) === null || _series_base === void 0 ? void 0 : _series_base[i]);
912
916
  const xVal = convertXValueToNumber((_series_x = series.x) === null || _series_x === void 0 ? void 0 : _series_x[i]);
@@ -1095,7 +1099,8 @@ export const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, c
1095
1099
  const extractedNodeColors = 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, node === null || node === void 0 ? void 0 : node.color, colorMap, isDarkTheme);
1096
1100
  const sankeyChartData = {
1097
1101
  nodes: (_node_label = node.label) === null || _node_label === void 0 ? void 0 : _node_label.map((label, index)=>{
1098
- const color = resolveColor(extractedNodeColors, index, label, colorMap, isDarkTheme);
1102
+ var _input_layout_template_layout, _input_layout_template, _input_layout;
1103
+ const color = resolveColor(extractedNodeColors, index, label, 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);
1099
1104
  return {
1100
1105
  nodeId: index,
1101
1106
  name: label,
@@ -1132,9 +1137,9 @@ export const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, co
1132
1137
  const extractedColors = 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, stepsColors, colorMap, isDarkTheme);
1133
1138
  var _firstData_gauge_axis_range_, _firstData_value, _firstData_gauge_axis_range_1, _firstData_value1;
1134
1139
  const segments = ((_firstData_gauge1 = firstData.gauge) === null || _firstData_gauge1 === void 0 ? void 0 : (_firstData_gauge_steps = _firstData_gauge1.steps) === null || _firstData_gauge_steps === void 0 ? void 0 : _firstData_gauge_steps.length) ? firstData.gauge.steps.map((step, index)=>{
1135
- var _step_range, _step_range1;
1140
+ var _input_layout_template_layout, _input_layout_template, _input_layout, _step_range, _step_range1;
1136
1141
  const legend = step.name || `Segment ${index + 1}`;
1137
- const color = resolveColor(extractedColors, index, legend, colorMap, isDarkTheme);
1142
+ const color = resolveColor(extractedColors, index, 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);
1138
1143
  return {
1139
1144
  legend,
1140
1145
  size: ((_step_range = step.range) === null || _step_range === void 0 ? void 0 : _step_range[1]) - ((_step_range1 = step.range) === null || _step_range1 === void 0 ? void 0 : _step_range1[0]),
@@ -1157,16 +1162,16 @@ export const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, co
1157
1162
  if ((_firstData_delta = firstData.delta) === null || _firstData_delta === void 0 ? void 0 : _firstData_delta.reference) {
1158
1163
  const diff = firstData.value - firstData.delta.reference;
1159
1164
  if (diff >= 0) {
1160
- var _input_layout_template_layout2, _input_layout_template2, _input_layout4, _firstData_delta_increasing, _firstData_delta1;
1165
+ var _input_layout_template_layout2, _input_layout_template2, _input_layout4, _firstData_delta_increasing, _firstData_delta1, _input_layout_template_layout3, _input_layout_template3, _input_layout5;
1161
1166
  sublabel = `\u25B2 ${diff}`;
1162
1167
  const extractedIncreasingDeltaColors = extractColor((_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : (_input_layout_template2 = _input_layout4.template) === null || _input_layout_template2 === void 0 ? void 0 : (_input_layout_template_layout2 = _input_layout_template2.layout) === null || _input_layout_template_layout2 === void 0 ? void 0 : _input_layout_template_layout2.colorway, colorwayType, (_firstData_delta1 = firstData.delta) === null || _firstData_delta1 === void 0 ? void 0 : (_firstData_delta_increasing = _firstData_delta1.increasing) === null || _firstData_delta_increasing === void 0 ? void 0 : _firstData_delta_increasing.color, colorMap, isDarkTheme);
1163
- const color = resolveColor(extractedIncreasingDeltaColors, 0, '', colorMap, isDarkTheme);
1168
+ const color = resolveColor(extractedIncreasingDeltaColors, 0, '', colorMap, (_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : (_input_layout_template3 = _input_layout5.template) === null || _input_layout_template3 === void 0 ? void 0 : (_input_layout_template_layout3 = _input_layout_template3.layout) === null || _input_layout_template_layout3 === void 0 ? void 0 : _input_layout_template_layout3.colorway, isDarkTheme);
1164
1169
  sublabelColor = color;
1165
1170
  } else {
1166
- var _input_layout_template_layout3, _input_layout_template3, _input_layout5, _firstData_delta_decreasing, _firstData_delta2;
1171
+ var _input_layout_template_layout4, _input_layout_template4, _input_layout6, _firstData_delta_decreasing, _firstData_delta2, _input_layout_template_layout5, _input_layout_template5, _input_layout7;
1167
1172
  sublabel = `\u25BC ${Math.abs(diff)}`;
1168
- const extractedDecreasingDeltaColors = extractColor((_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : (_input_layout_template3 = _input_layout5.template) === null || _input_layout_template3 === void 0 ? void 0 : (_input_layout_template_layout3 = _input_layout_template3.layout) === null || _input_layout_template_layout3 === void 0 ? void 0 : _input_layout_template_layout3.colorway, colorwayType, (_firstData_delta2 = firstData.delta) === null || _firstData_delta2 === void 0 ? void 0 : (_firstData_delta_decreasing = _firstData_delta2.decreasing) === null || _firstData_delta_decreasing === void 0 ? void 0 : _firstData_delta_decreasing.color, colorMap, isDarkTheme);
1169
- const color = resolveColor(extractedDecreasingDeltaColors, 0, '', colorMap, isDarkTheme);
1173
+ const extractedDecreasingDeltaColors = extractColor((_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : (_input_layout_template4 = _input_layout6.template) === null || _input_layout_template4 === void 0 ? void 0 : (_input_layout_template_layout4 = _input_layout_template4.layout) === null || _input_layout_template_layout4 === void 0 ? void 0 : _input_layout_template_layout4.colorway, colorwayType, (_firstData_delta2 = firstData.delta) === null || _firstData_delta2 === void 0 ? void 0 : (_firstData_delta_decreasing = _firstData_delta2.decreasing) === null || _firstData_delta_decreasing === void 0 ? void 0 : _firstData_delta_decreasing.color, colorMap, isDarkTheme);
1174
+ const color = resolveColor(extractedDecreasingDeltaColors, 0, '', colorMap, (_input_layout7 = input.layout) === null || _input_layout7 === void 0 ? void 0 : (_input_layout_template5 = _input_layout7.template) === null || _input_layout_template5 === void 0 ? void 0 : (_input_layout_template_layout5 = _input_layout_template5.layout) === null || _input_layout_template_layout5 === void 0 ? void 0 : _input_layout_template_layout5.colorway, isDarkTheme);
1170
1175
  sublabelColor = color;
1171
1176
  }
1172
1177
  }
@@ -1419,13 +1424,13 @@ export const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, colorM
1419
1424
  // Assign a color per series/category and use it for all subValues of that category
1420
1425
  const seriesColors = {};
1421
1426
  input.data.forEach((series, seriesIdx)=>{
1422
- var _input_layout_template_layout, _input_layout_template, _input_layout, _series_marker, _series_marker1;
1427
+ var _input_layout_template_layout, _input_layout_template, _input_layout, _series_marker, _series_marker1, _input_layout_template_layout1, _input_layout_template1, _input_layout1;
1423
1428
  const category = series.name || `Category ${seriesIdx + 1}`;
1424
1429
  var _series_marker_colors;
1425
1430
  // Use the same color for this category across all stages
1426
1431
  const extractedColors = 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, (_series_marker_colors = (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.colors) !== null && _series_marker_colors !== void 0 ? _series_marker_colors : (_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color, colorMap, isDarkTheme);
1427
1432
  // Always use the first color for the series/category
1428
- const color = resolveColor(extractedColors, 0, category, colorMap, isDarkTheme);
1433
+ const color = resolveColor(extractedColors, 0, category, 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);
1429
1434
  seriesColors[category] = color;
1430
1435
  var _series_labels, _ref;
1431
1436
  const labels = (_ref = (_series_labels = series.labels) !== null && _series_labels !== void 0 ? _series_labels : series.y) !== null && _ref !== void 0 ? _ref : series.stage;
@@ -1473,7 +1478,8 @@ export const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, colorM
1473
1478
  var _series_marker_colors;
1474
1479
  const extractedColors = 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, (_series_marker_colors = (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.colors) !== null && _series_marker_colors !== void 0 ? _series_marker_colors : (_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color, colorMap, isDarkTheme);
1475
1480
  categories.forEach((label, i)=>{
1476
- const color = resolveColor(extractedColors, i, label, colorMap, isDarkTheme);
1481
+ var _input_layout_template_layout, _input_layout_template, _input_layout;
1482
+ const color = resolveColor(extractedColors, i, label, 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);
1477
1483
  const valueNum = Number(values[i]);
1478
1484
  if (isNaN(valueNum)) {
1479
1485
  return;
@@ -1812,11 +1818,13 @@ export const getAllupLegendsProps = (input, colorMap, colorwayType, traceInfo, i
1812
1818
  var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _pieSeries_marker, _pieSeries_labels;
1813
1819
  const pieSeries = series;
1814
1820
  var _input_layout_piecolorway, _input_layout_piecolorway1;
1815
- const colors = extractColor((_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.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, (_input_layout_piecolorway1 = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.piecolorway) !== null && _input_layout_piecolorway1 !== void 0 ? _input_layout_piecolorway1 : pieSeries === null || pieSeries === void 0 ? void 0 : (_pieSeries_marker = pieSeries.marker) === null || _pieSeries_marker === void 0 ? void 0 : _pieSeries_marker.colors, colorMap, isDarkTheme);
1821
+ const colors = extractColor((_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.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, (_input_layout_piecolorway1 = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.piecolorway) !== null && _input_layout_piecolorway1 !== void 0 ? _input_layout_piecolorway1 : pieSeries === null || pieSeries === void 0 ? void 0 : (_pieSeries_marker = pieSeries.marker) === null || _pieSeries_marker === void 0 ? void 0 : _pieSeries_marker.colors, colorMap, isDarkTheme, true);
1816
1822
  (_pieSeries_labels = pieSeries.labels) === null || _pieSeries_labels === void 0 ? void 0 : _pieSeries_labels.forEach((label, labelIndex)=>{
1823
+ var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1;
1817
1824
  const legend = `${label}`;
1825
+ var _input_layout_piecolorway;
1818
1826
  // resolve color for each legend from the extracted colors
1819
- const color = resolveColor(colors, labelIndex, legend, colorMap, isDarkTheme);
1827
+ const color = resolveColor(colors, labelIndex, legend, colorMap, (_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.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, true);
1820
1828
  if (legend !== '' && allupLegends.some((group)=>group.title === legend) === false) {
1821
1829
  allupLegends.push({
1822
1830
  title: legend,
@@ -2088,6 +2096,7 @@ export const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
2088
2096
  });
2089
2097
  const isAxisTypeCategory = (ax === null || ax === void 0 ? void 0 : ax.type) === 'category' || isStringArray(values) && !isNumberArray(values) && !isDateArray(values);
2090
2098
  if (!isAxisTypeCategory) {
2099
+ result[propName] = 'data';
2091
2100
  return;
2092
2101
  }
2093
2102
  const isValidArray = isArrayOrTypedArray(ax === null || ax === void 0 ? void 0 : ax.categoryarray) && ax.categoryarray.length > 0;
@@ -2097,7 +2106,7 @@ export const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
2097
2106
  }
2098
2107
  if (!(ax === null || ax === void 0 ? void 0 : ax.categoryorder) || ax.categoryorder === 'trace' || ax.categoryorder === 'array') {
2099
2108
  const categoriesInTraceOrder = Array.from(new Set(values));
2100
- result[propName] = categoriesInTraceOrder;
2109
+ result[propName] = (ax === null || ax === void 0 ? void 0 : ax.autorange) === 'reversed' ? categoriesInTraceOrder.reverse() : categoriesInTraceOrder;
2101
2110
  return;
2102
2111
  }
2103
2112
  result[propName] = ax.categoryorder;