Taxonomy: Difference between revisions
From wikiluntti
(Created page with "=== Eliökunta === </graph> === Bakteerit ===") |
|||
| Line 2: | Line 2: | ||
<graph> | |||
{ | |||
"width": 600, | |||
"height": 150, | |||
"background": "#ffffff", | |||
"data": [ | |||
{ | |||
"name": "tree", | |||
"values": [ | |||
{"A": "Bakteerit","B": "Viuhkaeväiset","C": "Cladistia" }, | |||
{"A": "Alkueliöt (proktistit)","B": "Viuhkaeväiset","C": "Rustokiillesuomuiset" }, | |||
{"A": "Sienet","B": "Viuhkaeväiset","C": "Luukiillesuomuiset" }, | |||
{"A": "Kasvit","B": "Viuhkaeväiset","C": "Teleosteomorpa" }, | |||
{"A": "Eläimet","B": "Varsieväiset","C": "Latimeriat" }, | |||
], | |||
"transform": [ | |||
{ | |||
"type": "treeify", | |||
"groupby": ["A","B"] | |||
}, | |||
{ | |||
"type": "hierarchy", | |||
"mode": "cluster", | |||
"nodesize": [20,100] | |||
}, | |||
{ | |||
"type": "formula", | |||
"field": "align", | |||
"expr": "'right'" | |||
}, | |||
{ | |||
"type": "formula", | |||
"field": "offset", | |||
"expr": "-10" | |||
} | |||
] | |||
} | |||
], | |||
"marks": [ | |||
{ | |||
"type": "path", | |||
"from": { | |||
"data": "tree", | |||
"transform": [ | |||
{"type": "filter","test": "datum.parent"}, | |||
{ | |||
"type": "linkpath", | |||
"sourceX": "parent.layout_y", | |||
"sourceY": "parent.layout_x", | |||
"targetX": "layout_y", | |||
"targetY": "layout_x", | |||
"shape": "cornerX" | |||
} | |||
] | |||
}, | |||
"properties": { | |||
"enter": { | |||
"path": {"field": "layout_path"}, | |||
"strokeWidth": {"value": 2}, | |||
"stroke": {"value": "#000000"} | |||
} | |||
} | |||
}, | |||
{ | |||
"type": "text", | |||
"from": { | |||
"data": "tree", | |||
"transform": [ | |||
{ | |||
"type": "formula", | |||
"field": "ff_node_label", | |||
"expr": "if(datum.layout_depth == 0, 'Eliökunta', if(datum.layout_depth == 1, datum.A, if(datum.layout_depth == 2, datum.B, if(datum.layout_depth == 3, datum.C, ''))))" | |||
} | |||
] | |||
}, | |||
"properties": { | |||
"enter": { | |||
"x": {"field": "layout_y"}, | |||
"dx": {"field": "offset"}, | |||
"y": {"field": "layout_x"}, | |||
"dy": {"value": -8}, | |||
"font": {"value": "Arial"}, | |||
"fontSize": {"value": 16}, | |||
"align": {"field": "align"}, | |||
"baseline": {"value": "middle"}, | |||
"fill": {"value": "#0000ff"}, | |||
"text": {"field": "ff_node_label"} | |||
} | |||
} | |||
} | |||
] | |||
} | |||
</graph> | </graph> | ||
=== Bakteerit === | === Bakteerit === | ||
Revision as of 09:08, 15 June 2021
Eliökunta
<graph> {
"width": 600,
"height": 150,
"background": "#ffffff",
"data": [
{
"name": "tree",
"values": [
{"A": "Bakteerit","B": "Viuhkaeväiset","C": "Cladistia" },
{"A": "Alkueliöt (proktistit)","B": "Viuhkaeväiset","C": "Rustokiillesuomuiset" },
{"A": "Sienet","B": "Viuhkaeväiset","C": "Luukiillesuomuiset" },
{"A": "Kasvit","B": "Viuhkaeväiset","C": "Teleosteomorpa" },
{"A": "Eläimet","B": "Varsieväiset","C": "Latimeriat" },
],
"transform": [
{
"type": "treeify",
"groupby": ["A","B"]
},
{
"type": "hierarchy",
"mode": "cluster",
"nodesize": [20,100]
},
{
"type": "formula",
"field": "align",
"expr": "'right'"
},
{
"type": "formula",
"field": "offset",
"expr": "-10"
}
]
}
],
"marks": [
{
"type": "path",
"from": {
"data": "tree",
"transform": [
{"type": "filter","test": "datum.parent"},
{
"type": "linkpath",
"sourceX": "parent.layout_y",
"sourceY": "parent.layout_x",
"targetX": "layout_y",
"targetY": "layout_x",
"shape": "cornerX"
}
]
},
"properties": {
"enter": {
"path": {"field": "layout_path"},
"strokeWidth": {"value": 2},
"stroke": {"value": "#000000"}
}
}
},
{
"type": "text",
"from": {
"data": "tree",
"transform": [
{
"type": "formula",
"field": "ff_node_label",
"expr": "if(datum.layout_depth == 0, 'Eliökunta', if(datum.layout_depth == 1, datum.A, if(datum.layout_depth == 2, datum.B, if(datum.layout_depth == 3, datum.C, ))))"
}
]
},
"properties": {
"enter": {
"x": {"field": "layout_y"},
"dx": {"field": "offset"},
"y": {"field": "layout_x"},
"dy": {"value": -8},
"font": {"value": "Arial"},
"fontSize": {"value": 16},
"align": {"field": "align"},
"baseline": {"value": "middle"},
"fill": {"value": "#0000ff"},
"text": {"field": "ff_node_label"}
}
}
}
]
} </graph>