Mermaid-Chart / vscode-mermaid-preview

Previews Mermaid diagrams
MIT License
148 stars 16 forks source link

links apparently not sufficiently styled by default for `graph` #13

Closed g3o2 closed 7 years ago

g3o2 commented 8 years ago

The following code in vscode version 1.7.1 (Mac OS X Sierra) does not draw the links but only the arrows of the links

    ```mermaid
    graph TB;
        A-->B;
        B-->C;
        C-->A;

![screen shot 2016-11-08 at 23 12 11](https://cloud.githubusercontent.com/assets/12123506/20119478/f83e34a8-a608-11e6-8009-3f2b588fba89.png)

It does not matter which color theme is chosen in vscode. It appears to be due to a lack of (default) styling of the links, i.e. probably `stroke` set to `none` or something like that.

![screen shot 2016-11-08 at 23 14 01](https://cloud.githubusercontent.com/assets/12123506/20119528/24fc7824-a609-11e6-92cf-1d699319260d.png)
g3o2 commented 8 years ago

It would also be more convenient if fill be set to none by default.

The following links would look weird.

    ```mermaid
    graph TB;

      A-->B
      linkStyle 0 stroke:gray;
      B-->C
      linkStyle 1 stroke:gray;
      C-->A
      linkStyle 2 stroke:gray;

![screen shot 2016-11-08 at 23 16 06](https://cloud.githubusercontent.com/assets/12123506/20119607/7d8678aa-a609-11e6-8d8d-affd11e6a61d.png)

The fix would be:
```mermaid
graph TB;

  A-->B
  linkStyle 0 stroke:gray,fill:none;
  B-->C
  linkStyle 1 stroke:gray,fill:none;
  C-->A
  linkStyle 2 stroke:gray,fill:none;
```


![screen shot 2016-11-08 at 23 16 38](https://cloud.githubusercontent.com/assets/12123506/20119616/869173dc-a609-11e6-8a86-e098ce81af3e.png)
g3o2 commented 8 years ago

Finally, the arrow-head with its dark gray for dark themes is not very legible. The color code gray should be more legible.

g3o2 commented 8 years ago

It occurs to me that all this may be related to the preview stylesheets conflict described in #2.

vstirbu commented 8 years ago

Thanks for pointing this out. Seems that at least in 1.7 the previewHtml functionality used by the plugin has changed. The styles do not work as expected. Investigating...

vstirbu commented 8 years ago

@g3o2 can you post screen captures of what is displayed on your machine. Also the information about your configuration would be useful.

g3o2 commented 8 years ago

Done.

vstirbu commented 8 years ago

Thanks for adding the captures!

Made some initial investigation and so far I have seen on my machine that the rendering of the diagram does not yield always the same result.

Can you check if you get the correct rendering by following this procedure:

  1. open the preview view
  2. close it
  3. open it again
g3o2 commented 8 years ago

Voilà, here's what I've done.

  1. - 3. as requested

screen shot 2016-11-09 at 23 15 18

Then,

  1. Click outside of the diagram code.
  2. Click back onto the diagram code.

screen shot 2016-11-09 at 23 15 34

vstirbu commented 8 years ago

yes, exactly the same here. seems that the plugin works well only after the second activation and only for the first rendering, subsequent updates are not rendered correctly.

g3o2 commented 8 years ago

not quite. try closing the code tab after that, then suddenly the preview works again (for that moment of course)

g3o2 commented 7 years ago

The said issue has reappeared. Do you have any tests in place to check for past issues ?

vstirbu commented 7 years ago

On which vscode version are you?

It is not possible to test what is actually happening inside the viewer component, beyond the input markup.

g3o2 commented 7 years ago

I'm on 1.11.2.

That's truly a pity, it would be much more convenient to be able to fetch the styles from the output markup. Hmm, how about providing a markdown file with specs that should work ? (maybe including a png version to compare with) That way, anyone could perform the tests and notify the issues.

agusmba commented 7 years ago

I just tried this plugin for the first time after updating vscode today (there was a reference to this plugin in the release notes).

I'm experiencing this same issue, no arrows visible on the first test diagram (the one shown here).

My vscode is v1.15.1 (windows 32bits build)

In the marketplace, the latest plugin version seems to be 0.0.3 (uploaded a couple days ago), which I don't know how to relate with the releases seen in github (v0.5.0 ?)

Other than that, thanks for the plugin! I'd been longing for this functionality for a while.

vstirbu commented 7 years ago

published 0.5.1. The arrow tip is white on my machine for dark theme.

agusmba commented 7 years ago

Thanks! Got the 0.5.1 from the market, however I still see no arrow tips... Maybe there's something wrong on my end.

vstirbu commented 6 years ago

Arrows in 0.8.2:

screen shot 2018-01-29 at 22 40 35