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
139
Issues
139
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
34bec071
Commit
34bec071
authored
Mar 12, 2025
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/730-frontend-for-bridgeness-method-choice' into dev
parents
ed749259
60629353
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
107 deletions
+16
-107
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+12
-83
Types.purs
...text/Components/Forest/Tree/Node/Action/Update/Types.purs
+4
-24
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
34bec071
...
...
@@ -2,8 +2,6 @@ module Gargantext.Components.Forest.Tree.Node.Action.Update where
import Gargantext.Prelude
import Gargantext.Components.Forest.Tree.Node.Action.Update.Types (Charts(..), Granularity(..), GraphMetric(..), Method(..), PartitionMethod(..), UpdateNodeParams(..), Strength(..), BridgenessMethod(..), UpdateNodeConfigGraph(..))
import DOM.Simple.Console (log3)
import Data.Either (Either(..))
import Data.Maybe (Maybe(..))
...
...
@@ -13,11 +11,12 @@ import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..))
import Gargantext.Components.Forest.Tree.Node.Action.Types (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Update.Types (BridgenessMethod(..), Charts(..), Granularity(..), GraphMetric(..), Method(..), Strength(..), UpdateNodeConfigGraph(..), UpdateNodeParams(..))
import Gargantext.Components.Forest.Tree.Node.Tools as Tools
import Gargantext.Components.PhyloExplorer.API as Phylo
import Gargantext.Components.PhyloExplorer.Config.ConfigForm as PhyloForm
import Gargantext.Components.PhyloExplorer.ConfigFormParser as PhyloHook
import Gargantext.Config.REST (
RESTError,
AffRESTError)
import Gargantext.Config.REST (AffRESTError)
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID, NodeType(..))
...
...
@@ -104,10 +103,7 @@ updateGraphCpt = here.component "updateGraph" cpt
methodGraphNodeType2 <- T.useBox GT.CTabTerms
methodGraphNodeType2' <- T.useLive T.unequal methodGraphNodeType2
methodGraphClustering <- T.useBox Spinglass
methodGraphClustering' <- T.useLive T.unequal methodGraphClustering
methodGraphBridgeness <- T.useBox BridgenessMethod_Basic
methodGraphBridgeness <- T.useBox BridgenessBasic
methodGraphBridgeness' <- T.useLive T.unequal methodGraphBridgeness
let
...
...
@@ -117,7 +113,6 @@ updateGraphCpt = here.component "updateGraph" cpt
let
config = UpdateNodeConfigGraph
{ methodGraphMetric: methodGraphMetric'
, methodGraphClustering: methodGraphClustering'
, methodGraphBridgeness: methodGraphBridgeness'
, methodGraphEdgesStrength: methodGraphEdgesStrength'
, methodGraphNodeType1: methodGraphNodeType1'
...
...
@@ -141,43 +136,16 @@ updateGraphCpt = here.component "updateGraph" cpt
, label: "Show subjects with Order1 or concepts with Order2 ?"
}
[]
, Tools.formChoiceSafe
{ items: [ BridgenessBasic, BridgenessAdvanced ]
, default: methodGraphBridgeness'
, callback: \val -> T.write_ val methodGraphBridgeness
, print: show
, label: "Intercluster link filtering method"
}
[]
]
{-
, H.text "Bridgness Method : Basic is ok, Advanced in Development"
, formChoiceSafe { items: [BridgenessMethod_Basic, BridgenessMethod_Advanced]
, default: methodGraphBridgeness'
, callback: \val -> T.write_ val methodGraphBridgeness
, print: show } []
, H.text "NodeType 1 ?"
, formChoiceSafe { items: [GT.CTabTerms, GT.CTabSources, GT.CTabAuthors, GT.CTabInstitutes]
, default: methodGraphNodeType1'
, callback: \val -> T.write_ val methodGraphNodeType1
, print: show } []
, H.text "Ngrams ?"
, formChoiceSafe { items: [GT.CTabTerms, GT.CTabSources, GT.CTabAuthors, GT.CTabInstitutes]
, default: methodGraphNodeType2'
, callback: \val -> T.write_ val methodGraphNodeType2
, print: show } []
--}
{-
, H.text "Show Strong (expected) links or weak (maybe unexpected) links?"
, formChoiceSafe { items: [Strong, Weak]
, default: methodGraphEdgesStrength'
, callback: \val -> T.write_ val methodGraphEdgesStrength
, print: show } []
, formChoiceSafe { items: [Spinglass, Infomap, Confluence]
, default: methodGraphClustering'
, callback: \val -> T.write_ val methodGraphClustering
, print: show } []
-}
updatePhylo :: R2.Leaf UpdateProps
updatePhylo = R2.leaf updatePhyloCpt
...
...
@@ -246,37 +214,6 @@ updateCorpusCpt = here.component "updateTexts" cpt
methodList <- T.useBox Basic
methodList' <- T.useLive T.unequal methodList
-- method for graph metric
methodGraphMetric <- T.useBox Order1
methodGraphMetric' <- T.useLive T.unequal methodGraphMetric
let
graphConfig = UpdateNodeConfigGraph
{ methodGraphMetric: methodGraphMetric'
, methodGraphEdgesStrength: Strong
, methodGraphClustering: Spinglass
, methodGraphBridgeness: BridgenessMethod_Basic
, methodGraphNodeType1: GT.CTabTerms
, methodGraphNodeType2: GT.CTabTerms
}
let
phyloConfig = Phylo.UpdateData
{ defaultMode: true
, proximity: 0.5
, synchrony: 0.5
, quality: 0.8
, exportFilter: 3.0
, timeUnit: Phylo.Year $ Phylo.TimeUnitCriteria
{ period: 3
, step: 1
, matchingFrame: 5
}
, clique: Phylo.MaxClique
{ size: 5
, threshold: 0.0001
, filter: Phylo.ByThreshold
}
}
let methodTexts = Both
pure $
...
...
@@ -354,13 +291,7 @@ updateTextsCpt = here.component "updateTexts" cpt
, iconName: "reload-with-settings"
, textTitle: "Update documents (contexts)"
}
[] -- H.text "Update with"
-- formChoiceSafe { items: [NewNgrams, NewTexts, Both]
-- , default: methodTexts'
-- , callback: \val -> T.write_ val methodTexts
-- , print: show } []
-- (submitButton (UpdateNode $ UpdateNodeParamsTexts { methodTexts: methodTexts' }) dispatch)
[]
updateOther :: R2.Component UpdateProps
updateOther = R.createElement updateOtherCpt
...
...
@@ -370,5 +301,3 @@ updateOtherCpt = here.component "updateOther" cpt
where
cpt _ _ = do
pure $ H.div {} []
-- fragmentPT $ "Update " <> show nodeType
src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs
View file @
34bec071
...
...
@@ -13,7 +13,6 @@ import Simple.JSON.Generics as JSONG
newtype UpdateNodeConfigGraph = UpdateNodeConfigGraph
{ methodGraphMetric :: GraphMetric
, methodGraphEdgesStrength :: Strength
, methodGraphClustering :: PartitionMethod
, methodGraphBridgeness :: BridgenessMethod
, methodGraphNodeType1 :: GT.CTabNgramType
, methodGraphNodeType2 :: GT.CTabNgramType
...
...
@@ -143,28 +142,9 @@ instance JSON.ReadForeign Strength where
instance JSON.WriteForeign Strength where
writeImpl = JSON.writeImpl <<< show
data PartitionMethod = Spinglass | Infomap | Confluence
derive instance Generic PartitionMethod _
derive instance Eq PartitionMethod
instance Show PartitionMethod where
show = genericShow
instance Read PartitionMethod where
read "Spinglass" = Just Spinglass
read "Confluence" = Just Confluence
read "Infomap" = Just Infomap
read _ = Nothing
instance JSON.ReadForeign PartitionMethod where
readImpl = JSONG.enumSumRep
instance JSON.WriteForeign PartitionMethod where
writeImpl = JSON.writeImpl <<< show
data BridgenessMethod
= Bridgeness
Method_
Basic
| Bridgeness
Method_
Advanced
= BridgenessBasic
| BridgenessAdvanced
derive instance Generic BridgenessMethod _
derive instance Eq BridgenessMethod
...
...
@@ -172,8 +152,8 @@ instance Show BridgenessMethod where
show = genericShow
instance Read BridgenessMethod where
read "Bridgeness
Method_Basic" = Just BridgenessMethod_
Basic
read "Bridgeness
Method_Advanced" = Just BridgenessMethod_
Advanced
read "Bridgeness
Basic" = Just Bridgeness
Basic
read "Bridgeness
Advanced" = Just Bridgeness
Advanced
read _ = Nothing
instance JSON.ReadForeign BridgenessMethod where
...
...
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