Whenever a sequence is known (i.e. before #917 - and also with that, when it can be compiled), it would be nice to have a schematic representation of it.
The plot itself is already nice (and should be maintained), but some pulses are very short in comparison to others, making them less evident.
A possible way of schematic drawing could be to make it similar to a circuit:
draw each (logical) channel as a wire
draw each pulse (or pulse-like) as a box on a wire, with a label and fixed length
the explicit delays should be drawn differently (e.g. without the box, just as a label over the wire)
If the bixes' length is fixed, the only thing to determine is the initial position of each one (including delays, treated as phantom boxes).
For this, we should make a function that is processing the sequence, and returning these initial positions.
The algorithm could inspect the pulses with a queue-like approach:
sort all pulses by initial time
group together those with exactly the same timing (possibly up to a certain precision), assigning the group the max length of pulses within the group
process pulses one (group) at a time, deciding whether is entirely after any of the former ones:
if yes, put it after the maximum end of the pulses it is after
otherwise, just advance its start by a fixed amount wrt the last start
The fixed amount could depend on the box length (e.g. one quarter of a box) or something like that, or in relation to a proxy for the (yet) unknown channel length (e.g. box length * maximum number of boxes per wire).
But in general, the algorithm is approximate to make drawing "nice" (subjective) and meaningful (causal relations are respected, as much as possible). Thus, we could expose some arbitrary choices as parameters of the algorithm.
This information can then be consumed to create a simple diagram with characters or svg (this last one as a standalone graphics, or to be emitted in Jupyter notebooks).
Whenever a sequence is known (i.e. before #917 - and also with that, when it can be compiled), it would be nice to have a schematic representation of it.
The plot itself is already nice (and should be maintained), but some pulses are very short in comparison to others, making them less evident.
A possible way of schematic drawing could be to make it similar to a circuit:
If the bixes' length is fixed, the only thing to determine is the initial position of each one (including delays, treated as phantom boxes). For this, we should make a function that is processing the sequence, and returning these initial positions. The algorithm could inspect the pulses with a queue-like approach:
The fixed amount could depend on the box length (e.g. one quarter of a box) or something like that, or in relation to a proxy for the (yet) unknown channel length (e.g. box length * maximum number of boxes per wire). But in general, the algorithm is approximate to make drawing "nice" (subjective) and meaningful (causal relations are respected, as much as possible). Thus, we could expose some arbitrary choices as parameters of the algorithm.
This information can then be consumed to create a simple diagram with characters or svg (this last one as a standalone graphics, or to be emitted in Jupyter notebooks).