cache state on page and use to initialize graph