Action:
|
Creates a new graph from all of the component elements of a given graph specified by one of the component elements.
|
|
Filename:
|
kern/kern_scm/graph_scm.cxx
|
|
Syntax:
|
(graph:component in-graph in-which)
|
|
Arg Types:
|
in-graph
|
graph
|
|
in-which
|
integer | string | entity
|
|
Returns:
|
graph
|
|
Description:
|
This extension is useful if the given
in-graph has multiple components. It creates a new graph from just the elements of a single component.
|
|
|
in-graph specifies a graph.
|
|
|
in-which specifies a component. The component is selected by providing the integer of the component (numbering starts at 0), a string which is the name of an element of the component, or an entity that is associated with an element of the component.
|
|
Example:
|
; graph:component
|
|
; Create a simple example
|
|
(define g1 (graph "me-you us-them
|
|
|
we-they them-they
|
|
|
FIDO-SPOT SPOT-KING SPOT-PETEY"))
|
|
;; g1
|
|
; CAREFUL: The order of the graph output may
|
|
; not be the same each time.
|
|
(graph:components g1)
|
|
;; 3
|
|
(define g2 (graph:component g1 "me"))
|
|
;; g2
|
|
(define g3 (graph:component g1 "FIDO"))
|
|
;; g3
|
|
(define g4 (graph:component g1 1))
|
|
;; g4
|