package cytoscapejs
import "gonum.org/v1/gonum/graph/formats/cytoscapejs"
Package cytoscapejs implements marshaling and unmarshaling of Cytoscape.js JSON documents.
See http://js.cytoscape.org/ for Cytoscape.js documentation.
Index ¶
- type Edge
- type EdgeData
- func (e *EdgeData) MarshalJSON() ([]byte, error)
- func (e *EdgeData) UnmarshalJSON(data []byte) error
- type ElemData
- func (e *ElemData) MarshalJSON() ([]byte, error)
- func (e *ElemData) UnmarshalJSON(data []byte) error
- type ElemType
- type Element
- type Elements
- type GraphElem
- type GraphNodeEdge
- type Node
- type NodeData
- func (n *NodeData) MarshalJSON() ([]byte, error)
- func (n *NodeData) UnmarshalJSON(data []byte) error
- type Position
Types ¶
type Edge ¶
type Edge struct { Data EdgeData `json:"data"` Selected bool `json:"selected,omitempty"` Selectable bool `json:"selectable,omitempty"` Classes string `json:"classes,omitempty"` Scratch interface{} `json:"scratch,omitempty"` }
Edge is a Cytoscape.js edge.
type EdgeData ¶
EdgeData is a graph edge's data container.
func (*EdgeData) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*EdgeData) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type ElemData ¶
type ElemData struct { ID string Source string Target string Parent string Attributes map[string]interface{} }
ElemData is a graph element's data container.
func (*ElemData) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*ElemData) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type ElemType ¶
type ElemType int
ElemType describes an Element type.
type Element ¶
type Element struct { Group string `json:"group,omitempty"` Data ElemData `json:"data"` Position *Position `json:"position,omitempty"` RenderedPosition *Position `json:"renderedPosition,omitempty"` Selected bool `json:"selected,omitempty"` Selectable bool `json:"selectable,omitempty"` Locked bool `json:"locked,omitempty"` Grabbable bool `json:"grabbable,omitempty"` Classes string `json:"classes,omitempty"` Scratch interface{} `json:"scratch,omitempty"` }
Element is a mixed graph element.
func (Element) Type ¶
Type returns the element type of the receiver. It returns an error if the Element Group is invalid or does not match the Element Data, or if the Element Data is an incomplete edge.
type Elements ¶
Elements contains the nodes and edges of a GraphNodeEdge.
type GraphElem ¶
type GraphElem struct { Elements []Element `json:"elements"` Layout interface{} `json:"layout,omitempty"` Style []interface{} `json:"style,omitempty"` }
GraphElem is a Cytoscape.js graph with mixed graph elements.
type GraphNodeEdge ¶
type GraphNodeEdge struct { Elements Elements `json:"elements"` Layout interface{} `json:"layout,omitempty"` Style []interface{} `json:"style,omitempty"` }
GraphNodeEdge is a Cytoscape.js graph with separated nodes and edges.
type Node ¶
type Node struct { Data NodeData `json:"data"` Position *Position `json:"position,omitempty"` RenderedPosition *Position `json:"renderedPosition,omitempty"` Selected bool `json:"selected,omitempty"` Selectable bool `json:"selectable,omitempty"` Locked bool `json:"locked,omitempty"` Grabbable bool `json:"grabbable,omitempty"` Classes string `json:"classes,omitempty"` Scratch interface{} `json:"scratch,omitempty"` }
Node is a Cytoscape.js node.
type NodeData ¶
NodeData is a graph node's data container.
func (*NodeData) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*NodeData) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Position ¶
Position is a node position.
Source Files ¶
cytoscapejs.go
- Version
- v0.15.1 (latest)
- Published
- Aug 16, 2024
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 days ago –
Tools for package owners.