feature request: possibility to remove dotted lines #10

Closed
opened 2025-07-09 18:59:56 +00:00 by bernsteining · 4 comments

Hey,

First of all thanks a lot for chronos, it helps me a lot to write my courses in typst, and the examples are perfect.

However, I was asking myself if there's a way to remove the dotted line when calling _par("Participant").

I'm using a mock partipant "Charlie" as follows to express an insecure channel where an eavesdropper could be, and the dotted lines are mixed with the messages "Alice" and "Bob" are exchanging, thus reducing readability.

Maybe there's a workaround without using a mock participant ? Or maybe adding such a feature (removing dotted lines) could make chronos even better.

Here's the typst code snippet showcasing my problem, with a screenshot of the compiled result.

#chronos.diagram({
  import chronos: *
  _par("Alice")
  _par("Insecure Channel: Charlie")
  _par("Bob")

_sync({
    _seq("Bob", "Alice", comment: "Parameters agreement: p, g", comment-align: "center")
    _seq("Alice", "Bob", comment: "")
  })

  _seq("Alice", "Bob", comment: $A = g^a$, comment-align: "center")
  _seq("Bob", "Alice", comment: $B = g^b$, comment-align: "center")
  _sync({
    _seq("Bob", "Bob", comment: $s = A^b = g^(a b)$, comment-align: "start")
    _seq("Alice", "Alice", comment: $s = B^a = g^(a b)$, comment-align: "start", flip:true)
  })
})

If adding such a feature sounds interesting to you, I would be pleased to have a look to the source code of chronos in order to implement it, if you give me pointers.

Otherwise, I'm curious about workarounds, as I didn't find a suitable one when looking at the examples.

Cheers,

Hey, First of all thanks a lot for `chronos`, it helps me a lot to write my courses in `typst`, and the examples are perfect. However, I was asking myself if there's a way to remove the dotted line when calling `_par("Participant")`. I'm using a mock partipant "Charlie" as follows to express an insecure channel where an eavesdropper could be, and the dotted lines are mixed with the messages "Alice" and "Bob" are exchanging, thus reducing readability. Maybe there's a workaround without using a mock participant ? Or maybe adding such a feature (removing dotted lines) could make `chronos` even better. Here's the `typst` code snippet showcasing my problem, with a screenshot of the compiled result. ```typst #chronos.diagram({ import chronos: * _par("Alice") _par("Insecure Channel: Charlie") _par("Bob") _sync({ _seq("Bob", "Alice", comment: "Parameters agreement: p, g", comment-align: "center") _seq("Alice", "Bob", comment: "") }) _seq("Alice", "Bob", comment: $A = g^a$, comment-align: "center") _seq("Bob", "Alice", comment: $B = g^b$, comment-align: "center") _sync({ _seq("Bob", "Bob", comment: $s = A^b = g^(a b)$, comment-align: "start") _seq("Alice", "Alice", comment: $s = B^a = g^(a b)$, comment-align: "start", flip:true) }) }) ``` If adding such a feature sounds interesting to you, I would be pleased to have a look to the source code of `chronos` in order to implement it, if you give me pointers. Otherwise, I'm curious about workarounds, as I didn't find a suitable one when looking at the examples. Cheers,
HEL added the
enhancement
good first issue
labels 2025-07-09 20:13:15 +00:00
Owner

Thank you for using chronos and taking the time to open this issue !
Removing the dotted line is indeed not currently possible
Hereunder are some workarounds (including yours)

I will also look into adding an option to either style the line or remove it entirely (shouldn't be too complex)

If you have any other questions or feel like a feature is missing, don't hesitate to open a new issue

#let body = {
  import chronos: *
  _sync({
    _seq("Bob", "Alice", comment: "Parameters agreement: p, g", comment-align: "center")
    _seq("Alice", "Bob", comment: "")
  })

  _seq("Alice", "Bob", comment: $A = g^a$, comment-align: "center")
  _seq("Bob", "Alice", comment: $B = g^b$, comment-align: "center")
  _sync({
    _seq("Bob", "Bob", comment: $s = A^b = g^(a b)$, comment-align: "start")
    _seq("Alice", "Alice", comment: $s = B^a = g^(a b)$, comment-align: "start", flip:true)
  })
}

