Plugin: MarkMap

Hi @Catakan ,

Thank you for your feedback!

Unfortunately, your suggestion would require a lot of change, maybe even a rewrite of the plugin, which is why this is not on the roadmap for the moment.
As already discussed with @dukeja, this would be better implemented in an additional plugin.

Hi @danielfomin96,

First of all hanks for you reply and consideration. You are totaly right, i just wanted to take my shot to see if you were considering it.

Although after using the plugin for a few week now, I have a new request if I may. A watermark (rather a simple username scribing etc.) so when sharing the generated png, svg etc. files some ownership or at least original author is shown in auto generated content.

What is your opinion about this?

Thanks

When I create a new mindmap using the tool embbeded in the plugin it works well but I dont know how to edit it later using the wysiwyg editor again

Thank you for the request. This feature is not planned at the moment. However, you could maybe modify the final image in a image or vector graphic program so that it suits your needs.

Since the result is an image there is no possibility to modify it using joplin. The only possibility is to create a new mindmap that include your modifications.

This plugin comes (unintentionally ?) with a very nice extra:
when you create a mindmap with the classic Freemind application, then select a node and copy it, next paste it into a Joplin note and click on the Markmap icon .... voilà ... the node with all siblings, children etc is presented correctly in the window that opens.
Any formatting is lost (font styles, colors, etc.) but that does not diminish the value of this plugin. Big thank-you to you, Daniel.

It would be really nice if the Joplin team could vet this plugin and vouch for its security.

Hi ajay,

Thank you for your warm words! Of course everything is intentional :wink:

@danielfomin96 great plugin that I use regularly. With large mindmaps, setting the initial expand level is essential. For some strange reason this plugin option doesn’t have any effect. Setting color and animation duration for instance work nicely.

Any ideas for troubleshooting?

Thanks,

MaBo

Good News, @mabo! I found the culprit and will be including the solution in the next version :slight_smile:

Spoiler: It works with the newest markmap libraries

And thank you for the kind words.

Version 1.7.3

Changelog:

    Update to markmap version 1.8.x.
    Table rendering
    Image rendering
    Fixed Math rendering
    Fixed initialExpandLevel

Very nice, and I can confirm it works now! Would it be possible that also the exported html-mindmap adheres to the same expandlevel?

In dark mode, though, the text becomes unreadable. The text and background are exactly the same color.

Thanks!

Great plugin! Thanks for taking the time to build it. I really wish it works on mobile though.

Version 1.8.0

Changelog:

     jsonOptions in HTML export
     Fix: color jsonOption

Both mobile support and visibility in dark mode is difficult to implement right now. But I have created tickets for those issues and will look into them sometime.

Thanks for the feedback.

yes exporting the mindmap with the specified level of collapse works!

Thanks!!!

Colors seem to be still unreadable in dark mode, though.

Version 1.9.0

Changelog:
     htmlParser jsonOption support
     Dark Mode support

Hi,

Thanks very much for this excellent plug-in. Since the last update of my system (NixOS), I encounter a problem that prevents any map from displaying. I'm using Joplin 3.5.13 with Markmap: 1.9.1. There is no error message in a terminal, but the dev tools show the following error:

index.html:40 Uncaught SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules
    at getCssSheetRules (index.html:40:23)
    at index.html:49:25
getCssSheetRules @ index.html:40
(anonymous) @ index.html:49
useMessageHandler.ts:30 Got ipc-message: noteRenderComplete undefined

This may be related to the specific configuration of my system, but I just post this here in case someone else has the same problem.

I had the same issue and fixed it with help from ChatGPT - here's the instructions it provided:

Reliable workaround: patch Markmap

The required correction is small. Replace the existing getCssSheetRules function with:

function getCssSheetRules(sheet) {
    try {
        return [...sheet.cssRules]
            .map(({ cssText }) => cssText)
            .join(" ");
    } catch (error) {
        console.warn(
            "Markmap: skipping inaccessible stylesheet",
            sheet.href,
            error
        );
        return "";
    }
}

This tells Markmap to skip protected stylesheets instead of aborting the entire mind-map creation process.

How to patch the installed plugin on Windows

  1. In Joplin, open Tools → Options and note the profile-directory path displayed near the top.

  2. Open that directory in File Explorer, then open its plugins folder. It will usually resemble:

    C:\Users\YourName\.config\joplin-desktop\plugins
    
  3. Fully exit Joplin, including its notification-area icon.

  4. Make a backup copy of:

    de.fomin.markmap.jpl
    
  5. Install 7-Zip if you do not already have it.

  6. Enable View → Show → File name extensions in File Explorer.

  7. Temporarily rename:

    de.fomin.markmap.jpl
    

    to:

    de.fomin.markmap.tar
    

    The JPL is actually a TAR archive internally.

  8. Open the TAR archive with 7-Zip. You should see:

    index.html
    index.js
    manifest.json
    lib\
    
  9. Extract index.html, open it in Notepad, and find the function beginning around line 37:

    function getCssSheetRules(sheet){
    
  10. Replace the complete function with the patched version above and save it.

  11. Drag the modified index.html back into the open 7-Zip archive, replacing the original. Make sure it remains at the archive’s top level rather than inside a new folder.

  12. Close 7-Zip and rename the archive back to:

de.fomin.markmap.jpl
  1. Start Joplin and test Show mindmap again.

The fix also turned Markmaps font text black, which is barely legible against the dark themed background. Here's the explanation and new fix from ChatGPT:

The previous fix allows Markmap to render but skips the protected stylesheet containing Joplin’s theme variables. Markmap consequently loses --joplin-color and falls back to dark text. Joplin normally provides this variable to plugin views. Joplin plugin theming

Recommended small modification

Open index.html inside de.fomin.markmap.jpl again, following the same process as before.

In index.html, find:

--markmap-text-color: var(--joplin-color)

Replace only that part with:

--markmap-text-color: var(--joplin-color, #eeeeee)

Optionally, change:

background: var(--joplin-background-color)

to:

background: var(--joplin-background-color, #202124)

Save the file back into the plugin archive and restart Joplin. The first change is the one that fixes the black text.