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.
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.
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?
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.
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.