Skip to content

Comments

H-6236: Add 'export as TikZ' option for Petrinaut#8439

Merged
CiaranMn merged 3 commits intomainfrom
cm/tikz-petrinaut-output-format
Feb 18, 2026
Merged

H-6236: Add 'export as TikZ' option for Petrinaut#8439
CiaranMn merged 3 commits intomainfrom
cm/tikz-petrinaut-output-format

Conversation

@CiaranMn
Copy link
Member

🌟 What is the purpose of this PR?

Adds an option to export Petrinaut nets as TikZ diagrams (net structure only).

The motivation is to make it easier to include nets created in Petrinaut in mathematical papers.

Since we now have 3 'export as...' options, I also moved these into an 'Export' sub-menu.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

❓ How to test this?

  1. Visit the preview deployment
  2. Load an example (or create your own)
  3. Menu -> Export -> TikZ

📹 Demo

Output / Compiled

Screenshot 2026-02-18 at 18 36 46

@CiaranMn CiaranMn requested a review from kube February 18, 2026 18:40
@vercel
Copy link

vercel bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
petrinaut Ready Ready Preview, Comment Feb 18, 2026 6:59pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
hash Ignored Ignored Preview Feb 18, 2026 6:59pm
hashdotdesign Ignored Ignored Preview Feb 18, 2026 6:59pm
hashdotdesign-tokens Ignored Ignored Preview Feb 18, 2026 6:59pm

@cursor
Copy link

cursor bot commented Feb 18, 2026

PR Summary

Low Risk
Primarily adds a new client-side export format and minor UI/menu wiring; low risk aside from potential formatting/labeling edge cases in generated TikZ.

Overview
Adds a new TikZ/LaTeX export path for Petrinaut nets, generating a standalone .tex document that preserves node positions (scaled), escapes labels, and annotates non-1 arc weights.

Updates the editor menu so Export becomes a submenu with JSON, JSON without visual info, and TikZ, and tweaks JSON export filenames to replace : in ISO timestamps for safer downloads. A changeset bumps @hashintel/petrinaut with a patch release note.

Written by Cursor Bugbot for commit 6356c98. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team labels Feb 18, 2026
@augmentcode
Copy link

augmentcode bot commented Feb 18, 2026

🤖 Augment PR Summary

Summary: Adds a new “Export as TikZ” option in Petrinaut to generate a standalone LaTeX/TikZ diagram of the net structure.

Changes:

  • Introduces a new TikZ export helper that renders places, transitions, and arcs (including arc weights).
  • Escapes LaTeX special characters in labels and applies basic label formatting (camelCase splitting + wrapping for long labels).
  • Preserves the net’s visual layout by converting SDCPN x/y positions into scaled TikZ coordinates.
  • Reorganizes existing export actions into an Export submenu (JSON / JSON without visual info / TikZ).

Technical Notes: The TikZ export emits a standalone document using the standalone class and TikZ arrows.meta with Stealth arrowheads.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@graphite-app graphite-app bot requested review from a team February 18, 2026 18:46
kube
kube previously approved these changes Feb 18, 2026
Copy link
Collaborator

@kube kube left a comment

Choose a reason for hiding this comment

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

👍

I guess we'll need to move export/import and transformers from views/Editor/lib later.

@github-actions github-actions bot dismissed kube’s stale review February 18, 2026 18:56

Your organization requires reapproval when changes are made, so Graphite has dismissed approvals. See the output of git range-diff at https://github.com/hashintel/hash/actions/runs/22153345099

@CiaranMn CiaranMn requested a review from kube February 18, 2026 18:56
@CiaranMn CiaranMn enabled auto-merge February 18, 2026 18:56
@CiaranMn CiaranMn added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit 9741121 Feb 18, 2026
46 checks passed
@CiaranMn CiaranMn deleted the cm/tikz-petrinaut-output-format branch February 18, 2026 19:09
@hashdotai hashdotai mentioned this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants