Commit fd95f968 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Tabs] MoreLikeFav/MoreLikeTrash tabs working now

parent df8f7022
......@@ -52,14 +52,9 @@ statefulTabs :: Spec Tab.State Props Tab.Action
statefulTabs =
Tab.tabs identity identity $ fromFoldable
[ Tuple "Documents" $ docs
--, Tuple "Sources" $ ngramsViewSpec {mode: Sources }
--, Tuple "Authors" $ ngramsViewSpec {mode: Authors }
--, Tuple "Institutes" $ ngramsViewSpec {mode: Institutes}
--, Tuple "Terms" $ ngramsViewSpec {mode: Terms }
--, Tuple "" $ trash -- TODO empty here
, Tuple "Trash" $ trash
, Tuple "More like fav" $ docs -- TODO
, Tuple "More like trash" $ docs -- TODO
, Tuple "More like fav" $ moreLikeFav
, Tuple "More like trash" $ moreLikeTrash
]
where
-- TODO totalRecords
......@@ -76,6 +71,27 @@ statefulTabs =
, corpusId: Just corpusId}) $ noState DT.docViewSpec
)
)
moreLikeFav = noState (cmapProps (\{corpusId, corpusData: {defaultListId}} ->
{ nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : div [][]
, tabType: TabCorpus TabMoreLikeFav
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId}) $ noState DT.docViewSpec
)
moreLikeTrash = noState (cmapProps (\{corpusId, corpusData: {defaultListId}} ->
{ nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : div [][]
, tabType: TabCorpus TabMoreLikeTrash
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId}) $ noState DT.docViewSpec
)
trash = cmapProps (\{corpusId, corpusData: {defaultListId}} ->
{ nodeId: corpusId
, chart: div [][]
......@@ -83,42 +99,3 @@ statefulTabs =
, totalRecords: 4736
, listId: defaultListId
, corpusId: Nothing}) $ noState DT.docViewSpec
-- data Mode = Authors | Sources | Institutes | Terms
-- derive instance genericMode :: Generic Mode _
-- instance showMode :: Show Mode where
-- show = genericShow
-- derive instance eqMode :: Eq Mode
-- modeTabType :: Mode -> CTabNgramType
-- modeTabType Authors = CTabAuthors
-- modeTabType Sources = CTabSources
-- modeTabType Institutes = CTabInstitutes
-- modeTabType Terms = CTabTerms
-- ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
-- ngramsViewSpec {mode} =
-- noState $ chart mode <>
-- cmapProps (\{corpusData: {defaultListId}, corpusId: nodeId} ->
-- {defaultListId, nodeId, tabType})
-- (NT.mainNgramsTableSpec (modeTabType mode))
-- where
-- tabType = TabCorpus $ TabNgramType $ modeTabType mode
-- chart Authors = cmapProps (\{corpusId} -> {corpusId, tabType}) pieSpec
-- chart Sources = cmapProps (\{corpusId} -> {corpusId, tabType}) barSpec
-- chart Institutes = cmapProps (\{corpusData: {defaultListId}, corpusId} ->
-- {corpusId, listId: defaultListId, tabType, limit: (Just 1000)})
-- treeSpec
-- chart Terms = cmapProps (\{corpusData: {defaultListId}, corpusId} ->
-- {corpusId, listId: defaultListId, tabType, limit: (Just 1000)})
-- -- TODO limit should be select in the chart by default it is 1000
-- metricsSpec
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