We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abd7b93 commit e34a547Copy full SHA for e34a547
1 file changed
src/component/1d/SpectraLegends.tsx
@@ -64,8 +64,13 @@ function InnerSpectraLegends({
64
spectra,
65
legendsFields,
66
}: InnerSpectraLegendsProps) {
67
- const visibleLegendsFields = legendsFields.filter((legend) => legend.visible);
68
-
+ const visibleLegendsFields = legendsFields
+ .filter((legend) => legend.visible)
69
+ .toSorted((a, b) => {
70
+ if ((a as PredefinedLegendField).name === 'intensity') return 1;
71
+ if ((b as PredefinedLegendField).name === 'intensity') return -1;
72
+ return 0;
73
+ });
74
return (
75
<g className="spectra-intensity-legend">
76
{spectra.map((spectrum, index) => (
0 commit comments