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
import Gargantext.Prelude
import DOM.Simple (
Window
)
import DOM.Simple (
Document, Window, querySelectorAll
)
import Data.Either (Either(..))
import Data.Foldable (for_)
import Data.FoldableWithIndex (forWithIndex_)
...
...
@@ -17,7 +17,6 @@ import Effect.Class (liftEffect)
import Effect.Uncurried (EffectFn1, EffectFn7, runEffectFn1, runEffectFn7)
import FFI.Simple (applyTo, getProperty, (..), (.=), (.?))
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.Selection as D3S
import Graphics.D3.Util (ffi)
...
...
@@ -135,18 +134,23 @@ setGlobalD3Reference window d3 = void $ pure $ (window .= "d3") d3
-----------------------------------------------------------
unhide :: String -> Effect Unit
unhide name = pure unit
<* setText "phyloName" name
<* turnVisible "phyloName"
<* turnVisible "reset"
<* turnVisible "label"
<* turnVisible "heading"
unhide :: Document -> String -> Effect Unit
unhide d s = do
setText s `toElements` "#phyloName"
turnVisible `toElements` "#phyloName"
turnVisible `toElements` ".reset"
turnVisible `toElements` ".label"
turnVisible `toElements` ".heading"
turnVisible `toElements` ".export"
where
setText id n = getElementById id >>= \el -> pure $ (el .= "innerHTML") n
turnVisible id = getElementById id >>= \el -> pure $ (el .= "visibility")
"visible"
toElements fn query = querySelectorAll d query >>= flip for_ fn
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 =
)
data RawObject
= Layer
{ _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
= GroupToNode
{ _gvid :: Int
, bId :: String
, branchId :: String
...
...
@@ -106,6 +86,21 @@ data RawObject
, weight :: String
| 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
{ _gvid :: Int
, fontsize :: String
...
...
@@ -115,6 +110,12 @@ data RawObject
, to :: String
| NodeData
}
| Layer
{ _gvid :: Int
, nodes :: Array Int
| GraphData
}
derive instance Generic RawObject _
derive instance Eq RawObject
...
...
src/Gargantext/Components/PhyloExplorer/Layout.purs
View file @
dbb0fd41
...
...
@@ -4,7 +4,7 @@ module Gargantext.Components.PhyloExplorer.Layout
import Gargantext.Prelude
import DOM.Simple (window)
import DOM.Simple (
document,
window)
import Data.Array as Array
import Gargantext.Components.PhyloExplorer.Draw (drawPhylo, highlightSource, setGlobalD3Reference, setGlobalDependencies, unhide)
import Gargantext.Components.PhyloExplorer.Types (PhyloDataSet(..))
...
...
@@ -29,7 +29,7 @@ layoutCpt = here.component "layout" cpt where
} _ = do
-- States
R.useEffectOnce' $ do
unhide o.name
unhide
document
o.name
setGlobalD3Reference window d3
setGlobalDependencies window (PhyloDataSet o)
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