Skip to content

ShowGraph: RenderEdges and RenderVertices get their own options again - #6

Merged
rocky merged 1 commit into
masterfrom
fix-render-options
Oct 30, 2026
Merged

rocky merged 1 commit into
masterfrom
fix-render-options

Conversation

@tombouctou

Copy link
Copy Markdown
Contributor

Found while running the examples of Skiena and Pemmaraju's Computational Discrete Mathematics with this package under Mathics3, comparing every result with WMA 15.

Options[RenderEdges] and Options[RenderVertices] are now the literal slices of Options[ShowGraph] that WMA's Take gives:

  • edges: EdgeColor, EdgeStyle, EdgeLabel, EdgeLabelColor, EdgeLabelPosition, LoopPosition, EdgeDirection
  • vertices: VertexColor, VertexStyle, VertexNumber, VertexNumberColor, VertexNumberPosition, VertexLabel, VertexLabelColor, VertexLabelPosition

Taken from Options[ShowGraph], which Mathics3 listed sorted by name, they picked up the wrong options, and every ShowGraph gave Part::partw/Part::partd messages. That was about 250 of the book's examples. Mathics3/mathics-core#2082 keeps the order of Options as set, which fixes the root cause; this PR makes the package independent of it.

Package tests: 18 passed.

🤖 Generated with Claude Code

Options[RenderEdges] held vertex options and Options[RenderVertices]
edge options (with a comma missing), so RenderEdges found no
EdgeDirection and every ShowGraph printed Part::partw and Part::partd.
They are now the last 7 and the first 8 options of ShowGraph, as the
original Take[Options[ShowGraph], ...] gives in WMA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rocky

rocky commented Oct 30, 2026

Copy link
Copy Markdown
Member

Thanks!

@rocky
rocky merged commit 995d355 into master Oct 30, 2026
1 check passed
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.

2 participants