Quartz / Chartbuilder

A front-end charting application that facilitates easy creation of simple beautiful charts
http://quartz.github.io/Chartbuilder
MIT License
2.1k stars 354 forks source link

Save current settings to LocalStorage? #170

Closed mhkeller closed 9 years ago

mhkeller commented 9 years ago

What do you think of storing the chart settings in LocalStorage to protect against refreshing / closing the browser inadvertently and losing the project? To protect against always being confronted by your last chart, you could have a "Load previous" button.

nsonnad commented 9 years ago

Hello! This is already implemented. There is a localStorage timer that starts on page load, and the "Load previous" button persists for some time (currently 30sec), after which it starts saving the current chart to localStorage on change.

Here's the component that controls that button: https://github.com/Quartz/Chartbuilder/blob/master/src/js/components/LocalStorageTimer.jsx

The timer is controlled via the Session flux store: https://github.com/Quartz/Chartbuilder/blob/master/src/js/stores/SessionStore.js

mhkeller commented 9 years ago

I must have changed something else then. Thanks!