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
137702d0
Commit
137702d0
authored
Jun 17, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Texts update method
parent
0ad2f78f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+7
-1
Types.purs
...text/Components/Forest/Tree/Node/Action/Update/Types.purs
+11
-10
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
137702d0
...
...
@@ -53,7 +53,13 @@ update Graph dispatch = do
]
(submitButton (UpdateNode $ UpdateNodeParamsGraph {method}) dispatch)
update Texts _ = pure $ H.div {} []
update Texts dispatch = do
meth @( method /\ setMethod ) <- R.useState' NewNgrams
pure $ panel [ -- H.text "Update with"
formChoiceSafe [NewNgrams, NewTexts, Both] NewNgrams setMethod
]
(submitButton (UpdateNode $ UpdateNodeParamsTexts {method}) dispatch)
update _ _ = pure $ H.div {} []
-- fragmentPT $ "Update " <> show nodeType
src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs
View file @
137702d0
...
...
@@ -10,7 +10,7 @@ import Gargantext.Prelude (class Eq, class Read, class Show)
data UpdateNodeParams = UpdateNodeParamsList { method :: Method }
| UpdateNodeParamsGraph { method :: Metric }
| UpdateNodeParamsTexts { method ::
Int
}
| UpdateNodeParamsTexts { method ::
Granularity
}
derive instance eqUpdateNodeParams :: Eq UpdateNodeParams
...
...
@@ -71,24 +71,25 @@ instance encodeJsonMetric :: Argonaut.EncodeJson Metric where
----------------------------------------------------------------------
data
Metric = Order1 | Order2
data
Granularity = NewNgrams | NewTexts | Both
derive instance generic
Metric :: Generic Metric
_
derive instance generic
Granularity :: Generic Granularity
_
derive instance eq
Metric :: Eq Metric
derive instance eq
Granularity :: Eq Granularity
instance show
Metric :: Show Metric
where
instance show
Granularity :: Show Granularity
where
show = genericShow
instance readMetric :: Read Metric where
read "Order1" = Just Order1
read "Order2" = Just Order2
instance readGranularity :: Read Granularity where
read "NewNgrams" = Just NewNgrams
read "NewTexts" = Just NewTexts
read "Both" = Just Both
read _ = Nothing
instance decodeJson
Metric :: Argonaut.DecodeJson Metric
where
instance decodeJson
Granularity :: Argonaut.DecodeJson Granularity
where
decodeJson = genericSumDecodeJson
instance encodeJson
Metric :: Argonaut.EncodeJson Metric
where
instance encodeJson
Granularity :: Argonaut.EncodeJson Granularity
where
encodeJson = genericSumEncodeJson
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