graph-view: fix front-end

This commit is contained in:
Logan Allen 2020-07-01 12:40:33 -04:00
parent ee5e80cf44
commit 299b54baa1
4 changed files with 40 additions and 7 deletions

View File

@ -101,6 +101,7 @@
%remove-graph
:_ this
[%give %kick ~[resource+(en-path:resource resource.update)] ~]~
::
%archive-graph
:_ this
[%give %kick ~[resource+(en-path:resource resource.update)] ~]~

View File

@ -80,6 +80,7 @@
::
:: NOTE: cannot send these updates as pokes
::
:: TODO: add ~| error message
%keys !!
%tags !!
%tag-queries !!

View File

@ -209,7 +209,7 @@
%all
=/ keys (scry-for resources:store /keys)
:_ state
:- (give con [%graph-view-update !>([%0 [%keys keys]])])
:- (give con [%graph-update !>([%0 now.bowl [%keys keys]])])
%+ turn ~(tap in keys)
|= [=ship =term]
(give con [%graph-update !>((add-graph ship term))])
@ -218,22 +218,22 @@
:_ state
:_ ~
%+ give con
:- %graph-view-update
!>([%0 [%keys (scry-for resources:store /keys)]])
:- %graph-update
!>([%0 now.bowl [%keys (scry-for resources:store /keys)]])
::
%tags
:_ state
:_ ~
%+ give con
:- %graph-view-update
!>([%0 [%tags (scry-for (set term) /tags)]])
:- %graph-update
!>([%0 now.bowl [%tags (scry-for (set term) /tags)]])
::
%tag-queries
:_ state
:_ ~
%+ give con
:- %graph-view-update
!>([%0 [%tag-queries (scry-for tag-queries:store /tag-queries)]])
:- %graph-update
!>([%0 now.bowl [%tag-queries (scry-for tag-queries:store /tag-queries)]])
::
%graph
:_ state

View File

@ -4,6 +4,37 @@
=< [sur .]
=, sur
|%
++ enjs
=, enjs:format
|%
++ update
|= upd=^update
^- json
?> ?=(%0 -.upd)
|^ (frond %graph-view-update (pairs ~[(encode +.upd)]))
::
++ encode
|= upd=update-0
^- [cord json]
?- -.upd
%graph-subset
[%graph-subset ~]
::
%node
[%node ~]
::
%post
[%post ~]
::
%node-children
[%node-children ~]
::
%node-children-subset
[%node-children-subset ~]
==
--
--
::
++ dejs
=, dejs:format
|%