Closed martin31821 closed 4 years ago
editor.view.area.zoom(zoom_data); // see rete/src/view/area.ts
got it solved by using:
// save
localStorage.setItem('GRAPH_EDITOR_VIEW', JSON.stringify(this.editor.view.area.transform));
// restore
try {
const viewString = localStorage.getItem('GRAPH_EDITOR_VIEW');
if (viewString) {
const view = JSON.parse(viewString);
this.editor.view.area.transform = view;
this.editor.view.area.update();
}
} catch (err) {
localStorage.removeItem('GRAPH_EDITOR_VIEW');
}
I'm building a flow editor within an angular app, using rete and the vue render plugin. I'd like to store the current position and zoom level of the rete canvas within localstorage and restore it.
How can I achieve this?