Package: thinkmap.graph.history

This module exposes the Thinkmap history manager. The history manager is used to manager history through the browser like most typical applications. By pushing and restoring states, the user can revisit different actions and views of several graphs.

A couple of important notes however. History is only managed once the user enters Thinkmap. Because of the asynchronous nature of Thinkmap datasources, the amount of entities that can be visited, and limitations of browser history size, Thinkmap cannot save history once the user leaves the page. So although states will be in the browser history, pressing forward/back buttons will have no effect as the data was not serialized once the user left the page.

Examples:

Create a history manager that manages the history of a display var graph = new thinkmap.graph.Graph(); var display = new thinkmap.display.Display(); graph.datasource('/moviedb.tas'); var historyManager = new thinkmap.graph.history.HistoryManager(graph); historyManager.add(display); function center(entity) { graph.query('node','edge','node') .execute(entity) .onresult(display.add) .oncomplete(function(results) { display.retainOnly(results); historyManager.pushState(); }); } //configure optional history listener historyManager.addEventListener('popstate',function(state) { console.log('history restored'); });

Classes: