pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

Feature: export method to code export nodes and edges as json

Open bitprofve opened this issue 2 years ago • 3 comments

It would be very useful if you could export a function in the library that allows us to export the nodes and edges through code, not only through ui (the shareable property on the Svelvet componentet).

Example methods like:

getNodesAsJSON(canvasId) getEdgesAsJSON(canvasId)

example of (dummy)usage showing what such an implementations could look like:

import Svelvet from "svelvet"; import { getNodesAsJSON, getEdgesAsJSON } from 'svelvet'; // these methods could be exported by Svelvet

<Svelvet {...svelvetconfig} bind:canvasId={canvasId} />

{JSON.stringify( getNodesAsJSON(canvasId) )}>

{JSON.stringify( getEdgessAsJSON(canvasId) )}>

bitprofve avatar Apr 07 '23 15:04 bitprofve

Similar #229

rohanrajpal avatar Apr 09 '23 06:04 rohanrajpal

+1 It would be very useful to have an import/export feature

marco-santini avatar May 07 '23 11:05 marco-santini

Similar #229

@rohanrajpal This is not similar to the requirement of two way binding. Exporting to JSON would allow for programmatic parsing for other requirements eg: NoCode tools etc. Exporting as JSON should be a critical feature, IMO.

rungdung avatar Jun 22 '23 04:06 rungdung