API Reference

JGraphs.JGraphMethod
JGraph(g::JGraphData)

The JGraph structure is the core structure of the package when called with a JGraphData argument creates and Object for each node in the graph and stores them in jnodes and an Object for each edge and stores them in jedges. Note that jnodes is a Vector, whereas jedges is a Dict with pairs of nodes (integers) as keys.

Note

Since JGraph stores Objects it can only be called after a Video has been initialized look at Javis documentation to know all about it.

source
JGraphs.JGraphDataType
JGraphData(graph::AbstractGraph, layout::NetworkLayout.AbstractLayout; kwargs...)

The JGraphData is the structure used to set all the properties of the graph animation, the graph itself, its layout and all the options useful to animate it in the appropriate way. It should be passed to JGraph to obtain an animation with the specified properties. The keyword arguments will increase to increase in the future.

Arguments

  • graph::AbstractGraph: A graph as created with LightGraphs and affiliate packages
  • layout::NetworkLayout.AbstractLayout: A layout as provided by NetworkLayout to place the graph nodes in space.

Keywords

  • node_template provide function that could be used as the function argument of an Object
  • edges_color sets the colors of all edges
  • edges_size sets the width of all edges
  • width sets the width to which the graph will be adjusted
  • height sets the height to which the graph will be adjusted
  • frames the frames during which the animations on the graph will last if not specified elsewhere
  • numbered Defaults to false if set to true labels the nodes with their number as vertices in the graph.
source
JGraphs.GB2LuxorMethod
GB2Luxor(p)

Transforms a Point defined in GeometryBasics into one defined in Luxor.

source
JGraphs._adapt_to_limsMethod
_adapt_to_lims(points, width, height)

Rescales a vector of points to fit in height and width to keep it simple it uses the smallest among x and y needed variation to rescale both.

source
JGraphs.draw_nodeMethod
draw_node(args; center, radius, action)

Function used to draw a circle. Very similar to Javis.JCircle with the only difference that it does not use sethue so animating a color change is easier.

source
JGraphs.jedgesMethod
jedges(jg::JGraph)

Accessor function to the jedges stored in a JGraph.

source
JGraphs.jgraph_morphMethod
jgraph_morph(g::JGraph, layout_to, lims_to; frames=nothing)

This functions allows to animate the change from one layout to another for a graph.

Arguments

  • g::JGraph the JGraph to animate.
  • layout_to a NetworkLayout.AbstractLayout or a Vector{NetworkLayout.AbstractLayout} that will be applied to nodes and edges

to determine the configuration to reach.

  • lims_to a tuple or a vector of tuples each holding width and height to scale the positions of nodes and edges in the animation.

Keywords

  • frames a range of frames during which the morph will take place.

If not specified the animation will last as long aas the JGraph itself.

  • starting_positions specifies the starting positions of each node, defaults

to get_starting_positions(g)

source
JGraphs.jgraph_walkMethod
jgraph_walk(g::JGraph, walk_func)

This function will iteratively change the colors of nodes and edges in a graph to draw a path along them of the graph.

Arguments

  • g::JGraph the JGraph on which the walk should be animated
  • walk_func a function that takes as argument and AbstractGraph and returns

a set of nodes linked each to the following one by and edge present in the graph. One can use randomwalk and non_backtracking_randomwalk from LightGraphs.

source
JGraphs.jnodesMethod
jnodes(jg::JGraph)

Accessor function to the jnodes stored in a JGraph.

source