Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DG.subgraph does not output %DG{} #24

Closed
jdewar opened this issue Sep 26, 2023 · 2 comments · Fixed by #25
Closed

DG.subgraph does not output %DG{} #24

jdewar opened this issue Sep 26, 2023 · 2 comments · Fixed by #25

Comments

@jdewar
Copy link
Contributor

jdewar commented Sep 26, 2023

I had a DG that was too large to print together so I did some edge snipping to make several components to display. I found that I had to manually shove the output of DG.subgraph into a DG struct.

components =
  dg
  |> DG.components()
  |> Enum.map(fn vertices ->
    new_dg = DG.subgraph(dg, vertices, keep_labels: true)
    %DG{dg: new_dg, opts: []}
  end)

components |> Enum.at(0) |> inspect |> Kino.Mermaid.new()
@princemaple
Copy link
Owner

Congrats. You probably used the library more than anyone else :) I never tried that function.

Do you want to send a PR? I will find the time to do it if you don't. Thanks for reporting.

@jdewar
Copy link
Contributor Author

jdewar commented Sep 27, 2023

Took a swing at it. Being able to output mermaid into a Livebook cell was the feature that had me use this library, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants