File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1892,6 +1892,22 @@ clickThrough (v:vs) = addInterrupt $ plot v
18921892 interac@ (Interactions [] _) -> fmap addInterrupt $ anim interac
18931893 Interactions (_: _) _ -> Just $ clickThrough vs
18941894
1895+ mouseInteractive :: Plottable p
1896+ => (MouseEvent (ℝ ,ℝ ) -> s -> s )
1897+ -> s
1898+ -> (s -> p )
1899+ -> DynamicPlottable
1900+ mouseInteractive upd initl f = go initl
1901+ where go s = addInterrupt . plot $ f s
1902+ where addInterrupt :: DynamicPlottable -> DynamicPlottable
1903+ addInterrupt pl = pl
1904+ & futurePlots %~ \ anim -> \ case
1905+ Interactions _ Nothing
1906+ -> fmap addInterrupt $ anim mempty
1907+ Interactions _ (Just drag)
1908+ -> pure . go $ upd drag s
1909+
1910+
18951911
18961912atExtendOf :: PlainGraphicsR2 -> PlainGraphicsR2 -> PlainGraphicsR2
18971913atExtendOf d₁ = atExtendOf' d₁ 1
You can’t perform that action at this time.
0 commit comments