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

Cannot Generate `gitGraph` Images

Open P-N-L opened this issue 2 years ago • 2 comments

Hello,

I have set up Pandoc with mermaid-filter 1.4.6 from NPM. It works great with flowcharts, but generates a blank image when I try to use a gitGraph. When I run it, I simply get empty/white images generated. I understand that gitGraph is currently experimental, I just wanted to see whether I should expect it to work, and if not, whether anybody knows if that is an upcoming effort for mermaid-filter or the mermaid project itself.

Thanks!

P-N-L avatar May 03 '22 15:05 P-N-L

I'm sorry, I stand corrected! Looks like I was using a bad example.

Good example (from gitGraph documentation):

gitGraph:
options
{
    "nodeSpacing": 150,
    "nodeRadius": 10
}
end
commit
branch newbranch
checkout newbranch
commit
commit
checkout master
commit
commit
merge newbranch

Bad example (honestly can't remember where I found it, sorry):

gitGraph
    commit
    commit
    branch develop
    checkout develop
    commit
    commit
    checkout main
    merge develop
    commit
    commit

I am seeing an issue where the graph gets cut off where I am using it on a webpage, but that may be something I just have to fiddle with.

P-N-L avatar May 03 '22 15:05 P-N-L

When I generate with png, it looks OK (though perhaps a bit too wide):

tmp-9788YAFQsdQ6jgCV tmp

When I generate with svg, it gets cut off: tmp-9265xE0KOmFq0at7 tmp

P-N-L avatar May 03 '22 15:05 P-N-L

I'm using mermaid-filter 1.4.6 and this chart exports as a blank white graph (regardless of options like theme) in my pandoc HTML output.

     ```{.mermaid theme=forest}
      gitGraph:
        commit
        commit
    
        branch feature/x
        checkout feature/x
        commit
        commit
        
        checkout main
    
        merge feature/x
        
        branch feature/y
        checkout feature/y
        commit
        commit
        
        checkout main
    
        merge feature/y
        
        branch release/x
        checkout release/x
    
        commit tag: "X.X.X-qualifier.X"
        
        checkout main
        branch feature/z
        checkout feature/z
        commit
        commit
        
        checkout main
    
        merge feature/z
            
    ```
  gitGraph:
    commit
    commit

    branch feature/x
    checkout feature/x
    commit
    commit
    
    checkout main

    merge feature/x
    
    branch feature/y
    checkout feature/y
    commit
    commit
    
    checkout main

    merge feature/y
    
    branch release/x
    checkout release/x

    commit tag: "X.X.X-qualifier.X"
    
    checkout main
    branch feature/z
    checkout feature/z
    commit
    commit
    
    checkout main

    merge feature/z
        

lunarcloud avatar Dec 06 '23 18:12 lunarcloud

Can you try out v1.4.7 from npm? I added the example to the e2e test file in the repo. Please reopen if you run into issues

raghur avatar Dec 23 '23 12:12 raghur