I have collected data on the books I have read over the past few years. I want to create a visualization in which I can see how many books I was reading each day of the year. Currently, the data I’ve collected contains the start and stop day of the books, along with the title and author as such:
data = [
{title: 'War and Peace', author: 'Leo Tolstoy', start: '2021-01-01', stop: '2021-06-15'},
{title: 'The Great Gatsby', author: 'F. Scott Fitzgerald', start: '2021-02-20', stop: '2021-03-30'},
{title: 'Moby Dick', author: 'Herman Melville', start: '2021-05-06', stop: '2021-08-10'},
{title: 'Pride and Prejudice', author: 'Jane Austen', start: '2021-05-25', stop: '2021-10-03'},
{title: 'Mrs. Dalloway', author: 'Virginia Woolf', start: '2021-06-02', stop: '2021-11-10'},
]
I want to use Plot and the cell mark to show how many books I was reading on any given day. I am unsure how to transform a series of overlapping date ranges into an aggregated count of books by day. Any advice would help.
I’ve added a fix for the “degenerate” case of reading a book on a single day (start==end — maybe not War and Peace though); we still want it to show on the chart.
This is just what I have in mind for an antibiotic use chart for a patient in ICU! Instead of books, antibiotics.
Medical charts are boring and really hard to interpret, as we, docs, just fill in the dates of antibiotic use. We don’t really have a true image of whats going on with patients, who, sometimes, spend weeks under intensive care, using multiple antibiotics!
Dang! I could use different shades of colors for different classes of antibiotics! Different carbapenems are different shades of orange, different aminoglycosides are different shades of green, and so on!