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
475a69dc
Commit
475a69dc
authored
Oct 13, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[chart] some chart reloading simplifications
parent
42bc8a18
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+11
-8
Ends.purs
src/Gargantext/Ends.purs
+1
-1
Routes.purs
src/Gargantext/Routes.purs
+3
-1
No files found.
src/Gargantext/Components/Nodes/Lists/Tabs.purs
View file @
475a69dc
...
@@ -13,7 +13,6 @@ import Gargantext.Prelude
...
@@ -13,7 +13,6 @@ import Gargantext.Prelude
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
import Gargantext.Components.Nodes.Corpus.Chart.API (recomputeChart)
import Gargantext.Components.Nodes.Corpus.Chart.Metrics (metrics)
import Gargantext.Components.Nodes.Corpus.Chart.Metrics (metrics)
import Gargantext.Components.Nodes.Corpus.Chart.Pie (pie, bar)
import Gargantext.Components.Nodes.Corpus.Chart.Pie (pie, bar)
import Gargantext.Components.Nodes.Corpus.Chart.Tree (tree)
import Gargantext.Components.Nodes.Corpus.Chart.Tree (tree)
...
@@ -64,12 +63,13 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
...
@@ -64,12 +63,13 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
, corpusId
, corpusId
, mode
, mode
, session } _ = do
, session } _ = do
chartType <- R.useState' Histo
chartType <- R.useState' Histo
chartsReload <- R.useState' 0
chartsReload <- R.useState' 0
pure $ R.fragment
pure $ R.fragment
( charts tabNgramType chartType chartsReload
( charts tabNgramType chartType chartsReload
<> [ NT.mainNgramsTable { afterSync: afterSync
(fst chartType)
chartsReload
<> [ NT.mainNgramsTable { afterSync: afterSync chartsReload
, cacheState
, cacheState
, defaultListId
, defaultListId
, nodeId: corpusId
, nodeId: corpusId
...
@@ -81,10 +81,13 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
...
@@ -81,10 +81,13 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
]
]
)
)
where
where
afterSync
chartType
(_ /\ setChartsReload) _ = do
afterSync (_ /\ setChartsReload) _ = do
case mNgramsType of
case mNgramsType of
Just ngramsType -> do
Just ngramsType -> do
_ <- recomputeChart session chartType ngramsType corpusId listId
-- NOTE: No need to recompute chart, after ngrams are sync this
-- should be recomputed already
-- We just refresh it
-- _ <- recomputeChart session chartType ngramsType corpusId listId
liftEffect $ setChartsReload $ (+) 1
liftEffect $ setChartsReload $ (+) 1
Nothing -> pure unit
Nothing -> pure unit
...
@@ -121,7 +124,7 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
...
@@ -121,7 +124,7 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
]
]
charts _ _ _ = [ chart mode ]
charts _ _ _ = [ chart mode ]
chart Authors = pie {
session, path
}
chart Authors = pie {
path, session
}
chart Institutes = tree {
session, path
}
chart Institutes = tree {
path, session
}
chart Sources = bar {
session, path
}
chart Sources = bar {
path, session
}
chart Terms = metrics {
session, path
}
chart Terms = metrics {
path, session
}
src/Gargantext/Ends.purs
View file @
475a69dc
...
@@ -119,7 +119,7 @@ sessionPath (R.Tab t i) = sessionPath (R.NodeAPI Node i (showTabType
...
@@ -119,7 +119,7 @@ sessionPath (R.Tab t i) = sessionPath (R.NodeAPI Node i (showTabType
sessionPath (R.Children n o l s i) = sessionPath (R.NodeAPI Node i ("children?type=" <> show n <> offsetUrl o <> limitUrl l <> orderUrl s))
sessionPath (R.Children n o l s i) = sessionPath (R.NodeAPI Node i ("children?type=" <> show n <> offsetUrl o <> limitUrl l <> orderUrl s))
sessionPath (R.NodeAPI Phylo pId p) = "phyloscape?nodeId=" <> (show $ fromMaybe 0 pId) <> p
sessionPath (R.NodeAPI Phylo pId p) = "phyloscape?nodeId=" <> (show $ fromMaybe 0 pId) <> p
sessionPath (R.RecomputeNgrams nt nId lId) = "node/" <> (show nId) <> "/ngrams/recompute?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeNgrams nt nId lId) = "node/" <> (show nId) <> "/ngrams/recompute?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartBar nt nId lId) = "node/" <> (show nId) <> "/
chart
?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartBar nt nId lId) = "node/" <> (show nId) <> "/
pie
?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartPie nt nId lId) = "node/" <> (show nId) <> "/pie?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartPie nt nId lId) = "node/" <> (show nId) <> "/pie?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartTree nt nId lId) = "node/" <> (show nId) <> "/tree?" <> (defaultList lId) <> "&ngramsType=" <> (show nt) <> "&listType=" <> show MapTerm
sessionPath (R.RecomputeListChart ChartTree nt nId lId) = "node/" <> (show nId) <> "/tree?" <> (defaultList lId) <> "&ngramsType=" <> (show nt) <> "&listType=" <> show MapTerm
sessionPath (R.RecomputeListChart Histo nt nId lId) = "node/" <> (show nId) <> "/chart?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart Histo nt nId lId) = "node/" <> (show nId) <> "/chart?" <> (defaultList lId) <> "&ngramsType=" <> (show nt)
...
...
src/Gargantext/Routes.purs
View file @
475a69dc
...
@@ -4,7 +4,9 @@ import Prelude
...
@@ -4,7 +4,9 @@ import Prelude
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit, ListId, NgramsGetOpts, NodeType, Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList, NgramsGetTableAllOpts)
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit,
ListId, NgramsGetOpts, NgramsGetTableAllOpts, NodeType,
Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList)
import Gargantext.Types as GT
import Gargantext.Types as GT
data AppRoute
data AppRoute
...
...
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