I have written a matplotlib application which scrolls through events on a timeline. It displays a frame of 25 years at a time along 500 years. However, I need to link the events to wikipedia, and matplotlib doesn’t do that, not that I could see. So I’m trying to use bokeh.
I have seen a test app which displays a bokeh timeline view, but it only uses one set of data.
Which approach is best? Should I display all 500 years of data in one HTML? Or should I use bokeh server to grab the next 25years when the user scrolls either way? Which is the more elegant and/or easier for a web page?
Hi @Roger one HTML will probably be the simplest option since it does not require hosting and running a server somewhere (or having your users run something locally). But it would really depend on the size of your data. What exactly is each “frame” and how big are they?
It’s an independent research project for myself, I hope to make it of wider use though.
It’s covering the years 1200 to 1600, covering popes, wars, patrons, significant personalities, painters, sculptors. writers, architects, plus their works.
A time-frame is a 25 year subset of all the events, initially set to 1453+24. The user can then pan either side of that initial view.
The number of events in the time-frame can be none, but it’s more likely to be a lot. Sorry to be vague, but at this stage I don’t know precise details. It’s not going to be an overly large amount of data - we’re not talking about terabytes of data, at most it’s (finger in the air) going to be megabytes of data in toto. I think I’m talking in the range of 2mb.
Additional functionality has to include hover boxes for each points which would link to the Wikipedia. Plus an example of art. Other functionality needs to turn off groups of events (the annotation line is colour coded) so that the user can declutter their view.
All the events, and some of the config data, is kept in an SQLite database. The image jpegs are going to be external and referenced in the hover box, so not plotting data
I think my best bet is to start by creating one big HTML page then modify it if I think the amount of data becomes unwieldy.
I make tonnes of standalone HTML type content, and I only start to blink/think about “efficiency” (whether that’s simply cutting down the amount of content, more compact/smart storage of data, or going server side), when the generated html exceeds 50 mb. I have colleagues that don’t even scoff at a 100 mb, though the load times for that irk me .
I’d say start with writing a script that scrapes the data you need from wikipedia and write it to csv/parquet/pickle etc. Then have a another script that builds a standalone bokeh application using said data.