theme | toc |
---|---|
dashboard |
false |
import {plotBreakdownChange, plotValueChange} from "./components/plots.js";
import {createClubbedStack, convertDates, getTopPerformer} from "./components/helpers.js";
import * as Inputs from "npm:@observablehq/inputs";
const breakdown = FileAttachment("./data/value.json").json();
const weeklyObj = getTopPerformer(breakdown, 7);
const monthlyObj = getTopPerformer(breakdown, 30);
const clubbedStack = createClubbedStack(breakdown)
const date = view(
Inputs.date({
label: "Select starting date for comparison",
min: clubbedStack[0].time,
max: clubbedStack[clubbedStack.length - 1].time
}));
${resize((width) => plotValueChange(convertDates(breakdown), date, {width}))}
${resize((width) => plotBreakdownChange(clubbedStack, date, {width}))}