mindmap-markdown icon indicating copy to clipboard operation
mindmap-markdown copied to clipboard

Canvas

Open Hela-Girl opened this issue 1 year ago • 22 comments

Good afternoon, Don! Perhaps you will have some free time this month to see how you can set up converting a file to *.canvas?

Hela-Girl avatar Jan 03 '24 08:01 Hela-Girl

Perhaps this month you will have some free time to implement "Canvas"?

Hela-Girl avatar Mar 04 '24 13:03 Hela-Girl

I've looked at it a couple of times. Much more complex than the mindmap. Requires positions and colors which will be a different parsing technique. It will be while before I can get to it - I have a couple of other open source projects to update first. Thanks for pushing though!

djsudduth avatar Mar 06 '24 00:03 djsudduth

Thanks for answering. I'll wait, I have no choice anyway. Can I write to you in a month, maybe you’ll have a minute?

Hela-Girl avatar Mar 27 '24 06:03 Hela-Girl

@Hela-Girl just wanted to let you know I had done some updates to fix some of the input/output-i and -o switches. Some of the code was lost in the process. I believe I recovered everything - but, be sure to make a backup of mindmd.py before you download the latest changes. I haven't looked at canvas additions yet. I will soon.

djsudduth avatar Apr 21 '24 03:04 djsudduth

Thank you for making changes to the code. I look forward to the finalization.

Hela-Girl avatar May 02 '24 16:05 Hela-Girl

** Mindmap Markdown v-0.0.2 **

Mindmap: mindmaps/Rain-game.smmx ----> Markdown: markdown/Rain-game.md
Traceback (most recent call last):
  File "C:\Users\MaX\Downloads\111\mindmap-markdown-main\mindmd.py", line 414, in <module>
    main()
  File "C:\Users\MaX\Downloads\111\mindmap-markdown-main\mindmd.py", line 368, in main
    write_output(DEFAULT_MINDMAP, outfile, nums, vs)
  File "C:\Users\MaX\Downloads\111\mindmap-markdown-main\mindmd.py", line 270, in write_output
    sm_nodes = parse_mind_map(infile)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\MaX\Downloads\111\mindmap-markdown-main\mindmd.py", line 168, in parse_mind_map
    topic_node.title = topic.get('text').replace('\\N',' ')
                       ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'

So far, this is the error with these startup parameters: python mindmd.py -i mindmaps/Rain-game.smmx -o markdown/Rain-game.md

Hela-Girl avatar May 02 '24 16:05 Hela-Girl

Sorry - when I re-added the code I missed a line. Just put a # in front of line 168 so it looks like this:

#topic_node.title = topic.get('text').replace('\\N',' ')  
topic_node.title = topic.get('text')
if topic_node.title is not None:
(etc)

I'll fix it

djsudduth avatar May 02 '24 20:05 djsudduth

@Hela-Girl - fixed

djsudduth avatar May 03 '24 00:05 djsudduth

https://i.imgur.com/vqC3VaX.jpeg

Hurray it seems to be working. Thank you for your quick response. It's a pity that it's not canvas.

Hela-Girl avatar May 03 '24 09:05 Hela-Girl

Hi @Hela-Girl - I'm starting to look at export to Canvas now. Can you provide to a link to one of your mindmaps - preferably somewhat simple but reflects what you want? I can't start with a huge mindmap - but, maybe one with 5-10 branches and some attached images in the way you like?
Thx!!

djsudduth avatar May 17 '24 23:05 djsudduth

https://mega.nz/folder/I7pBSBgb#7b_h0svNZvcbbrByAoqIag

Thank you for not forgetting about me! The link contains 2 files, one very small and the second a little larger (with external files), for testing. Please note that the images are connected to the knot by invisible threads, in addition to the knots that are also connected to each other.

Hela-Girl avatar May 18 '24 05:05 Hela-Girl

Thx @Hela-Girl - got them. One question for you. Your examples are more visual and probably don't need a markdown note for each node. In my case I do since my mindmaps have notes within each node and I want an Obsidian note for each. I'm wondering if you only need a canvas for visualization and no notes??

However, I do see one issue. If you need an image embedded in an Obsidian Canvas node, then you have to have a markdown note file that contains the image for that. But, if is just an image or box with a only title, then a markdown note file isn't needed. So, in your example 1.smmx, one image is within the Simplemind node - vs. the other images are outside - so I have to create a markdown file just for that one Simplemind node.

