You signed in with another tab or window. Reload t
8000
o refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to wrap this graph library in a api so I can interact with it from a web page. I have got a basic graph built with my custom vertex type. i have a Fiber route and provides access to my basic graph . When I attempt to marshal the graph to JSON in Fiber, I get an empty string.
To my inexperienced eye, it looks like I should use the Store interface. I should store the graph somewhere (like memory?) and then marshal/unmarshal the stored graph. Does that sound like the right/best approach?
Activity
emilykmarx commentedon May 28, 2026
I didn't see any built-in support in the library, but I had success with this -
To marshal:
Edges()) and vertices (viaDFS()with a visit function that callsVertex()and appends to an array)MarshalJSON()on my node typeTo unmarshal:
UnmarshalJSON())AddVertex()andAddEdge())