Skip to content

Instantly share code, notes, and snippets.

@zioalex
Last active July 18, 2024 12:48
Show Gist options
  • Save zioalex/c426a25475757722b2f1c560e1c7c56b to your computer and use it in GitHub Desktop.
Save zioalex/c426a25475757722b2f1c560e1c7c56b to your computer and use it in GitHub Desktop.
mermaid

Install mermaid cli

npm i mermaid-cli

Run it with

See the sample file here

mmdc -t default -i test.mmd -o process1.png -p ./puppepteerConfigFile.json

Sample file

graph TD
A[Start] --> E{Launch the Data Analysis script<BR> <b><i>python data_analysis.py</b></i>}
E --> I[Output example <i>Processing data in ./data_output/2024-03-11_10-01/PROJECT-XYZ/Analysis - PROD- DataFile.txt_analysis.json<BR>AnalyzerName: PostgresDB, Confirmed: 0, Not Confirmed: 24 Project Total Records: 24 Total Records: 1405</i>]
I --> K{Initiate report generation and notification sending <b><i>python notification.py</b></i>}
K --> L[Notification is sent following the template <b><i>mail_templates/notification_template_attachment.html</b></i>]
L --> M[Output example <i>Record: 2 projects without projectManager 0 projects with projectManager Found a total number of 5 impacted data records<BR> Sent a total number of 0 notifications</i> Notification sending process needs to be enabled with the flag <b><i>--send_notifications</b></i> ]
M --> P[Output files created <i>notification_CURRENT_DATE.txt notification_CURRENT_DATE_brief.csv</i> used later for data analysis]
P --> Q[Usually, a 1 month notice period is given to address the issues.]
Q --> S[End]

Linux Sandbox issue

If you are running in a container you could have the follow sandbox problem because of lack of Docker permission.

If updating docker permission is not possible, though advisable, you can disable the sandbox execution 1.

Create a json file like this called puppeteerConfigFile.json:

{
  "args": ["--no-sandbox"]
}

Low resolution on PNG files

Just found out that if you have long lines the end resolution with be very low. You can break them with <BR> and it should better.

See 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment