Commit ff7f35a7 authored by arturo's avatar arturo

>>> continue

parent 9183052a
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<!-- <link href="styles/bootstrap.min.css" rel="stylesheet"> --> <!-- <link href="styles/bootstrap.min.css" rel="stylesheet"> -->
<link id="bootstrap-css" href="styles/bootstrap-default.css" rel="stylesheet" /> <link id="bootstrap-css" href="styles/bootstrap-default.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="styles/highlightjs-solarized-light.css" /> <link rel="stylesheet" type="text/css" href="styles/highlightjs-solarized-light.css" />
<link href="styles/sass.css" rel="stylesheet" type="text/css" />
<style> * {margin: 0; padding: 0; list-style: none;} </style> <style> * {margin: 0; padding: 0; list-style: none;} </style>
</head> </head>
<body> <body>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{"version":3,"sourceRoot":"","sources":["../../src/sass/_menu.sass","../../src/sass/_context_menu.sass","../../src/sass/_graph.sass","../../src/sass/_login.sass","../../src/sass/_tree.sass","../../src/sass/abstract/_members.scss","../../src/sass/_code_editor.sass","../../src/sass/_styles.sass","../../src/sass/_range_slider.sass","../../src/sass/_annotation.sass","../../src/sass/_folder_view.sass","../../src/sass/_phylo.scss"],"names":[],"mappings":"AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;EACE;EACA;EACA;EACA;EAEA;;;AAEF;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;;;AAEF;AACI;EACA;;;AAEJ;AACI;EACA;;;AAGJ;AACA;EACI;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;EACA;;;AAEF;EACE;;;AAME;EACE;;;AC9DN;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;;;AClBF;EACE;EACA;EACA;;;AAEF;AAkCE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAxCA;EAZA;EACA;EAEA;EAWE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AACN;EACE;;AACF;EACE;;AAEF;EApCA;EACA;EAEA;EAmCE;EACA;;AACF;EACE;;AACF;EACE;;AAWF;EAEE;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AAEJ;EACE;;AAEA;EACE;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACjFJ;EACE;;AACA;EACE;EACA;;;AAEJ;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;;AAEE;EACE;EACA;;AACA;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;;AAKJ;EACE;EACA;EACA;;;AAEJ;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAGF;EACE;;;AAEJ;EACI;EACA;;;AAGF;EACE;;;AAEJ;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AC1GF;EACE;;;AAGA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGA;EACE;;AACF;EACE;;AAEJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAKJ;EACE;;AACA;EACE;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;EACA;EACA;;AACF;EACE;;AACF;EACE;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AACF;EACE;;AAGN;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AAIR;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAEV;EACE;;AACF;EACE;;AAEE;EACE;;AACF;EACE;;AACN;EACE;;AAEE;EACE;;;AAMN;EACE;;AAEA;EACE;EACA;EACA;EACA;;AAEF;EACE;;AAEA;EACE;EACA;;AAEJ;EACE;EACA;;AAIA;EACE;EACA;;AAEF;EACE;;AAEF;EACE;;;AAIF;EACE;EACA;;AAEF;EACE;;AAEF;EACE;;;AAGR;EACE;;AAEA;EACE;EACA;;AC5HO;ED+HP;;;ACxIO;ED2IP;;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAEN;EAWE;EAGA;EACA,eAvPkB;;AAyPlB;EACE;EACA;;AC/LO;ED4MP;EACA,MAFW;EAGX;;;ACvNO;ED2NP;EACA,OAFW;EAGX;;;AAGA;EACE;;AAEA;EACE;;AAGJ;EACE;;AACF;EACE;;AACF;EACE;;AAGJ;EACE;EACA;;AAEA;EAGE;EACA,WAzSa;EA4Sb;EACA;EACA;;AAEA;EACE;;AAEF;EACE;EACA;EACA;EACA;;AACA;EACE;;AAEN;EACE;EACA;EACA;EACA;;AAEJ;EAEE;EACA;;;AAEJ;EAEE;EACA;;;AAEF;EAGE;EAKA;EACA;EACA;EACA;EAGA;EACA;EACA;EAKA;;AAHA;EACE;;;AAKJ;EAGE;;AC3SS;EDrDP;EACA;;;AC2CO;EDxCP;EACA;;;ACgDO;ED8SP;;AAEA;EACE;;;AC1TK;ED6TP;;AAEA;EACE;;;AAON;EAIE;EAEA;EACA;EACA;EACA,QApYmC;EAqYnC;;ACxUS;ED4UP;;;ACrVO;EDwVP;;;AAEJ;EAGE;EAEA;EACA;EACA;EACA,QAvZgC;EAwZhC;;AC1VS;ED8VP;;;ACvWO;ED0WP;;;AAKF;EAIE;EACA;;AC3WO;EDrDP;EACA;;;AC2CO;EDxCP;EACA;;;AA6ZA;EACE,eA3a+B;;;AAibjC;EACE;;AAEE;EACE;;;AE/ZN;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EApCR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA0CM;EACE;EACA;EACA;EACA;EACA;EA5CR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAkDE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;AAEV;EACE;;AAEA;EACE;;;AC9FN;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAII;EACE;EACA;;AAEJ;EACE;EACA;;AF4CK;EEzCP;;AAEA;EACE;;;AF6BK;EE1BP;;AAEA;EACE;;;AAGN;EACE;;AACA;EACE;;AACF;EACE;EACA;EACA;;;AAIA;EACE;;AACA;EACE;EACA;;AACF;EACE;;AACA;EACE;;AACJ;EACE;;;AAER;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;AAGI;EACE;;AACF;EACE;;;AAEN;EACE;EACA;EACA;;;AAIA;EACE;;AACF;EACE;;;AAEJ;EACE;;AACA;EACE;;;AAEJ;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAEF;EACE;;AAEA;EACE;;AAEF;EACE;;;AAGJ;EAKE;;AAEA;EACE;;AAIE;EACE;;AACF;EACE;;AAEJ;EAGE;;AAGJ;EACE,SAtBa;EAuBb;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAKE;EACE;;AADF;EACE;;AADF;EACE;;AADF;EACE;;AADF;EACE;;AADF;EACE;;AADF;EACE;;AADF;EACE;;AADF;EACE;;AADF;EACE;;;AAKN;EACE;;AFjGO;EEoGL;;;AF7GK;EEgHL;;;AAEJ;EACE,SAZa;;;AAcjB;EAKE;;AAEA;EACE;EACA,OARa;EASb,QATa;EAUb,MAToB;EAUpB,KATmB;;;AC/KvB;EACE;AACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;;AAEA;EACE;EAEA;EACA;EACA;;;AAGN;EACE;;;ACxBJ;EACE;;AAEA;EANE;EACA;;AAQF;EAbE;EACA;;AAeF;EAhBE;EACA;;AAkBF;EAnBE;EACA;;AAqBF;EA1BE;EACA,kBANyB;;AAkC3B;EA7BE;EACA,kBAPqB;;AAsCvB;EAhCE;EACA,kBAJoB;;;AAuCtB;EApCE;EACA,kBANyB;;AA4C3B;EAvCE;EACA,kBAPqB;;AAgDvB;EA1CE;EACA,kBAJoB;;;ACNxB;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;ACZF;AAEA;EACE;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;;AAIF;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAEA;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;AAEA;EACE;EACA;AACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;AACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAIJ;AAEA;EACE;EACA;AACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;AACA;;;AAIF;AAGA;AAEA;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EAAU;EACV;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;AAAA;EAEE;;;AAEF;EACE;EACA;;;AAKF;AAGA;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;AACE;AACA;EACA;EACA;;;AAGF;EACE;;;AAGF;AAEA;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;AAEA;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;AAEA;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;AACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;AAEA;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAWF;EACE;EACA;EACA;;;AAGF;AACE;AACA;AACA;EACA;;;AAGF;AACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;AAEA;EACE;EACA;;;AAGF;AAEA;EACE;;;AAIF;AAEA;EACE;EACA;;;AAGF;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAIF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAKF;EACE;;AAEA;EAIE;EACA,WAHS;EAIT,QALO;EAMP,OANO;EASP;EACA;;;AAMJ;EACE;;AAEA;EACE,OAhkBiB;EAikBjB;;AAGF;EACE;EACA,OAtkBiB;EAukBjB;;AAGF;EAGE;;AAGA;EACE;;AAIJ;EACE;EACA;;AAEA;EACE;;AAIJ;EACE","file":"sass.css"}
\ No newline at end of file
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
"scripts": { "scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix", "generate-purs-packages-nix": "./nix/generate-purs-packages.nix",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash", "generate-psc-packages-nix": "./nix/generate-packages-json.bash",
"css": "sass src/sass/sass.sass:dist/styles/sass.css && yarn css-themes", "css": "yarn css-themes",
"css-themes": "yarn css-default-theme && yarn css-dark-theme && yarn css-darkster-theme && yarn css-greyson-theme && yarn css-herbie-theme && yarn css-monotony-theme", "css-themes": "yarn css-default-theme && yarn css-dark-theme && yarn css-darkster-theme && yarn css-greyson-theme && yarn css-herbie-theme && yarn css-monotony-theme",
"css-default-theme": "sass src/sass/bootstrap/default.sass:dist/styles/bootstrap-default.css", "css-default-theme": "sass src/sass/themes/default.sass:dist/styles/bootstrap-default.css",
"css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css", "css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css",
"css-darkster-theme": "sass src/sass/bootstrap/darkster.scss:dist/styles/bootstrap-darkster.css", "css-darkster-theme": "sass src/sass/themes/darkster.scss:dist/styles/bootstrap-darkster.css",
"css-greyson-theme": "sass src/sass/bootstrap/greyson.scss:dist/styles/bootstrap-greyson.css", "css-greyson-theme": "sass src/sass/themes/greyson.scss:dist/styles/bootstrap-greyson.css",
"css-herbie-theme": "sass src/sass/bootstrap/herbie.scss:dist/styles/bootstrap-herbie.css", "css-herbie-theme": "sass src/sass/themes/herbie.scss:dist/styles/bootstrap-herbie.css",
"css-monotony-theme": "sass src/sass/bootstrap/monotony.scss:dist/styles/bootstrap-monotony.css", "css-monotony-theme": "sass src/sass/themes/monotony.scss:dist/styles/bootstrap-monotony.css",
"docs": "pulp docs -- --format html", "docs": "pulp docs -- --format html",
"repl": "pulp repl", "repl": "pulp repl",
"clean": "rm -Rf output node_modules", "clean": "rm -Rf output node_modules",
......
...@@ -8,8 +8,7 @@ module Gargantext.Components.PhyloExplorer.Draw ...@@ -8,8 +8,7 @@ module Gargantext.Components.PhyloExplorer.Draw
import Gargantext.Prelude import Gargantext.Prelude
import DOM.Simple (Document, Window, querySelector, querySelectorAll) import DOM.Simple (Document, Window, querySelectorAll)
import DOM.Simple.Console (log, log2)
import Data.Array as Array import Data.Array as Array
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Foldable (for_) import Data.Foldable (for_)
...@@ -18,9 +17,11 @@ import Data.Maybe (Maybe(..), isJust, maybe) ...@@ -18,9 +17,11 @@ import Data.Maybe (Maybe(..), isJust, maybe)
import Data.String as String import Data.String as String
import Effect (Effect) import Effect (Effect)
import Effect.Uncurried (EffectFn1, EffectFn4, EffectFn7, runEffectFn1, runEffectFn4, runEffectFn7) import Effect.Uncurried (EffectFn1, EffectFn4, EffectFn7, runEffectFn1, runEffectFn4, runEffectFn7)
import FFI.Simple (applyTo, getProperty, setProperty, (..), (.=), (.?)) import FFI.Simple ((..), (.=), (.?))
import Gargantext.Components.PhyloExplorer.Types (AncestorLink, Branch, BranchLink, GlobalTerm(..), Group(..), Link, Period, PhyloDataSet(..)) import Gargantext.Components.PhyloExplorer.Types (AncestorLink, Branch, BranchLink, Term(..), Group(..), Link, Period, PhyloDataSet(..))
import Gargantext.Utils (getter) import Gargantext.Utils (getter)
import Gargantext.Utils.Reactix ((~~))
import Gargantext.Utils.Reactix as R2
import Graphics.D3.Base (D3, D3Eff) import Graphics.D3.Base (D3, D3Eff)
import Graphics.D3.Selection as D3S import Graphics.D3.Selection as D3S
import Graphics.D3.Util (ffi) import Graphics.D3.Util (ffi)
...@@ -73,24 +74,6 @@ orDie :: forall err a. Maybe a -> err -> Either err a ...@@ -73,24 +74,6 @@ orDie :: forall err a. Maybe a -> err -> Either err a
orDie (Just a) _ = Right a orDie (Just a) _ = Right a
orDie Nothing err = Left err orDie Nothing err = Left err
-- @XXX: FFI.Simple `(...)` throws error (JavaScript issue)
-- need to decompose computation
--
-- (?) chained prototype property issue?
applyTo_ :: forall src arg res. src -> String -> Array arg -> res
applyTo_ src name args =
let fn = getProperty name src
in applyTo fn src args
infixl 4 applyTo_ as ~~
-- @WIP: DOM.Simple lack of "ClassList" module
addClass :: forall el. el -> Array String -> Effect Unit
addClass el args = pure $ (el .. "classList") ~~ "add" $ args
removeClass :: forall el. el -> Array String -> Effect Unit
removeClass el args = pure $ (el .. "classList") ~~ "remove" $ args
-- @WIP: "Graphics.D3.Selection" lack of "filter" function -- @WIP: "Graphics.D3.Selection" lack of "filter" function
-- @WIP: "Graphics.D3.Selection" lack of "nodes" function -- @WIP: "Graphics.D3.Selection" lack of "nodes" function
selectionFilter :: forall d. String -> D3S.Selection d -> D3Eff (D3S.Selection D3S.Void) selectionFilter :: forall d. String -> D3S.Selection d -> D3Eff (D3S.Selection D3S.Void)
...@@ -117,7 +100,7 @@ setGlobalDependencies w (PhyloDataSet o) ...@@ -117,7 +100,7 @@ setGlobalDependencies w (PhyloDataSet o)
_ <- pure $ (w .= "weighted") o.weighted _ <- pure $ (w .= "weighted") o.weighted
(freq :: Array Int) <- pure $ w .. "freq" (freq :: Array Int) <- pure $ w .. "freq"
(terms :: Array GlobalTerm) <- pure $ w .. "terms" (terms :: Array Term) <- pure $ w .. "terms"
for_ o.groups \(Group g) -> do for_ o.groups \(Group g) -> do
...@@ -141,7 +124,7 @@ setGlobalDependencies w (PhyloDataSet o) ...@@ -141,7 +124,7 @@ setGlobalDependencies w (PhyloDataSet o)
-- append an item to the global window.terms -- append an item to the global window.terms
case (terms .? val') of case (terms .? val') of
Just _ -> pure unit Just _ -> pure unit
Nothing -> void <<< pure $ (terms .= val') $ GlobalTerm Nothing -> void <<< pure $ (terms .= val') $ Term
{ label: l .. idx' { label: l .. idx'
, fdt : val' , fdt : val'
} }
...@@ -189,14 +172,14 @@ highlightSource window value = ...@@ -189,14 +172,14 @@ highlightSource window value =
then then
selectionFilter ".source-focus" groups selectionFilter ".source-focus" groups
>>= selectionNodes >>= selectionNodes
>>= flip for_ (flip addClass [ "group-unfocus" ]) >>= flip for_ (flip R2.addClass [ "group-unfocus" ])
else else
pure unit pure unit
-- unselected all the groups -- unselected all the groups
_ <- selectionNodes groups _ <- selectionNodes groups
>>= flip for_ (flip removeClass [ "source-focus" ]) >>= flip for_ (flip R2.removeClass [ "source-focus" ])
if hasLdView if hasLdView
then then
...@@ -231,8 +214,8 @@ highlightSource window value = ...@@ -231,8 +214,8 @@ highlightSource window value =
selectNodeGroup :: forall el. el -> Effect Unit selectNodeGroup :: forall el. el -> Effect Unit
selectNodeGroup el = do selectNodeGroup el = do
removeClass el [ "group-unfocus" ] R2.removeClass el [ "group-unfocus" ]
addClass el [ "source-focus" ] R2.addClass el [ "source-focus" ]
fill "#a6bddb" el fill "#a6bddb" el
bid <- pure $ (el ~~ "getAttribute") [ "bId" ] bid <- pure $ (el ~~ "getAttribute") [ "bId" ]
...@@ -243,9 +226,9 @@ highlightSource window value = ...@@ -243,9 +226,9 @@ highlightSource window value =
autocompleteSearch :: autocompleteSearch ::
Array GlobalTerm Array Term
-> String -> String
-> Effect (Maybe GlobalTerm) -> Effect (Maybe Term)
autocompleteSearch terms query = autocompleteSearch terms query =
let let
hasMinLen = String.length >>> (_ > 0) hasMinLen = String.length >>> (_ > 0)
...@@ -253,20 +236,20 @@ autocompleteSearch terms query = ...@@ -253,20 +236,20 @@ autocompleteSearch terms query =
in pure in pure
if hasMinLen query if hasMinLen query
then findGlobalTermByPrefix terms query then findTermByPrefix terms query
else Nothing else Nothing
autocompleteSubmit :: Maybe (GlobalTerm) -> Effect Unit autocompleteSubmit :: Maybe Term -> Effect Unit
autocompleteSubmit = case _ of autocompleteSubmit = case _ of
Nothing -> pure unit Nothing -> pure unit
Just (GlobalTerm { label, fdt }) -> do Just (Term { label, fdt }) -> do
showLabel "search" showLabel "search"
termClick label fdt 0 "search" termClick label fdt 0 "search"
findGlobalTermByPrefix :: Array GlobalTerm -> String -> Maybe GlobalTerm findTermByPrefix :: Array Term -> String -> Maybe Term
findGlobalTermByPrefix terms prefix = findTermByPrefix terms prefix =
let let
needle = String.toLower prefix needle = String.toLower prefix
fn s fn s
......
...@@ -10,7 +10,7 @@ import FFI.Simple ((..)) ...@@ -10,7 +10,7 @@ import FFI.Simple ((..))
import Gargantext.Components.Bootstrap as B import Gargantext.Components.Bootstrap as B
import Gargantext.Components.PhyloExplorer.Draw (autocompleteSearch, autocompleteSubmit, drawPhylo, highlightSource, onPhyloReady, setGlobalD3Reference, setGlobalDependencies) import Gargantext.Components.PhyloExplorer.Draw (autocompleteSearch, autocompleteSubmit, drawPhylo, highlightSource, onPhyloReady, setGlobalD3Reference, setGlobalDependencies)
import Gargantext.Components.PhyloExplorer.TopBar (topBar) import Gargantext.Components.PhyloExplorer.TopBar (topBar)
import Gargantext.Components.PhyloExplorer.Types (GlobalTerm, PhyloDataSet(..), Source, sortSources) import Gargantext.Components.PhyloExplorer.Types (Term, PhyloDataSet(..), Source, sortSources)
import Gargantext.Utils (nbsp) import Gargantext.Utils (nbsp)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Graphics.D3.Base (d3) import Graphics.D3.Base (d3)
...@@ -36,7 +36,7 @@ layoutCpt = here.component "layout" cpt where ...@@ -36,7 +36,7 @@ layoutCpt = here.component "layout" cpt where
mTopBarHost <- R.unsafeHooksEffect $ R2.getElementById "portal-topbar" mTopBarHost <- R.unsafeHooksEffect $ R2.getElementById "portal-topbar"
sources /\ sourcesBox <- R2.useBox' (mempty :: Array Source) sources /\ sourcesBox <- R2.useBox' (mempty :: Array Source)
-- @WIP: move value to PhyloDataSet? -- @WIP: move value to PhyloDataSet?
terms /\ termsBox <- R2.useBox' (mempty :: Array GlobalTerm) terms /\ termsBox <- R2.useBox' (mempty :: Array Term)
R.useEffectOnce' $ do R.useEffectOnce' $ do
(sortSources >>> flip T.write_ sourcesBox) o.sources (sortSources >>> flip T.write_ sourcesBox) o.sources
......
...@@ -9,7 +9,7 @@ import Data.Tuple.Nested ((/\)) ...@@ -9,7 +9,7 @@ import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Gargantext.Components.Bootstrap as B import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..)) import Gargantext.Components.Bootstrap.Types (ComponentStatus(..))
import Gargantext.Components.PhyloExplorer.Types (GlobalTerm(..), Source(..)) import Gargantext.Components.PhyloExplorer.Types (Term(..), Source(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
...@@ -23,8 +23,8 @@ here = R2.here "Gargantext.Components.PhyloExplorer.TopBar" ...@@ -23,8 +23,8 @@ here = R2.here "Gargantext.Components.PhyloExplorer.TopBar"
type Props = type Props =
( sourceCallback :: String -> Effect Unit ( sourceCallback :: String -> Effect Unit
, sourceList :: Array Source , sourceList :: Array Source
, autocompleteSearchCallback :: String -> Effect (Maybe GlobalTerm) , autocompleteSearchCallback :: String -> Effect (Maybe Term)
, autocompleteSubmitCallback :: Maybe GlobalTerm -> Effect Unit , autocompleteSubmitCallback :: Maybe Term -> Effect Unit
) )
topBar :: R2.Leaf Props topBar :: R2.Leaf Props
...@@ -35,7 +35,7 @@ topBarCpt = here.component "main" cpt where ...@@ -35,7 +35,7 @@ topBarCpt = here.component "main" cpt where
-- States -- States
let defaultSource = "" let defaultSource = ""
let defaultSearch = "" let defaultSearch = ""
let defaultResult = (Nothing :: Maybe GlobalTerm) let defaultResult = (Nothing :: Maybe Term)
source /\ sourceBox <- R2.useBox' defaultSource source /\ sourceBox <- R2.useBox' defaultSource
search /\ searchBox <- R2.useBox' defaultSearch search /\ searchBox <- R2.useBox' defaultSearch
...@@ -65,8 +65,7 @@ topBarCpt = here.component "main" cpt where ...@@ -65,8 +65,7 @@ topBarCpt = here.component "main" cpt where
{ className: "phylo-topbar__source"} { className: "phylo-topbar__source"}
[ [
B.formSelect B.formSelect
{ className: "phylo-topbar" { value: source
, value: source
, callback: onSourceChange , callback: onSourceChange
} $ } $
[ [
...@@ -100,7 +99,7 @@ topBarCpt = here.component "main" cpt where ...@@ -100,7 +99,7 @@ topBarCpt = here.component "main" cpt where
, status: Idled , status: Idled
, value: case result of , value: case result of
Nothing -> "" Nothing -> ""
Just (GlobalTerm { label }) -> label Just (Term { label }) -> label
-- (?) noop: see `onAutocompleteChange` -- (?) noop: see `onAutocompleteChange`
, callback: const $ pure unit , callback: const $ pure unit
} }
......
...@@ -3,7 +3,7 @@ module Gargantext.Components.PhyloExplorer.Types ...@@ -3,7 +3,7 @@ module Gargantext.Components.PhyloExplorer.Types
, parsePhyloJSONSet , parsePhyloJSONSet
, Branch(..), Period(..), Group(..) , Branch(..), Period(..), Group(..)
, Link(..), AncestorLink(..), BranchLink(..) , Link(..), AncestorLink(..), BranchLink(..)
, GlobalTerm(..) , Term(..)
, Source(..) , Source(..)
, sortSources , sortSources
) where ) where
...@@ -291,15 +291,15 @@ parseBranchLinks ...@@ -291,15 +291,15 @@ parseBranchLinks
----------------------------------------------------------- -----------------------------------------------------------
newtype GlobalTerm = GlobalTerm newtype Term = Term
{ label :: String { label :: String
, fdt :: String , fdt :: String
} }
derive instance Newtype GlobalTerm _ derive instance Newtype Term _
derive instance Generic GlobalTerm _ derive instance Generic Term _
derive instance Eq GlobalTerm derive instance Eq Term
instance Show GlobalTerm where show = genericShow instance Show Term where show = genericShow
----------------------------------------------------------- -----------------------------------------------------------
......
...@@ -42,6 +42,7 @@ import Gargantext.Routes as GR ...@@ -42,6 +42,7 @@ import Gargantext.Routes as GR
import Gargantext.Sessions (Session, WithSession) import Gargantext.Sessions (Session, WithSession)
import Gargantext.Sessions as Sessions import Gargantext.Sessions as Sessions
import Gargantext.Types (CorpusId, Handed(..), ListId, NodeID, NodeType(..), SessionId, SidePanelState(..), reverseHanded) import Gargantext.Types (CorpusId, Handed(..), ListId, NodeID, NodeType(..), SessionId, SidePanelState(..), reverseHanded)
import Gargantext.Utils.Reactix (getElementById)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
...@@ -66,17 +67,30 @@ router props = R.createElement routerCpt props [] ...@@ -66,17 +67,30 @@ router props = R.createElement routerCpt props []
routerCpt :: R.Component Props routerCpt :: R.Component Props
routerCpt = here.component "router" cpt where routerCpt = here.component "router" cpt where
cpt { boxes: boxes@{ handed } } _ = do cpt { boxes: boxes@{ handed } } _ = do
-- States
handed' <- T.useLive T.unequal handed handed' <- T.useLive T.unequal handed
let handedClassName = case handed' of -- Effects
LeftHanded -> "left-handed" let
RightHanded -> "right-handed" handedClassName = case _ of
LeftHanded -> "left-handed"
RightHanded -> "right-handed"
R.useEffect1' handed' $
getElementById "app" >>= case _ of
Nothing -> pure unit
Just app -> do
R2.removeClass app
[ handedClassName LeftHanded
, handedClassName RightHanded
]
R2.addClass app [ handedClassName handed' ]
pure $ R.fragment pure $ R.fragment
([ loginModal { boxes } ([ loginModal { boxes }
, topBar { boxes } , topBar { boxes }
, errorsView { errors: boxes.errors } [] , errorsView { errors: boxes.errors } []
, H.div { className: handedClassName <> " router-inner" } $ reverseHanded handed' $ , H.div { className: "router-inner" }
[ forest { boxes } [ forest { boxes }
, mainPage { boxes } , mainPage { boxes }
, sidePanel { boxes } , sidePanel { boxes }
......
...@@ -23,7 +23,7 @@ import Effect.Aff (Aff, launchAff, launchAff_, killFiber) ...@@ -23,7 +23,7 @@ import Effect.Aff (Aff, launchAff, launchAff_, killFiber)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Effect.Exception (error) import Effect.Exception (error)
import Effect.Uncurried (EffectFn1, EffectFn3, mkEffectFn1, mkEffectFn2, runEffectFn1, runEffectFn3) import Effect.Uncurried (EffectFn1, EffectFn3, mkEffectFn1, mkEffectFn2, runEffectFn1, runEffectFn3)
import FFI.Simple ((..), (...), (.=), defineProperty, delay, args2, args3) import FFI.Simple (applyTo, args2, args3, defineProperty, delay, getProperty, (..), (...), (.=))
import Partial.Unsafe (unsafePartial) import Partial.Unsafe (unsafePartial)
import React (class ReactPropFields, Children, ReactClass, ReactElement) import React (class ReactPropFields, Children, ReactClass, ReactElement)
import React as React import React as React
...@@ -475,7 +475,6 @@ boundingRect els = ...@@ -475,7 +475,6 @@ boundingRect els =
-------------------------------------- --------------------------------------
-- | One-liner `if` simplifying render writing -- | One-liner `if` simplifying render writing
-- | (best for one child) -- | (best for one child)
if' :: Boolean -> R.Element -> R.Element if' :: Boolean -> R.Element -> R.Element
...@@ -514,3 +513,23 @@ createPortal' mHost children = ...@@ -514,3 +513,23 @@ createPortal' mHost children =
Nothing -> mempty Nothing -> mempty
Just host -> flip R.createPortal host $ singleton $ Just host -> flip R.createPortal host $ singleton $
fragmentWithKey key children fragmentWithKey key children
--------------------------------------
-- @XXX: FFI.Simple `(...)` throws error (JavaScript issue)
-- need to decompose computation
--
-- (?) chained prototype property issue?
applyTo_ :: forall src arg res. src -> String -> Array arg -> res
applyTo_ src name args =
let fn = getProperty name src
in applyTo fn src args
infixl 4 applyTo_ as ~~
-- @WIP: DOM.Simple lack of "ClassList" module
addClass :: forall el. el -> Array String -> Effect Unit
addClass el args = pure $ (el .. "classList") ~~ "add" $ args
removeClass :: forall el. el -> Array String -> Effect Unit
removeClass el args = pure $ (el .. "classList") ~~ "remove" $ args
@forward "./base/_form.scss"
@forward "./base/_layout.scss"
@forward "./base/_tree.scss"
@forward "./components/_grouped.scss"
@forward "./_legacy/_menu"
@forward "./_legacy/_context_menu"
@forward "./_legacy/_graph"
@forward "./_legacy/_login"
@forward "./_legacy/_tree"
@forward "./_legacy/_code_editor"
@forward "./_legacy/_styles"
@forward "./_legacy/_range_slider"
@forward "./_legacy/_annotation"
@forward "./_legacy/_folder_view"
@forward "./_legacy/_phylo"
For each file and its content, determine what:
* individual/grouped `component` are needed to be created
* to be placed within the `base` folder
* (normally, no logic `module` has to be created, but a refactorisation is possible here)
@use "./abstract/_members" as * @use '../abstract/_members' as *
@mixin font-inherit() @mixin font-inherit()
font-family: inherit font-family: inherit
......
@use "./abstract/_members" as * @use '../abstract/_members' as *
.fv.folders .fv.folders
display: grid display: grid
......
@use "./abstract/_members" as * @use '../abstract/_members' as *
/* styles for menu.html template (navbar etc) */ /* styles for menu.html template (navbar etc) */
......
@use "./abstract/_members" as *; @use '../abstract/_members' as *;
@use '../modules/_layout' as layout;
$topbar-input-width: 304px; $topbar-input-width: 304px;
...@@ -573,6 +574,8 @@ i.how:hover span { ...@@ -573,6 +574,8 @@ i.how:hover span {
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
.phylo-topbar { .phylo-topbar {
@include layout.asideTopbar();
display: flex; display: flex;
&__source { &__source {
......
@use "./abstract/_members" as * @use '../abstract/_members' as *
.cache-toggle .cache-toggle
cursor: pointer cursor: pointer
...@@ -105,10 +105,10 @@ select.form-control ...@@ -105,10 +105,10 @@ select.form-control
.router-inner .router-inner
display: flex display: flex
&.left-handed @include left-handed
flex-direction: row flex-direction: row-reverse
&.right-handed @include right-handed
flex-direction: row flex-direction: row
......
@use "./abstract/_members" as * @use '../abstract/_members' as *
$forest-layout-top-teaser-height: 24px $forest-layout-top-teaser-height: 24px
$forest-layout-bottom-teaser-height: 24px // ~line-height to 1.5 (covering tree) $forest-layout-bottom-teaser-height: 24px // ~line-height to 1.5 (covering tree)
......
@import "../../../node_modules/bootstrap/scss/functions";
@import "../../../node_modules/bootstrap/scss/variables";
/// Global spacing value /// Global spacing value
$space-unit: 8px; $space-unit: 8px;
@use '../abstract/_members' as main; @use '../abstract/_members' as *;
@use "sass:math" as math; @use '../abstract/_variables' as *;
@use '../modules/_form' as form;
///
/// @TODO: create "base", "module", "component" SASS business folders
///
/// @TODO: More SASS structure (eg. exporting theme variables into component
/// SASS files)
///
/// ############################################################################
/// MODULES
/// ############################################################################
@mixin inputError() {
border-color: $danger;
&:focus, &:active {
border-color: $danger;
box-shadow: 0 0 0 1px $danger;
}
}
/// ############################################################################
/// BASE
/// ############################################################################
/// Bootstrap customisation
///-----------------------------------------------------------------------------
// Rectify readonly UI
.custom-select:disabled[readonly],
.form-control[readonly] {
background-color: $input-bg;
// (opinionated rules)
color: $input-placeholder-color;
border-style: dashed;
}
/// Misc
///-----------------------------------------------------------------------------
.with-icon-font {
font-family: ForkAwesome, $font-family-base;
}
/// Tree
///-----------------------------------------------------------------------------
.forest-layout {
@include main.right-handed {
border-right: 2px solid $border-color;
}
@include main.left-handed {
border-left: 2px solid $border-color;
}
}
.forest-layout-bottom-teaser {
background: linear-gradient(
to bottom,
mixAlpha($body-bg, 0%) 0%,
mixAlpha($body-bg, 100%) 45%
);
}
.forest-layout-top-teaser {
background: linear-gradient(
to top,
mixAlpha($body-bg, 0%) 0%,
mixAlpha($body-bg, 100%) 45%
);
}
.main-page__horizontal-tiles {
border-top: 2px solid $border-color;
.tile-block:not(:first-child) {
border-left: 2px solid $border-color;
}
}
.main-page__vertical-tiles {
border-left: 2px solid $border-color;
.tile-block:not(:first-child) {
border-top: 2px solid $border-color;
}
}
.tile-menu__popover {
border-radius: $border-radius;
background-color: $body-bg;
}
/// Form
///-----------------------------------------------------------------------------
/// We made the choice to let the "form-group" element purely declarative, as /// We made the choice to let the "form-group" element purely declarative, as
/// reality projected use cases are far too numerous. Making structural rules /// reality projected use cases are far too numerous. Making structural rules
...@@ -149,7 +49,7 @@ ...@@ -149,7 +49,7 @@
.form-group--error { .form-group--error {
label { color: $danger; } label { color: $danger; }
.b-form-input { @include inputError; } .b-form-input { @include form.inputError; }
} }
...@@ -179,109 +79,11 @@ ...@@ -179,109 +79,11 @@
} }
} }
/// ############################################################################ // Rectify Bootstrap readonly UI
/// COMPONENTS .custom-select:disabled[readonly],
/// ############################################################################ .form-control[readonly] {
background-color: $input-bg;
/// FormInput // (opinionated rules)
///----------------------------------------------------------------------------- color: $input-placeholder-color;
border-style: dashed;
.b-form-input {
&[type=password] {
letter-spacing: space-x(1);
font-weight: 700;
}
}
/// Modal
///-----------------------------------------------------------------------------
.b-modal {
$self: &;
$wrapper-margin: 1.75rem; // from "_modal.scss"
&--visible {
display: block;
}
&__content {
background-color: $modal-content-bg;
max-height: calc(100% - #{ $wrapper-margin * 2 } );
overflow: auto;
}
&__header {
background-color: $card-cap-bg;
&__content {
color: $primary;
font-size: 21px;
}
}
&__overlay {
width: 100%;
height: 100%;
background-color: mixAlpha($black, 50%);
position: absolute;
&--collapsible {
cursor: pointer;
}
}
// @at-root body.modal-open {
// overflow: hidden;
// }
}
/// Spinner
///-----------------------------------------------------------------------------
.b-spinner {
// regarding sizing, Bootstrap set a default `2rem ^ 2rem`
// (cf. "_spinners.scss")
font-size: inherit;
}
/// Button
///-----------------------------------------------------------------------------
.b-button {
$spinner-size: 20px;
$self: &;
@include clickable();
position: relative;
// (!) `translate` CSS modifiers won't work with bootstrap spinner
&__spinner {
position: absolute;
left: calc(50% - #{ math.div($spinner-size, 2) });
top: calc(50% - #{ math.div($spinner-size, 2) });
width: $spinner-size;
height: $spinner-size;
}
&--disabled,
&--deferred,
&--idled {
@include unclickable();
}
&--deferred {
#{ $self }__inner {
visibility: hidden;
}
}
// icon alignement
.b-icon {
vertical-align: text-top;
}
} }
@use '../abstract/_variables' as *;
.with-icon-font {
font-family: ForkAwesome, $font-family-base;
}
@use '../abstract/_members' as *;
@use '../abstract/_variables' as *;
.forest-layout {
@include right-handed {
border-right: 2px solid $border-color;
}
@include left-handed {
border-left: 2px solid $border-color;
}
}
.forest-layout-bottom-teaser {
background: linear-gradient(
to bottom,
mixAlpha($body-bg, 0%) 0%,
mixAlpha($body-bg, 100%) 45%
);
}
.forest-layout-top-teaser {
background: linear-gradient(
to top,
mixAlpha($body-bg, 0%) 0%,
mixAlpha($body-bg, 100%) 45%
);
}
.main-page__horizontal-tiles {
border-top: 2px solid $border-color;
.tile-block:not(:first-child) {
border-left: 2px solid $border-color;
}
}
.main-page__vertical-tiles {
border-left: 2px solid $border-color;
.tile-block:not(:first-child) {
border-top: 2px solid $border-color;
}
}
.tile-menu__popover {
border-radius: $border-radius;
background-color: $body-bg;
}
This diff is collapsed.
@use '../abstract/_variables' as *;
@mixin inputError() {
border-color: $danger;
&:focus, &:active {
border-color: $danger;
box-shadow: 0 0 0 1px $danger;
}
}
@use '../abstract/_members' as *;
@use '../abstract/_variables' as *;
@mixin asideTopbar() {
margin-left: space-x(2);
margin-right: space-x(2);
height: 100%;
@include right-handed() {
border-left: 1px solid $navbar-dark-hover-color;
}
@include left-handed() {
border-right: 1px solid $navbar-dark-hover-color;
}
}
@use "_menu.sass"
@use "_context_menu.sass"
@use "_graph.sass"
@use "_login.sass"
@use "_tree.sass"
@use "_code_editor.sass"
@use "_styles.sass"
@use "_range_slider.sass"
@use "_annotation.sass"
@use "_folder_view.sass"
@use "_phylo.scss"
...@@ -74,8 +74,10 @@ $breadcrumb-active-color:$gray-500; ...@@ -74,8 +74,10 @@ $breadcrumb-active-color:$gray-500;
@import "../../../node_modules/bootstrap/scss/bootstrap"; @import "../../../node_modules/bootstrap/scss/bootstrap";
// Add SASS theme customizations here.. // Add SASS theme customizations here..
@import "../abstract/_members"; @import "../_components";
@import "./common"; @import "../_base";
@import "../_legacy";
.navbar-dark.bg-primary {background-color:#111111 !important;} .navbar-dark.bg-primary {background-color:#111111 !important;}
.table.able {color:#ccccc5} .table.able {color:#ccccc5}
......
...@@ -11,5 +11,6 @@ $theme-colors: ("primary": $blue, "secondary": $black) ...@@ -11,5 +11,6 @@ $theme-colors: ("primary": $blue, "secondary": $black)
@import ../../../node_modules/bootstrap/scss/bootstrap @import ../../../node_modules/bootstrap/scss/bootstrap
// Add SASS theme customizations here.. // Add SASS theme customizations here..
@import ../abstract/_members @import ../_components
@import ./_common @import ../_base
@import ../_legacy
...@@ -24,5 +24,6 @@ $enable-rounded:false; ...@@ -24,5 +24,6 @@ $enable-rounded:false;
@import "../../../node_modules/bootstrap/scss/bootstrap"; @import "../../../node_modules/bootstrap/scss/bootstrap";
// Add SASS theme customizations here.. // Add SASS theme customizations here..
@import "../abstract/_members"; @import "../_components";
@import "./common"; @import "../_base";
@import "../_legacy";
...@@ -16,5 +16,6 @@ $dark:#072247; ...@@ -16,5 +16,6 @@ $dark:#072247;
@import "../../../node_modules/bootstrap/scss/bootstrap"; @import "../../../node_modules/bootstrap/scss/bootstrap";
// Add SASS theme customizations here.. // Add SASS theme customizations here..
@import "../abstract/_members"; @import "../_components";
@import "./common"; @import "../_base";
@import "../_legacy";
...@@ -22,5 +22,6 @@ $dark:#111111; ...@@ -22,5 +22,6 @@ $dark:#111111;
@import "../../../node_modules/bootstrap/scss/bootstrap"; @import "../../../node_modules/bootstrap/scss/bootstrap";
// Add SASS theme customizations here.. // Add SASS theme customizations here..
@import "../abstract/_members"; @import "../_components";
@import "./common"; @import "../_base";
@import "../_legacy";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment