The use case is that at my work when we receive a new dataset, my colleagues like it when I quickly provide some interactive bar charts and histograms for exploration. The format for these visualizations is generally:
A picklist to select the variable of interest;
Some checkboxes to filter by cohort or some other grouping variable;
The resulting chart.
Reminder that I’m working in a Quarto document.
I usually create a few of these plots, each corresponding to a different group of variables (for example maybe one for exploring baseline covariates, another for exploring outcome values, etc). Since I find myself doing this so often, I thought it would be nice to have a function that generates all 3 of these pieces (the picklist, checkboxes, and chart) simultaneously for a particular input dataset, rather than needing to manually define the new viewofs and modify the code to filter the plotted dataset based on the values of those viewofs.