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
152
Issues
152
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
a339e7d9
Commit
a339e7d9
authored
Feb 28, 2022
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue
parent
388f48fc
Pipeline
#2521
failed with stage
in 0 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
227 additions
and
63 deletions
+227
-63
API.purs
src/Gargantext/Components/PhyloExplorer/API.purs
+42
-10
ConfigForm.purs
src/Gargantext/Components/PhyloExplorer/ConfigForm.purs
+185
-52
Unboxed.purs
src/Gargantext/Hooks/StateRecord/Unboxed.purs
+0
-1
No files found.
src/Gargantext/Components/PhyloExplorer/API.purs
View file @
a339e7d9
...
...
@@ -3,6 +3,8 @@ module Gargantext.Components.PhyloExplorer.API
, UpdateData(..)
, TimeUnit(..), ReflexiveTimeUnit(..), TimeUnitCriteria(..)
, Clique(..), ReflexiveClique(..), CliqueFilter(..)
, toReflexiveTimeUnit, fromReflexiveTimeUnit, extractCriteria
, toReflexiveClique
, update, updateProgress
) where
...
...
@@ -11,6 +13,7 @@ import Gargantext.Prelude
import Data.Either (Either(..))
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Show.Generic (genericShow)
import Data.Symbol (SProxy(..))
import Gargantext.Components.PhyloExplorer.JSON (PhyloJSONSet)
...
...
@@ -170,12 +173,12 @@ instance Show ReflexiveTimeUnit where show = genericShow
instance Read ReflexiveTimeUnit where
read :: String -> Maybe ReflexiveTimeUnit
read = case _ of
"Epoch" -> Just Epoch_
"Year" -> Just Year_
"Month" -> Just Month_
"Week" -> Just Week_
"Day" -> Just Day_
_ -> Nothing
"Epoch
_
" -> Just Epoch_
"Year
_
" -> Just Year_
"Month
_
" -> Just Month_
"Week
_
" -> Just Week_
"Day
_
" -> Just Day_
_
-> Nothing
newtype TimeUnitCriteria = TimeUnitCriteria
...
...
@@ -186,6 +189,7 @@ newtype TimeUnitCriteria = TimeUnitCriteria
derive instance Generic TimeUnitCriteria _
derive instance Eq TimeUnitCriteria
derive instance Newtype TimeUnitCriteria _
instance Show TimeUnitCriteria where show = genericShow
derive newtype instance JSON.ReadForeign TimeUnitCriteria
...
...
@@ -245,9 +249,9 @@ instance Show ReflexiveClique where show = genericShow
instance Read ReflexiveClique where
read :: String -> Maybe ReflexiveClique
read = case _ of
"FIS" -> Just FIS_
"MaxClique" -> Just MaxClique_
_ -> Nothing
"FIS
_
" -> Just FIS_
"MaxClique
_
" -> Just MaxClique_
_
-> Nothing
data CliqueFilter = ByThreshold | ByNeighbours
...
...
@@ -260,11 +264,39 @@ instance JSON.WriteForeign CliqueFilter where writeImpl = JSON.writeImpl <<< sho
instance Read CliqueFilter where
read :: String -> Maybe CliqueFilter
read = case _ of
"ByT
reshold"
-> Just ByThreshold
"ByT
hreshold"
-> Just ByThreshold
"ByNeighbours" -> Just ByNeighbours
_ -> Nothing
toReflexiveTimeUnit :: TimeUnit -> ReflexiveTimeUnit
toReflexiveTimeUnit (Epoch _) = Epoch_
toReflexiveTimeUnit (Year _) = Year_
toReflexiveTimeUnit (Month _) = Month_
toReflexiveTimeUnit (Week _) = Week_
toReflexiveTimeUnit (Day _) = Day_
fromReflexiveTimeUnit :: ReflexiveTimeUnit -> TimeUnitCriteria -> TimeUnit
fromReflexiveTimeUnit Epoch_ c = Epoch c
fromReflexiveTimeUnit Year_ c = Year c
fromReflexiveTimeUnit Month_ c = Month c
fromReflexiveTimeUnit Week_ c = Week c
fromReflexiveTimeUnit Day_ c = Day c
extractCriteria :: TimeUnit -> TimeUnitCriteria
extractCriteria (Epoch (o :: TimeUnitCriteria)) = o
extractCriteria (Year (o :: TimeUnitCriteria)) = o
extractCriteria (Month (o :: TimeUnitCriteria)) = o
extractCriteria (Week (o :: TimeUnitCriteria)) = o
extractCriteria (Day (o :: TimeUnitCriteria)) = o
toReflexiveClique :: Clique -> ReflexiveClique
toReflexiveClique (FIS _) = FIS_
toReflexiveClique (MaxClique _) = MaxClique_
update ::
Session
-> NodeID
...
...
src/Gargantext/Components/PhyloExplorer/ConfigForm.purs
View file @
a339e7d9
This diff is collapsed.
Click to expand it.
src/Gargantext/Hooks/StateRecord/Unboxed.purs
View file @
a339e7d9
...
...
@@ -13,7 +13,6 @@ import Prim.RowList (class RowToList)
import Reactix as R
import Toestand as T
-- @TODO: /!\ `bindStateKey` + `setStateKey` not working together
type Methods r a =
-- | Every provided props will be available within the `formFields` proxy
...
...
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