Skip to content

Commit

Permalink
fix(render/dot): makes the 'width' attribute on transitions with a no…
Browse files Browse the repository at this point in the history
…te attached is heeded at all
  • Loading branch information
sverweij committed Dec 24, 2024
1 parent 8ce2805 commit af76f8f
Show file tree
Hide file tree
Showing 18 changed files with 467 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dist/render/dot/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<meta name="google-site-verification" content="K0j5zueKp7lYKMR7WihmcTJbLpHxBOpaXZEI_s0nHTw" />
<link rel="canonical" href="https://state-machine-cat.js.org">
<script nonce="known-inline-script">let LOG = false;</script>
<script src="smcat-online-interpreter.min.js" type="module" defer integrity="sha512-zjUJ8dw8zn8908zjtSts2zmnouMJPiv05qBf8h7cNVzop1iUTlpykP4Qp8jQxW2E2vXBOww4ccROAyQvHfcHKA=="></script>
<script src="smcat-online-interpreter.min.js" type="module" defer integrity="sha512-IgVDLqTCVyaJd467fILElqG3A2ZJG/2kJ7P3hdgcoFueUQndUY6YwRwLTDCJ1+nO2FMNvnkNfwtOqBA45DZ16A=="></script>
<script defer src="https://code.getmdl.io/1.3.0/material.min.js" async></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DCPVBY7NNV"></script>
<script nonce="known-inline-script">
Expand Down
2 changes: 1 addition & 1 deletion docs/inpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
src="state-machine-cat-inpage.min.js"
type="module"
defer
integrity="sha512-LFjbu8zQaX4Yv+8MXwVw0ytPOVkayTEIBsQIz+Lc9zI0hflRo4Idiu8VeihNl/8yjxgisEDoPPTO/GpPbAU+vQ=="
integrity="sha512-gwYByERsER+mF5G3WZMruQnkvMtangWaNYUy4m/fIssvgcHiwEt/3Oil00QEFzilirf0JaKetZeUNkP8VU6gMQ=="
></script>
<style>
body { font-family: sans-serif; margin: 0 auto; max-width: 799px;
Expand Down
6 changes: 3 additions & 3 deletions docs/smcat-online-interpreter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/smcat-online-interpreter.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/state-machine-cat-inpage.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/state-machine-cat-inpage.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/render/dot/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ function transition(
const lNoteName = `note_${lTransitionName}`;
const lNoteNodeName = `i_${lNoteName}`;
const lNoteNode = `\n${pIndent} "${lNoteNodeName}" [shape=point style=invis margin=0 width=0 height=0 fixedsize=true]`;
const lTransitionFrom = `\n${pIndent} "${pTransition.from}" -> "${lNoteNodeName}" [arrowhead=none${lTail}${lColorAttribute}]`;
const lTransitionTo = `\n${pIndent} "${lNoteNodeName}" -> "${pTransition.to}" [label="${lLabel}"${lHead}${lColorAttribute}${lFontColorAttribute}]`;
const lTransitionFrom = `\n${pIndent} "${pTransition.from}" -> "${lNoteNodeName}" [arrowhead=none${lTail}${lColorAttribute}${lPenWidth}]`;
const lTransitionTo = `\n${pIndent} "${lNoteNodeName}" -> "${pTransition.to}" [label="${lLabel}"${lHead}${lColorAttribute}${lFontColorAttribute}${lPenWidth}]`;
const lLineToNote = `\n${pIndent} "${lNoteNodeName}" -> "${lNoteName}" [style=dashed arrowtail=none arrowhead=none weight=0]`;
const lNote = `\n${pIndent} "${lNoteName}" [label="${noteToLabel(pTransition.note)}" shape=note fontsize=10 color=black fontcolor=black fillcolor="#ffffcc" penwidth=1.0]`;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
digraph "state transitions" {
fontname="Helvetica" fontsize=12 penwidth=2.0 splines=true ordering=out compound=true overlap=scale nodesep=0.3 ranksep=0.1
node [shape=plaintext style=filled fillcolor="#FFFFFF01" fontname=Helvetica fontsize=12 penwidth=2.0]
edge [fontname=Helvetica fontsize=10]

"a" [margin=0 class="state regular" label= <
<table align="center" cellborder="0" border="2" style="rounded" width="48">
<tr><td width="48" cellpadding="7">a</td></tr>
</table>
>]
"i_note_tr_a_b_1" [shape=point style=invis margin=0 width=0 height=0 fixedsize=true]
"a" -> "i_note_tr_a_b_1" [arrowhead=none penwidth=2]
"i_note_tr_a_b_1" -> "b" [label=" \l" penwidth=2]
"i_note_tr_a_b_1" -> "note_tr_a_b_1" [style=dashed arrowtail=none arrowhead=none weight=0]
"note_tr_a_b_1" [label="this is a note on the transition a --> b\l" shape=note fontsize=10 color=black fontcolor=black fillcolor="#ffffcc" penwidth=1.0]
"b" [margin=0 class="state regular" label= <
<table align="center" cellborder="0" border="2" style="rounded" width="48">
<tr><td width="48" cellpadding="7">b</td></tr>
</table>
>]

}
Loading

0 comments on commit af76f8f

Please sign in to comment.