mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-08 01:28:15 -07:00
website_next: snapshot
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
import { createAreaPathData, createLinePathData } from "../path.js";
|
||||
import { appendSeriesPath } from "../series-path.js";
|
||||
import { createStackedSeries } from "./series.js";
|
||||
|
||||
/**
|
||||
* @param {PlotContext} context
|
||||
*/
|
||||
export function renderStackedPlot({
|
||||
group,
|
||||
loadedSeries,
|
||||
frame,
|
||||
highlight,
|
||||
scale,
|
||||
order,
|
||||
}) {
|
||||
const { lineIndexes, plottedSeries, stackIndexes } = createStackedSeries(
|
||||
loadedSeries,
|
||||
frame,
|
||||
order,
|
||||
scale,
|
||||
);
|
||||
|
||||
for (const index of stackIndexes) {
|
||||
const { color, points } = plottedSeries[index];
|
||||
appendSeriesPath({
|
||||
group,
|
||||
highlight,
|
||||
index,
|
||||
chart: "stacked",
|
||||
color,
|
||||
d: createAreaPathData(points),
|
||||
});
|
||||
}
|
||||
|
||||
for (const index of lineIndexes) {
|
||||
const { color, points } = plottedSeries[index];
|
||||
appendSeriesPath({
|
||||
group,
|
||||
highlight,
|
||||
index,
|
||||
chart: "line",
|
||||
color,
|
||||
d: createLinePathData(points),
|
||||
});
|
||||
}
|
||||
|
||||
return plottedSeries;
|
||||
}
|
||||
Reference in New Issue
Block a user