Skip to content
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

Is it possible to add images on the elements of my mind ? #66

Open
djanesh opened this issue Mar 15, 2017 · 8 comments
Open

Is it possible to add images on the elements of my mind ? #66

djanesh opened this issue Mar 15, 2017 · 8 comments

Comments

@djanesh
Copy link

djanesh commented Mar 15, 2017

Hi Thanks for this tool. It works really well. I was wondering if it would be possible to add images to the elements. For example, if I want to make a organization hierarchy, it would be nice if you could add images of people within a organization. If you already have such examples, I would love to see that.

@ondras
Copy link
Owner

ondras commented Mar 19, 2017

There is no built-in support for this. The hard part is deciding where to actually store such image.

But you can almost certainly insert images using the data-URI, which might or might not be supported in your browser when pasting image data from clipboard. Try this in Firefox and Chrome and tell us whether that worked or not 👍

@ssavinel
Copy link

Commenting on an old issue.
Can't the picture be turned to base64 and saved in the json file?

@ondras
Copy link
Owner

ondras commented May 30, 2020

Can't the picture be turned to base64 and saved in the json file?

That is literally the point I was making in the previous comment :-)

@ssavinel
Copy link

I could have read the link...
Fair point! I'll try this.

@ssavinel
Copy link

I'd say it does not work well in Chromium based browsers
image
where it simply pastes the text in Firefox.

I also tried copying an image file directly and it works well on Firefox :
image
but only displays the local file path on Chromium, which means that it won't work on another device as the file is kept locally.

@ondras
Copy link
Owner

ondras commented Jun 1, 2020

Perhaps we can scan the HTML content for <img> tags, drawing them into a separate <canvas> and convert to base64 via toDataURL.

@irfan-yusanif
Copy link
Contributor

irfan-yusanif commented Jul 7, 2020

Hello @ondras , I'm adding images as base64:
image

When I add the image it re-arrange the nodes, that's excellent! (Please check below screenshot)
image

But when I open an existing map, it gives space between nodes as it is a single-line text (Please check below screenshot)
image

And when I select a node with image, write some text and update it.. then it re-arrange the parent node and gives the right amount of space.

How can I do the same re-arranging on restoring that we're doing to updating a node's text?

I have tried adding MM.Item.prototype.update(); after MM.App.io.restore(); but it doesn't work.

@ondras
Copy link
Owner

ondras commented Jul 13, 2020

But when I open an existing map, it gives space between nodes as it is a single-line text (Please check below screenshot)

That is probably because the image is not loaded yet, so the size of the node is not known. Loading an image (even if it is base64-encoded) is an asynchronous operation. You would need to add a load event listener and re-render the map once it happens.

ondras added a commit that referenced this issue Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants