Hi All, I have copied the code from highcharts for the network graph. It gave me several errors. I’ve been able to fix some but there’s some i just can’t figure out. Is someone able to help? I’d really appreciate it! I’m sorry i don’t know how to make this any easier to read, but a good way to replicate it is to take the network highchart code and paste it into a highchart graph. Here’s the code below. thanks all!
{
“chart”: {
“type”: “networkgraph”,
“height”: “60%”
},
“plotOptions”: {
“networkgraph”: {
“keys”: [“from”, “to”,“color”,“width”]
//Enable this section if you want the nodes and links to be animated
//This is more resource intensive and can cause low end machines to freeze.
// “layoutAlgorithm”: {
// “enableSimulation”: true,
// “friction”: -0.9
// }
}
},
“series”: [{
“dataLabels”: {
“enabled”: true,
“linkFormat”: “”,
“style”: {
“fontSize”: “10px”,
“fontWeight”: “normal”
}
},
//From Lang, To Lang, Link Width, Link Color
//Link color and width are set for just couple of links using analysis level calcs.
//This is just to demonstrate the capability.
“data”: [“getColumn”,0,1,2,3],
//Leaf nodes aren’t present in From Language getColumn and
//Top parent node isn’t in To Language column.
//Hence, got to get unique value from both columns to set nodes.
//Using an extra map wrapper to reuse the node weightage for radius and color.
“nodes”:[“map”,
[“map”,
//Unique langauges from both From and To Language columns
[“unique”,[“+”, [“getColumn”,0], [“getColumn”,1]]],
//Creating an intermediate object array to feed the outer map
{
“language”: [“item”],
//Get node level: 1 (top) - 7 (leaf)
“nodeLevel”:[“get”,
[“get”,
[“+”, //Adding a dummy value (explained below)
//Filter rows matching From Language
[“filter”,
[“getColumn”,0,4], //From Language, Level
//Where From Language = Language from (immediate) outer map
[“==”,[“get”,[“item”],0], [“item”,2]]
],
//Outer map is working on unique languages from both From and To columns.
//So, When processing a leaf node entry, which isn’t present in From Language,
//the above filter will return an empty array.
//Hence, adding a Dummy with value 7 to end of array to cover leaf nodes
[[“Dummy”,7]]
],
0 //Pick first array; All should be same as we are filtered for one language at a time
],
1 //Pick the language level
]
}
],
//Shaping the above intermediate object into node objects
{
“id”:[“get”,“item”,“language”], //Language from intermediate object
“color”: [“get”, //Pick a color based on level
[“getColorTheme”], //Returns colors from QuickSight theme
[“-”,
[“get”,[“item”],“nodeLevel”], //Node level from intermediate object
1 //Substracting one to convert level to 0 based index
]
],
“marker”: {
“radius”:[“-”, //Reversing level so that top node is biggest
10, //Using 10 so that leaf node isn’t too small
[“get”,[“item”],“nodeLevel”]
]
}
}
]
}
]
}
And then here are the errors i’m still getting.
-
33:16 Warning: Missing property “type”,
-
67:18 Warning: Incorrect type. Expected “object”.
-
69:13 Warning: Incorrect type. Expected “object”,
-
129:18 Warning: Incorrect type. Expected “string”
-
131:22 Warning: Incorrect type. Expected “object”.