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
67818106
Commit
67818106
authored
Jul 24, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into testing
parents
702e218f
4df661c3
Pipeline
#6461
passed with stages
in 18 minutes and 58 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
41 deletions
+48
-41
package.json
package.json
+1
-1
Layout.purs
src/Gargantext/Components/Frame/Layout.purs
+9
-7
Phylo.purs
src/Gargantext/Components/Nodes/Corpus/Phylo.purs
+29
-25
Frame.purs
src/Gargantext/Components/Nodes/Frame.purs
+1
-0
API.purs
src/Gargantext/Components/PhyloExplorer/API.purs
+1
-1
JSON.purs
src/Gargantext/Components/PhyloExplorer/JSON.purs
+4
-2
Types.purs
src/Gargantext/Components/PhyloExplorer/Types.purs
+3
-5
No files found.
package.json
View file @
67818106
{
"name"
:
"Gargantext"
,
"version"
:
"0.0.7.1.1
1
"
,
"version"
:
"0.0.7.1.1
4
"
,
"scripts"
:
{
"build"
:
"spago build"
,
"bundle"
:
"spago bundle --module Main --outfile dist/bundle.js"
,
...
...
src/Gargantext/Components/Frame/Layout.purs
View file @
67818106
...
...
@@ -21,6 +21,7 @@ here = R2.here "Gargantext.Components.Frame.Layout"
type Props =
( frame :: NodePoly Hyperdata
, nodeType :: NodeType
, nodeId :: Int
)
layout :: R2.Leaf Props
...
...
@@ -29,6 +30,7 @@ layoutCpt :: R.Component Props
layoutCpt = here.component "main" cpt where
cpt { frame: NodePoly { hyperdata: Hyperdata { base, frame_id } }
, nodeType
, nodeId
} _ = case nodeType of
-- Visio Node
...
...
@@ -58,7 +60,7 @@ layoutCpt = here.component "main" cpt where
,
H.a
{ className : "fa fa-video-camera fa-5x"
, href : hframeUrl nodeType base frame_id
, href : hframeUrl nodeType base frame_id
nodeId
, target: "_blank"
}
[]
...
...
@@ -92,7 +94,7 @@ layoutCpt = here.component "main" cpt where
[
-- H.script { src: "https://visio.gargantext.org/external_api.js"} [],
H.iframe
{ src: hframeUrl nodeType base frame_id
{ src: hframeUrl nodeType base frame_id
nodeId
, width: "100%"
, height: "100%"
}
...
...
@@ -132,8 +134,8 @@ layoutCpt = here.component "main" cpt where
--------------------------------------------------------------
hframeUrl :: NodeType -> Base -> FrameId -> String
hframeUrl NodeFrameNotebook base frame_id = base <> "/" <> frame_id -- Temp fix : frame_id is currently the whole url created
hframeUrl Calc base frame_id
= base <> "/" <> frame_id
hframeUrl NodeFrameVisio base frame_id
= base <> "/" <> frame_id
hframeUrl _ base frame_id
= base <> "/" <> frame_id <> "?view"
-- "?both"
hframeUrl :: NodeType -> Base -> FrameId ->
Int ->
String
hframeUrl NodeFrameNotebook base frame_id
_
= base <> "/" <> frame_id -- Temp fix : frame_id is currently the whole url created
hframeUrl Calc base frame_id
_
= base <> "/" <> frame_id
hframeUrl NodeFrameVisio base frame_id
_
= base <> "/" <> frame_id
hframeUrl _ base frame_id
node_id = base <> "/" <> frame_id <> "?view&node_id=" <> show node_id
-- "?both"
src/Gargantext/Components/Nodes/Corpus/Phylo.purs
View file @
67818106
...
...
@@ -40,7 +40,7 @@ nodeCpt = R2.hereComponent here "node" hCpt where
-- |
session <- useSession
state' /\ state <- R2.useBox' (Nothing :: Maybe
PhyloSet
)
state' /\ state <- R2.useBox' (Nothing :: Maybe
(Maybe PhyloSet)
)
cache' /\ cache <- R2.useBox' (defaultCacheParams :: CacheParams)
-- | Computed
...
...
@@ -92,28 +92,32 @@ nodeCpt = R2.hereComponent here "node" hCpt where
]
]
, defaultSlot:
R2.fromMaybe state' \(PhyloSet { corpusId, listId, phyloData, phyloConfig}) ->
let
state_ :: Record PhyloStore.State
state_ =
-- Data
{ phyloData
, phyloConfig
, corpusId
, listId
, phyloId: nodeId
-- (cache params)
, expandSelection: getter _.expandSelection cache'
, expandNeighborhood: getter _.expandNeighborhood cache'
-- (default options)
} `Record.merge` PhyloStore.options
in
PhyloStore.provide
state_
[
layout
{}
]
R2.fromMaybe state' \p ->
case p of
Just (PhyloSet {phyloData, phyloConfig, corpusId, listId}) ->
let
state_ :: Record PhyloStore.State
state_ =
-- Data
{ phyloData
, phyloConfig
, corpusId
, listId
, phyloId: nodeId
-- (cache params)
, expandSelection: getter _.expandSelection cache'
, expandNeighborhood: getter _.expandNeighborhood cache'
-- (default options)
} `Record.merge` PhyloStore.options
in
PhyloStore.provide
state_
[
layout
{}
]
_ -> H.p
{ className: "text-center pt-10" }
[ H.text "Phylo not generated yet, please update the node settings to see your phylonometry." ]
}
src/Gargantext/Components/Nodes/Frame.purs
View file @
67818106
...
...
@@ -70,6 +70,7 @@ nodeCpt = R2.hereComponent here "node" hCpt where
layout
{ frame
, nodeType
, nodeId
}
}
...
...
src/Gargantext/Components/PhyloExplorer/API.purs
View file @
67818106
...
...
@@ -30,7 +30,7 @@ import Simple.JSON.Generics as JSONG
import Type.Proxy (Proxy(..))
get :: S.Session -> NodeID -> AffRESTError (PhyloSet)
get :: S.Session -> NodeID -> AffRESTError (
Maybe
PhyloSet)
get session nodeId = request >>= (_ <#> parseToPhyloSet) >>> pure
where
request :: AffRESTError (PhyloJSON)
...
...
src/Gargantext/Components/PhyloExplorer/JSON.purs
View file @
67818106
...
...
@@ -23,7 +23,7 @@ import Simple.JSON as JSON
newtype PhyloJSON = PhyloJSON
{ pd_corpusId :: Int
, pd_listId :: Int
, pd_data ::
, pd_data ::
Maybe (
{ _subgraph_cnt :: Int
, directed :: Boolean
, edges :: Array RawEdge
...
...
@@ -31,7 +31,8 @@ newtype PhyloJSON = PhyloJSON
, strict :: Boolean
| GraphData
}
, pd_config ::
)
, pd_config :: Maybe (
{ clique :: Cluster
, exportLabel :: Array PhyloLabel
, exportSort :: Sort
...
...
@@ -42,6 +43,7 @@ newtype PhyloJSON = PhyloJSON
, timeUnit :: TimeUnit
| ConfigData
}
)
}
derive instance Generic PhyloJSON _
...
...
src/Gargantext/Components/PhyloExplorer/Types.purs
View file @
67818106
...
...
@@ -56,8 +56,8 @@ derive instance Generic PhyloSet _
derive instance Eq PhyloSet
instance Show PhyloSet where show = genericShow
parseToPhyloSet :: PhyloJSON -> PhyloSet
parseToPhyloSet (PhyloJSON o
) =
PhyloSet
parseToPhyloSet :: PhyloJSON ->
Maybe
PhyloSet
parseToPhyloSet (PhyloJSON o
@{pd_data: Just p, pd_config: Just c}) = Just $
PhyloSet
{ corpusId : o.pd_corpusId
, listId : o.pd_listId
, phyloData : PhyloData
...
...
@@ -91,9 +91,6 @@ parseToPhyloSet (PhyloJSON o) = PhyloSet
}
where
p = o.pd_data
c = o.pd_config
epochTS = p.phyloTimeScale == "epoch"
ancestorLinks = parseAncestorLinks p.edges
...
...
@@ -102,6 +99,7 @@ parseToPhyloSet (PhyloJSON o) = PhyloSet
groups = parseGroups epochTS p.objects
links = parseLinks p.edges
periods = parsePeriods epochTS p.objects
parseToPhyloSet _ = Nothing
----------------------------------------------------------------------
...
...
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