schradert / sage

Process design and tracking application
GNU Affero General Public License v3.0
0 stars 0 forks source link

Single graph selector #24

Closed schradert closed 1 month ago

schradert commented 1 month ago

Closes #22

This introduces a single option combox selector in a xyflow panel to choose the graph to display in the xyflow flow diagram. It comes with another dummy diagram (a simplified recipe for making tacos) that we will soon connect and try to visualize together.

There is also some slight refactoring here to clarify the difference between our "database" (temporary localStorage) and just frontend stores that will reset when the application is reloaded. This came with the introduction of svelte-writable-derived which makes synchronizing interdependent svelte stores trivial.

One caveat with this choice is that, while dependent stores are reevaluated, they do not reactively trigger reloading dependent components, like the SvelteFlow diagram at the center of anything, so we introduce a basic refreshGraph function to force that and also refit the view.