Commit cc8a92c0 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DOC+FIX] User Doc (title) + warning (Types)

parent 4eac6682
...@@ -24,7 +24,6 @@ import Gargantext.Prelude (Unit, bind, const, discard, pure, show, unit, ($), (+ ...@@ -24,7 +24,6 @@ import Gargantext.Prelude (Unit, bind, const, discard, pure, show, unit, ($), (+
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, get, put, sessionId) import Gargantext.Sessions (Session, get, put, sessionId)
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2
display :: String -> Array R.Element -> R.Element display :: String -> Array R.Element -> R.Element
display title elems = display title elems =
......
...@@ -54,37 +54,44 @@ ngramsViewCpt = R.hooksComponent "G.C.N.L.T.ngramsView" cpt ...@@ -54,37 +54,44 @@ ngramsViewCpt = R.hooksComponent "G.C.N.L.T.ngramsView" cpt
chartType <- R.useState' Histo chartType <- R.useState' Histo
pure $ R.fragment pure $ R.fragment
( charts tabNgramType chartType $ charts tabNgramType chartType
<> [ <> [ NT.mainNgramsTable { session
NT.mainNgramsTable , defaultListId
{session, defaultListId, nodeId: corpusId, tabType, tabNgramType, withAutoUpdate: false} , nodeId: corpusId
] , tabType
) , tabNgramType
, withAutoUpdate: false
}
]
where where
tabNgramType = modeTabType mode tabNgramType = modeTabType mode
tabType = TabCorpus (TabNgramType tabNgramType) tabType = TabCorpus (TabNgramType tabNgramType)
listId = defaultListId listId = defaultListId
path = {corpusId, listId, tabType, limit: (Just 1000)} path = {corpusId, listId, tabType, limit: (Just 1000)}
charts CTabTerms (chartType /\ setChartType) = [ charts CTabTerms (chartType /\ setChartType) = [
H.div { className: "row chart-type-selector" } [ H.div { className: "row chart-type-selector" } [
H.div { className: "col-md-3" } [ H.div { className: "col-md-3" } [
R2.select { className: "form-control" R2.select { className: "form-control"
, on: { change: \e -> setChartType $ const $ fromMaybe Histo $ chartTypeFromString $ R2.unsafeEventValue e } , on: { change: \e -> setChartType
$ const
$ fromMaybe Histo
$ chartTypeFromString
$ R2.unsafeEventValue e
}
, defaultValue: show chartType } [ , defaultValue: show chartType } [
H.option { value: show Histo } [ H.text $ show Histo ] H.option { value: show Histo } [ H.text $ show Histo ]
, H.option { value: show Scatter } [ H.text $ show Scatter ] , H.option { value: show Scatter } [ H.text $ show Scatter ]
, H.option { value: show ChartBar } [ H.text $ show ChartBar ] , H.option { value: show ChartBar } [ H.text $ show ChartBar ]
, H.option { value: show ChartTree } [ H.text $ show ChartTree ] , H.option { value: show ChartTree } [ H.text $ show ChartTree ]
] ]
] ]
] ]
, getChartFunction chartType $ { session, path } , getChartFunction chartType $ { session, path }
] ]
charts _ _ = [ chart mode ] charts _ _ = [ chart mode ]
chart Authors = pie { session, path }
chart Authors = pie { session, path } chart Sources = bar { session, path }
chart Sources = bar { session, path } chart Institutes = tree { session, path }
chart Institutes = tree { session, path }
chart Terms = metrics { session, path } chart Terms = metrics { session, path }
...@@ -46,6 +46,7 @@ type KeyProps = ( ...@@ -46,6 +46,7 @@ type KeyProps = (
textsLayoutWithKey :: Record KeyProps -> R.Element textsLayoutWithKey :: Record KeyProps -> R.Element
textsLayoutWithKey props = R.createElement textsLayoutWithKeyCpt props [] textsLayoutWithKey props = R.createElement textsLayoutWithKeyCpt props []
textsLayoutWithKeyCpt :: R.Component KeyProps
textsLayoutWithKeyCpt = R.hooksComponent "G.C.N.T.textsLayoutWithKey" cpt textsLayoutWithKeyCpt = R.hooksComponent "G.C.N.T.textsLayoutWithKey" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session } _ = do
......
...@@ -21,7 +21,9 @@ tabsCpt = R.hooksComponent "G.C.Tab.tabs" cpt ...@@ -21,7 +21,9 @@ tabsCpt = R.hooksComponent "G.C.Tab.tabs" cpt
pure $ pure $
H.div {} H.div {}
[ H.nav {} [ H.nav {}
[ H.div { className: "nav nav-tabs" } [ H.div { className: "nav nav-tabs"
, title : "Tab for ngrams"
}
(mapWithIndex (button setActiveTab activeTab) props.tabs) ] (mapWithIndex (button setActiveTab activeTab) props.tabs) ]
, H.div { className: "tab-content" } $ mapWithIndex (item activeTab) props.tabs ] , H.div { className: "tab-content" } $ mapWithIndex (item activeTab) props.tabs ]
button setActiveTab selected index (name /\ _) = button setActiveTab selected index (name /\ _) =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment