+ tune ArrangeHorizontal
+ $ enterChoiceWithShared [ChooseFromList (toString o snd)] (mapRead 'DM'.toList data)
+ >&> \sh->whileUnchanged sh \v->case v of
+ Nothing = return () @? const NoValue
+ Just x = updateInformation [UpdateAs snd (tuple o fst)] x
+ >^* [ OnAction (Action "new") $ always $ upd (\l->'DM'.put (inc $ maxList $ 'DM'.keys l) (name "-" "-") l) data
+ , OnAction (Action "update") $ withValue \(i, n)->Just $ upd ('DM'.put i n) data
+ , OnAction (Action "delete") $ withValue \(i, n)->Just $ upd ('DM'.del i) data
+ ]
+
+gui6 :: Task [(Span, Span, Span)]
+gui6 = updateInformation
+ [UpdateUsing id (const id) (fromSVGEditor svged)]
+ [(px 5.0, px 5.0, px 5.0)]
+
+svged :: SVGEditor [(Span, Span, Span)] [(Span, Span, Span)]
+svged = {initView=id, renderImage=renderImage, updModel= \m v->v}
+where
+ renderImage _ images ts
+ # (_, images) = trace_stdout ("img: ", images)
+ = overlay
+ [(AtMiddleX, AtMiddleY)]
+ [(px 0.0, px 0.0)]
+ [img]
+ $ Host $ rect (px 1000.0) (px 1000.0)
+ <@< {fill=toSVGColor "white"}
+ where
+ img = collage [(x, y)\\(_, x, y)<-images] [circle r\\(r, _, _)<-images]
+ $ Host $ rect (px 100.0) (px 100.0)
+ <@< {fill=toSVGColor "white"}
+ <@< {onclick=clicker,local=False}
+
+ clicker (x, y) m = [(px 5.0, x, y):m]
+
+import Debug.Trace, StdDebug
+import iTasks.UI.JavaScript
+derive gEq Span, LookupSpan, ImageTag
+derive gText Span, LookupSpan, ImageTag, FontDef`
+derive JSONEncode Span, LookupSpan, ImageTag
+derive JSONDecode Span, LookupSpan, ImageTag
+derive gEditor Span, LookupSpan, ImageTag, FontDef`