@fluentui/react-charts 0.0.0-nightly-20251014-0406.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.
@@ -271,7 +271,7 @@ const getSecondaryYAxisValues = (data, layout, maxAllowedMinY, minAllowedMaxY)=>
271
271
  };
272
272
  const _getGaugeAxisColor = (colorway, colorwayType, color, colorMap, isDarkTheme)=>{
273
273
  const extractedColors = (0, _PlotlyColorAdapter.extractColor)(colorway, colorwayType, color, colorMap, isDarkTheme);
274
- return (0, _PlotlyColorAdapter.resolveColor)(extractedColors, 0, '', colorMap, isDarkTheme);
274
+ return (0, _PlotlyColorAdapter.resolveColor)(extractedColors, 0, '', colorMap, colorway, isDarkTheme);
275
275
  };
276
276
  const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNumber)=>{
277
277
  if (x === null || x === undefined) {
@@ -408,54 +408,41 @@ const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayT
408
408
  // extract colors for each series only once
409
409
  // use piecolorway if available
410
410
  // otherwise, default to colorway from template
411
- const colors = (0, _PlotlyColorAdapter.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);
411
+ const colors = (0, _PlotlyColorAdapter.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);
412
412
  const mapLegendToDataPoint = {};
413
- if (colors) {
414
- var _firstData_labels;
415
- (_firstData_labels = firstData.labels) === null || _firstData_labels === void 0 ? void 0 : _firstData_labels.forEach((label, index)=>{
416
- const value = getNumberAtIndexOrDefault(firstData.values, index);
417
- if ((0, _chartutilities.isInvalidValue)(value) || value < 0) {
418
- return;
419
- }
420
- const legend = `${label}`;
421
- // resolve color for each legend from the extracted colors
422
- const color = (0, _PlotlyColorAdapter.resolveColor)(colors, index, legend, colorMap, isDarkTheme);
413
+ // clear colorMap for donut chart to reassign colors as the colorMap initially gets assigned by
414
+ // getAllupLegendsProps function without sorting labels by value
415
+ colorMap.current.clear();
416
+ // Sort labels by value descending before mapping
417
+ if (firstData.labels && firstData.values) {
418
+ var _firstData_marker1;
419
+ const markerColors = ((_firstData_marker1 = firstData.marker) === null || _firstData_marker1 === void 0 ? void 0 : _firstData_marker1.colors) || undefined;
420
+ const hasMarkerColors = Array.isArray(markerColors) && markerColors.length >= firstData.labels.length;
421
+ const labelValuePairs = firstData.labels.map((label, index)=>({
422
+ label,
423
+ value: getNumberAtIndexOrDefault(firstData.values, index),
424
+ index,
425
+ color: hasMarkerColors ? markerColors[index] : undefined
426
+ }));
427
+ // Filter out invalid values
428
+ const validPairs = labelValuePairs.filter((pair)=>!(0, _chartutilities.isInvalidValue)(pair.value));
429
+ // Sort descending by value; when marker colors are present, keep color attached to the label
430
+ validPairs.sort((a, b)=>b.value - a.value);
431
+ validPairs.forEach((pair, sortedIdx)=>{
432
+ var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1;
433
+ const legend = `${pair.label}`;
434
+ var _input_layout_piecolorway, _pair_color;
435
+ const color = (_pair_color = pair.color) !== null && _pair_color !== void 0 ? _pair_color : (0, _PlotlyColorAdapter.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);
423
436
  if (!mapLegendToDataPoint[legend]) {
424
437
  mapLegendToDataPoint[legend] = {
425
438
  legend,
426
- data: value,
439
+ data: pair.value,
427
440
  color
428
441
  };
429
442
  } else {
430
- mapLegendToDataPoint[legend].data += value;
443
+ mapLegendToDataPoint[legend].data += pair.value;
431
444
  }
432
445
  });
433
- } else {
434
- // Sort labels by value descending before mapping
435
- if (firstData.labels && firstData.values) {
436
- const labelValuePairs = firstData.labels.map((label, index)=>({
437
- label,
438
- value: getNumberAtIndexOrDefault(firstData.values, index),
439
- index
440
- }));
441
- // Filter out invalid values
442
- const validPairs = labelValuePairs.filter((pair)=>!(0, _chartutilities.isInvalidValue)(pair.value));
443
- // Sort descending by value
444
- validPairs.sort((a, b)=>b.value - a.value);
445
- validPairs.forEach((pair, sortedIdx)=>{
446
- const legend = `${pair.label}`;
447
- const color = (0, _PlotlyColorAdapter.resolveColor)(colors, sortedIdx, legend, colorMap, isDarkTheme);
448
- if (!mapLegendToDataPoint[legend]) {
449
- mapLegendToDataPoint[legend] = {
450
- legend,
451
- data: pair.value,
452
- color
453
- };
454
- } else {
455
- mapLegendToDataPoint[legend].data += pair.value;
456
- }
457
- });
458
- }
459
446
  }
460
447
  var _input_layout_width;
461
448
  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;
@@ -470,10 +457,25 @@ const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayT
470
457
  const donutMarginVertical = 40 + (hideLabels ? 0 : 40);
471
458
  const innerRadius = firstData.hole ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2) : _utilities.MIN_DONUT_RADIUS;
472
459
  const { chartTitle } = getTitles(input.layout);
460
+ // Build anticlockwise order by keeping the first item, reversing the rest
461
+ const legends = Object.keys(mapLegendToDataPoint);
462
+ const reorderedEntries = legends.length > 1 ? [
463
+ [
464
+ legends[0],
465
+ mapLegendToDataPoint[legends[0]]
466
+ ],
467
+ ...legends.slice(1).reverse().map((key)=>[
468
+ key,
469
+ mapLegendToDataPoint[key]
470
+ ])
471
+ ] : legends.map((key)=>[
472
+ key,
473
+ mapLegendToDataPoint[key]
474
+ ]);
473
475
  return {
474
476
  data: {
475
477
  chartTitle,
476
- chartData: Object.values(mapLegendToDataPoint)
478
+ chartData: reorderedEntries.map(([, v])=>v)
477
479
  },
478
480
  hideLegend: isMultiPlot || ((_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : _input_layout5.showlegend) === false,
479
481
  width: (_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : _input_layout6.width,
@@ -484,7 +486,8 @@ const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayT
484
486
  'percent',
485
487
  'label+percent'
486
488
  ].includes(firstData.textinfo) : true,
487
- roundCorners: true
489
+ roundCorners: true,
490
+ order: 'sorted'
488
491
  };
489
492
  };
490
493
  const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
@@ -513,7 +516,7 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
513
516
  const rangeXValues = series.x.slice(rangeStart, rangeEnd);
514
517
  const rangeYValues = series.y.slice(rangeStart, rangeEnd);
515
518
  rangeXValues.forEach((x, index2)=>{
516
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2;
519
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout;
517
520
  if (!mapXToDataPoints[x]) {
518
521
  mapXToDataPoints[x] = {
519
522
  xAxisPoint: resolveXAxisPoint(x, isXYearCategory, isXString, isXDate, isXNumber),
@@ -523,7 +526,7 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
523
526
  }
524
527
  const legend = legends[index1];
525
528
  // resolve color for each legend's bars from the colorscale or extracted colors
526
- const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.resolveColor)(extractedBarColors, index2, legend, colorMap, isDarkTheme);
529
+ const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.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);
527
530
  const opacity = (0, _PlotlyColorAdapter.getOpacity)(series, index2);
528
531
  const yVal = rangeYValues[index2];
529
532
  const yAxisCalloutData = getFormattedCalloutYData(yVal, yAxisTickFormat);
@@ -541,8 +544,8 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
541
544
  yMaxValue = Math.max(yMaxValue, yVal);
542
545
  }
543
546
  } else if (series.type === 'scatter' || !!fallbackVSBC) {
544
- var _series_mode;
545
- const lineColor = (0, _PlotlyColorAdapter.resolveColor)(extractedLineColors, index1, legend, colorMap, isDarkTheme);
547
+ var _input_layout_template_layout1, _input_layout_template1, _input_layout1, _series_mode;
548
+ const lineColor = (0, _PlotlyColorAdapter.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);
546
549
  const lineOptions = !((_series_mode = series.mode) === null || _series_mode === void 0 ? void 0 : _series_mode.includes('text')) ? getLineOptions(series.line) : undefined;
547
550
  const legendShape = getLegendShape(series);
548
551
  var _rgb_copy_formatHex81;
@@ -649,10 +652,10 @@ const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, colorwayTy
649
652
  };
650
653
  }
651
654
  if (series.type === 'bar') {
652
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2;
655
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _processedInput_layout_template_layout, _processedInput_layout_template, _processedInput_layout;
653
656
  const legend = legends[index1];
654
657
  // resolve color for each legend's bars from the colorscale or extracted colors
655
- const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.resolveColor)(extractedColors, index2, legend, colorMap, isDarkTheme);
658
+ const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.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);
656
659
  const opacity = (0, _PlotlyColorAdapter.getOpacity)(series, index2);
657
660
  const yVal = series.y[index2];
658
661
  var _rgb_copy_formatHex8;
@@ -733,10 +736,10 @@ const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colorwayTyp
733
736
  return yVal;
734
737
  });
