Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
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
Grégoire Locqueville
purescript-gargantext
Commits
dbb0fd41
Commit
dbb0fd41
authored
Nov 17, 2021
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue
parent
ea829efa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
35 deletions
+40
-35
Draw.purs
src/Gargantext/Components/PhyloExplorer/Draw.purs
+16
-12
JSON.purs
src/Gargantext/Components/PhyloExplorer/JSON.purs
+22
-21
Layout.purs
src/Gargantext/Components/PhyloExplorer/Layout.purs
+2
-2
No files found.
src/Gargantext/Components/PhyloExplorer/Draw.purs
View file @
dbb0fd41
...
@@ -7,7 +7,7 @@ module Gargantext.Components.PhyloExplorer.Draw
...
@@ -7,7 +7,7 @@ module Gargantext.Components.PhyloExplorer.Draw
import Gargantext.Prelude
import Gargantext.Prelude
import DOM.Simple (
Window
)
import DOM.Simple (
Document, Window, querySelectorAll
)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Foldable (for_)
import Data.Foldable (for_)
import Data.FoldableWithIndex (forWithIndex_)
import Data.FoldableWithIndex (forWithIndex_)
...
@@ -17,7 +17,6 @@ import Effect.Class (liftEffect)
...
@@ -17,7 +17,6 @@ import Effect.Class (liftEffect)
import Effect.Uncurried (EffectFn1, EffectFn7, runEffectFn1, runEffectFn7)
import Effect.Uncurried (EffectFn1, EffectFn7, runEffectFn1, runEffectFn7)
import FFI.Simple (applyTo, getProperty, (..), (.=), (.?))
import FFI.Simple (applyTo, getProperty, (..), (.=), (.?))
import Gargantext.Components.PhyloExplorer.Types (AncestorLink, Branch, BranchLink, GlobalTerm(..), Group(..), Link, Period, PhyloDataSet(..))
import Gargantext.Components.PhyloExplorer.Types (AncestorLink, Branch, BranchLink, GlobalTerm(..), Group(..), Link, Period, PhyloDataSet(..))
import Gargantext.Utils.Reactix (getElementById)
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)
...
@@ -135,18 +134,23 @@ setGlobalD3Reference window d3 = void $ pure $ (window .= "d3") d3
...
@@ -135,18 +134,23 @@ setGlobalD3Reference window d3 = void $ pure $ (window .= "d3") d3
-----------------------------------------------------------
-----------------------------------------------------------
unhide :: String -> Effect Unit
unhide :: Document -> String -> Effect Unit
unhide name = pure unit
unhide d s = do
<* setText "phyloName" name
setText s `toElements` "#phyloName"
<* turnVisible "phyloName"
turnVisible `toElements` "#phyloName"
<* turnVisible "reset"
turnVisible `toElements` ".reset"
<* turnVisible "label"
turnVisible `toElements` ".label"
<* turnVisible "heading"
turnVisible `toElements` ".heading"
turnVisible `toElements` ".export"
where
where
setText id n = getElementById id >>= \el -> pure $ (el .= "innerHTML") n
toElements fn query = querySelectorAll d query >>= flip for_ fn
turnVisible id = getElementById id >>= \el -> pure $ (el .= "visibility")
"visible"
turnVisible el = do
style <- pure $ (el .. "style")
pure $ (style .= "visibility") "visible"
setText name el = pure $ (el .= "innerHTML") name
-----------------------------------------------------------
-----------------------------------------------------------
...
...
src/Gargantext/Components/PhyloExplorer/JSON.purs
View file @
dbb0fd41
...
@@ -66,27 +66,7 @@ type NodeData =
...
@@ -66,27 +66,7 @@ type NodeData =
)
)
data RawObject
data RawObject
= Layer
= GroupToNode
{ _gvid :: Int
, nodes :: Array Int
| GraphData
}
| BranchToNode
{ _gvid :: Int
, age :: String
, bId :: String
, birth :: String
, branchId :: String
, branch_x :: String
, branch_y :: String
, fillcolor :: String
, fontname :: String
, fontsize :: String
, size :: String
, style :: String
| NodeData
}
| GroupToNode
{ _gvid :: Int
{ _gvid :: Int
, bId :: String
, bId :: String
, branchId :: String
, branchId :: String
...
@@ -106,6 +86,21 @@ data RawObject
...
@@ -106,6 +86,21 @@ data RawObject
, weight :: String
, weight :: String
| NodeData
| NodeData
}
}
| BranchToNode
{ _gvid :: Int
, age :: String
, bId :: String
, birth :: String
, branchId :: String
, branch_x :: String
, branch_y :: String
, fillcolor :: String
, fontname :: String
, fontsize :: String
, size :: String
, style :: String
| NodeData
}
| PeriodToNode
| PeriodToNode
{ _gvid :: Int
{ _gvid :: Int
, fontsize :: String
, fontsize :: String
...
@@ -115,6 +110,12 @@ data RawObject
...
@@ -115,6 +110,12 @@ data RawObject
, to :: String
, to :: String
| NodeData
| NodeData
}
}
| Layer
{ _gvid :: Int
, nodes :: Array Int
| GraphData
}
derive instance Generic RawObject _
derive instance Generic RawObject _
derive instance Eq RawObject
derive instance Eq RawObject
...
...
src/Gargantext/Components/PhyloExplorer/Layout.purs
View file @
dbb0fd41
...
@@ -4,7 +4,7 @@ module Gargantext.Components.PhyloExplorer.Layout
...
@@ -4,7 +4,7 @@ module Gargantext.Components.PhyloExplorer.Layout
import Gargantext.Prelude
import Gargantext.Prelude
import DOM.Simple (window)
import DOM.Simple (
document,
window)
import Data.Array as Array
import Data.Array as Array
import Gargantext.Components.PhyloExplorer.Draw (drawPhylo, highlightSource, setGlobalD3Reference, setGlobalDependencies, unhide)
import Gargantext.Components.PhyloExplorer.Draw (drawPhylo, highlightSource, setGlobalD3Reference, setGlobalDependencies, unhide)
import Gargantext.Components.PhyloExplorer.Types (PhyloDataSet(..))
import Gargantext.Components.PhyloExplorer.Types (PhyloDataSet(..))
...
@@ -29,7 +29,7 @@ layoutCpt = here.component "layout" cpt where
...
@@ -29,7 +29,7 @@ layoutCpt = here.component "layout" cpt where
} _ = do
} _ = do
-- States
-- States
R.useEffectOnce' $ do
R.useEffectOnce' $ do
unhide o.name
unhide
document
o.name
setGlobalD3Reference window d3
setGlobalD3Reference window d3
setGlobalDependencies window (PhyloDataSet o)
setGlobalDependencies window (PhyloDataSet o)
drawPhylo
drawPhylo
...
...
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