wellcometrust / timeline

Interactive timeline
Other
97 stars 25 forks source link

API? #1

Closed gaoyike closed 11 years ago

gaoyike commented 11 years ago

Hey, great work! Is there a way that can add/delete entry in a loaded timeline?

edsilv commented 11 years ago

Hi! There isn't currently a facility for doing this, although theoretically you could alter the json data at runtime and re-initialise the timeline. The deep linking mechanism could then link to your new event id. Would be a cool addition.

gaoyike commented 11 years ago

Thanks One more question Have you tested how many entries it can load witout slowing the browser? And In sample_data.js, what are FirstUsage and UsedBy ? I read all code, but i cant find the usage of those

edsilv commented 11 years ago

Performance depends greatly on the device really. The Wellcome timeline is designed to work well on an average sort of laptop plotting ~150 events. It struggles a bit when animating on an iPad, but the Nexus 7 has relatively smooth transitions. You can get different results by changing the options in wellcomeTimelineProvider.js:

$.extend(this.options, options, { provider: this, maxTicks: 100, maxYearIntervalWidth: 500, maxDecadeIntervalWidth: 2000, maxCenturyIntervalWidth: 500, zoomAnimationDuration: 1000, eventFadeDuration: 500, zoomFactor: 3, eventStackSize: 3, padding: 0 });

FirstUsage and UsedBy are artifacts of how timeline events are also used on the Wellcome Library site as promos on web pages. These can be ignored.