Created
September 3, 2015 21:18
-
-
Save nomeata/c27bc409dc285a2ed7af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RecursiveDo #-} | |
import Reflex.Dom | |
import qualified Data.Map as M | |
import Data.Monoid | |
import Control.Applicative | |
main = mainWidget $ el "div" $ do | |
(svg, ()) <- buildElementNS mns "svg" ("width" =: "300" <> "height" =: "300") $ mdo | |
circle <- wrapElement =<< buildEmptyElementNS mns "circle" | |
("cx" =: "100" <> "cy" =: "100" <> "r" =: "100" <> "fill" =: "red") | |
return () | |
(bar,_) <- el' "hr" $ return () | |
svg <- wrapElement svg | |
coords <- holdDyn (0,0) (traceEvent "down" (domEvent Mousedown bar)) | |
txt <- mapDyn show coords | |
dynText txt | |
return () | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment