Documentation
¶
Overview ¶
Package formats defines the serialization formats which can be used for network graph persistence
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteCytoscapeJSON ¶
WriteCytoscapeJSON is to write this network graph using Cytoscape JSON encoding. Generated JSON file can be used for visualization with Cytoscape application https://cytoscape.org or as input to the Cytoscape JavaScript library https://js.cytoscape.org This will use goNEAT default style for the graph. If you want to apply different style you can use WriteCytoscapeJSONWithStyle and provide your style as a parameter.
func WriteCytoscapeJSONWithStyle ¶
func WriteCytoscapeJSONWithStyle(w io.Writer, n *network.Network, style *CytoscapeStyleOptions) error
WriteCytoscapeJSONWithStyle allows writing of this network graph using Cytoscape JSON encoding. Additionally, it is possible to provide style to be used for rendering of the graph. For more details about style, see https://js.cytoscape.org/#getting-started/specifying-basic-options
Types ¶
type CytoscapeStyleOptions ¶
type CytoscapeStyleOptions struct { // Style the style to be applied to the graph elements: nodes and edges. Style []ElementStyle // Layout the layout used for the graph visualization. See https://js.cytoscape.org/#layouts Layout interface{} }
CytoscapeStyleOptions is to hold style options to be appended to the graph elements definition when serializing to Cytoscape JSON. Form more details, see https://js.cytoscape.org/#getting-started/specifying-basic-options
type ElementStyle ¶
type ElementStyle struct { //// Selector is to select element to apply style: node or edge Selector string `json:"selector"` //// Style the map with style options to be applied Style map[string]interface{} `json:"style"` }
ElementStyle is to define style of particular element: edge or node. See https://js.cytoscape.org/#style