Skip to content
Matt Cox edited this page Jun 2, 2014 · 15 revisions

#####graphHeight: [int]
Height of graph in pixels. Unless specified, graph height defaults to to the height of the current window. #####graphWidth: [int]
Width of graph in pixels. Unless specified, graph height defaults to to the height of the current window. #####alpha: [float] .5
Is a part of the d3 force layout, alpha sets the cooling parameter for the force layout. You can read more about how changing the default value for alpha can change the layout here. #####cluster: [false| 'string'] false
Currently implemented as bool Clustering nodes will have an effect on layout and color. If you wish to cluster nodes, simply define the key that will identify a nodes cluster within each node object in your GraphJSON data object. E.g. if you have identified node communities by assigning them communities as ingtegers under the "community" key in your GraphJSON, that is the key that you would pass to cluster. Alchemy.js will except any values under the cluster key in the GraphJSON (string, integer, float) as long as precisely the same value is used for all nodes in a cluster. #####clusterColours: [array of strings]
["#DD79FF", "#FFFC00","#00FF30", "#5168FF","#00C0FF", "#FF004B", "#00CDCD", "#f83f00", "#f800df", "#ff8d8f","#ffcd00", "#184fff","#ff7e00"]) curently implemented as colours Provides a list of colors that can be assigned to different clusters. Elements are strings of hex or rgb values. The above colors are the defaults that are randomly assigned to the clusters using the fisherYates algorithm.

#####forceLocked: [bool] true force layout does not continue after initial node layout #####linkDistance: [integer|function] 2000 Alchemy.js provides the ability for a user defined custom link distance function in the force layout. If you wish to override the default value with a function or provide another static value, simply pass it as the value for linkDistance. Read more about how linkDistance is used in d3's force layout here #####nodePositions: [array] null not currently implemented Per the GraphJSON specifications, users can provide GraphJSON with nodes that containb pre-calculated layout positions for nodes in pixel length. The nodePositions parameter tells alchemy where to look up the node position. The most obvious parameter for the user to pass woul be ["x","y"] telling alchemy to look for the x position for nodes with the "x" key on each node where available, and the y position with the "y" key. A user could just as easily define a custom set of keys for their GraphJSON. For example, ["apples","oranges"] would tell alchemy to look for the x position of nodes with the "apples" key and the y position of nodes with the "organges" key.

Clone this wiki locally