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
28e62c6c
Commit
28e62c6c
authored
Jun 13, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] read instances + fix warnings
parent
e0d243ad
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
46 deletions
+34
-46
API.purs
src/Gargantext/Components/GraphExplorer/API.purs
+2
-5
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+8
-9
API.purs
src/Gargantext/Components/NgramsTable/API.purs
+2
-8
Dashboard.purs
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
+10
-15
Types.purs
src/Gargantext/Types.purs
+12
-9
No files found.
src/Gargantext/Components/GraphExplorer/API.purs
View file @
28e62c6c
module Gargantext.Components.GraphExplorer.API where
module Gargantext.Components.GraphExplorer.API where
import Gargantext.Prelude
import Data.Maybe (Maybe)
import Data.Maybe (Maybe)
import Effect (Effect)
import Effect.Aff (Aff)
import Effect.Aff (Aff, launchAff_)
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Prelude
import Gargantext.Routes as GR
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, get, post)
import Gargantext.Sessions (Session, get, post)
import Gargantext.Types as GT
import Gargantext.Types as GT
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
28e62c6c
...
@@ -23,22 +23,21 @@ import Data.Symbol (SProxy(..))
...
@@ -23,22 +23,21 @@ import Data.Symbol (SProxy(..))
import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect (Effect)
import Prelude (class Show, Unit, bind, const, discard, identity, map, mempty, not, pure, show, unit, (#), ($), (&&), (/=), (<$>), (<<<), (<>), (=<<), (==), (||))
import Reactix as R
import Reactix.DOM.HTML as H
import Unsafe.Coerce (unsafeCoerce)
import Gargantext.Components.AutoUpdate (autoUpdateElt)
import Gargantext.Components.AutoUpdate (autoUpdateElt)
import Gargantext.Components.Loader (loader)
import Gargantext.Components.Loader (loader)
import Gargantext.Components.LoadingSpinner (loadingSpinner)
import Gargantext.Components.LoadingSpinner (loadingSpinner)
import Gargantext.Components.NgramsTable.Core (Action(..), CoreState, Dispatch, NgramsElement(..), NgramsPatch(..), NgramsTable, NgramsTerm, PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, _NgramsElement, _NgramsTable, _children, _list, _ngrams, _occurrences, _root, addNewNgram, applyNgramsPatches, applyPatchSet, commitPatchR, convOrderBy, filterTermSize, fromNgramsPatches, initialPageParams, loadNgramsTableAll, ngramsTermText, normNgram, patchSetFromMap, replace, rootsOf, singletonNgramsTablePatch, syncPatchesR)
import Gargantext.Components.NgramsTable.Components as NTC
import Gargantext.Components.NgramsTable.Components as NTC
import Gargantext.Components.NgramsTable.Core (Action(..), CoreState, Dispatch, NgramsElement(..), NgramsPatch(..), NgramsTable, NgramsTerm, PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, _NgramsElement, _NgramsTable, _children, _list, _ngrams, _occurrences, _root, addNewNgram, applyNgramsPatches, applyPatchSet, commitPatchR, convOrderBy, filterTermSize, fromNgramsPatches, initialPageParams, loadNgramsTableAll, ngramsTermText, normNgram, patchSetFromMap, replace, rootsOf, singletonNgramsTablePatch, syncPatchesR)
import Gargantext.Components.Table as T
import Gargantext.Components.Table as T
import Gargantext.Prelude (class Show, Unit, bind, const, discard, identity, map, mempty, not, pure, show, unit, (#), ($), (&&), (/=), (<$>), (<<<), (<>), (=<<), (==), (||), read)
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (CTabNgramType, OrderBy(..), SearchQuery, TabType, TermList(..), TermSize,
readTermList, readTermSize,
termLists, termSizes)
import Gargantext.Types (CTabNgramType, OrderBy(..), SearchQuery, TabType, TermList(..), TermSize, termLists, termSizes)
import Gargantext.Utils (queryMatchesLabel, toggleSet)
import Gargantext.Utils (queryMatchesLabel, toggleSet)
import Gargantext.Utils.List (sortWith) as L
import Gargantext.Utils.List (sortWith) as L
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Unsafe.Coerce (unsafeCoerce)
type State' =
type State' =
CoreState
CoreState
...
@@ -159,7 +158,7 @@ tableContainerCpt { dispatch
...
@@ -159,7 +158,7 @@ tableContainerCpt { dispatch
[ R2.select { id: "picklistmenu"
[ R2.select { id: "picklistmenu"
, className: "form-control custom-select"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termListFilter)
, defaultValue: (maybe "" show termListFilter)
, on: {change: setTermListFilter <<< read
TermList
<<< R2.unsafeEventValue}}
, on: {change: setTermListFilter <<< read <<< R2.unsafeEventValue}}
(map optps1 termLists)]
(map optps1 termLists)]
]
]
, H.div {className: "col-md-2", style: {marginTop : "6px"}}
, H.div {className: "col-md-2", style: {marginTop : "6px"}}
...
@@ -167,7 +166,7 @@ tableContainerCpt { dispatch
...
@@ -167,7 +166,7 @@ tableContainerCpt { dispatch
[ R2.select {id: "picktermtype"
[ R2.select {id: "picktermtype"
, className: "form-control custom-select"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termSizeFilter)
, defaultValue: (maybe "" show termSizeFilter)
, on: {change: setTermSizeFilter <<< read
TermSize
<<< R2.unsafeEventValue}}
, on: {change: setTermSizeFilter <<< read <<< R2.unsafeEventValue}}
(map optps1 termSizes)]
(map optps1 termSizes)]
]
]
, H.div { className: "col-md-2", style: { marginTop: "6px" } } [
, H.div { className: "col-md-2", style: { marginTop: "6px" } } [
...
...
src/Gargantext/Components/NgramsTable/API.purs
View file @
28e62c6c
module Gargantext.Components.NgramsTable.API where
module Gargantext.Components.NgramsTable.API where
import Gargantext.Prelude
import Effect.Aff (Aff)
import Data.Maybe (Maybe)
import Effect (Effect)
import Effect.Aff (Aff, launchAff_)
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Routes as GR
import Gargantext.Routes as GR
import Gargantext.Sessions (Session,
get,
post)
import Gargantext.Sessions (Session, post)
import Gargantext.Types as GT
import Gargantext.Types as GT
type UpdateNodeListParams =
type UpdateNodeListParams =
...
...
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
View file @
28e62c6c
module Gargantext.Components.Nodes.Corpus.Dashboard where
module Gargantext.Components.Nodes.Corpus.Dashboard where
import DOM.Simple.Console (log2)
import Data.Array as A
import Data.Array as A
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Tuple (fst)
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Nodes.Corpus.Chart.Predefined as P
import Gargantext.Components.Nodes.Corpus.Chart.Predefined as P
import Gargantext.Components.Nodes.Dashboard.Types as DT
import Gargantext.Components.Nodes.Dashboard.Types as DT
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.
Utils.Reactix as R2
import Gargantext.
Prelude
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (NodeID)
import Gargantext.Types (NodeID)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
type Props =
type Props =
(
( nodeId :: NodeID
nodeId :: NodeID
, session :: Session
, session :: Session
)
)
...
@@ -49,11 +45,10 @@ dashboardLayoutCpt = R.hooksComponent "G.C.N.C.D.dashboardLayout" cpt
...
@@ -49,11 +45,10 @@ dashboardLayoutCpt = R.hooksComponent "G.C.N.C.D.dashboardLayout" cpt
where
where
onChange :: NodeID -> R.State Int -> DT.Hyperdata -> Array P.PredefinedChart -> Effect Unit
onChange :: NodeID -> R.State Int -> DT.Hyperdata -> Array P.PredefinedChart -> Effect Unit
onChange nodeId (_ /\ setReload) (DT.Hyperdata h) charts = do
onChange nodeId
'
(_ /\ setReload) (DT.Hyperdata h) charts = do
launchAff_ do
launchAff_ do
DT.saveDashboard {
DT.saveDashboard { hyperdata: DT.Hyperdata $ h { charts = charts }
hyperdata: DT.Hyperdata $ h { charts = charts }
, nodeId:nodeId'
, nodeId
, session }
, session }
liftEffect $ setReload $ (+) 1
liftEffect $ setReload $ (+) 1
...
...
src/Gargantext/Types.purs
View file @
28e62c6c
...
@@ -13,6 +13,7 @@ import Data.Maybe (Maybe(..), maybe)
...
@@ -13,6 +13,7 @@ import Data.Maybe (Maybe(..), maybe)
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Prim.Row (class Union)
import Prim.Row (class Union)
import URI.Query (Query)
import URI.Query (Query)
import Gargantext.Prelude (class Read)
type ID = Int
type ID = Int
type Name = String
type Name = String
...
@@ -43,10 +44,11 @@ instance showTermSize :: Show TermSize where
...
@@ -43,10 +44,11 @@ instance showTermSize :: Show TermSize where
show MonoTerm = "MonoTerm"
show MonoTerm = "MonoTerm"
show MultiTerm = "MultiTerm"
show MultiTerm = "MultiTerm"
readTermSize :: String -> Maybe TermSize
instance readTermSize :: Read TermSize where
readTermSize "MonoTerm" = Just MonoTerm
read :: String -> Maybe TermSize
readTermSize "MultiTerm" = Just MultiTerm
read "MonoTerm" = Just MonoTerm
readTermSize _ = Nothing
read "MultiTerm" = Just MultiTerm
read _ = Nothing
termSizes :: Array { desc :: String, mval :: Maybe TermSize }
termSizes :: Array { desc :: String, mval :: Maybe TermSize }
termSizes = [ { desc: "All types", mval: Nothing }
termSizes = [ { desc: "All types", mval: Nothing }
...
@@ -92,11 +94,12 @@ termListName GraphTerm = "Map List"
...
@@ -92,11 +94,12 @@ termListName GraphTerm = "Map List"
termListName StopTerm = "Stop List"
termListName StopTerm = "Stop List"
termListName CandidateTerm = "Candidate List"
termListName CandidateTerm = "Candidate List"
readTermList :: String -> Maybe TermList
instance readTermList :: Read TermList where
readTermList "GraphTerm" = Just GraphTerm
read :: String -> Maybe TermList
readTermList "StopTerm" = Just StopTerm
read "GraphTerm" = Just GraphTerm
readTermList "CandidateTerm" = Just CandidateTerm
read "StopTerm" = Just StopTerm
readTermList _ = Nothing
read "CandidateTerm" = Just CandidateTerm
read _ = Nothing
termLists :: Array { desc :: String, mval :: Maybe TermList }
termLists :: Array { desc :: String, mval :: Maybe TermList }
termLists = [ { desc: "All terms", mval: Nothing }
termLists = [ { desc: "All terms", mval: 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