No description
Find a file
Finn Romaneessen 4b0099526c 1.1.0
2026-03-01 19:22:10 +01:00
.github/workflows Fixed rlease.yaml 2025-01-13 22:52:45 +01:00
images Automatically calculate node values with ?-operator. Closes #4 2026-03-01 19:08:16 +01:00
src Automatically calculate node values with ?-operator. Closes #4 2026-03-01 19:08:16 +01:00
.editorconfig Initial commit 2024-11-18 22:42:34 +01:00
.eslintignore Initial commit 2024-11-18 22:42:34 +01:00
.eslintrc Initial commit 2024-11-18 22:42:34 +01:00
.gitignore Initial commit 2024-11-18 22:42:34 +01:00
.npmrc Initial commit 2024-11-18 22:42:34 +01:00
esbuild.config.mjs Updated README.md 2025-01-10 13:41:11 +01:00
LICENSE Added LICENSE 2025-01-10 13:51:00 +01:00
manifest.json 1.1.0 2026-03-01 19:22:10 +01:00
package-lock.json 1.1.0 2026-03-01 19:22:10 +01:00
package.json 1.1.0 2026-03-01 19:22:10 +01:00
README.md Automatically calculate node values with ?-operator. Closes #4 2026-03-01 19:08:16 +01:00
tsconfig.json Initial commit 2024-11-18 22:42:34 +01:00
version-bump.mjs Initial commit 2024-11-18 22:42:34 +01:00
versions.json 1.1.0 2026-03-01 19:22:10 +01:00

Sankey Diagrams for Obsidian

Create Sankey diagrams in Obsidian.

Usage

To generate a Sankey diagram, create a sankey code block. Sankey diagrams consist of links and nodes that can be specified using YAML.

Links are created using a source, a target and a value.

links:
- source: A
  target: B
  value: 1

A link value can be set to ? to have it calculated automatically. The plugin will infer the value using conservation of flow: what enters a node must equal what leaves it. A ? value can be resolved as long as it is the only unknown on one side of a node.

links:
  - source: Income
    target: Budget
    value: 3000
  - source: Budget
    target: Rent
    value: 1200
  - source: Budget
    target: Savings
    value: ?   # resolved as 3000 - 1200 = 1800

Chains are supported — resolving one unknown can unlock others. An error is shown in place of the diagram if a value cannot be resolved.

Nodes

Nodes can be explicitly created to add a specific color to a node. If none or not all nodes are added to the code block, the rest of the nodes will be inferred from the link targets and sources.

nodes:
- name: A
  color: blue

Examples

Basic example

A simple example using only links.

links:
- source: A
  target: B
  value: 100
- source: B
  target: C
  value: 50
- source: B
  target: D
  value: 50
- source: D
  target: E
  value: 25
- source: D
  target: F
  value: 25
- source: Z
  target: A
  value: 75
- source: Y
  target: A
  value: 25

Results in:

image

Node colors

An example specifying the colors for nodes A and B.

nodes:
- name: A
  color: blue
- name: B
  color: green
links:
- source: A
  target: B
  value: 1
- source: A
  target: C
  value: 2

Results in:

image