|
239 | 239 | description:
|
240 | 240 | "Parameters that are specific to particular lines. Takes priority over `basicLineParams` and tieredLineParams",
|
241 | 241 | functionElements: {
|
242 |
| - functionAsString: `function (key, el) { |
243 |
| - return { |
244 |
| - pathStrokeColor: ["primary", "hover", "clicked"].includes(key) |
245 |
| - ? getColor( |
246 |
| - el[series], |
247 |
| - [ |
248 |
| - "E07000224", |
249 |
| - "E07000225", |
250 |
| - "E07000226", |
251 |
| - "E07000228", |
252 |
| - ].indexOf(el[series]), |
253 |
| - ) |
254 |
| - : null, |
255 |
| - }; |
256 |
| - }`, |
| 242 | + functionAsString: ``, |
257 | 243 | },
|
258 | 244 | value: function (tier, el) {
|
259 | 245 | return {
|
|
268 | 254 | (!clickedSeries &&
|
269 | 255 | hoveredTier === "primary" &&
|
270 | 256 | tier === "primary"),
|
271 |
| - pathStrokeColor: ["primary", "hover", "clicked"].includes(tier) |
272 |
| - ? getColor( |
273 |
| - el[series], |
274 |
| - [ |
275 |
| - "E07000224", |
276 |
| - "E07000225", |
277 |
| - "E07000226", |
278 |
| - "E07000228", |
279 |
| - englandMedian, |
280 |
| - similarAreas, |
281 |
| - ].indexOf(el[series]), |
282 |
| - ) |
283 |
| - : null, |
284 |
| - markerFill: ["primary", "hover", "clicked"].includes(tier) |
285 |
| - ? getColor( |
286 |
| - el[series], |
287 |
| - [ |
288 |
| - "E07000224", |
289 |
| - "E07000225", |
290 |
| - "E07000226", |
291 |
| - "E07000228", |
292 |
| - englandMedian, |
293 |
| - similarAreas, |
294 |
| - ].indexOf(el[series]), |
295 |
| - ) |
296 |
| - : null, |
297 | 257 | };
|
298 | 258 | },
|
299 | 259 | },
|
|
448 | 408 | activeMarkerId = marker;
|
449 | 409 | },
|
450 | 410 | },
|
451 |
| - { |
452 |
| - name: "getColor", |
453 |
| - category: "customisingLines", |
454 |
| - functionElements: { |
455 |
| - functionAsString: `function (series, i) { |
456 |
| - let colorsArray = [colors.coral, colors.fuschia, colors.purple]; |
457 |
| -
|
458 |
| - return ( |
459 |
| - { |
460 |
| - [englandMedian]: colors.lightblue, |
461 |
| - [selectedAreaCode]: colors.teal, |
462 |
| - [similarAreas]: colors.darkblue, |
463 |
| - }[series] ?? colorsArray[i % colorsArray.length] |
464 |
| - ); |
465 |
| - };`, |
466 |
| - }, |
467 |
| - value: function (series, i) { |
468 |
| - let colorsArray = colors; |
469 |
| -
|
470 |
| - return ( |
471 |
| - { |
472 |
| - [englandMedian]: colors.burntSienna, |
473 |
| - [selectedAreaCode]: colors.coral, |
474 |
| - [similarAreas]: colors.slatePurple, |
475 |
| - }[series] ?? colorsArray[i % colorsArray.length] |
476 |
| - ); |
477 |
| - }, |
478 |
| - }, |
479 | 411 |
|
480 | 412 | {
|
481 | 413 | name: "paddingTop",
|
|
722 | 654 | clicked: { opacity: 1 },
|
723 | 655 | });
|
724 | 656 |
|
725 |
| - let getColor = function (series, i) { |
726 |
| - let colorsArray = colors; |
727 |
| -
|
728 |
| - return ( |
729 |
| - { |
730 |
| - [englandMedian]: colors.lightblue, |
731 |
| - [selectedAreaCode]: colors.teal, |
732 |
| - [similarAreas]: colors.darkblue, |
733 |
| - }[series] ?? colorsArray[i % colorsArray.length] |
734 |
| - ); |
735 |
| - }; |
736 |
| -
|
737 | 657 | let xFunction = $derived(function (number) {
|
738 | 658 | return scaleLinear()
|
739 | 659 | .domain([2015, 2022])
|
|
780 | 700 | lineFunction,
|
781 | 701 | lineChartData,
|
782 | 702 | tieredLineParams,
|
783 |
| - getColor, |
784 | 703 | basicLineParams,
|
785 | 704 | nothingSelected,
|
786 | 705 | globalTierRules,
|
|
0 commit comments