🚀 Bear 2.9.2 Mermaid Diagram Support

Good news everyone! Now you can draw diagrams and charts right inside a note with Mermaid support, completely free for everyone. Just like Mathjax support, Bear renders your diagrams live, showing the finished result right inside the note as you type.

How it works in Bear

Type three backticks, label it mermaid, and write your diagram inside. Bear renders it live below. The diagram code will be hidden when you move the caret outside the code block.

Useful Links

Mermaid’s documentation | Mermaid Official
How to add diagrams in Bear | Bear Support

Update now

:mobile_phone: iOS App Store

:laptop: Mac App Store

If you’ve been waiting to bring diagrams into your notes, now’s the time. We’d love to hear what you think!

Happy Writing!

:bear::heart::bar_chart:

13 Likes

Amazing! Love the focus on academic/technical features, between getting LaTeX a while back and now this :slight_smile:

1 Like

I have never used Mermaid but I can see this coming in very useful. Stupendous!

2 Likes

I would expected this to be a 2.10 update! Waited for this really long. But it came quicker than expected (after seeing it in Lettera). So really happy with it.

3 Likes

Is there support for Frontmatter for Mermaid in Bear? Diagram Syntax | Mermaid

If not, is it on the roadmap? I love using Mermaid and I’m thrilled to have it in Bear. I’d like to have more control over formatting.

Cheers!

From what I can see: yes. I tested various examples from Mermaid’s docs and everything seems to work in Bear.

1 Like

I can not emphasize this enough: THANK YOU!!

1 Like

Exciting and useful. Why not 2.10 though?

I love that this is being added and, I may be missing something staring me in the face, but I cannot seem to get Mermaid diagrams to function. Even using the sample emailed out to all users, there is no chart that appears below the code? Does anyone know what I may be missing?

Go here and copy one of the code blocks:

Then create a Bear doc and paste the mermaid code in between here:

```mermaid
[paste here]
```
1 Like

I like the new feature. Is there a way to make a sankey diagram bigger?
I tried width: 1800, height: 1600 but the text is then really small.

Please make sure you are using Bear 2.9.2 by visiting its App Store pages
macOS: https://apps.apple.com/it/app/bear-markdown-notes/id1091189122?l=en&mt=12
​iOS: https://apps.apple.com/it/app/bear-markdown-notes/id1016366447?l=en

Somehow, Mermaid as a feature felt “minor” compared to Workspaces or other releases. Maybe we underestimated the interest around it.

1 Like

If I’m not mistaken about your request, yes, it works as in the example.

Love this so much, thank you! I feel there’s just one thing missing .. Being able to double click on the diagrams and see them zoomed in, as with images!

Thanks for the quick response! I’m asking about Mermaid styling or formatting. Using the Frontmatter syntax, my diagrams aren’t taking on the styling I’m using as a directive. I was able to change the title using Frontmatter on a couple of diagram types, but the styling didn’t actually change.

I’d like to be able to do something like this (and have the elements update accordingly with those styles)…

---
config:
  theme: 'base'
  themeVariables:
    primaryColor: '#BB2528'
    primaryTextColor: '#fff'
    primaryBorderColor: '#7C0000'
    lineColor: '#F8B229'
    secondaryColor: '#006100'
    tertiaryColor: '#fff'
---
        graph TD
          A[Christmas] -->|Get money| B(Go shopping)
          B --> C{Let me think}
          B --> G[/Another/]
          C ==>|One| D[Laptop]
          C -->|Two| E[iPhone]
          C -->|Three| F[fa:fa-car Car]
          subgraph section
            C
            D
            E
            F
            G
          end

Please consider adding this support in future releases. Nevertheless, Mermaid is an OUTSTANDING addition to Bear. Thank you for it!

I wasn’t necessarily interested in mermaid at first because I thought it was complicated. Since it was added to Lettera, I’ve taken a closer look at it and am really amazed at how simple the syntax is and all the things you can do with it. It’s definitely a great addition to Bear!

While experimenting, I discovered that for obvious reasons it is not possible to use those features to interact with the diagrams, since clicking on them immediately opens the code block. Maybe the devs have an idea on how to solve this issue. Here a video:

Even when the note is read-only it is not possible to activate the link on click.

2 Likes

The theming doesn’t seem to work at all in Bear. In Obsidian it works fine

Congratulations on getting support out for Mermaid. Extremely useful! It would be good if there was a way that we could resize diagrams. I want to be able to have the diagram take the full width available to it. Instead it just stays rather small.

This is so useful thank you! :folded_hands:

Great implementation.