vue-mermaid icon indicating copy to clipboard operation
vue-mermaid copied to clipboard

Invalid link representation

Open dmitry-worker opened this issue 5 years ago • 6 comments

nodes: [
        {
          id: "1",
          text: "A",
          link: ["-- yes -->", "-- no -->"],
          next: ["2", "3"],
          editable: true
        },
        { id: "2", text: "B" },
        { id: "3", text: "C"}
      ],

Expected: https://raw.githubusercontent.com/robin1liu/vue-mermaid/HEAD/img/links.jpg Actual:

graph LR
1[A]-- yes -->,-- no -->2[B]
1[A]-- yes -->,-- no -->3[C]
2[B]
3[C]

dmitry-worker avatar Jan 17 '20 02:01 dmitry-worker

I found a workaround. When defining a separate node, it can be realized.

nodes: [
        {
          id: "1",
          text: "A",
          link: ["-- yes -->"],
          next: ["2"],
          editable: true
        },
        {
          id: "1",
          text: "A",
          link: ["-- no -->"],
          next: ["3"],
          editable: true
        },
        { id: "2", text: "B" },
        { id: "3", text: "C"}
      ],

TE-ShinyaYamada avatar Jun 01 '20 06:06 TE-ShinyaYamada

But then why would the link attribute be an array if it can only have an length of 1? That doesn't make much sense to allude to multiple links via that attribute's data type but then not be able to render it as expected

ginger-tek avatar Jun 01 '20 15:06 ginger-tek

Of course It is definitely a bug since readme.md shows a node with multiple links are allowed. https://github.com/robin1liu/vue-mermaid#different-link-values-of-next

So, my solution is just a workaround.

TE-ShinyaYamada avatar Jun 02 '20 00:06 TE-ShinyaYamada

Any news about this bug?

alberto-bottarini avatar Jun 03 '20 07:06 alberto-bottarini

I found a comment https://github.com/robin1liu/vue-mermaid/issues/11#issuecomment-569527049 mentioning that modifying vue-mermaid/package.json manually will resolve the bug.

TE-ShinyaYamada avatar Jun 03 '20 08:06 TE-ShinyaYamada

Thanks, but i will prefer your workaround

alberto-bottarini avatar Jun 03 '20 08:06 alberto-bottarini