Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-reactix-d3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-reactix-d3
Commits
d5c69824
Commit
d5c69824
authored
Jun 24, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[react] sample react app added, first draft
parent
77f25aa9
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1166 additions
and
74 deletions
+1166
-74
index.html
example/dist/index.html
+2
-0
index.html
example/index.html
+2
-0
index.js
example/index.js
+1079
-48
package.json
example/package.json
+3
-1
spago.dhall
example/spago.dhall
+3
-0
EReact.purs
example/src/EReact.purs
+32
-0
Main.purs
example/src/Main.purs
+4
-0
yarn.lock
example/yarn.lock
+41
-25
No files found.
example/dist/index.html
View file @
d5c69824
...
...
@@ -34,6 +34,8 @@
<div
id=
"reset-zoom"
>
Reset zoom
</div>
<div
id=
"xml"
></div>
<div
id=
"react"
></div>
<!-- NOTE: it's important that this is at the end so that the DOM is ready -->
<script
type=
"text/javascript"
src=
"/index.fd532818.js"
></script>
</body>
...
...
example/index.html
View file @
d5c69824
...
...
@@ -35,6 +35,8 @@
<div
id=
"reset-zoom"
>
Reset zoom
</div>
<div
id=
"xml"
></div>
<div
id=
"react"
></div>
<!-- NOTE: it's important that this is at the end so that the DOM is ready -->
<script
type=
"text/javascript"
src=
"index.js"
></script>
</body>
...
...
example/index.js
View file @
d5c69824
This diff is collapsed.
Click to expand it.
example/package.json
View file @
d5c69824
...
...
@@ -18,6 +18,8 @@
"spago"
:
"^0.20.3"
},
"dependencies"
:
{
"d3"
:
"^7.0.0"
"d3"
:
"^7.0.0"
,
"react"
:
"^17.0.2"
,
"react-dom"
:
"^17.0.2"
}
}
example/spago.dhall
View file @
d5c69824
...
...
@@ -19,13 +19,16 @@ to generate this file without the comments in this block.
, "dom-simple"
, "effect"
, "either"
, "ffi-simple"
, "foldable-traversable"
, "foreign"
, "integers"
, "math"
, "maybe"
, "nullable"
, "prelude"
, "psci-support"
, "reactix"
, "reactix-d3"
, "transformers"
, "tuples"
...
...
example/src/EReact.purs
0 → 100644
View file @
d5c69824
module Example.React where
import Data.Maybe (Maybe(..))
import Data.Nullable (toMaybe)
import DOM.Simple as DOM
import DOM.Simple (Element)
import DOM.Simple.Console (log)
import DOM.Simple.Document (document)
import Effect (Effect)
import FFI.Simple ((...), delay, args2)
import Reactix as R
import Reactix.DOM.HTML as H
import Prelude
main :: Effect Unit
main = paint $ toMaybe (document ... "getElementById" $ [ "react" ])
render :: R.Element -> DOM.Element -> Effect Unit
render e d = delay unit $ \_ -> pure $ R.reactDOM ... "render" $ args2 e d
paint :: Maybe Element -> Effect Unit
paint Nothing = log "[main] container not found"
paint (Just c) = render (app {} []) c
app :: {} -> Array R.Element -> R.Element
app = R.createElement appCpt
appCpt :: R.Component ()
appCpt = R.hooksComponentWithModule "Example.React" "app" cpt where
cpt {} _ = do
pure $ H.div {} [ H.text "hello" ]
example/src/Main.purs
View file @
d5c69824
...
...
@@ -31,6 +31,8 @@ import Graphics.D3.Time as Time
import Graphics.D3.Util
import Graphics.D3.Zoom as Zoom
import Example.React as EReact
main :: Effect Unit
main = do
log2 "d3" d3
...
...
@@ -223,3 +225,5 @@ main = do
log2 "rows" rows
log "xml done"
EReact.main
example/yarn.lock
View file @
d5c69824
...
...
@@ -5011,7 +5011,7 @@ isstream@~0.1.2:
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
js-tokens@^4.0.0:
"js-tokens@^3.0.0 || ^4.0.0",
js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
...
...
@@ -5342,6 +5342,13 @@ log4js@^4.0.0:
rfdc "^1.1.4"
streamroller "^1.0.6"
loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
lowlight@~1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.17.0.tgz#a1143b2fba8239df8cd5893f9fe97aaf8465af4a"
...
...
@@ -5997,14 +6004,6 @@ parallel-transform@^1.1.0:
inherits "^2.0.3"
readable-stream "^2.1.5"
parcel-plugin-static-files-copy@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/parcel-plugin-static-files-copy/-/parcel-plugin-static-files-copy-2.6.0.tgz#06d7d9b6d7e2071b2e261315e94209b522108beb"
integrity sha512-k3YxdnEQWo1aMfCeBfxgUNJWuUE0O730EGiGBcmWEUOto7f1jM/8oxBKXkVZsXDCO1o00dw5X7CsT+yF0JY4qA==
dependencies:
minimatch "3.0.4"
path "0.12.7"
parcel@^2.0.0-beta.2:
version "2.0.0-beta.2"
resolved "https://registry.yarnpkg.com/parcel/-/parcel-2.0.0-beta.2.tgz#0a58f0b810fe2199b35d7bf7a949906568222d75"
...
...
@@ -6130,14 +6129,6 @@ path-to-regexp@2.2.1:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.2.1.tgz#90b617025a16381a879bc82a38d4e8bdeb2bcf45"
integrity sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==
path@0.12.7:
version "0.12.7"
resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f"
integrity sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=
dependencies:
process "^0.11.1"
util "^0.10.3"
pbkdf2@^3.0.3:
version "3.1.2"
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075"
...
...
@@ -6622,7 +6613,7 @@ process-nextick-args@~2.0.0:
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
process@^0.11.1
, process@^0.11.1
0, process@~0.11.0:
process@^0.11.10, process@~0.11.0:
version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=
...
...
@@ -6841,6 +6832,15 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
react-dom@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler "^0.20.2"
react-is@^16.8.4:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
...
...
@@ -6851,6 +6851,14 @@ react-refresh@^0.9.0:
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.9.0.tgz#71863337adc3e5c2f8a6bfddd12ae3bfe32aafbf"
integrity sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ==
react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
read-only-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
...
...
@@ -7192,6 +7200,14 @@ saxes@^3.1.9:
dependencies:
xmlchars "^2.1.1"
scheduler@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
semver@7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
...
...
@@ -8158,13 +8174,6 @@ util@0.10.3:
dependencies:
inherits "2.0.1"
util@^0.10.3, util@~0.10.1:
version "0.10.4"
resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901"
integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==
dependencies:
inherits "2.0.3"
util@^0.12.0, util@^0.12.3:
version "0.12.4"
resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253"
...
...
@@ -8177,6 +8186,13 @@ util@^0.12.0, util@^0.12.3:
safe-buffer "^5.1.2"
which-typed-array "^1.1.2"
util@~0.10.1:
version "0.10.4"
resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901"
integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==
dependencies:
inherits "2.0.3"
utils-merge@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment