-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Insert Images in flowchart #548
Comments
Normaly, does the Trick. But somehow only in the Live editor not on local page, any hints ? Edit1: Yes i did set htmlLabels: true Edit: works if you use API instead
Bug? |
To get it work without API you need to use html special characters instead of direct chars like single quote, apostrophe, equal, etc. |
Would it be possible to include a complete example flowchart where multiple modes display images? |
I am able to do this use
.iphone-icon { width:64px; height:64px; background: url(https://example.com/iphone-icon.png) no-repeat center center; }
.server-icon { width:64px; height:64px; background: url(https://example.com/server-icon.png) no-repeat center center; }
NOTE: All CSS URLs should be absolute web URLs if you plan to share the SVG. Alternatively you could embed the icons in the CSS file using data-urls. |
Building up on top of @lennynyktyk's answer, I added definitions for icons in CSS.
I'm able to use them:
With this approach, it's enough to define a general |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Can this issue be reopened? It would be useful to insert my custom SVG files as custom shapes in a flowchart. I tried doing |
I figure out that I could get this to work locally by adjusting the config to ensure The graph: graph LR
%% Directive to load the special config
%% @config{./config.json} %%
%% Don't escape the <>, but need to use ' instead of "
x((<img width='50px' height='50px' src='https://iconscout.com/ms-icon-310x310.png' />))
The config: {
"securityLevel": "loose",
"flowchart": {
"htmlLabels": true
}
} |
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.0.5 to 3.0.6. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](tailwindlabs/tailwindcss@v3.0.5...v3.0.6) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
is it possible to apply images cleanly with mermaid styles? Mine renders, but i cannot position the icon outside the mermaid shape-dimentions. Certainly cannot change the placement, alignment or positioning using CSS attributes in the classDef. This is about the best I can do with an hour or messing with CSS:
of course i can replace the |
Maybe this helps someone. %%{init:{"theme":"dark","flowchart":{"curve":"linear"}}}%%
flowchart BT
Jedan[Jedan\nChristmas] -->|KomentarA| Dva[Neštonešto]
Dva --> Tri{Let me think}
Tri -->|Broj4| Četiri[LeKomentar]
Tri -->|PremaDva| Pet[Tekst5]
Tri -->|Tri| Šest[fa:fa-car Car]
Pet[<img src='https://iconscout.com/ms-icon-310x310.png' width='40' /> \nasd]
Šest([<img src='https://icon-library.com/images/small-icon-png/small-icon-png-6.jpg' width='40' /> QWE])
Tri[(<img src='https://icon-library.com/images/small-icon-png/small-icon-png-6.jpg' width='40',height='40' />)]
|
Can you do the same thing in |
Hi there, (I'm using Typora) ✅ Absolute File Path Works
❌ Relative File Path does not work
|
Sorry BOTH examples you gave are relative file-paths. IE relative to the location of the MD file. an absolute file path would be something like this:
or
or even
Note the last one is the root-directory of the web-site instance. |
Sorry, but in macos there is no C:// ... It's directly with /Users/... |
Yeah but your ‘absolute’ example had a full-stop preceding the first slash ‘/‘. Making it relative to the current working directory.Linux/mac/windows.. it’s all the same.On 7 Jan 2024, at 08:21, Ahmed Thahir ***@***.***> wrote:
Sorry, but in macos there is no C:// ... It's directly with /Users/...
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Alright! Could you help me with getting images to work with relative links? |
Just to be absolutely clear.. mermaid has nothing to do with loading files. That’s all native html.If your web service (say Nginx/httpd) is bound to /mnt/www upon startup. Then all paths that are relative from that directory, should work.Eg:File-system:Logo.md- /images- /images/logo.pngIf your markdown file includes a mermaid area, and as you said, you added in a html IMG tag, referencing the sub/directory.First prove you can reach the file: by going to http://websiteFQDN/images/logo.png - does the file show?If it does, you can set the paths as:- Absolute = ‘ http://websiteFQDN/images/logo.png‘ or ‘/images/logo.png’ for short (much better practice NOT to hard code the fqdn inside the html files, makes your webpages portable).- Relative = ‘./images/logo.png’If your md file is in a different folder, eg:Index.HTML- /images- /images/logo.png- /diagrams- /diagrams/logo.mdThen the ‘relative’ location needs to be one folder higher from logo.md- Relative = ‘../images/logo.png’(Notice the doubt dot refers to parent directory)Hope it helps.On 7 Jan 2024, at 12:28, Ahmed Thahir ***@***.***> wrote:
Alright!
Could you help me with getting images to work with relative links?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
How can I make a jpeg, png , gif as a NODE in flowchart.
Most of the time we need that for presentation purpose.
Can We do that please. Please let me know
If not can you add that Please.....
The text was updated successfully, but these errors were encountered: