Kartmakare map formats

Readable JSON format version 1 · Share-link binary format version 3 · Status: stable
File exports use the .json extension (Kartmakare-readable.json).

This document specifies the formats used by Kartmakare to export, import and share Wardley maps. Readable JSON (sections 1–6) is the recommended interchange format for third-party tools: anything that writes a file matching this spec can be dropped straight into Kartmakare, and anything Kartmakare exports as “Readable JSON” follows it. Section 7 specifies the share-link binary format, for tools that want to emit a link (or QR code) that opens directly in Kartmakare.

Kartmakare also has a Compact JSON file format (a positional array, not covered here) — for file interchange use Readable JSON.
Contents
  1. Overview
  2. Coordinate system
  3. Entities
  4. Import behaviour
  5. Minimal valid example
  6. Writer's checklist
  7. Share-link binary format (QR / #k= URLs)
  8. Licensing

1. Overview

A map file is a single JSON object:

{
  "type": "kartmakare",
  "version": 1,
  "exported": "2026-07-07T12:00:00.000Z",
  "anchor": "Customer needs hot tea",
  "anchorLinks": ["id-kettle"],
  "items": [ ... ],
  "links": [ ... ],
  "areas": [ ... ],
  "labels": [ ... ]
}
FieldTypeRequiredDescription
typestringyesMust be exactly "kartmakare". This is the file discriminator — without it the import is rejected.
versionnumberrecommendedFormat version. Currently 1.
exportedstringnoISO 8601 timestamp. Informational only; ignored on import.
anchorstringnoThe user need at the top of the map. Empty string if unset.
anchorLinksstring[]noIDs of items linked directly to the anchor.
itemsItem[]yesThe map's components. May be empty.
linksLink[]yesDependencies between components. May be empty.
areasArea[]yesFreeform grouping blobs. May be empty.
labelsLabel[]noFreestanding text labels.

items, links and areas must be present (as arrays, even if empty) for the file to be recognised as Kartmakare data.

2. Coordinate system

All positions are fractions from 0 to 1 on both axes.

Evolution stages

The X axis is divided into four equal columns:

Stage valueColumn (posX range)Column centreUI label
"genesis"0.00 – 0.250.125Genesis
"custom"0.25 – 0.500.375Custom Built
"product"0.50 – 0.750.625Product
"commodity"0.75 – 1.000.875Commodity
"" (empty)——unstaged

stage and posX are stored independently, but Kartmakare keeps them consistent whenever the user drags an item (stage is re-derived from the X position). Writers should do the same: set stage to the column that posX falls in, or place the item at the column centre for its stage. An unstaged item (stage: "") conventionally sits at posX: 0, posY: 0 and shows up in Kartmakare's list/staging flow rather than on the map.

3. Entities

3.1 Item (component)

{
  "id": "3f2b8c4e-...",
  "text": "Kettle",
  "stage": "product",
  "posX": 0.625,
  "posY": 0.62,
  "evolvedFrom": "id-of-source-item"
}
FieldTypeRequiredConstraints
idstringyesNon-empty, unique within the file. Kartmakare uses UUIDs but any unique string works.
textstringyesDisplay name. Kartmakare's UI caps input at 200 chars.
stagestringnoOne of "", "genesis", "custom", "product", "commodity". null/missing is treated as "". Any other value drops the item.
posXnumberyesFinite number, 0–1.
posYnumberyesFinite number, 0–1.
evolvedFromstringnoID of the item this one evolved out of. Renders the item with a dashed outline and implies an evolution relationship. Cleared on import if the referenced ID doesn't exist.

3.2 Link (dependency)

{
  "id": "a1b2c3-...",
  "fromId": "id-cup-of-tea",
  "toId": "id-kettle",
  "style": "solid"
}
FieldTypeRequiredConstraints
idstringyesNon-empty, unique.
fromIdstringyesMust reference an existing item ID, otherwise the link is dropped.
toIdstringyesSame.
stylestringyesOne of "solid", "dashed", "evolution". Anything else drops the link.

Semantics: a link means fromId depends on toId. "solid" is a normal dependency, "dashed" a weak/inherited one, and "evolution" is the arrowed link from an item to its evolved successor (pair it with the successor's evolvedFrom field).

3.3 Area (grouping blob)

An area is a smooth Bezier blob drawn around a set of items.

{
  "id": "e5f6a7-...",
  "itemIds": ["id-kettle", "id-water", "id-power"],
  "vertexAdjustments": [],
  "midpointOffsets": []
}
FieldTypeRequiredConstraints
idstringyesNon-empty.
itemIdsstring[]yesItems enclosed by the blob. Unknown IDs are filtered out; an area left with zero valid items is dropped.
vertexAdjustmentsobject[]noManual shape fine-tuning (below). Safe to write as [].
midpointOffsetsobject[]noManual edge fine-tuning (below). Safe to write as [].

The blob's shape is derived — convex hull of the member items plus padding — so third-party writers only need itemIds. The two adjustment arrays exist so hand-tuned shapes survive a round-trip; preserve them if you read-modify-write a file, emit [] if you generate maps from scratch.

For completeness:

3.4 Label (freestanding text)

{
  "id": "b9c0d1-...",
  "text": "Team Platform owns this",
  "posX": 0.4,
  "posY": 0.15,
  "width": 160
}
FieldTypeRequiredConstraints
idstringyesNon-empty.
textstringyesLabel text.
posX, posYnumberyesFinite, 0–1, same coordinate system as items.
widthnumbernoBox width in pixels, 40–600. Defaults to 100.

3.5 Anchor

The anchor is the user need that sits at the top of a Wardley map. It is a plain string (anchor) plus a list of item IDs it connects to (anchorLinks). Unknown IDs in anchorLinks are filtered out on import.

4. Import behaviour (what Kartmakare does with your file)

Understanding the importer helps you write robust files:

  1. Discrimination. The JSON must parse, and must either be an object with type: "kartmakare" and array-valued items/links/areas, or a Compact JSON array. Otherwise the file is rejected outright.
  2. Field-level sanitising. Each entry is validated against the rules in section 3. Malformed entries are dropped, not repaired (except: missing stage becomes "", dangling evolvedFrom is deleted, dangling itemIds/anchorLinks entries are filtered). The user is told how many entries were dropped.
  3. Cross-reference grounding. Everything that points at an item ID is checked against the surviving items — links, areas, anchor links and evolvedFrom never dangle after import.
  4. Replacement, not merge. A successful import replaces the whole map.
  5. Unknown extra fields on entities are currently carried along untouched, but don't rely on that — treat the fields in this spec as the contract.

5. Minimal valid example

The smallest useful file another app can emit:

{
  "type": "kartmakare",
  "version": 1,
  "anchor": "Customer needs hot tea",
  "anchorLinks": ["cup"],
  "items": [
    { "id": "cup",    "text": "Cup of tea", "stage": "custom",    "posX": 0.375, "posY": 0.85 },
    { "id": "kettle", "text": "Kettle",     "stage": "product",   "posX": 0.625, "posY": 0.55 },
    { "id": "power",  "text": "Power",      "stage": "commodity", "posX": 0.875, "posY": 0.20 }
  ],
  "links": [
    { "id": "l1", "fromId": "cup",    "toId": "kettle", "style": "solid" },
    { "id": "l2", "fromId": "kettle", "toId": "power",  "style": "solid" }
  ],
  "areas": [],
  "labels": []
}

Drop this onto Kartmakare's import view (or anywhere in the window) and it renders as a three-component map with the anchor at the top.

6. Writer's checklist

Kartmakare share links carry the whole map in the URL fragment:

https://thekmf.github.io/Kartmakare/#k=<payload>

There is no server; the receiving page decodes the fragment locally. A tool that implements this section can emit links (or QR codes of them) that open directly in Kartmakare.

7.1 Pipeline

map state → KM3 binary (7.3) → raw DEFLATE → base64url → "#k=" + payload
Legacy links: payloads whose decoded bytes start with the gzip magic 1f 8b are the older format (gzip-wrapped Compact JSON). A valid raw-DEFLATE stream can never start with those bytes, so the two are unambiguous. New writers should only emit the current format.

7.2 Primitives

All integers are unsigned LEB128 varints: 7 bits per byte, little-endian groups, high bit = continuation. Signed values use zigzag coding first (n → n<0 ? -2n-1 : 2n), then varint.

Strings are UTF-8. String lists are written as all lengths (varints) first, then all UTF-8 bytes concatenated — lengths block, then text blob.

Positions (posX/posY, and label positions) are encoded from q = round(pos * 1000) (clamped 0–1000):

Decode: if bit 0 is set, pos = ((v>>1) * 25) / 1000, else pos = (v>>1) / 1000.

Stage numbering where used: 0 = unstaged, 1 = genesis, 2 = custom, 3 = product, 4 = commodity.
Link style numbering: 0 = solid, 1 = dashed, 2 = evolution.

7.3 Layout

In order, with n = item count:

#FieldEncoding
1format version1 byte, must be 3
2item count nvarint
3item textsstring list (7.2)
4item posX × nposition encoding
5item posY × nposition encoding
6stage exceptionsvarint count, then per entry: varint item index + 1 byte stage (0–4)
7evolvedFrom pairsvarint count, then per entry: varint item index + varint source item index
8link count mvarint
9link endpointsper link: varint from-index + varint to-index
10link stylesceil(m/4) bytes, 2 bits per link, LSB-first within each byte
11area countvarint
12areasper area, see below
13label countvarint
14label textsstring list
15label geometryper label: posX + posY (position encoding) + varint width (0 means default 100)
16anchorvarint byte-length + UTF-8
17anchor linksvarint count + varint item indices

Stage exceptions (6): an item's stage defaults to the column derived from its position: floor(round(posX*1000) / 250), clamped to 3 (giving genesis/custom/product/commodity). Only items whose actual stage differs — chiefly unstaged items — get an exception entry.

Per area (12):

FieldEncoding
member itemsvarint count + varint item indices
vertex adjustmentsvarint count, then per entry: varint item index + 5 zigzag varints: radiusOffset*100, handleLenA*100, handleLenB*100, handleAngleA*1000, handleAngleB*1000
midpoint offsetsvarint count, then per entry: varint from-index + varint to-index + 2 zigzag varints: dx*10, dy*10

A generator can write 0 for both adjustment counts (shapes are derived from the member items).

7.4 Writer's notes

8. Licensing

Kartmakare is released under the PolyForm Noncommercial License 1.0.0 — free to use, modify and share for any noncommercial purpose. The full license text ships with the source as LICENSE.md.

The license covers Kartmakare's software. This format specification is published to enable interoperability — you are welcome to write your own independent readers and writers for these formats, in any tool, under any license you choose. Preserved compatibility is appreciated; the format version fields exist so future revisions can evolve without breaking yours.

Copyright © Kristoffer Fredriksson. The author retains dual-licensing rights.