pkg/workflows/sdk: add DependencyGraph.FormatChart for mermaid flowcharts
This PR adds DependencyGraph.FormatChart for visualizing workflows as mermaid flowcharts.
I split out the builder changes to #821, so this PR is now just flowcharts for the existing types.
I swapped over to using the DependencyGraph.Graph, but it appears to be incomplete so I need to figure out how to augment it with the trigger dependencies. Back to draft for now.
Hey @jmank88 , I am trying to figure out how we provide the visual to users via CLI. From the dev platform CLI perspective,
- We get the paths of local files from users and get the wasm binary and config as byte[]
- We can get an instance of WorkflowSpec via GetWorkflowSpec
- We can call something like GetChart() to get the visual? Is the visual a SVG or image to the local?
Want to hear your thoughts on the flow, and how to integrate. Thanks! This comment is a copy-pasta from link
Hey @jmank88 , I am trying to figure out how we provide the visual to users via CLI. From the dev platform CLI perspective,
- We get the paths of local files from users and get the wasm binary and config as byte[]
- We can get an instance of WorkflowSpec via GetWorkflowSpec
- We can call something like GetChart() to get the visual? Is the visual a SVG or image to the local?
Want to hear your thoughts on the flow, and how to integrate. Thanks! This comment is a copy-pasta from link
I refactored the method to be on DependencyGraph instead, but yes you can just call FormatChart(). However, it returns text to be interpreted by Mermaid for visualization, so we'd have to call in to that library for rendering to SVG or anything else.
Edit: But we might not be pursuing this direction any longer :cry:
Returning text and we (client) render with Mermaid sounds great to me. This is gonna be a very useful feature from Dev Platform side.
But we might not be pursuing this direction any longer
May I know the new direction?