File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
src/lib/components/data-vis/line-chart Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 127
127
128
128
basicLineParams = {},
129
129
colorLineParams = (tier , line , lineIndex ) => {
130
- return { pathStrokeColor: lineColorMap . get ( line .areaCode ) };
130
+ return { pathStrokeColor: lineColorMap[ line .areaCode ] };
131
131
},
132
132
} = $props ();
133
133
151
151
slatePurple: " #64587C" ,
152
152
});
153
153
154
- const lineColorMap = new Map ();
155
-
156
- lineChartData .lines .forEach ((line , index ) => {
157
- const colorValues = Object .values (colors);
158
- const color = colorValues[index % colorValues .length ];
159
- lineColorMap .set (line .areaCode , color);
160
- });
154
+ const lineColorMap = Object .fromEntries (
155
+ lineChartData .lines .map ((line , index ) => [
156
+ line .areaCode ,
157
+ Object .values (colors)[index % Object .values (colors).length ],
158
+ ]),
159
+ );
161
160
162
161
let defaultLineParams = $derived ({
163
162
xFunction,
You can’t perform that action at this time.
0 commit comments