const currentDatapoint = scrawl.makeBlock({
name: name('dataframe'),
group,
mimic: name(`${selectedColumn}-${selectedRow}`),
useMimicDimensions: true,
useMimicStart: true,
useMimicHandle: true,
lockTo: 'mimic',
lineWidth: 6,
strokeStyle: 'yellow',
method: 'draw',
});
const redSpan = 'style="color: red; --SC-fill-style: red"';
const updateSelected = () => {
const {yearLabels, categoryLabels, yearData} = currentData;
const category = categoryLabels[selectedRow],
year = yearLabels[selectedColumn],
data = yearData[year][selectedRow];
currentDatapoint.set({
mimic: name(`${year}-${category}`),
});
frame.updateSubtitle(`${category} in ${year}: <span ${redSpan}>${data.toLocaleString()}</span>`);
};
updateSelected();