Generating Diagram Data with Power Automate
To re-generate the data for my diagram I was going to use Power Automate to extract data from the Microsoft List and then format the json data and update the data.json file in blob storage. You could probably use Logic Apps or Powe Automate or other workflow tools to easily do this depending on where you want to deploy the app.
My flow started by getting the items from the list using the SharePoint connector like below
I would then iterate over the items (remember to set your concurrency to 1) like below to build up the json array for the data.json file
One point to note is because I am using lookup columns sometimes it can be a reference to a list of items such as the project and program shown in the image. I know there will only be 1, but this is just how the designer generates the flow. I will look to get the program and project in a variable or you could do an expression if you want too. I then compose my json object to go in the array
Im then formatting my json array variable as a string and saving it to the blob
The last bit is that I wanted to refresh the css and index.html from github each time my flow runs to it picks up the latest. You may choose to do or not to do this step but its easy to do with the http connector.