735
738
  xBins.forEach((bin, index)=>{
736
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2;
739
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout;
737
740
  const legend = legends[seriesIdx];
738
741
  // resolve color for each legend's bars from the colorscale or extracted colors
739
- const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.resolveColor)(extractedColors, index, legend, colorMap, isDarkTheme);
742
+ const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.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);
740
743
  const opacity = (0, _PlotlyColorAdapter.getOpacity)(series, index);
741
744
  const yVal = calculateHistNorm(series.histnorm, y[index], total, isXString ? bin.length : getBinSize(bin));
742
745
  var _rgb_copy_formatHex8;
@@ -798,7 +801,7 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
798
801
  const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
799
802
  var shouldWrapLabels = false;
800
803
  const chartData = input.data.map((series, index)=>{
801
- var _series_mode, _series_line, _series_marker, _series_line1, _input_layout_template_layout, _input_layout_template, _input_layout, _series_mode1;
804
+ 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;
802
805
  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;
803
806
  // extract colors for each series only once
804
807
  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);
@@ -810,7 +813,7 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
810
813
  shouldWrapLabels = shouldWrapLabels || isXString && !isXDate;
811
814
  const legend = legends[index];
812
815
  // resolve color for each legend's lines from the extracted colors
813
- const seriesColor = (0, _PlotlyColorAdapter.resolveColor)(extractedColors, index, legend, colorMap, isDarkTheme);
816
+ 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);
814
817
  const seriesOpacity = (0, _PlotlyColorAdapter.getOpacity)(series, index);
