cyjs

package
v0.0.0-...-3d92bc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2018 License: MIT Imports: 4 Imported by: 6

Documentation

Overview

An entry in Cytoscape.js Style object

Index

Constants

View Source
const (
	Id          = "id"
	Source      = "source"
	Target      = "target"
	Interaction = "interaction"
)

Tags used in Cytoscape.js JSON

View Source
const (
	NW = "NW"
	N  = "N"
	NE = "NE"
	W  = "W"
	C  = "C"
	E  = "E"
	SW = "SW"
	S  = "S"
	SE = "SE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrowShapeConverter

type ArrowShapeConverter struct {
	// contains filtered or unexported fields
}

func NewArrowShapeConverter

func NewArrowShapeConverter() *ArrowShapeConverter

func (ArrowShapeConverter) Convert

func (conv ArrowShapeConverter) Convert(value string) interface{}

type CyJS

type CyJS struct {
	Data map[string]interface{} `json:"data"`

	Elements Elements `json:"elements"`

	Style []SelectorEntry `json:"style"`

	CxData map[string]interface{} `json:"cxData,omitempty"`
}

Cytoscape.js Network Object

type CyJSEdge

type CyJSEdge struct {
	Data map[string]interface{} `json:"data"`

	Selected bool `json:"selected,omitempty"`
}

Edge Object

type CyJSNode

type CyJSNode struct {
	Data map[string]interface{} `json:"data"`

	Position Position `json:"position,omitempty"`

	Selected bool `json:"selected"`
}

Node Object

type Elements

type Elements struct {
	Nodes []CyJSNode `json:"nodes"`
	Edges []CyJSEdge `json:"edges"`
}

Elements in the network (nodes & edges)

type LineStyleConverter

type LineStyleConverter struct {
	// contains filtered or unexported fields
}

func NewLineStyleConverter

func NewLineStyleConverter() *LineStyleConverter

func (LineStyleConverter) Convert

func (conv LineStyleConverter) Convert(value string) interface{}

type Position

type Position struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

Position of a node

type PositionConverter

type PositionConverter struct {
}

func NewPositionConverter

func NewPositionConverter() *PositionConverter

func (PositionConverter) Convert

func (conv PositionConverter) Convert(value string) interface{}

type SelectorEntry

type SelectorEntry struct {
	Selector string                 `json:"selector"`
	CSS      map[string]interface{} `json:"css"`
}

type ShapeConverter

type ShapeConverter struct {
	// contains filtered or unexported fields
}

func NewShapeConverter

func NewShapeConverter() *ShapeConverter

func (ShapeConverter) Convert

func (conv ShapeConverter) Convert(value string) interface{}

type TransparencyConverter

type TransparencyConverter struct{}

func NewTransparencyConverter

func NewTransparencyConverter() *TransparencyConverter

func (TransparencyConverter) Convert

func (conv TransparencyConverter) Convert(value string) interface{}

type ValueConverter

type ValueConverter interface {

	// Convert Cytoscape VP string value into Cyjs prop.
	Convert(value string) interface{}
}

type VisualMappingGenerator

type VisualMappingGenerator struct {
	VpConverter VisualPropConverter
}

func (VisualMappingGenerator) CreateContinuousMappings

func (vmGenerator VisualMappingGenerator) CreateContinuousMappings(
	vpName string, vpCytoscape string, vpDataType string,
	definition string, selectorType string, depList map[string]interface{}) []SelectorEntry

Continuous Mapping Converter

func (VisualMappingGenerator) CreateDiscreteMappings

func (vmGenerator VisualMappingGenerator) CreateDiscreteMappings(
	vpName string, vpCytoscape string, definition string, selectorType string) []SelectorEntry

Create selectors for each key-value pair of discrete mapping.

func (VisualMappingGenerator) CreatePassthroughMapping

func (vmGenerator VisualMappingGenerator) CreatePassthroughMapping(
	vpName string, definition string, entry *SelectorEntry)

Passthrough Mapping converter.

type VisualPropConverter

type VisualPropConverter struct {
	// contains filtered or unexported fields
}

func NewVisualPropConverter

func NewVisualPropConverter(typeTable map[string]string) *VisualPropConverter

func (VisualPropConverter) GetCyjsPropertyValue

func (vpConverter VisualPropConverter) GetCyjsPropertyValue(key string, value string) (converted interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL