(diff-dom graph diff)
diffs the graph with a set of changes to be made
(-> (reset-graph) (diff-dom {:> {}, :- {[:nodes :c] {:label "c"}}}) (get-dom)) => {:nodes {:b {:label "b"}, :a {:label "a"}}, :edges {[:a :b] {:label "a->b"}}}
diffs the graph with a set of changes to be made (-> (reset-graph) (diff-dom {:> {}, :- {[:nodes :c] {:label "c"}}}) (get-dom)) => {:nodes {:b {:label "b"}, :a {:label "a"}}, :edges {[:a :b] {:label "a->b"}}}
(edge graph k)
Accesses an edge within the graph
(-> (edge (reset-graph) [:a :b])
(object/to-data))
=> {:attributes {:label "a->b"}, :id [:a :b]}
Accesses an edge within the graph (-> (edge (reset-graph) [:a :b]) (object/to-data)) => {:attributes {:label "a->b"}, :id [:a :b]}
(element graph k)
Accesses the element in the graph, be it a node or a cess (-> (element (reset-graph) :a) (object/to-data)) => {:attributes {:label "a"}, :id :a}
Accesses the element in the graph, be it a node or a cess (-> (element (reset-graph) :a) (object/to-data)) => {:attributes {:label "a"}, :id :a}
(get-dom graph)
Gets the nodes and edges of the graph (get-dom (reset-graph)) => {:nodes {:a {:label "a"}, :b {:label "b"}, :c {:label "c"}} :edges {[:a :b] {:label "a->b"}}}
Gets the nodes and edges of the graph (get-dom (reset-graph)) => {:nodes {:a {:label "a"}, :b {:label "b"}, :c {:label "c"}} :edges {[:a :b] {:label "a->b"}}}
(make-patch diff)
creates a patch for updating the graph from a data diff (make-patch {:> {}, :- {}, :+ {[:nodes :c] {:label "c"}, [:nodes :b] {:label "b"}, [:nodes :a] {:label "a"}}}) => {:attributes {:+ {:b {:label "b"}, :c {:label "c"}, :a {:label "a"}}}, :nodes {:+ #{:c :b :a}}}
creates a patch for updating the graph from a data diff (make-patch {:> {}, :- {}, :+ {[:nodes :c] {:label "c"}, [:nodes :b] {:label "b"}, [:nodes :a] {:label "a"}}}) => {:attributes {:+ {:b {:label "b"}, :c {:label "c"}, :a {:label "a"}}}, :nodes {:+ #{:c :b :a}}}
(make-patch-attributes out arr v sign)
creates an entry for patching element attributes (make-patch-attributes {} [:nodes :a] {:label "hello"} :-) => {:attributes {:- {:nodes {:a {:label "hello"}}}}}
(make-patch-attributes {} [:nodes] {:a {:label "hello"}} :-) => {:attributes {:- {:nodes {:a {:label "hello"}}}}}
creates an entry for patching element attributes (make-patch-attributes {} [:nodes :a] {:label "hello"} :-) => {:attributes {:- {:nodes {:a {:label "hello"}}}}} (make-patch-attributes {} [:nodes] {:a {:label "hello"}} :-) => {:attributes {:- {:nodes {:a {:label "hello"}}}}}
(make-patch-element m type k sign)
creates an entry for patching a element (make-patch-element {} :nodes :a :+) => {:nodes {:+ #{:a}}}
creates an entry for patching a element (make-patch-element {} :nodes :a :+) => {:nodes {:+ #{:a}}}
(node graph k)
Accesses a node within the graph (-> (node (reset-graph) :a) (object/to-data)) => {:attributes {:label "a"}, :id :a}
Accesses a node within the graph (-> (node (reset-graph) :a) (object/to-data)) => {:attributes {:label "a"}, :id :a}
(patch graph patch)
Takes in a graph and a patch of the graph and applies (-> (reset-graph) (patch {:nodes {:- #{:b}}, :attributes {:+ {:c {:ui.class "hello"}, [:a :c] {:ui.class "world"}}}, :edges {:+ #{[:a :c]} :- #{[:a :b]}}}) (get-dom)) => {:nodes {:a {:label "a"}, :c {:label "c", :ui.class "hello"}}, :edges {[:a :c] {:ui.class "world"}}}
Takes in a graph and a patch of the graph and applies (-> (reset-graph) (patch {:nodes {:- #{:b}}, :attributes {:+ {:c {:ui.class "hello"}, [:a :c] {:ui.class "world"}}}, :edges {:+ #{[:a :c]} :- #{[:a :b]}}}) (get-dom)) => {:nodes {:a {:label "a"}, :c {:label "c", :ui.class "hello"}}, :edges {[:a :c] {:ui.class "world"}}}
(set-dom graph dom)
sets the graph to the (-> (reset-graph) (set-dom {:nodes {:d {:label "d"} :e {:label "c"}} :edges {[:d :e] {:label "d->e"}}}) (get-dom)) => {:nodes {:d {:label "d"}, :e {:label "c"}}, :edges {[:d :e] {:label "d->e"}}}
sets the graph to the (-> (reset-graph) (set-dom {:nodes {:d {:label "d"} :e {:label "c"}} :edges {[:d :e] {:label "d->e"}}}) (get-dom)) => {:nodes {:d {:label "d"}, :e {:label "c"}}, :edges {[:d :e] {:label "d->e"}}}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close