Skip to content
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

Mermaid Gantt diagrams are fixed to 640px width #6711

Closed
Tracked by #7629
pyriand3r opened this issue Aug 3, 2022 · 7 comments
Closed
Tracked by #7629

Mermaid Gantt diagrams are fixed to 640px width #6711

pyriand3r opened this issue Aug 3, 2022 · 7 comments
Labels
bug It's a bug medium Medium priority issues

Comments

@pyriand3r
Copy link

pyriand3r commented Aug 3, 2022

When writing a bigger mermaid gantt diagram in Joplin i came across, that the diagram stopped growing at some point. Further research revealed, that it seems that the gantt diagram is somehow fixed to max-width: 640px.

I tried to add a <style> tag to the note with the diagram, overwriting the max-width to 100%. But that won't help because the image itself is rendered to 640px. Changing the max-width to 100% only sets the svg-tag to 100% width centering the digram but it keeps its 640px width.

Environment

Joplin version: 2.8.8
Platform: MacOS
OS specifics: Monterey 12.5

Steps to reproduce

  1. Create a note with a bigger mermaid gantt diagram (with a wide time range)
  2. See in the render window that the gantt diagram is only 640px wide and will not expand further
  3. add following style code to the note to see the diagram center but not expand
<style>
  .mermaid svg {
  	max-width: 100% !important;
  }
</style>

Describe what you expected to happen

I would expect the diagram to use the width it needs to render the content correctly and readable, being able to be scrolled horizontally, or at least take as much space as possible.

Screenshots

without css

mermaid_no_css

with css

mermaid_with_css

@pyriand3r pyriand3r added the bug It's a bug label Aug 3, 2022
@davelopware-davea
Copy link

If you check the computed styles you may find it is actually overriding the max-width - however by default the svg will maintain it's aspect ratio. When I modify the height in css too, I find the gantt chart fills the full width - try adding:

<style>
  .mermaid svg {
	height: auto;
	max-width:100% !important;
  }
</style>

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

@github-actions github-actions bot added the stale An issue that hasn't been active for a while... label Sep 9, 2022
@tessus
Copy link
Collaborator

tessus commented Sep 14, 2022

I am not sure, if I can replicate this. Can you please provide a gantt chart.

@tessus tessus removed the stale An issue that hasn't been active for a while... label Sep 14, 2022
@davelopware-davea
Copy link

davelopware-davea commented Oct 6, 2022

try this simple example for the gantt chart:

\`\`\`mermaid
gantt
dateFormat  YYYY-MM-DD
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10

section A section
Completed task        :done,    des1, 2014-01-06,2014-01-08
Active task           :active,  des2, 2014-01-09, 3d
Future task           :         des3, after des2, 5d
Future task2          :         des4, after des3, 5d
Future task3          :         des5, after des4, 5d
Future task4          :         des6, after des5, 5d
\`\`\`

(note I'm escaping the backticks so that they show in the github comment text - obvs replace \` with just a single ` )

now I get the following:

image

Which is always limited in width in the rendered view. If I prepend the styling I mentioned on the 10 Aug:

<style>
  .mermaid svg {
	height: auto;
	max-width:100% !important;
  }
</style>

then you see a much more useful full-width gantt chart:

image

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

@github-actions github-actions bot added the stale An issue that hasn't been active for a while... label Nov 5, 2022
@github-actions
Copy link
Contributor

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information.

@tessus tessus added medium Medium priority issues and removed stale An issue that hasn't been active for a while... labels Nov 13, 2022
@tessus tessus reopened this Nov 13, 2022
@tessus
Copy link
Collaborator

tessus commented Sep 19, 2023

Fixed by #8890

@tessus tessus closed this as completed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug medium Medium priority issues
Projects
None yet
Development

No branches or pull requests

3 participants