(
label: string,
color: string,
accessor: (m: FeatureMetric) => number | null,
dashArray?: string,
)
| 439 | }) => { |
| 440 | const driftSeries: LineSeriesData[] = useMemo(() => { |
| 441 | const build = ( |
| 442 | label: string, |
| 443 | color: string, |
| 444 | accessor: (m: FeatureMetric) => number | null, |
| 445 | dashArray?: string, |
| 446 | ): LineSeriesData => ({ |
| 447 | label, |
| 448 | color, |
| 449 | dashArray, |
| 450 | points: metrics |
| 451 | .filter((m) => accessor(m) !== null) |
| 452 | .map((m) => ({ |
| 453 | x: toX(m), |
| 454 | y: 0, |
| 455 | value: accessor(m)!, |
| 456 | date: m.metric_date, |
| 457 | })), |
| 458 | }); |
| 459 | return [ |
| 460 | build("Mean", COLORS[0], (m) => m.mean, "6,3"), |
| 461 | build("P50", COLORS[1], (m) => m.p50), |
no test coverage detected