Formats de sauvegarde des diagrammes de Sankey¶
Il existe deux formats pour charger des diagrammes de sankey dans l’application * JSON (structure de donnée interne sauvé en texte) * Texte
JSON¶
Le format json est le suivant:
{
"nodes": [
{
"color": "green",
"id": 0,
"name": "Pommes",
"type": "product",
"orientation": "vertical",
"visible": 1,
"input_links": [
1,
0
],
"output_links": [
5,
4
],
"total_input_offset": 40,
"input_offsets": [
0,
10,
40
],
"total_output_offset": 40,
"output_offsets": [
0,
20,
40
],
"horizontal_index": 1,
"x": 551,
"y": 224,
"title_length": 50
},
...
]
},
"nodes_names": [
"Pommes",
"Poires",
"Importations de poires",
"Importations de pommes",
"Production de poires",
"Production de pommes",
"Exportations de pommes",
"Consommation"
],
"links": [
{
"id": 0,
"source_name": "Production de pommes",
"target_name": "Pommes",
"source": 5,
"target": 0,
"value": 30,
"mini": 30,
"maxi": 30,
"classif": "measured",
"display_value": "default",
"type": "bezier_link_arrow",
"color": "green",
"title_length": 218,
"tooltip_text": "",
"x_center": 0.5
},
...
]
},
"filtered_nodes": [],
"filtered_nodes_names": [],
"filtered_links": [],
"user_scale": 45,
"current_filter": 0,
"previous_filter": 0,
Texte¶
Le format texte est le suivant:
nodes
color = #05ab3d
id = 0
name = Pommes
orientation = vertical
x = 650
y = 140
input_links = 1,0
output_links = 5,4
input_offsets = 0,10,40
output_offsets = 0,20,40
total_input_offset = 40
total_output_offset = 40
merged_name = Fruits
...
links
color = #05ab3d
id = 0
source = 2
target = 0
source_name = Production<br>de pommes
target_name = Pommes
value = 30
x_center = 0.5
...
filtered_nodes
filtered_links
scale = 45
current_filter = 0
max_filter = 30