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
4c9f4b3b
Commit
4c9f4b3b
authored
Oct 18, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] User can chose the Bridgeness method
parent
fb73275e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+15
-1
Types.purs
...text/Components/Forest/Tree/Node/Action/Update/Types.purs
+19
-2
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
4c9f4b3b
...
...
@@ -2,7 +2,7 @@ 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(..))
import Gargantext.Components.Forest.Tree.Node.Action.Update.Types (Charts(..), Granularity(..), GraphMetric(..), Method(..), PartitionMethod(..), UpdateNodeParams(..), Strength(..)
, BridgenessMethod(..)
)
import DOM.Simple.Console (log3)
import Data.Either (Either(..))
...
...
@@ -90,6 +90,9 @@ updateGraphCpt = here.component "updateGraph" cpt where
methodGraphClustering <- T.useBox Spinglass
methodGraphClustering' <- T.useLive T.unequal methodGraphClustering
methodGraphBridgeness <- T.useBox BridgenessMethod_Basic
methodGraphBridgeness' <- T.useLive T.unequal methodGraphBridgeness
let
callback :: Action -> Aff Unit
callback = dispatch >=> \_ -> dispatch CloseBox
...
...
@@ -100,6 +103,15 @@ updateGraphCpt = here.component "updateGraph" cpt where
, callback: \val -> T.write_ val methodGraphMetric
, print: show } []
, 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]
...
...
@@ -113,6 +125,7 @@ updateGraphCpt = here.component "updateGraph" cpt where
, 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'
...
...
@@ -128,6 +141,7 @@ updateGraphCpt = here.component "updateGraph" cpt where
]
(submitButton (UpdateNode $ UpdateNodeParamsGraph { methodGraphMetric: methodGraphMetric'
, methodGraphClustering: methodGraphClustering'
, methodGraphBridgeness: methodGraphBridgeness'
, methodGraphEdgesStrength : methodGraphEdgesStrength'
, methodGraphNodeType1 : methodGraphNodeType1'
, methodGraphNodeType2 : methodGraphNodeType2'
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs
View file @
4c9f4b3b
...
...
@@ -16,6 +16,7 @@ data UpdateNodeParams
| UpdateNodeParamsGraph { methodGraphMetric :: GraphMetric
, methodGraphEdgesStrength :: Strength
, methodGraphClustering :: PartitionMethod
, methodGraphBridgeness :: BridgenessMethod
, methodGraphNodeType1 :: GT.CTabNgramType
, methodGraphNodeType2 :: GT.CTabNgramType
}
...
...
@@ -31,9 +32,9 @@ instance JSON.WriteForeign UpdateNodeParams where
writeImpl (UpdateNodeParamsList { methodList }) =
JSON.writeImpl { type: "UpdateNodeParamsList"
, methodList }
writeImpl (UpdateNodeParamsGraph { methodGraphMetric, methodGraphClustering, methodGraphEdgesStrength, methodGraphNodeType1, methodGraphNodeType2}) =
writeImpl (UpdateNodeParamsGraph { methodGraphMetric, methodGraphClustering, methodGraph
Bridgeness, methodGraph
EdgesStrength, methodGraphNodeType1, methodGraphNodeType2}) =
JSON.writeImpl { type: "UpdateNodeParamsGraph"
, methodGraphMetric, methodGraphClustering, methodGraphEdgesStrength, methodGraphNodeType1, methodGraphNodeType2}
, methodGraphMetric, methodGraphClustering, methodGraph
Bridgeness, methodGraph
EdgesStrength, methodGraphNodeType1, methodGraphNodeType2}
writeImpl (UpdateNodeParamsTexts { methodTexts }) =
JSON.writeImpl { type: "UpdateNodeParamsTexts"
, methodTexts }
...
...
@@ -99,6 +100,22 @@ instance Read PartitionMethod where
instance JSON.ReadForeign PartitionMethod where readImpl = JSONG.enumSumRep
instance JSON.WriteForeign PartitionMethod where writeImpl = JSON.writeImpl <<< show
data BridgenessMethod = BridgenessMethod_Basic
| BridgenessMethod_Advanced
derive instance Generic BridgenessMethod _
derive instance Eq BridgenessMethod
instance Show BridgenessMethod where show = genericShow
instance Read BridgenessMethod where
read "BridgenessMethod_Basic" = Just BridgenessMethod_Basic
read "BridgenessMethod_Advanced" = Just BridgenessMethod_Advanced
read _ = Nothing
instance JSON.ReadForeign BridgenessMethod where readImpl = JSONG.enumSumRep
instance JSON.WriteForeign BridgenessMethod where writeImpl = JSON.writeImpl <<< show
----------------------------------------------------------------------
data Granularity = NewNgrams | NewTexts | Both
...
...
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