(add-attr g node-or-edge k v)
(add-attr g n1 n2 k v)
Add an attribute to node or edge
Add an attribute to node or edge
(add-attrs g node-or-edge attribute-map)
(add-attrs g n1 n2 attribute-map)
Merges an attribute map with the existing attributes of a node or edge
Merges an attribute map with the existing attributes of a node or edge
(add-directed-edges g & edges)
Adds directed edges, regardless of whether the underlying graph is directed or undirected
Adds directed edges, regardless of whether the underlying graph is directed or undirected
(add-directed-edges* g edges)
Adds directed edges regardless of the graph's undirected/directed default
Adds directed edges regardless of the graph's undirected/directed default
(add-edges g & edges)
Adds edges to graph g of the form [n1 n2], [n1 n2 weight], or [n1 n2 attr-map].
Adds edges to graph g of the form [n1 n2], [n1 n2 weight], or [n1 n2 attr-map].
(add-edges* g edges)
Add edges to graph g. See add-edges
Add edges to graph g. See add-edges
(add-nodes g & nodes)
Adds nodes to graph g. Nodes can be any type of object
Adds nodes to graph g. Nodes can be any type of object
(add-nodes* g nodes)
Add nodes to graph g. See add-nodes
Add nodes to graph g. See add-nodes
(add-nodes-with-attrs g & nodes-with-attrs)
Takes any number of [node attr-map] pairs, and adds them to graph g.
Takes any number of [node attr-map] pairs, and adds them to graph g.
(add-nodes-with-attrs* g nodes-with-attrs)
Takes a sequence of [node attr-map] pairs, and adds them to graph g.
Takes a sequence of [node attr-map] pairs, and adds them to graph g.
(add-undirected-edges g & edges)
Adds directed edges, regardless of whether the underlying graph is directed or undirected
Adds directed edges, regardless of whether the underlying graph is directed or undirected
(add-undirected-edges* g edges)
Adds undirected edges regardless of the graph's undirected/directed default
Adds undirected edges regardless of the graph's undirected/directed default
(allow-parallel-edges? g)
If true, two edges between the same pair of nodes in the same direction are permitted. If false, adding a new edge between the same pair of nodes as an existing edge will merge the edges into a single edge, and adding an undirected edge on top of an existing directed edge will `upgrade' the directed edge to undirected and merge attributes.
If true, two edges between the same pair of nodes in the same direction are permitted. If false, adding a new edge between the same pair of nodes as an existing edge will merge the edges into a single edge, and adding an undirected edge on top of an existing directed edge will `upgrade' the directed edge to undirected and merge attributes.
(attr g node-or-edge k)
(attr g n1 n2 k)
Return the attribute on a node or edge
Return the attribute on a node or edge
(attrs g node-or-edge)
(attrs g n1 n2)
Return all attributes on a node or edge
Return all attributes on a node or edge
(build-graph g & inits)
Builds graphs using node descriptions of the form node-label or [node-label attribute-map] and edge descriptions of the form [src dest], [src dest weight], or [src dest attribute-map]. Also can build from other ubergraphs, ubergraph edge objects, and from adjacency maps.
Use ^:node and ^:edge metadata to resolve ambiguous inits, or build your graph with the more precise add-nodes, add-nodes-with-attrs, and add-edges functions.
Builds graphs using node descriptions of the form node-label or [node-label attribute-map] and edge descriptions of the form [src dest], [src dest weight], or [src dest attribute-map]. Also can build from other ubergraphs, ubergraph edge objects, and from adjacency maps. Use ^:node and ^:edge metadata to resolve ambiguous inits, or build your graph with the more precise add-nodes, add-nodes-with-attrs, and add-edges functions.
(count-edges g)
Counts how many edges are in g. Undirected edges are counted twice, once for each direction.
Counts how many edges are in g. Undirected edges are counted twice, once for each direction.
(count-nodes g)
Counts how many nodes are in g
Counts how many nodes are in g
(count-unique-edges g)
Counts how many edges are in g. Undirected edges are counted only once.
Counts how many edges are in g. Undirected edges are counted only once.
(dest edge)
Returns the dest node of the edge
Returns the dest node of the edge
(digraph & inits)
Digraph constructor. See build-graph for description of valid inits
Digraph constructor. See build-graph for description of valid inits
(edge-description->edge g ed)
Many ubergraph functions can take either an edge description (i.e., [src dest] [src dest weight] or [src dest attribute-map]) or an actual edge object. This function is used to convert edge descriptions into an edge object, or passing through an edge object unchanged, so regardless of what you pass in, you're guaranteed to get out an edge object.
Many ubergraph functions can take either an *edge description* (i.e., [src dest] [src dest weight] or [src dest attribute-map]) or an actual edge object. This function is used to convert edge descriptions into an edge object, or passing through an edge object unchanged, so regardless of what you pass in, you're guaranteed to get out an edge object.
(edge? o)
Tests whether o is an edge object
Tests whether o is an edge object
(edges g)
Edges in g. May return each edge twice in an undirected graph
Edges in g. May return each edge twice in an undirected graph
(edn->ubergraph {:keys [allow-parallel? undirected? nodes directed-edges
undirected-edges]})
(escape-label s)
Takes a string intended to be used as a node or edge label in a Graphviz graph, and returns a string with several characters that cause problems for Graphviz with suitable replacements. Called for you automatically if you use the ':auto-label true' option of the viz-graph function, but you may want to use it for label strings you provide to viz-graph when you do not use that option.
Takes a string intended to be used as a node or edge label in a Graphviz graph, and returns a string with several characters that cause problems for Graphviz with suitable replacements. Called for you automatically if you use the ':auto-label true' option of the viz-graph function, but you may want to use it for label strings you provide to viz-graph when you do not use that option.
(find-edge g query)
(find-edge g src dest)
Returns first edge that matches the query
Returns first edge that matches the query
(find-edges g query)
(find-edges g src dest)
Returns all edges that match the query
Returns all edges that match the query
(graph & inits)
Graph constructor. See build-graph for description of valid inits
Graph constructor. See build-graph for description of valid inits
(has-edge? g n1 n2)
Returns true when edge [n1 n2] is in g
Returns true when edge [n1 n2] is in g
(has-node? g node)
Returns true when node is in g
Returns true when node is in g
(in-degree g node)
Returns the number of direct predecessors to node
Returns the number of direct predecessors to node
(in-edges g node)
Returns all the incoming edges of node
Returns all the incoming edges of node
(mirror-edge? e)
Is e the mirrored half of the undirected edge?
Is e the mirrored half of the undirected edge?
(multidigraph & inits)
Multidigraph constructor. See build-graph for description of valid inits
Multidigraph constructor. See build-graph for description of valid inits
(multigraph & inits)
Multigraph constructor. See build-graph for description of valid inits
Multigraph constructor. See build-graph for description of valid inits
(nodes g)
Returns a collection of the nodes in graph g
Returns a collection of the nodes in graph g
(other-direction g edge)
Returns the other direction of this edge in graph g
Returns the other direction of this edge in graph g
(out-degree g node)
Returns the number of outgoing edges of node
Returns the number of outgoing edges of node
(out-edges g node)
Returns all the outgoing edges of node
Returns all the outgoing edges of node
(predecessors g)
(predecessors g node)
Returns direct predecessors of node
Returns direct predecessors of node
(predecessors* g node)
Returns direct predecessors of node
Returns direct predecessors of node
(remove-all g)
Removes all nodes and edges from graph g
Removes all nodes and edges from graph g
(remove-attr g node-or-edge k)
(remove-attr g n1 n2 k)
Remove an attribute from a node or edge
Remove an attribute from a node or edge
(remove-attrs g node-or-edge attributes)
(remove-attrs g n1 n2 attributes)
Removes the attributes from the node or edge
Removes the attributes from the node or edge
(remove-edges* g edges)
Removes edges from graph g. See remove-edges
Removes edges from graph g. See remove-edges
(remove-nodes g & nodes)
Removes nodes from graph g
Removes nodes from graph g
(remove-nodes* g nodes)
Remove nodes from graph g. See remove-nodes
Remove nodes from graph g. See remove-nodes
(set-attrs g node-or-edge attribute-map)
(set-attrs g n1 n2 attribute-map)
Sets the attribute map of a node or edge, overwriting existing attribute map
Sets the attribute map of a node or edge, overwriting existing attribute map
(src edge)
Returns the source node of the edge
Returns the source node of the edge
(successors g)
(successors g node)
Returns direct successors of node
Returns direct successors of node
(successors* g node)
Returns direct successors of node
Returns direct successors of node
(transpose g)
Returns a graph with all edges reversed
Returns a graph with all edges reversed
(ubergraph allow-parallel? undirected? & inits)
General ubergraph construtor. Takes booleans for allow-parallel? and undirected? to call either graph, digraph, multigraph, or multidigraph. See build-graph for description of valid inits
General ubergraph construtor. Takes booleans for allow-parallel? and undirected? to call either graph, digraph, multigraph, or multidigraph. See build-graph for description of valid inits
(undirected-edge? e)
Is e one 'direction' of an undirected edge?
Is e one 'direction' of an undirected edge?
(undirected-graph? g)
If true, new edges in g are undirected by default. If false, new edges in g are directed by default.
If true, new edges in g are undirected by default. If false, new edges in g are directed by default.
(viz-graph g)
(viz-graph g
{layout :layout
{filename :filename format :format :as save} :save
auto-label :auto-label
:as opts
:or {layout :dot}})
Uses graphviz to generate a visualization of your graph. Graphviz must be installed on your computer and in your path. Passes along to graphviz the attributes on the nodes and edges, so graphviz-related attributes such as color, style, label, etc. will be respected.
Takes an optional map which can contain: :auto-label true (labels each node/edge with its attribute map) :layout :dot, :neato, :fdp, :sfdp, :twopi, or :circo :save {:filename _, :format _} where format is one of :bmp :dot :eps :gif :ico :jpg :jpeg :pdf :png :ps :ps2 :svgz :tif :tiff :vmlz :wbmp Additionally map can contain graph attributes for graphviz like :bgcolor, :label, :splines, ...
Uses graphviz to generate a visualization of your graph. Graphviz must be installed on your computer and in your path. Passes along to graphviz the attributes on the nodes and edges, so graphviz-related attributes such as color, style, label, etc. will be respected. Takes an optional map which can contain: :auto-label true (labels each node/edge with its attribute map) :layout :dot, :neato, :fdp, :sfdp, :twopi, or :circo :save {:filename _, :format _} where format is one of :bmp :dot :eps :gif :ico :jpg :jpeg :pdf :png :ps :ps2 :svgz :tif :tiff :vmlz :wbmp Additionally map can contain graph attributes for graphviz like :bgcolor, :label, :splines, ...
(weight g)
(weight g e)
(weight g n1 n2)
Returns the weight of edge e or edge [n1 n2]
Returns the weight of edge e or edge [n1 n2]
(weight* g e)
(weight* g n1 n2)
Returns the weight of edge e or edge [n1 n2]
Returns the weight of edge e or edge [n1 n2]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close