DanielFlaum / grav-plugin-mermaid-diagrams

Mermaid Diagrams is a Grav plugin that adds simple and powerful diagrams functionality
https://github.com/DanielFlaum/grav-plugin-mermaid-diagrams
MIT License
12 stars 1 forks source link

Mermaid needs to be bumped to latest version #3

Open DanielFlaum opened 3 years ago

DanielFlaum commented 3 years ago

As of writing, Mermaid 8.6 is out, and adds ER diagrams. Until the new version is folded in, this plugin's users will not be able to use ER diagrams on their sites.

https://github.com/DanielFlaum/grav-plugin-mermaid-diagrams/compare/v1.0.1...DanielFlaum:v1.1.0 illustrates what was involved the last time Mermaid was upgraded. Namely, just updating Mermaid's single JS file, and making appropriate notes.

DanielFlaum commented 3 years ago

I personally am not using Grav at the moment, and my motivation to work on this has vanished. So, I won't do so unless someone specifically asks for it. It's not greatly time consuming, I'm just being lazy.

fseesink commented 3 years ago

Ok. I'll ask.😀

I recently began using Grav and eventually got to the point I wanted to add some diagrams to my posts. Initially figured maybe there was some kind of draw.io integration like they have in Confluence.

Then began finding references to plugins that did diagrams using Markdown syntax. The idea I could do posts with diagrams all with Markdown was appealing. Long story short, found your plugin and thought to give it a whirl.

Now I figured if it worked well enough would just leave you be. Initially tinkered with the Mermaid tutorial to try things out, and I hit on basic issues of not being able to use many shapes. Figured it was due to the use of []'s which likely confused things in Markdown.

But quickly realized even basic things like pie charts aren't displaying as they show on the Mermaid site. Specifically, the legend is missing, meaning all you get is a pie with percentages in it. No labels anywhere. Makes it not terribly useful.

Would it be possible to bump Mermaid to the latest? I'm really hoping it helps make things work properly. I love the idea of being able to use this, and for what it's worth, I appreciate your work on this.

DanielFlaum commented 3 years ago

No problem! I'll take care of it tomorrow, shouldn't take too long. Heads up, I have a feeling may discover that we need to do more than update, though, but we'll cross that bridge we get to it.

DanielFlaum commented 3 years ago

Hey @fseesink, you can download version 1.2.0 of this plugin as of now. I've put in a request for it to be propagated to Grav's repository of plugins, but that may take a bit. In the meantime, you can install the new version immediately by downloading it as a zip, expanding it, and placing it in the user/plugins directory of your Grav installation. You'll need to rename the plugin's directory from grav-plugin-mermaid-diagrams to just mermaid-diagrams. Let me know if you need any other help!

fseesink commented 3 years ago

Hey @DanielFlaum,

Thanks for the quick response! When I went to check just now, the plug-in update was already showing in Grav Admin! So updated and tested that way.

Sadly, pie charts still don't show legends. So not sure what's going on there.☹️ But still appreciate the rapid response.

fseesink commented 3 years ago

UPDATE: Scratch that. This may be an issue with the Mermaid tool itself. Let me explain.

After not seeing a change, I decided to start building some test pages to see exactly which features of the Mermaid tool worked in Grav. For now they live here, which I setup as a pseudo blog page. Then under that, I created pages for each of the Mermaid diagram types supported:

Then, taking the respective pages from the Mermaid site under "Diagram Syntax" on the left, I started taking their examples and putting them in the respective pages. I wanted to see which ones worked and which ones didn't.

Now I haven't fully fleshed this out yet, but so far did the Flowchart, Sequence, and Pie Chart pages. The others show bomb symbols as I simply copy/pasted a bit of placeholder code

title
[mermaid]
graph
[/mermaid]

repeatedly in each, as I'm filling those in as I go.

Anyway, if you visit here from your desktop, you will see the pie charts with the legends as expected.

This surprised me. Then something occurred to me. I had checked from my iPhone this morning. And that's what I'd been looking at when I put in this issue.

Checking again, seems all the mobile browsers show the pie charts without any legends, while my desktop browsers all show it just fine. So whatever this is, it has to be with the Mermaid tool and accessing pages on a mobile device.

So sorry about that.

One question I do have, though. On any page where a bomb occurs (e.g., here, scroll down a ways), the error indicates

Syntax error in graph mermaid version 8.9.2

But the latest version is 8.10.1. So did you fall back to upgrading to an older version? This is more just curiosity mind you. But thought it odd.

fseesink commented 3 years ago

UPDATE 2: I can confirm the issue is indeed with Mermaid generating pie charts on all mobile browsers without legends, even when the phone is placed in landscape mode giving ample space for the legend.

I have opened an issue with the Mermaid folks on this here.

DanielFlaum commented 3 years ago

Thanks so much for pinning it down to Mermaid itself!

But it should be 8.10.1 that I updated to. I could swear that's the version I downloaded. Will double check.

DanielFlaum commented 3 years ago

Yeah, so I definitely downloaded Mermaid from its 8.10.1 release, but there appear to be mistakes with the updating of the version number: https://github.com/mermaid-js/mermaid/commit/417428aceada045eabcc92826c68e08a1329c98f

I'll open another issue with Mermaid for this myself.

In the meantime, @fseesink, I am able to reproduce the missing pie chart legends on my Android device with Firefox. Firefox for Android gives me the option to render a desktop version of any page I look at, and when I turn that on, I can see the legends on the pie charts. Perhaps you can do the same on iOS? This isn't an acceptable fix, but maybe a temporary workaround.

mojerro commented 2 years ago

Hey @DanielFlaum, I open a pr to update mermaid to version 8.14, could you help me to merge and update it~

DanielFlaum commented 2 years ago

@mojerro Done! Your PR was helpful, thank you 😊! I see that the new version is showing up now on https://getgrav.org/downloads/plugins. If you run into any problems, let me know in a separate issue.

mojerro commented 2 years ago

Thank you for testing it too 😆

danilomunoz commented 4 months ago

Hi @DanielFlaum! It would be wonderful if you could update Mermaid and add support for GitGraph diagrams. Thank you very much!

DanielFlaum commented 4 months ago

I hear ya. It may take me a couple days, but I'll have it for you Saturday at the latest! Thanks!

DanielFlaum commented 4 months ago

Heya @danilomunoz, we have version 1.4.0 now!

I believe the Grav project has a cron job somewhere that pulls in new versions of plugins periodically, so this should show up for you soon (it's been a minute since I last updated this plugin). If you're impatient, though, you can download the source and manually put it in your plugins folder and it should work just fine.

Let me know if you run into issues.

danilomunoz commented 3 months ago

Heya @danilomunoz, we have version 1.4.0 now!

I believe the Grav project has a cron job somewhere that pulls in new versions of plugins periodically, so this should show up for you soon (it's been a minute since I last updated this plugin). If you're impatient, though, you can download the source and manually put it in your plugins folder and it should work just fine.

Let me know if you run into issues.

Pretty wonderful! It worked like a charm! I just updated plugin on admin area and now it´s working! Thank you so much!!!