#chronos.diagram({
  import chronos: *
  _par("Alice")
  _par("Insecure Channel: Charlie")
  _par("Bob")

  body
})

#chronos.diagram({
  import chronos: *
  _par("Alice")
  _par("Bob")

  _sep[Insecure Channel: Charlie]

  body
})

#chronos.diagram({
  import chronos: *
  _par("Alice")
  _par("Bob")

  _seq(
    "Alice", "Bob",
    comment: [Insecure Channel: Charlie],
    color: luma(0%).transparentize(100%),
    comment-align: "center"
  )

  body
})
Thank you for using chronos and taking the time to open this issue ! Removing the dotted line is indeed not currently possible Hereunder are some workarounds (including yours) I will also look into adding an option to either style the line or remove it entirely (shouldn't be too complex) If you have any other questions or feel like a feature is missing, don't hesitate to open a new issue ```typst #let body = { import chronos: * _sync({ _seq("Bob", "Alice", comment: "Parameters agreement: p, g", comment-align: "center") _seq("Alice", "Bob", comment: "") }) _seq("Alice", "Bob", comment: $A = g^a$, comment-align: "center") _seq("Bob", "Alice", comment: $B = g^b$, comment-align: "center") _sync({ _seq("Bob", "Bob", comment: $s = A^b = g^(a b)$, comment-align: "start") _seq("Alice", "Alice", comment: $s = B^a = g^(a b)$, comment-align: "start", flip:true) }) } #chronos.diagram({ import chronos: * _par("Alice") _par("Insecure Channel: Charlie") _par("Bob") body }) #chronos.diagram({ import chronos: * _par("Alice") _par("Bob") _sep[Insecure Channel: Charlie] body }) #chronos.diagram({ import chronos: * _par("Alice") _par("Bob") _seq( "Alice", "Bob", comment: [Insecure Channel: Charlie], color: luma(0%).transparentize(100%), comment-align: "center" ) body }) ```
Owner

With #11, you should now be able to completely hide the line by setting its stroke to none

As mentioned in the PR, I plan on adding more control over styling by using CeTZ' builting styles system, but this should already do the trick for the example you provided

Reusing the previous example:

#chronos.diagram({
  import chronos: *
  _par("Alice")
  _par("Insecure Channel: Charlie", line-stroke: none)
  _par("Bob")

  body
})

example_1.png

Or even nicer:

#chronos.diagram({
  import chronos: *
  _par("Alice")
  _par(
    "Charlie",
    display-name: align(center)[*Insecure Channel:\ Charlie*],
    line-stroke: none,
    show-bottom: false,
    shape: "actor"
  )
  _par("Bob")

  body
})

example_2.png

With #11, you should now be able to completely hide the line by setting its stroke to `none` As mentioned in the PR, I plan on adding more control over styling by using CeTZ' builting styles system, but this should already do the trick for the example you provided Reusing the previous example: ```typst #chronos.diagram({ import chronos: * _par("Alice") _par("Insecure Channel: Charlie", line-stroke: none) _par("Bob") body }) ``` ![example_1.png](/attachments/3ba7813a-13e6-454e-8526-1533f0e6a5f3) Or even nicer: ```typst #chronos.diagram({ import chronos: * _par("Alice") _par( "Charlie", display-name: align(center)[*Insecure Channel:\ Charlie*], line-stroke: none, show-bottom: false, shape: "actor" ) _par("Bob") body }) ``` ![example_2.png](/attachments/5c23daa5-3549-4f85-a1b7-38c90dd1609b)
Author

Wow, thank you so much ! That was fast :)

I managed to install the dev branch locally, and it works like charm.

Good job !

Wow, thank you so much ! That was fast :) I managed to install the `dev` branch locally, and it works like charm. Good job !
Owner

Great, I'll close this issue then
I don't plan on making a new release just now though, as there are other things I'd like to add

Great, I'll close this issue then I don't plan on making a new release just now though, as there are other things I'd like to add
HEL closed this issue 2025-07-11 10:11:43 +00:00
Sign in to join this conversation.
No description provided.