Skip to content

Commit 41444ab

Browse files
committed
update readme
1 parent cb99645 commit 41444ab

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

README.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,60 @@ This is a panel plugin for generating Sankey diagrams in Grafana 8.0+. Sankey di
1111

1212
## What's Different in This Fork
1313

14-
This fork simplifies the data parser to support **multi-step Sankey charts from just 3 columns of data**: `source`, `destination`, and `value`. This makes it easier to create complex flow visualizations without complex query structuring.
14+
This fork simplifies the data parser to support **multi-step Sankey charts from 3 or 4 columns of data**:
15+
- **3-column format**: `source`, `destination`, `value`
16+
- **4-column format**: `source`, `destination`, `color`, `value`
17+
18+
This makes it easier to create complex flow visualizations without complex query structuring.
1519

1620
![](https://github.com/netsage-project/netsage-sankey-panel/blob/master/src/img/sankey2.png?raw=true)
1721

22+
## Data Format
23+
24+
### Basic Format (3 columns)
25+
The basic format requires exactly 3 columns:
26+
1. **Source** - The starting node of the flow (string)
27+
2. **Destination** - The ending node of the flow (string)
28+
3. **Value** - The numeric value/weight of the flow (number)
29+
30+
Example query result:
31+
```
32+
source | destination | value
33+
-------|-------------|------
34+
A | B | 100
35+
B | C | 80
36+
A | C | 50
37+
```
38+
39+
### Custom Colors Format (4 columns)
40+
You can optionally add a 4th column to specify custom colors for each link:
41+
1. **Source** - The starting node of the flow (string)
42+
2. **Destination** - The ending node of the flow (string)
43+
3. **Color** - The color for this specific link (string)
44+
4. **Value** - The numeric value/weight of the flow (number)
45+
46+
The color column is automatically detected by:
47+
- **Column name**: If the column is named "color" or "colour"
48+
- **Column values**: If the values look like colors (hex codes, rgb, hsl, or CSS color names)
49+
50+
Example query result with colors:
51+
```
52+
source | destination | color | value
53+
-------|-------------|-----------|------
54+
A | B | #FF0000 | 100
55+
B | C | #00FF00 | 80
56+
A | C | blue | 50
57+
```
58+
59+
Supported color formats:
60+
- **Hex codes**: `#FF0000`, `#F00`, `#FF0000FF`
61+
- **RGB/RGBA**: `rgb(255, 0, 0)`, `rgba(255, 0, 0, 0.5)`
62+
- **HSL/HSLA**: `hsl(120, 100%, 50%)`, `hsla(120, 100%, 50%, 0.5)`
63+
- **CSS color names**: `red`, `blue`, `green`, etc.
64+
- **Named theme colors**: `dark-green`, `dark-blue`, `dark-red`, `dark-yellow`, `dark-orange`, `dark-purple` (and their `semi-dark-`, `light-`, `super-light-` variants)
65+
1866
## How it works
19-
The sankey panel requires at least 2 columns of data, a source and destination for the flows. This means your query should group your data into at least two groups. The screenshot above shows data grouped by source country, then by destination county.
20-
The panel will draw links from the first column of data points, to the last in order of the query. The thickness of the links will be proportionate to the value as assigned by the metric in the query.
67+
The panel will draw links from the source to the destination nodes. The thickness of the links will be proportionate to the value. When using the 4-column format with custom colors, each link will use its specified color. Otherwise, colors are automatically assigned based on the source node.
2168

2269
![](https://github.com/netsage-project/netsage-sankey-panel/blob/master/src/img/sankey3.png?raw=true)
2370

0 commit comments

Comments
 (0)