djsudduth avatar May 18 '24 20:05 djsudduth

hi @djsudduth, I think the notes will be useful since I made the map specifically the simplest one for the test.

Hela-Girl avatar May 19 '24 03:05 Hela-Girl

hi @djsudduth, do you have some time this month to try to implement the canvas?

Hela-Girl avatar Jun 11 '24 19:06 Hela-Girl

Hey @Hela-Girl ! I made some progress but had to stop and fix another application. Good timing, however, I'm back at it! I'll let you know soon.

djsudduth avatar Jun 11 '24 19:06 djsudduth

hi @djsudduth, maybe there will be a few days off in August to finish with the “canvas”?

Hela-Girl avatar Aug 02 '24 08:08 Hela-Girl

@Hela-Girl - made some progress but having some issues to work through. I think I need to refactor the app (since it was a quick-hit need in the first place). But, let me see if I can at least get you a prototype to look at.

djsudduth avatar Aug 02 '24 19:08 djsudduth

Good afternoon, can you spend some time on this thread this month?

Hela-Girl avatar Sep 15 '24 17:09 Hela-Girl

@Hela-Girl sorry on the delay - I promise I'll get to it

djsudduth avatar Sep 16 '24 01:09 djsudduth

@Hela-Girl I've created a new 'develop' branch to start the work. It isn't functional yet, but new Canvas code will be there until the release is done.

djsudduth avatar Sep 16 '24 02:09 djsudduth

This is great news!

Hela-Girl avatar Sep 16 '24 05:09 Hela-Girl

@Hela-Girl getting there... image

djsudduth avatar Oct 15 '24 00:10 djsudduth

Hello, great news! Does it support images?

Hela-Girl avatar Oct 15 '24 04:10 Hela-Girl

Getting there soon...

djsudduth avatar Oct 15 '24 05:10 djsudduth

Thank you very much for not giving up on what you started.

Hela-Girl avatar Oct 15 '24 06:10 Hela-Girl

Closer - there are still some weird issues with what Obsidian supports vs SimpleMind

image

djsudduth avatar Oct 16 '24 16:10 djsudduth

Wow, the beginning is already visible! This is the most important thing!

Hela-Girl avatar Oct 16 '24 16:10 Hela-Girl

Ok, @Hela-Girl - first BETA version is ready for some testing. Please be gentle to start with some basic examples. Here's what you need to do:

  1. Don't install this in your current setup - use a separate directory
  2. Go to the branch here in Github called develop
  3. Download the entire develop zip file into a new testing directory and unzip it there (https://github.com/djsudduth/mindmap-markdown/archive/refs/heads/develop.zip)
  4. The new switch to create the Obsidian canvas file is -c (so python mindmd.py -c)
  5. If the -c is used, then every simplemind node becomes a new markdown note and the canvas file is given the 'output name'.canvas
  6. Run the default test of the sample file with python mindmd.py -c which will give you an example
  7. The files have relative paths in the new test directory. I would suggest running this BETA version outside of Obsidian directories and then just copy all the files from the default markdown and markdown/media directories to Obsidian manually. (If you just copy the parent markdown directory in the new BETA version install folder, and just paste in the Obsidian parent folder - that should work and you'll see it in Obsidian automatically)

Just to note - Simplemind does not have connections between images and nodes. Also, cross-connections or relations between nodes isn't done yet.

Also, this does not work with the batch output yet.

Let me know what you discover!

djsudduth avatar Oct 16 '24 22:10 djsudduth

https://i.imgur.com/RlnCnju.jpeg and https://i.imgur.com/zxco0yo.jpeg

It works, but not all paths are there and there are a lot of extra files that probably also need to be processed somehow. Or maybe I configured something wrong...

https://mega.nz/file/4zJ2HQSD#bBl8bbF7DQ9X7RS2fZ_1kiuqXFlgxKMTkYmjzkgqrRI Link to file as an example.

Hela-Girl avatar Oct 17 '24 06:10 Hela-Girl

Fix has been added. Download the latest in develop. You should change the settings.cfg to something like this: [SETTINGS]
input_path = mindmaps/
output_path = betamarkdown/
media_path = media/
test_file_name = Rain-game.smmx
canvas_path = blank

Then, just copy the folder called betamarkdown to your Obsidian parent directory to test it.

image

djsudduth avatar Oct 17 '24 14:10 djsudduth