Files
World6-travelmap/ReadMe.md
T
2026-09-14 02:50:10 -06:00

66 lines
2.5 KiB
Markdown

# World6-travelmap
I made a tool for marking paths and measuring distance. :D
I made a little program for displaying a simplistic graph of nodes and edges to
make a travel network with calculated distances... specifically for my Minecraft
World.
Data must be in a map.json file. `nodes` is an object with named arrays of info.
Each node is an `x`, `y`, and `z` position. The optional 4th item is `true` to
display the node's name, a string to display *that* as the node name, or `false`
to completely hide a node. `edges` is an array of arrays of two names of nodes.
An optional 3rd item can be set to `false` to hide an edge, or a string for a
custom label. `edges` can be nonexistent.
Pan with WASD or arrow keys.
Zoom with +/- keys.
`r` to reload the default map.
You can drag and drop a JSON file to load it.
Both nodes and edges can have an extra object with metadata, some of which is
used by this program. An array called `offset` will adjust the positioning of
labels. An array called `color` will set the color via 0 to 1 RGBA values.
Added `areas` which are exactly like nodes except that they always draw a white
label and can have a custom radius specified. Drawn between edges and nodes.
Use transparency. 25% works well.
- `box` can be an array of width/height to draw a rectangular shape instead
- `radius` can be an array of x/z radii to draw an ellipse instead of a circle
- `mode` can be "line" to draw an outline instead of filling
- `image` can be a file path, in which case `size` must be an array of desired
width/height (I recommend placing these in a subdirectory)
- path must be relative to the JSON file
Images are only loaded if they will be displayed.
## Example JSON
```json
{
"nodes": {
"TestA": [100, 0, 100],
"TestB": [150, 0, 200],
"TestC": [300, 0, -200, true],
"TestE": [1200, 0, 200, "Displayed Name"],
"TestFarLeft": [-200, 5000, 50],
"TestFarBottomRight": [1200, 0, 2000, true],
"Hidden Node": [0, 0, 0, false]
},
"edges": [
["TestA", "TestB"],
["TestA", "TestC"],
["TestB", "TestC"],
["TestC", "TestE"],
["TestE", "TestFarLeft"],
["Hidden Node", "TestC", false]
]
}
```
## Tasks
- [ ] image loading can't cope with arbitrary JSON file locations and always tries to load from within the repo
fix: use the DroppedFile during load to get path to load relative to
- [ ] r should reload whatever is currently loaded, not the default
- [ ] Split the code that makes this work from its use for my world, make it available easily from anywhere.