huynd2210 / GraphToMermaid

Convert any graph-like data structures to mermaid code and vice versa.
1 stars 0 forks source link

mermaid_to_graph should additionally convert to a class if given #12

Closed huynd2210 closed 1 day ago

huynd2210 commented 1 day ago

As of right now, the output of mermaid_to_graph function outputs either MermaidToGraphAdapter or nx.Graph.

Fix it so that when a class is given, it should convert to said class. If no class is given, then keep the current functionality (convert to MermaidToGraphAdapter or nx.Graph)

Example of usage:

graph = mermaid_to_graph(mermaid_code, graph, target_class=CustomGraph)
print(isinstance(graph, CustomGraph) # True
huynd2210 commented 1 day ago

Feature unneeded/present