We've been trying to use the timeline to show our data, the problem is, it is lots of data (about 5000 records).
Now I know that's too much for one timeline, since it takes ages to convert all those records into timeline events.
Has anyone here had the same problem and managed to fix it? I've tried to use the onscroll_listener to only load what is visible but can't get it to work (there is hardly any documentation from simile and if there is chances are that it is outdated).
Thanks for the help,
I've thought about a couple of solutions, but never really explored any of them:
1. Showing only items that match the dates visible on the timeline, as you suggest. But to really do this, we'd need to query Omeka items that match those dates, and that's unfortunately impossible to do given the limitations of using historical dates with MySQL. As MySQL's documentation on dates illustrates, you can only reliably use a small range of dates reliably, roughly back to 1000CE. This, combined with the fact that, currently, Neatline Time looks at Omeka's DC:Date field, which could be any string (January 1; 1980, yesterday) makes this even more challenging.
2. Instead of building the JSON file for the timeline on the fly, we could generate and save a static JSON file in Omeka's
files directory, and reference that. This would has the advantage of being a static file, which could be cached, and you would need to hit Omeka's database everytime you load the timeline. The biggest issue with this, as I see it, is if you edit items on a timeline, the plugin would have to either regenerate the JSON file, or the data on the timeline would be out of date. This isn't particularly onerous, but it migth be necessary to do that for every timeline, every time you save an item. I imagine we coudl write some logic to only rebuild the JSON file for affected timelines, but we'd need to think about that some more.
If the latter solution sounds reasonable to you, I'd be curious to see whether a static JSON file for your timeline, with 5000 items on it, shows much of a difference in page load. If you can, save that output and see, or email it to me (email@example.com) and I can see how it works. The JSON output would be available at
neatline-time/timelines/items/1?output=neatlinetime-json, where '1' is the ID for your timeline.
Thanks Jeremy, I'll give your suggestions a go and keep you updated.
Your suggestion to preload the json and put it in a file did the trick. Loading the timeline now only takes a couple of seconds.
You can find (most of) the adjustments here:
and the plugin as we are using it now:
I've put a button in the admin section of the plugin with a button that when clicked loads an updated json of that specific timeline and saves it to a json file in /files.
Although this action (loading the json) can still take a long time (with subsequent timeouts) so we might have to turn this process into a background job at some point if that's possible.
Thanks, this is encouraging news! I'll see about updating the plugin to do this as well, either as a replacement for the current method or as an option.