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
137
Issues
137
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
368428a1
Commit
368428a1
authored
Nov 19, 2022
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Charts] fix after merge
parent
f7cd32be
Pipeline
#3395
failed with stage
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
36 deletions
+61
-36
ECharts.purs
src/Gargantext/Components/Charts/Options/ECharts.purs
+4
-3
Histo.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Histo.purs
+4
-2
Metrics.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Metrics.purs
+4
-2
Pie.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Pie.purs
+8
-4
Predefined.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Predefined.purs
+19
-18
Tree.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Tree.purs
+17
-3
Dashboard.purs
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
+1
-0
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+4
-4
No files found.
src/Gargantext/Components/Charts/Options/ECharts.purs
View file @
368428a1
module Gargantext.Components.Charts.Options.ECharts where
import Prelude
import CSS.Common (normal)
import CSS.FontStyle (FontStyle(..))
import Data.Maybe (Maybe(..))
...
...
@@ -11,9 +13,8 @@ import Gargantext.Components.Charts.Options.Font (IconOptions(..), Shape(..), Te
import Gargantext.Components.Charts.Options.Legend (legendType, LegendMode(..), PlainOrScroll(..), selectedMode, Orientation(..), orient)
import Gargantext.Components.Charts.Options.Position (Align(..), LeftRelativePosition(..), TopRelativePosition(..), numberPosition, percentPosition, relativePosition)
import Gargantext.Components.Charts.Options.Series (Series, seriesPieD1)
import Gargantext.Components.Charts.Options.Type (DataZoom, EChartRef, EChartsInstance, Echarts, Legend, MouseEvent, Option, Title, XAxis, YAxis, xAxis, yAxis)
import Gargantext.Components.Charts.Options.Type (DataZoom, EChartRef, EChartsInstance, Echarts, Legend, MouseEvent, Option, Title, XAxis, YAxis,
LegendSelectChangedEvent,
xAxis, yAxis)
import Gargantext.Utils.Reactix as R2
import Prelude
import React (ReactClass, unsafeCreateElementDynamic)
import Reactix as R
import Record.Extra as RX
...
...
@@ -185,7 +186,7 @@ data Options = Options
, addZoom :: Boolean
, tooltip :: Tooltip
, onClick :: Maybe (MouseEvent -> Effect Unit)
, onLegendChanged :: Maybe (
Mouse
Event -> Effect Unit)
, onLegendChanged :: Maybe (
LegendSelectChanged
Event -> Effect Unit)
-- (?) `onInit` custom listener
--
-- * in addition of the already existing `onReady` native listener
...
...
src/Gargantext/Components/Nodes/Corpus/Chart/Histo.purs
View file @
368428a1
...
...
@@ -47,7 +47,7 @@ derive newtype instance JSON.WriteForeign HistoMetrics
type Loaded = HistoMetrics
chartOptions :: Record MetricsProps -> HistoMetrics -> Options
chartOptions { onClick, onInit } (HistoMetrics { dates: dates', count: count'}) = Options
chartOptions { onClick, on
LegendChanged, on
Init } (HistoMetrics { dates: dates', count: count'}) = Options
{ mainTitle : "Histogram"
, subTitle : "Distribution of publications over time"
, xAxis : xAxis' dates'
...
...
@@ -56,6 +56,7 @@ chartOptions { onClick, onInit } (HistoMetrics { dates: dates', count: count'})
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
, series
, onClick
, onLegendChanged
, onInit
}
where
...
...
@@ -95,7 +96,7 @@ histo props = R.createElement histoCpt props []
histoCpt :: R.Component Props
histoCpt = here.component "histo" cpt
where
cpt { boxes, path, session, onClick, onInit } _ = do
cpt { boxes, path, session, onClick, on
LegendChanged, on
Init } _ = do
reload <- T.useBox T2.newReload
pure $ metricsWithCacheLoadView
...
...
@@ -108,6 +109,7 @@ histoCpt = here.component "histo" cpt
, reload
, session
, onClick
, onLegendChanged
, onInit
}
...
...
src/Gargantext/Components/Nodes/Corpus/Chart/Metrics.purs
View file @
368428a1
...
...
@@ -55,7 +55,7 @@ derive newtype instance JSON.ReadForeign Metrics
type Loaded = Array Metric
scatterOptions :: Record MetricsProps -> Array Metric -> Options
scatterOptions { onClick, onInit } metrics' = Options
scatterOptions { onClick, on
LegendChanged, on
Init } metrics' = Options
{ mainTitle : "Ngrams Selection Metrics"
, subTitle : "Local metrics (Inc/Exc, Spe/Gen), Global metrics (TFICF maillage)"
, xAxis : xAxis { min: -1 }
...
...
@@ -64,6 +64,7 @@ scatterOptions { onClick, onInit } metrics' = Options
, addZoom : false
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
, onClick
, onLegendChanged
, onInit
}
where
...
...
@@ -108,7 +109,7 @@ metrics props = R.createElement metricsCpt props []
metricsCpt :: R.Component Props
metricsCpt = here.component "etrics" cpt
where
cpt { boxes, onClick, onInit, path, session } _ = do
cpt { boxes, onClick, on
LegendChanged, on
Init, path, session } _ = do
reload <- T.useBox T2.newReload
pure $ metricsWithCacheLoadView {
...
...
@@ -121,6 +122,7 @@ metricsCpt = here.component "etrics" cpt
, reload
, session
, onClick
, onLegendChanged
, onInit
}
...
...
src/Gargantext/Components/Nodes/Corpus/Chart/Pie.purs
View file @
368428a1
...
...
@@ -53,7 +53,7 @@ derive newtype instance JSON.WriteForeign HistoMetrics
type Loaded = HistoMetrics
chartOptionsBar :: Record MetricsProps -> HistoMetrics -> Options
chartOptionsBar { onClick, onInit } (HistoMetrics { dates: dates', count: count'}) = Options
chartOptionsBar { onClick, on
LegendChanged, on
Init } (HistoMetrics { dates: dates', count: count'}) = Options
{ mainTitle : "Bar"
, subTitle : "Count of MapTerm"
, xAxis : xAxis' $ map (\t -> joinWith " " $ map (take 3) $ A.take 3 $ filter (\s -> length s > 3) $ split (Pattern " ") t) dates'
...
...
@@ -62,11 +62,12 @@ chartOptionsBar { onClick, onInit } (HistoMetrics { dates: dates', count: count'
, addZoom : false
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
, onClick
, onLegendChanged
, onInit
}
chartOptionsPie :: Record MetricsProps -> HistoMetrics -> Options
chartOptionsPie { onClick, onInit } (HistoMetrics { dates: dates', count: count'}) = Options
chartOptionsPie { onClick, on
LegendChanged, on
Init } (HistoMetrics { dates: dates', count: count'}) = Options
{ mainTitle : "Pie"
, subTitle : "Distribution by MapTerm"
, xAxis : xAxis' []
...
...
@@ -76,6 +77,7 @@ chartOptionsPie { onClick, onInit } (HistoMetrics { dates: dates', count: count'
, addZoom : false
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
, onClick
, onLegendChanged
, onInit
}
...
...
@@ -101,7 +103,7 @@ pie = R2.leafComponent pieCpt
pieCpt :: R.Component Props
pieCpt = here.component "pie" cpt
where
cpt { boxes, path, session, onClick, onInit } _ = do
cpt { boxes, path, session, onClick, on
LegendChanged, on
Init } _ = do
reload <- T.useBox T2.newReload
pure $ metricsWithCacheLoadView
...
...
@@ -114,6 +116,7 @@ pieCpt = here.component "pie" cpt
, reload
, session
, onClick
, onLegendChanged
, onInit
}
...
...
@@ -131,7 +134,7 @@ bar props = R.createElement barCpt props []
barCpt :: R.Component Props
barCpt = here.component "bar" cpt
where
cpt { boxes, path, session, onClick, onInit} _ = do
cpt { boxes, path, session, onClick, on
LegendChanged, on
Init} _ = do
reload <- T.useBox T2.newReload
pure $ metricsWithCacheLoadView {
...
...
@@ -144,6 +147,7 @@ barCpt = here.component "bar" cpt
, reload
, session
, onClick
, onLegendChanged
, onInit
}
...
...
src/Gargantext/Components/Nodes/Corpus/Chart/Predefined.purs
View file @
368428a1
...
...
@@ -8,7 +8,7 @@ import Data.Ord.Generic (genericCompare)
import Data.Show.Generic (genericShow)
import Effect (Effect)
import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.Charts.Options.Type (EChartsInstance, MouseEvent)
import Gargantext.Components.Charts.Options.Type (EChartsInstance, MouseEvent
, LegendSelectChangedEvent
)
import Gargantext.Components.Nodes.Corpus.Chart.Histo (histo)
import Gargantext.Components.Nodes.Corpus.Chart.Metrics (metrics)
import Gargantext.Components.Nodes.Corpus.Chart.Pie (bar, pie)
...
...
@@ -55,51 +55,52 @@ allPredefinedCharts =
type Params =
( boxes :: Boxes
, corpusId :: NodeID
( boxes
:: Boxes
, corpusId
:: NodeID
-- optinal params
, limit :: Maybe Int
, listId :: Maybe Int
, onClick :: Maybe (MouseEvent -> Effect Unit)
, onInit :: Maybe (EChartsInstance -> Effect Unit)
, session :: Session
, limit :: Maybe Int
, listId :: Maybe Int
, onClick :: Maybe (MouseEvent -> Effect Unit)
, onLegendChanged :: Maybe (LegendSelectChangedEvent -> Effect Unit)
, onInit :: Maybe (EChartsInstance -> Effect Unit)
, session :: Session
)
render :: PredefinedChart -> Record Params -> R.Element
render CDocsHistogram { boxes, corpusId, listId, session, onClick, onInit } =
histo { boxes, path, session, onClick, onInit }
render CDocsHistogram { boxes, corpusId, listId, session, onClick, on
LegendChanged, on
Init } =
histo { boxes, path, session, onClick, on
LegendChanged, on
Init }
where
path = { corpusId
, listId: fromMaybe 0 listId
, limit: Nothing
, tabType: TabCorpus TabDocs
}
render CAuthorsPie { boxes, corpusId, listId, session, onClick, onInit } =
pie { boxes, path, session, onClick, onInit }
render CAuthorsPie { boxes, corpusId, listId, session, onClick, on
LegendChanged, on
Init } =
pie { boxes, path, session, onClick, on
LegendChanged, on
Init }
where
path = { corpusId
, listId: fromMaybe 0 listId
, limit: Nothing
, tabType: TabCorpus (TabNgramType $ modeTabType Authors)
}
render CInstitutesTree { boxes, corpusId, limit, listId, session, onClick, onInit } =
tree { boxes, path, session, onClick, onInit }
render CInstitutesTree { boxes, corpusId, limit, listId, session, onClick, on
LegendChanged, on
Init } =
tree { boxes, path, session, onClick, on
LegendChanged, on
Init }
where
path = { corpusId
, limit
, listId: fromMaybe 0 listId
, tabType: TabCorpus (TabNgramType $ modeTabType Institutes)
}
render CTermsMetrics { boxes, corpusId, limit, listId, session, onClick, onInit } =
metrics { boxes, path, session, onClick, onInit }
render CTermsMetrics { boxes, corpusId, limit, listId, session, onClick, on
LegendChanged, on
Init } =
metrics { boxes, path, session, onClick, on
LegendChanged, on
Init }
where
path = { corpusId
, limit
, listId: fromMaybe 0 listId
, tabType: TabCorpus (TabNgramType $ modeTabType Terms)
}
render CSourcesBar { boxes, corpusId, limit, listId, session, onClick, onInit } =
bar { boxes, path, session, onClick, onInit }
render CSourcesBar { boxes, corpusId, limit, listId, session, onClick, on
LegendChanged, on
Init } =
bar { boxes, path, session, onClick, on
LegendChanged, on
Init }
where
path = { corpusId
, limit
...
...
src/Gargantext/Components/Nodes/Corpus/Chart/Tree.purs
View file @
368428a1
module Gargantext.Components.Nodes.Corpus.Chart.Tree where
module Gargantext.Components.Nodes.Corpus.Chart.Tree
( Loaded
, Metrics(..)
, chartUrl
, getMetricsHash
, handleResponse
, here
, loaded
, mkRequest
, tree
, treeCpt
)
where
import Gargantext.Prelude
...
...
@@ -38,7 +50,7 @@ derive newtype instance JSON.WriteForeign Metrics
type Loaded = Array TreeNode
scatterOptions :: Record MetricsProps -> Array TreeNode -> Options
scatterOptions { onClick, onInit } nodes = Options
scatterOptions { onClick, on
LegendChanged, on
Init } nodes = Options
{ mainTitle : "Tree"
, subTitle : "Tree Sub Title"
, xAxis : xAxis' []
...
...
@@ -46,6 +58,7 @@ scatterOptions { onClick, onInit } nodes = Options
, series : [ mkTree TreeMap nodes]
, addZoom : false
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
, onLegendChanged
, onClick
, onInit
-- TODO improve the formatter:
...
...
@@ -75,7 +88,7 @@ tree props = R.createElement treeCpt props []
treeCpt :: R.Component Props
treeCpt = here.component "tree" cpt
where
cpt { boxes, path, session, onClick, onInit } _ = do
cpt { boxes, path, session, onClick, on
LegendChanged, on
Init } _ = do
reload <- T.useBox T2.newReload
pure $ metricsWithCacheLoadView
...
...
@@ -88,6 +101,7 @@ treeCpt = here.component "tree" cpt
, reload
, session
, onClick
, onLegendChanged
, onInit
}
...
...
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
View file @
368428a1
...
...
@@ -264,6 +264,7 @@ renderChartCpt = here.component "renderChart" cpt
, limit: Just 1000
, listId: Just defaultListId
, onClick: Nothing
, onLegendChanged: Nothing
, onInit: Nothing
, session
}
...
...
src/Gargantext/Components/Nodes/Lists/Tabs.purs
View file @
368428a1
...
...
@@ -226,10 +226,10 @@ ngramsViewCpt' = here.component "ngramsView_clone" cpt where
]
charts params' _ = [ chart params' mode ]
chart path Authors = pie { boxes, path, session, onClick: Nothing, onInit: Nothing }
chart path Institutes = tree { boxes, path, session, onClick: Nothing, onInit: Nothing }
chart path Sources = bar { boxes, path, session, onClick: Nothing, onInit: Nothing }
chart path Terms = metrics { boxes, path, session, onClick: Nothing, onInit: Nothing }
chart path Authors = pie { boxes, path, session, onClick: Nothing, on
LegendChanged: Nothing, on
Init: Nothing }
chart path Institutes = tree { boxes, path, session, onClick: Nothing, on
LegendChanged: Nothing, on
Init: Nothing }
chart path Sources = bar { boxes, path, session, onClick: Nothing, on
LegendChanged: Nothing, on
Init: Nothing }
chart path Terms = metrics { boxes, path, session, onClick: Nothing, on
LegendChanged: Nothing, on
Init: Nothing }
tabType = TabCorpus (TabNgramType tabNgramType)
...
...
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