wallento / wavedrompy

WaveDrom compatible python command line
Other
94 stars 21 forks source link

Incorrect behavior for bold title and invalid SVG output #16

Closed JasperCraeghs closed 4 years ago

JasperCraeghs commented 4 years ago

The JSON below doesn't produce the same output as wavedrom tool. When converting the SVG to PDF format with cairosvg in GitLab CI using a docker image the following Exception is raised and a blank canvas in PDF is generated:

wavedrompy: screenshot 15 wavedrom: screenshot 16

{
    "signal": [
        {
            "wave": "|nh....nh.nhn.xnhnh..|."
        },
        {
            "wave": "x=.....=..=..x|=.=...=.",
            "data": [
                "Calib.",
                "Stat./Comm.",
                "N data nibbles",
                "CRC",
                "Pause",
                "Calib."
            ]
        },
        {
            "node": "...................1.2."
        }
    ],
    "edge": [
        "1<->2 Interrupt"
    ],
    "head": {
        "text": [
            "tspan",
            [
                "tspan",
                {
                    "font-weight": "bold"
                },
                "SENT message signal timing diagram"
            ]
        ]
    }
}
Exception occurred:
  File "/usr/local/lib/python3.7/dist-packages/cairosvg/parser.py", line 419, in __init__
    'No tag with id="{}" found.'.format(element_id))
TypeError: No tag with id="|||" found.

When the cariosvg Exception is not raised (during a local build in docer), I end up with the following conversion to PDF:

invalid_diagram

To me this looks related to https://github.com/bavovanachte/sphinx-wavedrom/issues/13. Can I expect a fix soon or should I resort to other means for the time being?

wallento commented 4 years ago

Hi,

I think you mixed the two images wavedrom vs. wavedrompy, right? Can you please update to the latest master, the title issue has been fixed the last couple of days. The problem with cairo is related to that the first one is a gap. I think it is very easy to fix, but cannot promise it until Monday.

Cheers, Stefan

JasperCraeghs commented 4 years ago

Hi,

Yes, I did mix them up. I edited the post to fix it. A release on Monday would be awesome!

Thank you very much already!

wallento commented 4 years ago

Fixed, tracked by test/files/issue_16.json and part of wavedrompy:2.0.3.post1

Thanks for reporting and have a good weekend!

wallento commented 4 years ago

@JasperCraeghs I have added infrastructure to automatically ensure that regression json files still render identically as wavedrom. Do you think you can contribute some from your project?

JasperCraeghs commented 4 years ago

I most likely do. I will look into this. Good weekend to you too!

JasperCraeghs commented 4 years ago

I can confirm that the fix works.