kiln / flourish-sdk

The SDK for developing Flourish templates
Other
81 stars 16 forks source link

Question: Perserve State and CORS Question? #84

Open doomsayer2 opened 2 years ago

doomsayer2 commented 2 years ago

I am developing a custom template with some additional features for the user. They will be able to generate new elements for the visualization inside the template. However I am facing some issues.

I am substantially further then I was before, but I would really need help now. I need to save some custom things in the state so it gets perserved when the user works on the template. I have created a variable in the state called "store" which is set programmatically. E.g. whenever a new element is added by the user through a button click. However it doesn't save it in the state or persist it in the live version or preview. The issue I found is that you have to have a respective settings field in order to trigger a save. I also tried to trigger it with window.parent.document.getElementById('setting-store') but then i get a CORS on the preview. Althoug it works on localhost.

So my questions would be:

Thanks :D Thanks for help :D

doomsayer2 commented 2 years ago

Would really appreciate some help if someone knows anything. I am working now 2 months on this and trying around.