Scaling issue for charts

Thans for integrating this functionality, it has a lot of potential for visualising data!

Is there a way to set the radius (or size in general) of a pie chart?
The default one is unfortunately so small to be practically useless :confused:

pie showData
    title Key elements in Product X
    "Calcium" : 42.96
    "Potassium" : 50.05
    "Magnesium" : 10.01
8 Likes

I’m also having some size/scaling issues. Gaant charts for example are essentially useless :frowning:

Is there anyway Discourse could provide the option to view mermaid diagrams in a fullscreen way, similar to the Markdown Table Fullscreen?

6 Likes

This is a fantastic idea, I would love to have it. We don’t have this work slotted at the moment.

8 Likes

Are we likely to see any movement on this? It just feels such a shame to have something so usefull sit so close to perfection.

We wanted to use a pie chart to show some of the distribution of languages in the company, but this is the real size in the end :frowning:

1 Like

is it possible to have some zoom possibilities to the mermaid display? Larger diagrams can become quate small now.

Maybe allow the mermaid diagrams to be opened in a popup lightbox and have pan and zoom like on https://mermaid.live/

3 Likes

This would be a great additional feature!

1 Like

I would love this feature. It is assigned to the member experience team and will be prioritized by them.

Missing this is certainly heavily impacting how useful complex mermaid diagrams on the forums can be.

As to when? @lindsey will be prioritizing this.

If you need it in a hurry though probably best talk to Jamie

8 Likes

Thank you for looking at this again :heart:

1 Like

+1 for this much needed feature - any progress?

1 Like

We also really need this feature at our company, scaling charts in height is limited and this make mermaid useless in discourse, need to have a way to render them externally or by showing them fullscreen.

1 Like

I built something. I thought someone might want to give it a try before I release it.

The goal was to have a low-threshold and robust approach:

  1. analyze if a post contains an SVG element
  2. if so, display a text link “zoom” next to it
  3. open the SVG in a new browser window where you can zoom, print, etc. as you like

GitHub - rstockm/svg-zoom: Discourse theme component that adds zoom functionality to Mermaid/SVG elements in posts

Update, @David is working on a fix here and it looks great, we just need to clean up some APIs and will post about it soon.

4 Likes

This is now merged. Diagrams will always be rendered with a 16:9 aspect ratio, and there’s a button to pop them into a fullscreen view:

kanban
  Todo
    [Create Documentations]
    docs[Create Blog about the new diagrams]
  [In progress]
    id6[Create renderer so that it works in all cases. We also add som extra text here for testing purposes. And some more just for the extra flare.]
  id9[Ready for deploy]
    id8[Design grammar]@{ assigned: 'knsv' }
  id10[Ready for test]
    id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
    id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }
  id11[Done]
    id5[define getData]
    id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}
    id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }

  id12[Can't reproduce]
    id3[Weird flickering in Firefox]
4 Likes

OMG. I am sorry, but the reaction is not enough. THANK YOU!!!

One small thing – if I zoom out a bit using the browser (Alt+ -) the texts do not fit. If I am at 100 %, it’s all perfect.

2 Likes

Also just noticed that Mermaid charts do not switch light/dark theme without refreshing the browser when using the new dark theme switcher setting.

2 Likes

Massive thank you from my side for putting through an update for this :heart:

Now we can use Gaant charts and Pie charts along with Discourse’s revision history :slight_smile:

Thank you, but I would prefer to open the chards in a new, dedicated window - so wie can Print, export to PDF etc.

See my approach: