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
e592afb1
Unverified
Commit
e592afb1
authored
Dec 13, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] Missing file
parent
b63bfd70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
Tabs.purs
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
+53
-0
No files found.
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
0 → 100644
View file @
e592afb1
module Gargantext.Pages.Corpus.Graph.Tabs where
import Prelude hiding (div)
import Data.Lens (view)
import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Gargantext.Config (TabType(..), TabSubType(..))
import Gargantext.Components.GraphExplorer.Types (GraphSideCorpus(..))
import Gargantext.Components.DocsTable as DT
import Gargantext.Components.Tab as Tab
import React (ReactElement, ReactClass, Children, createElement)
import Thermite ( Spec, PerformAction, Render, _performAction, _render
, hideState, noState, cmapProps, simpleSpec, createClass
)
type Props = { sides :: Array GraphSideCorpus }
tabsElt :: Props -> ReactElement
tabsElt props = createElement tabsClass props []
-- TODO no need for Children here
tabsClass :: ReactClass { sides :: Array GraphSideCorpus, children :: Children }
tabsClass = createClass "GraphTabs" pureTabs (const {})
pureTabs :: Spec {} Props Void
pureTabs = hideState (const {activeTab: 0}) statefulTabs
tab :: forall props state. GraphSideCorpus -> Tuple String (Spec state props Tab.Action)
tab (GraphSideCorpus {corpusId: nodeId, corpusLabel}) =
Tuple corpusLabel $
cmapProps (const {nodeId, chart, tabType: TabCorpus TabDocs, totalRecords: 4736}) $
noState DT.docViewSpec
where
-- TODO totalRecords: probably need to insert a corpusLoader.
chart = mempty
statefulTabs :: Spec Tab.State Props Tab.Action
statefulTabs =
withProps (\{sides} -> Tab.tabs identity identity $ fromFoldable $ tab <$> sides)
-- TODO move to Thermite
-- | This function captures the props of the `Spec` as a function argument.
withProps
:: forall state props action
. (props -> Spec state props action)
-> Spec state props action
withProps f = simpleSpec performAction render
where
performAction :: PerformAction state props action
performAction a p st = view _performAction (f p) a p st
render :: Render state props action
render k p st = view _render (f p) k p st
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