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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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-gargantext
Commits
da689190
Commit
da689190
authored
Jun 25, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default imtbgraph set and legend added
parent
7c145829
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
Graph.purs
src/Graph.purs
+9
-8
Types.purs
src/GraphExplorer/Types.purs
+2
-2
Navigation.purs
src/Navigation.purs
+1
-1
No files found.
src/Graph.purs
View file @
da689190
...
...
@@ -8,7 +8,7 @@ import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Eff.Unsafe (unsafePerformEff)
import DOM (DOM)
import Data.Argonaut (decodeJson)
import Data.Array (length, mapWithIndex, (!!))
import Data.Array (length, mapWithIndex,
take,
(!!))
import Data.Either (Either(..))
import Data.HTTP.Method (Method(..))
import Data.Int (toNumber)
...
...
@@ -69,9 +69,9 @@ performAction _ _ _ = void do
convert :: GraphData -> SigmaGraphData
convert (GraphData r) = SigmaGraphData { nodes
: nodes', edges : edges'
}
convert (GraphData r) = SigmaGraphData { nodes
, edges
}
where
nodes
'
= mapWithIndex nodeFn r.nodes
nodes = mapWithIndex nodeFn r.nodes
nodeFn i (Node n) =
sigmaNode
{ id : n.id_
...
...
@@ -83,7 +83,7 @@ convert (GraphData r) = SigmaGraphData { nodes : nodes', edges : edges'}
}
where
cDef (Cluster {clustDefault}) = clustDefault
edges
'
= map edgeFn r.edges
edges = map edgeFn r.edges
edgeFn (Edge e) = sigmaEdge {id : e.id_, source : e.source, target : e.target}
render :: forall props. Render State props Action
...
...
@@ -283,7 +283,7 @@ dispLegend :: Array Legend -> ReactElement
dispLegend ary = div [] $ map dl ary
where
dl (Legend {id_, label}) =
div
[]
p
[]
[ span [style {width : 10, height : 10, backgroundColor : intColor id_, display: "inline-block"}] []
, text $ " " <> label
]
...
...
@@ -400,8 +400,9 @@ specOld = simpleSpec performAction render
, edgeShapes {"default" : edgeShape.curve}
]
]
]
<>
if length st.legendData > 0 then [div [style {position : "absolute", bottom : "10px", border: "1px solid black", boxShadow : "rgb(0, 0, 0) 0px 2px 6px", marginLeft : "10px", padding: "16px"}] [dispLegend st.legendData]] else []
]
, div [className "col-md-3", style {border : "1px black solid", backgroundColor : "beige"}]
[ div [className "row"]
[ div [_id "sidepanel" , className "col-md-12", style {borderBottom : "1px solid black"}]
...
...
@@ -440,7 +441,7 @@ specOld = simpleSpec performAction render
, a [ className "badge badge-light"][text "software engineering"]
, a [ className "badge badge-light"][text "complex systems"]
, a [ className "badge badge-light"][text "wireless communications"]
, dispLegend st.legendData
]
]
]
...
...
src/GraphExplorer/Types.purs
View file @
da689190
...
...
@@ -3,7 +3,7 @@ module GraphExplorer.Types where
import Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Array (concat, group, head, length, sort)
import Data.Array (concat, group, head, length, sort
, take
)
import Data.Maybe (fromJust)
import Data.Newtype (class Newtype)
import Data.NonEmpty (NonEmpty(..))
...
...
@@ -85,7 +85,7 @@ getLegendData (GraphData {nodes, edges}) = nn
mp (NonEmpty a ary) = [a] <> (if length ary > 0 then [unsafePartial $ fromJust $ head ary] else [])
n = sort $ map t' nodes
g = group n
nn = concat $ map mp g
nn =
take 5 $
concat $ map mp g
t' :: Node -> Legend
t' (Node r) = Legend { id_ : clustDefault, label : r.label}
...
...
src/Navigation.purs
View file @
da689190
...
...
@@ -646,7 +646,7 @@ dispatchAction dispatcher _ CorpusAnalysis = do
dispatchAction dispatcher _ PGraphExplorer = do
_ <- dispatcher $ SetRoute $ PGraphExplorer
--_ <- dispatcher $ GraphExplorerA $ GE.NoOp
_ <- dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
pure unit
dispatchAction dispatcher _ NGramsTable = do
...
...
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