815
818
  mode = series.fill === 'tozeroy' ? 'tozeroy' : 'tonexty';
816
819
  // if mode contains 'text', we prioritize showing the text over curving the line
@@ -927,12 +930,12 @@ const transformPlotlyJsonToHorizontalBarWithAxisProps = (input, isMultiPlot, col
927
930
  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, (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color, colorMap, isDarkTheme);
928
931
  const legend = legends[index];
929
932
  return series.y.map((yValue, i)=>{
930
- var _series_x, _series_marker, _series_marker1, _series_marker_color, _series_marker2;
933
+ var _series_x, _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout;
931
934
  if ((0, _chartutilities.isInvalidValue)((_series_x = series.x) === null || _series_x === void 0 ? void 0 : _series_x[i]) || (0, _chartutilities.isInvalidValue)(yValue)) {
932
935
  return null;
933
936
  }
934
937
  // resolve color for each legend's bars from the colorscale or extracted colors
935
- const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.resolveColor)(extractedColors, i, legend, colorMap, isDarkTheme);
938
+ const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.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);
936
939
  const opacity = (0, _PlotlyColorAdapter.getOpacity)(series, i);
937
940
  var _rgb_copy_formatHex8;
938
941
  return {
@@ -990,12 +993,12 @@ const transformPlotlyJsonToGanttChartProps = (input, isMultiPlot, colorMap, colo
990
993
  return (0, _chartutilities.isInvalidValue)(value) ? 0 : isXDate ? +parseLocalDate(value) : +value;
991
994
  };
992
995
  return series.y.map((yVal, i)=>{
993
- var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _series_base, _series_x;
996
+ var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout, _series_base, _series_x;
994
997
  if ((0, _chartutilities.isInvalidValue)(yVal)) {
995
998
  return null;
996
999
  }
997
1000
  // resolve color for each legend's bars from the colorscale or extracted colors
998
- const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.resolveColor)(extractedColors, i, legend, colorMap, isDarkTheme);
1001
+ const color = colorScale ? colorScale((0, _chartutilities.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) : (0, _PlotlyColorAdapter.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);
999
1002
  const opacity = (0, _PlotlyColorAdapter.getOpacity)(series, i);
1000
1003
  const base = convertXValueToNumber((_series_base = series.base) === null || _series_base === void 0 ? void 0 : _series_base[i]);
1001
1004
  const xVal = convertXValueToNumber((_series_x = series.x) === null || _series_x === void 0 ? void 0 : _series_x[i]);
@@ -1183,7 +1186,8 @@ const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorway
1183
1186
  const extractedNodeColors = (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, node === null || node === void 0 ? void 0 : node.color, colorMap, isDarkTheme);
1184
1187
  const sankeyChartData = {
1185
1188
  nodes: (_node_label = node.label) === null || _node_label === void 0 ? void 0 : _node_label.map((label, index)=>{
1186
- const color = (0, _PlotlyColorAdapter.resolveColor)(extractedNodeColors, index, label, colorMap, isDarkTheme);
1189
+ var _input_layout_template_layout, _input_layout_template, _input_layout;
1190
+ const color = (0, _PlotlyColorAdapter.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);
1187
1191
  return {
1188
1192
  nodeId: index,
1189
1193
  name: label,
@@ -1220,9 +1224,9 @@ const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayT
1220
1224
  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, stepsColors, colorMap, isDarkTheme);
1221
1225
  var _firstData_gauge_axis_range_, _firstData_value, _firstData_gauge_axis_range_1, _firstData_value1;
1222
1226
  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)=>{
1223
- var _step_range, _step_range1;
1227
+ var _input_layout_template_layout, _input_layout_template, _input_layout, _step_range, _step_range1;
1224
1228
  const legend = step.name || `Segment ${index + 1}`;
1225
- const color = (0, _PlotlyColorAdapter.resolveColor)(extractedColors, index, legend, colorMap, isDarkTheme);
1229
+ const color = (0, _PlotlyColorAdapter.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);
1226
1230
  return {
1227
1231
  legend,
1228
1232
  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]),
@@ -1245,16 +1249,16 @@ const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayT
1245
1249
  if ((_firstData_delta = firstData.delta) === null || _firstData_delta === void 0 ? void 0 : _firstData_delta.reference) {
1246
1250
  const diff = firstData.value - firstData.delta.reference;
1247
1251
  if (diff >= 0) {
1248
- var _input_layout_template_layout2, _input_layout_template2, _input_layout4, _firstData_delta_increasing, _firstData_delta1;
1252
+ var _input_layout_template_layout2, _input_layout_template2, _input_layout4, _firstData_delta_increasing, _firstData_delta1, _input_layout_template_layout3, _input_layout_template3, _input_layout5;
1249
1253
  sublabel = `\u25B2 ${diff}`;
1250
1254
  const extractedIncreasingDeltaColors = (0, _PlotlyColorAdapter.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);
1251
- const color = (0, _PlotlyColorAdapter.resolveColor)(extractedIncreasingDeltaColors, 0, '', colorMap, isDarkTheme);
1255
+ const color = (0, _PlotlyColorAdapter.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);
1252
1256
  sublabelColor = color;
1253
1257
  } else {
1254
- var _input_layout_template_layout3, _input_layout_template3, _input_layout5, _firstData_delta_decreasing, _firstData_delta2;
1258
+ var _input_layout_template_layout4, _input_layout_template4, _input_layout6, _firstData_delta_decreasing, _firstData_delta2, _input_layout_template_layout5, _input_layout_template5, _input_layout7;
1255
1259
  sublabel = `\u25BC ${Math.abs(diff)}`;
1256
- const extractedDecreasingDeltaColors = (0, _PlotlyColorAdapter.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);
1257
- const color = (0, _PlotlyColorAdapter.resolveColor)(extractedDecreasingDeltaColors, 0, '', colorMap, isDarkTheme);
1260
+ const extractedDecreasingDeltaColors = (0, _PlotlyColorAdapter.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);
1261
+ const color = (0, _PlotlyColorAdapter.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);
1258
1262
  sublabelColor = color;
1259
1263
  }
1260
1264
  }
@@ -1507,13 +1511,13 @@ const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, colorMap, col
1507
1511
  // Assign a color per series/category and use it for all subValues of that category
1508
1512
  const seriesColors = {};
1509
1513
  input.data.forEach((series, seriesIdx)=>{
1510
- var _input_layout_template_layout, _input_layout_template, _input_layout, _series_marker, _series_marker1;
1514
+ var _input_layout_template_layout, _input_layout_template, _input_layout, _series_marker, _series_marker1, _input_layout_template_layout1, _input_layout_template1, _input_layout1;
1511
1515
  const category = series.name || `Category ${seriesIdx + 1}`;
1512
1516
  var _series_marker_colors;
1513
1517
  // Use the same color for this category across all stages
1514
1518
  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, (_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);
1515
1519
  // Always use the first color for the series/category
1516
- const color = (0, _PlotlyColorAdapter.resolveColor)(extractedColors, 0, category, colorMap, isDarkTheme);
1520
+ const color = (0, _PlotlyColorAdapter.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);
1517
1521
  seriesColors[category] = color;
1518
1522
  var _series_labels, _ref;
1519
1523
  const labels = (_ref = (_series_labels = series.labels) !== null && _series_labels !== void 0 ? _series_labels : series.y) !== null && _ref !== void 0 ? _ref : series.stage;
@@ -1561,7 +1565,8 @@ const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, colorMap, col
1561
1565
  var _series_marker_colors;
1562
1566
  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, (_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);
1563
1567
  categories.forEach((label, i)=>{
1564
- const color = (0, _PlotlyColorAdapter.resolveColor)(extractedColors, i, label, colorMap, isDarkTheme);
1568
+ var _input_layout_template_layout, _input_layout_template, _input_layout;
1569
+ const color = (0, _PlotlyColorAdapter.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);
1565
1570
  const valueNum = Number(values[i]);
1566
1571
  if (isNaN(valueNum)) {
1567
1572
  return;
@@ -1895,11 +1900,13 @@ const getAllupLegendsProps = (input, colorMap, colorwayType, traceInfo, isDarkTh
1895
1900
  var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _pieSeries_marker, _pieSeries_labels;
1896
1901
  const pieSeries = series;
1897
1902
  var _input_layout_piecolorway, _input_layout_piecolorway1;
1898
- const colors = (0, _PlotlyColorAdapter.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);
1903
+ const colors = (0, _PlotlyColorAdapter.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);
1899
1904
  (_pieSeries_labels = pieSeries.labels) === null || _pieSeries_labels === void 0 ? void 0 : _pieSeries_labels.forEach((label, labelIndex)=>{
1905
+ var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1;
1900
1906
  const legend = `${label}`;
1907
+ var _input_layout_piecolorway;
1901
1908
  // resolve color for each legend from the extracted colors
1902
- const color = (0, _PlotlyColorAdapter.resolveColor)(colors, labelIndex, legend, colorMap, isDarkTheme);
1909
+ const color = (0, _PlotlyColorAdapter.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);
1903
1910
  if (legend !== '' && allupLegends.some((group)=>group.title === legend) === false) {
1904
1911
  allupLegends.push({
1905
1912
  title: legend,
@@ -2171,6 +2178,7 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
2171
2178
  });
2172
2179
  const isAxisTypeCategory = (ax === null || ax === void 0 ? void 0 : ax.type) === 'category' || (0, _chartutilities.isStringArray)(values) && !(0, _chartutilities.isNumberArray)(values) && !(0, _chartutilities.isDateArray)(values);
2173
2180
  if (!isAxisTypeCategory) {
2181
+ result[propName] = 'data';
2174
2182
  return;
2175
2183
  }
2176
2184
  const isValidArray = (0, _chartutilities.isArrayOrTypedArray)(ax === null || ax === void 0 ? void 0 : ax.categoryarray) && ax.categoryarray.length > 0;
@@ -2180,7 +2188,7 @@ const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
2180
2188
  }
2181
2189
  if (!(ax === null || ax === void 0 ? void 0 : ax.categoryorder) || ax.categoryorder === 'trace' || ax.categoryorder === 'array') {
2182
2190
  const categoriesInTraceOrder = Array.from(new Set(values));
2183
- result[propName] = categoriesInTraceOrder;
2191
+ result[propName] = (ax === null || ax === void 0 ? void 0 : ax.autorange) === 'reversed' ? categoriesInTraceOrder.reverse() : categoriesInTraceOrder;
2184
2192
  return;
2185
2193
  }
2186
2194
  result[propName] = ax.categoryorder;