Files
brk/website_next/chart/line/index.js
T
2026-07-03 21:06:32 +02:00

34 lines
748 B
JavaScript

import { createOrderedIndexes } from "../order.js";
import { createLinePathData } from "../path.js";
import { appendSeriesPath } from "../series-path.js";
import { createLineSeries } from "./series.js";
/**
* @param {PlotContext} context
*/
export function renderLinePlot({
group,
loadedSeries,
frame,
highlight,
scale,
order,
}) {
const plottedSeries = createLineSeries(loadedSeries, frame, scale);
const indexes = createOrderedIndexes(plottedSeries.length, order);
for (const index of indexes) {
const { color, points } = plottedSeries[index];
appendSeriesPath({
group,
highlight,
index,
chart: "line",
color,
d: createLinePathData(points),
});
}
return plottedSeries;
}