modality / obsidian-text-mapper

Render beautiful hex maps in Obsidian.md
MIT License
37 stars 9 forks source link

Orientation Math Tweaks and Namespacing #13

Closed modality closed 9 months ago

modality commented 9 months ago

What it is

Tests

Swap Even Odd

Depending on the hex program you use, you might get different numbering scheme. Here's the source (a section of "Wolves Upon the Coast" by Luke Gearing). You can see here that for an odd X hex like 01.04, the next hex to the right with the same Y value 02.04 is to the northeast

Screenshot 2024-01-21 at 2 14 01 PM

Before

If I put the hex numbers into the textmapper plugin, 0204 is rendered to the southeast of 0104

Screenshot 2024-01-21 at 2 13 01 PM

After

Adding option swap-even-odd fixes the alignment of hexes, producing something that looks more like the source material:

Screenshot 2024-01-21 at 2 13 07 PM

Coordinate Formatting

Here's the above map with option coordinates format {X}.{Y}. Now the map really matches the source material:

Screenshot 2024-01-21 at 2 16 15 PM

Namespacing

Before

Both these maps have option global set. Notice how the pointy top hexes used in the top map (which has option horizontal set) carry over to the bottom map:

Screenshot 2024-01-21 at 2 09 24 PM

After

Now the Obsidian document ID is appended to every ID in the map, and every SVG element is unique to the map.

Screenshot 2024-01-21 at 2 09 37 PM