Skip to content

feat: save visualizer html#236

Merged
Thijss merged 12 commits into
mainfrom
pgm/save-visualizer-html
May 26, 2026
Merged

feat: save visualizer html#236
Thijss merged 12 commits into
mainfrom
pgm/save-visualizer-html

Conversation

@jaapschoutenalliander

Copy link
Copy Markdown
Member
  • Added save_html(grid, path) to visualizer.py — exports the grid as a standalone HTML file without starting the Dash server
  • New html_export.py module handles HTML generation: embeds graph elements, stylesheet, and layout as JSON with Cytoscape.js
  • Docs updated with usage example and parameter table; two unit tests cover default and non-default parameter paths

Signed-off-by: Jaap Schouten <jaap.schouten@alliander.com>
Signed-off-by: Jaap Schouten <jaap.schouten@alliander.com>
Signed-off-by: Jaap Schouten <jaap.schouten@alliander.com>
Signed-off-by: Jaap Schouten <jaap.schouten@alliander.com>

@vincentkoppen vincentkoppen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice addition. Haven't tested/viewed the HTML, but the code to maintain this doesn't seem to bad.

Maybe some of the setup surround the layout/stylesheet can be shared even more with the actual app. But if not, this seems fine to me.

@jaapschoutenalliander jaapschoutenalliander marked this pull request as ready for review May 2, 2026 17:17
@Thijss

Thijss commented May 4, 2026

Copy link
Copy Markdown
Member

Looks promising! This has been requested for quite a while I believe 👍 . I'll review later this week

@Thijss Thijss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it locally.

The HTML only contains the graph. The top and bottom sections are not included. In the future we could look whether that is feasible/desirable too (but we'd have to move logic to the JS side instead of Python).

For now, nice addition!

Thijss and others added 2 commits May 11, 2026 08:22
Signed-off-by: Jaap Schouten <jaap.schouten@alliander.com>
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@Thijss Thijss merged commit 8a48c78 into main May 26, 2026
15 checks passed
@Thijss Thijss deleted the pgm/save-visualizer-html branch May 26, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants