package sigmajs

import "gonum.org/v1/gonum/graph/formats/sigmajs"

Package sigmajs implements marshaling and unmarshaling of Sigma.js JSON documents.

See http://sigmajs.org/ for Sigma.js documentation.

Index

Types

type Edge

type Edge struct {
	ID         string
	Source     string
	Target     string
	Attributes map[string]interface{}
}

Edge is a Sigma.js edge.

func (*Edge) MarshalJSON

func (e *Edge) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Edge) UnmarshalJSON

func (e *Edge) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type Graph

type Graph struct {
	Nodes []Node `json:"nodes"`
	Edges []Edge `json:"edges"`
}

Graph is a Sigma.js graph.

type Node

type Node struct {
	ID         string
	Attributes map[string]interface{}
}

Node is a Sigma.js node.

func (*Node) MarshalJSON

func (n *Node) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

Source Files

sigmajs.go

Version
v0.15.1 (latest)
Published
Aug 16, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
12 hours ago

Tools for package owners.