-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Width fixed to 400px #204
Comments
Hello! I think this can be fixed. I am struggling to recreate the problem. What version do you run? |
0.5.1
I'm generating it from the command line... I was using it before on GitBook using gitbook-plugin-mermaid but normal images are shown with their real size or its width adjusted to the book width, so I don't think the problem would be here... If you are interested, the next block: graph BT
subgraph initramfs
/ === ibin[bin]
/ --- DEV((dev))
/ === ilib[lib]
/ --- proc((proc))
/ === tmp
/ === usr
usr === bin
bin === ENV(env)
tmp --- root
tmp --- users((users))
root --- RDEV((dev))
root --- rproc((proc))
root --- rtmp((tmp))
root --- home((home))
end
subgraph usersfs
.workdirs
nodeos
uroot[root]
nodeos --- NDEV((dev))
nodeos --- nproc((proc))
nodeos --- ntmp((tmp))
end
home === .workdirs
home === nodeos
home === uroot
users -.-> home
DEV -.- NDEV
proc -.- nproc
DEV -.- RDEV
proc -.- rproc
is generating the next image As you can see, the image is 400px width and you can hardly read the text labels or see the lines patterns... :-/ |
I would like to set a max-width (and max-height). I have a fluid design (responsive), so widescreen have much more space. ;) |
Also, I think the borders width should be removed so image can adjust better and don't waste space... |
@piranna I can reproduce your issue. The easy fix is to not use maxWidth in the mermaid settings. In your case this would mean a width of around 1200 px. With maxWidth set mermaid tries to make the flowchart no wider then the surrounding element. If it is smaller it stays smaller otherwise small flowcharts can look a bit big... :) I am not sure how the plugin generates the images. If it is using the api in the you use the flowchart config settings to turn this of as outlined below:
The cli needs an update to change the default value of having maxWidth set. |
I can confirm that this fix it :-) Lines patterns are not shown, but at least text is now readable :-P
Well, this could be done better with another approach, having elements with a fixed size and getting the graph as big as needed instead of the inverse (having the graph a fixed size and being elements as big as possible). Since first they are generated as SVG graphics, maybe the problem is when converting them to PDF assigning them a fixed width via CSS instead lefting it to auto...
It works by crafting and ad-hoc html page injecting the graph description and rendering it with PhantomJS. A bit cumbersome (I would have used node-canvas + Raphaël instead to be Node.js pure), but plugin is not mine... |
I'm glad it helped!
|
Thank you! :-) I've fixed it for gitbook-plugin-mermaid at piranna/gitbook-plugin-mermaid@ee9838f :-) |
Is the CLI already fixed? I tried to generate a more complex diagram from 0.5.3 (installed via npm) and still see a very low resolution (554 x 241). |
No… :( Many aspects, default config for flowcharts using CLI is to not use maxWidth and no way to set it. Will fix this in two ways.
|
CLI is pretty much unusable until this is fixed :( |
Will try to make a small 0.5.4 release fairly soon |
…width is 1200. Added logger using es6 syntax
How to fix it now i am still having issues with Is there any easy command now |
Try the new CLI https://github.com/mermaidjs/mermaid.cli I did a quick test and it can generate image with width bigger than 400px. |
…yarn/develop/typescript-eslint/parser-4.26.1 Bump @typescript-eslint/parser from 4.26.0 to 4.26.1
In the CLI or when using the API, the flowchart graphs are always width 400px, so when having somewhat complex charts the letters and boxes get small and blurry. Online editor don't happen to have this problem, showing them full size.
The text was updated successfully, but these errors were encountered: