Commit 6ae9aa55 authored by arturo's avatar arturo

>>> continue

parent b9434715
...@@ -7576,10 +7576,14 @@ input[type=range]:-moz-focusring { ...@@ -7576,10 +7576,14 @@ input[type=range]:-moz-focusring {
cursor: pointer; cursor: pointer;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
transition: all 0.2s ease-in-out;
} }
.graph-doc-list__item:focus { .graph-doc-list__item:focus {
outline: 0; outline: 0;
} }
.graph-doc-list__item:hover {
background-color: #121212;
}
.graph-doc-list__item__main { .graph-doc-list__item__main {
flex-grow: 1; flex-grow: 1;
padding-right: 1.25rem; padding-right: 1.25rem;
......
...@@ -7529,10 +7529,14 @@ input[type=range]:-moz-focusring { ...@@ -7529,10 +7529,14 @@ input[type=range]:-moz-focusring {
cursor: pointer; cursor: pointer;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
transition: all 0.2s ease-in-out;
} }
.graph-doc-list__item:focus { .graph-doc-list__item:focus {
outline: 0; outline: 0;
} }
.graph-doc-list__item:hover {
background-color: #FCFCFC;
}
.graph-doc-list__item__main { .graph-doc-list__item__main {
flex-grow: 1; flex-grow: 1;
padding-right: 1.25rem; padding-right: 1.25rem;
......
...@@ -7285,10 +7285,14 @@ input[type=range]:-moz-focusring { ...@@ -7285,10 +7285,14 @@ input[type=range]:-moz-focusring {
cursor: pointer; cursor: pointer;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
transition: all 0.2s ease-in-out;
} }
.graph-doc-list__item:focus { .graph-doc-list__item:focus {
outline: 0; outline: 0;
} }
.graph-doc-list__item:hover {
background-color: #FCFCFC;
}
.graph-doc-list__item__main { .graph-doc-list__item__main {
flex-grow: 1; flex-grow: 1;
padding-right: 1.25rem; padding-right: 1.25rem;
......
...@@ -7533,10 +7533,14 @@ input[type=range]:-moz-focusring { ...@@ -7533,10 +7533,14 @@ input[type=range]:-moz-focusring {
cursor: pointer; cursor: pointer;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
transition: all 0.2s ease-in-out;
} }
.graph-doc-list__item:focus { .graph-doc-list__item:focus {
outline: 0; outline: 0;
} }
.graph-doc-list__item:hover {
background-color: #FCFCFC;
}
.graph-doc-list__item__main { .graph-doc-list__item__main {
flex-grow: 1; flex-grow: 1;
padding-right: 1.25rem; padding-right: 1.25rem;
......
...@@ -7534,10 +7534,14 @@ input[type=range]:-moz-focusring { ...@@ -7534,10 +7534,14 @@ input[type=range]:-moz-focusring {
cursor: pointer; cursor: pointer;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
transition: all 0.2s ease-in-out;
} }
.graph-doc-list__item:focus { .graph-doc-list__item:focus {
outline: 0; outline: 0;
} }
.graph-doc-list__item:hover {
background-color: #FCFCFC;
}
.graph-doc-list__item__main { .graph-doc-list__item__main {
flex-grow: 1; flex-grow: 1;
padding-right: 1.25rem; padding-right: 1.25rem;
......
module Gargantext.Components.GraphExplorer.Frame.DocFocus module Gargantext.Components.GraphExplorer.Frame.DocFocus
where ( docFocus
{-} ) where
import Gargantext.Prelude import Gargantext.Prelude
import Data.Maybe (Maybe(..))
import Gargantext.Components.GraphExplorer.Types (GraphSideDoc(..))
import Gargantext.Components.Nodes.Corpus.Document (documentMainLayout)
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (ListId, NodeID)
import Gargantext.Utils.Reactix as R
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Frame.DocFocus" here = R2.here "Gargantext.Components.GraphExplorer.Frame.DocFocus"
type Props = type Props =
( listId :: ListId ( graphSideDoc :: GraphSideDoc
, corpusId :: NodeID
, nodeId :: NodeID
, session :: Session , session :: Session
) )
...@@ -24,4 +26,27 @@ docFocus = R2.leaf docFocusCpt ...@@ -24,4 +26,27 @@ docFocus = R2.leaf docFocusCpt
docFocusCpt :: R.Component Props docFocusCpt :: R.Component Props
docFocusCpt = here.component "main" cpt where docFocusCpt = here.component "main" cpt where
cpt props _ = pure $ H.div {} [] cpt { graphSideDoc: GraphSideDoc { docId, listId, corpusId }
, session
} _ = do
-- | Render
-- |
pure $
H.div
{ className: "graph-layout__focus" }
[
H.div
{ className: "graph-layout__focus__inner" }
[
documentMainLayout
{ listId
, mCorpusId: Just corpusId
, nodeId: docId
, session
}
[]
]
]
...@@ -14,11 +14,13 @@ import Data.Set as Set ...@@ -14,11 +14,13 @@ import Data.Set as Set
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Gargantext.Components.App.Data (Boxes) import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.Bootstrap as B import Gargantext.Components.Bootstrap as B
import Gargantext.Components.GraphExplorer.Frame.DocFocus (docFocus)
import Gargantext.Components.GraphExplorer.Resources as Graph import Gargantext.Components.GraphExplorer.Resources as Graph
import Gargantext.Components.GraphExplorer.Sidebar as GES import Gargantext.Components.GraphExplorer.Sidebar as GES
import Gargantext.Components.GraphExplorer.Store as GraphStore import Gargantext.Components.GraphExplorer.Store as GraphStore
import Gargantext.Components.GraphExplorer.Toolbar.Controls as Controls import Gargantext.Components.GraphExplorer.Toolbar.Controls as Controls
import Gargantext.Components.GraphExplorer.TopBar as GETB import Gargantext.Components.GraphExplorer.TopBar as GETB
import Gargantext.Components.GraphExplorer.Types (GraphSideDoc)
import Gargantext.Components.GraphExplorer.Types as GET import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Config (defaultFrontends) import Gargantext.Config (defaultFrontends)
import Gargantext.Data.Louvain as Louvain import Gargantext.Data.Louvain as Louvain
...@@ -124,17 +126,14 @@ layoutCpt = R.memo' $ here.component "explorerWriteGraph" cpt where ...@@ -124,17 +126,14 @@ layoutCpt = R.memo' $ here.component "explorerWriteGraph" cpt where
{ className: "graph-layout__frame" } { className: "graph-layout__frame" }
[ [
-- Doc focus -- Doc focus
R2.fromMaybe_ showDoc' \listId -> R2.fromMaybe_ showDoc' \(graphSideDoc :: GraphSideDoc) ->
docFocus
{ session
, graphSideDoc
}
H.div
{ className: "graph-layout__focus" }
[
H.div
{ className: "graph-layout__focus__inner" }
[
H.div {} [ H.text $ show listId ]
]
]
, ,
-- Sidebar -- Sidebar
H.div H.div
......
...@@ -12,14 +12,13 @@ import Effect (Effect) ...@@ -12,14 +12,13 @@ import Effect (Effect)
import Gargantext.Components.Bootstrap as B import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (Variant(..)) import Gargantext.Components.Bootstrap.Types (Variant(..))
import Gargantext.Components.FacetsTable (DocumentsView(..), PagePath, Rows(..), initialPagePath, loadPage, publicationDate) import Gargantext.Components.FacetsTable (DocumentsView(..), PagePath, Rows(..), initialPagePath, loadPage, publicationDate)
import Gargantext.Components.GraphExplorer.Types (GraphSideCorpus(..)) import Gargantext.Components.GraphExplorer.Types (GraphSideCorpus(..), GraphSideDoc(..), DocId)
import Gargantext.Components.Search (SearchQuery) import Gargantext.Components.Search (SearchQuery)
import Gargantext.Config.REST (RESTError(..)) import Gargantext.Config.REST (RESTError(..))
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoaderEffect) import Gargantext.Hooks.Loader (useLoaderEffect)
import Gargantext.Hooks.UpdateEffect (useUpdateEffect1') import Gargantext.Hooks.UpdateEffect (useUpdateEffect1')
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (ListId)
import Gargantext.Utils ((?)) import Gargantext.Utils ((?))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
...@@ -34,7 +33,7 @@ type TabsProps = ...@@ -34,7 +33,7 @@ type TabsProps =
, query :: SearchQuery , query :: SearchQuery
, session :: Session , session :: Session
, graphSideCorpus :: GraphSideCorpus , graphSideCorpus :: GraphSideCorpus
, showDoc :: T.Box (Maybe ListId) , showDoc :: T.Box (Maybe GraphSideDoc)
) )
docList :: R2.Leaf TabsProps docList :: R2.Leaf TabsProps
...@@ -104,15 +103,35 @@ docListCpt = here.component "main" cpt where ...@@ -104,15 +103,35 @@ docListCpt = here.component "main" cpt where
-- | -- |
let let
callback :: Maybe ListId -> ListId -> Effect Unit callback :: Maybe GraphSideDoc -> DocId -> Effect Unit
callback Nothing new = T.write_ (Just new) showDoc callback
callback (Just old) new Nothing
| old == new = T.write_ Nothing showDoc new
| otherwise = T.write_ (Just new) showDoc = setGraphSideDoc new # Just # flip T.write_ showDoc
callback
(Just (GraphSideDoc { docId }))
new
| docId == new = T.write_ Nothing showDoc
| otherwise = setGraphSideDoc new # Just # flip T.write_ showDoc
setGraphSideDoc :: DocId -> GraphSideDoc
setGraphSideDoc docId = GraphSideDoc
{ docId
, listId
, corpusId: nodeId
}
isSelected :: Maybe GraphSideDoc -> DocumentsView -> Boolean
isSelected
(Just (GraphSideDoc { docId }))
(DocumentsView { id })
= docId == id
isSelected :: Maybe ListId -> DocumentsView -> Boolean isSelected
isSelected Nothing _ = false _
isSelected (Just current) (DocumentsView { id }) = current == id _
= false
-- | Render -- | Render
-- | -- |
...@@ -158,7 +177,7 @@ type ItemProps = ...@@ -158,7 +177,7 @@ type ItemProps =
, frontends :: Frontends , frontends :: Frontends
, session :: Session , session :: Session
, path :: PagePath , path :: PagePath
, callback :: ListId -> Effect Unit , callback :: DocId -> Effect Unit
, isSelected :: Boolean , isSelected :: Boolean
) )
......
...@@ -35,7 +35,7 @@ import Gargantext.Data.Array (mapMaybe) ...@@ -35,7 +35,7 @@ import Gargantext.Data.Array (mapMaybe)
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Sigmax.Types as SigmaxT import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (CTabNgramType, FrontendError(..), NodeID, TabSubType(..), TabType(..), TermList(..), ListId, modeTabType) import Gargantext.Types (CTabNgramType, FrontendError(..), NodeID, TabSubType(..), TabType(..), TermList(..), modeTabType)
import Gargantext.Utils (nbsp) import Gargantext.Utils (nbsp)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Stores as Stores import Gargantext.Utils.Stores as Stores
...@@ -127,7 +127,6 @@ sideTabDataCpt = here.component "sideTabData" cpt where ...@@ -127,7 +127,6 @@ sideTabDataCpt = here.component "sideTabData" cpt where
cpt props _ = do cpt props _ = do
-- States -- States
{ selectedNodeIds { selectedNodeIds
, showDoc
, graph , graph
} <- Stores.useStore GraphStore.context } <- Stores.useStore GraphStore.context
...@@ -178,7 +177,6 @@ sideTabDataCpt = here.component "sideTabData" cpt where ...@@ -178,7 +177,6 @@ sideTabDataCpt = here.component "sideTabData" cpt where
, searchType: SearchDoc , searchType: SearchDoc
, selectedNodeIds: selectedNodeIds' , selectedNodeIds: selectedNodeIds'
, session: props.session , session: props.session
, showDoc
} }
] ]
] ]
...@@ -193,7 +191,6 @@ sideTabCommunityCpt = here.component "sideTabCommunity" cpt where ...@@ -193,7 +191,6 @@ sideTabCommunityCpt = here.component "sideTabCommunity" cpt where
cpt props@{ frontends } _ = do cpt props@{ frontends } _ = do
-- States -- States
{ selectedNodeIds { selectedNodeIds
, showDoc
, graph , graph
} <- Stores.useStore GraphStore.context } <- Stores.useStore GraphStore.context
...@@ -244,7 +241,6 @@ sideTabCommunityCpt = here.component "sideTabCommunity" cpt where ...@@ -244,7 +241,6 @@ sideTabCommunityCpt = here.component "sideTabCommunity" cpt where
, searchType: SearchContact , searchType: SearchContact
, selectedNodeIds: selectedNodeIds' , selectedNodeIds: selectedNodeIds'
, session: props.session , session: props.session
, showDoc
} }
] ]
] ]
...@@ -625,7 +621,6 @@ type DocListWrapper = ...@@ -625,7 +621,6 @@ type DocListWrapper =
, searchType :: SearchType , searchType :: SearchType
, selectedNodeIds :: SigmaxT.NodeIds , selectedNodeIds :: SigmaxT.NodeIds
, session :: Session , session :: Session
, showDoc :: T.Box (Maybe ListId)
) )
docListWrapper :: R2.Leaf DocListWrapper docListWrapper :: R2.Leaf DocListWrapper
...@@ -639,9 +634,11 @@ docListWrapperCpt = here.component "docListWrapper" cpt where ...@@ -639,9 +634,11 @@ docListWrapperCpt = here.component "docListWrapper" cpt where
, searchType , searchType
, selectedNodeIds , selectedNodeIds
, session , session
, showDoc
} _ = do } _ = do
-- States -- States
{ showDoc
} <- Stores.useStore GraphStore.context
query /\ queryBox <- R2.useBox' Nothing query /\ queryBox <- R2.useBox' Nothing
-- Helpers -- Helpers
......
...@@ -33,7 +33,7 @@ type Store = ...@@ -33,7 +33,7 @@ type Store =
, showControls :: T.Box Boolean , showControls :: T.Box Boolean
, sideTab :: T.Box GET.SideTab , sideTab :: T.Box GET.SideTab
, showSidebar :: T.Box GT.SidePanelState , showSidebar :: T.Box GT.SidePanelState
, showDoc :: T.Box (Maybe GT.ListId) , showDoc :: T.Box (Maybe GET.GraphSideDoc)
-- Controls -- Controls
, multiSelectEnabled :: T.Box Boolean , multiSelectEnabled :: T.Box Boolean
, edgeConfluence :: T.Box Range.NumberRange , edgeConfluence :: T.Box Range.NumberRange
...@@ -61,7 +61,7 @@ type State = ...@@ -61,7 +61,7 @@ type State =
, showControls :: Boolean , showControls :: Boolean
, sideTab :: GET.SideTab , sideTab :: GET.SideTab
, showSidebar :: GT.SidePanelState , showSidebar :: GT.SidePanelState
, showDoc :: Maybe GT.ListId , showDoc :: Maybe GET.GraphSideDoc
-- Controls -- Controls
, multiSelectEnabled :: Boolean , multiSelectEnabled :: Boolean
, edgeConfluence :: Range.NumberRange , edgeConfluence :: Range.NumberRange
...@@ -86,7 +86,7 @@ options :: ...@@ -86,7 +86,7 @@ options ::
, removedNodeIds :: SigmaxT.NodeIds , removedNodeIds :: SigmaxT.NodeIds
, selectedNodeIds :: SigmaxT.NodeIds , selectedNodeIds :: SigmaxT.NodeIds
, showControls :: Boolean , showControls :: Boolean
, showDoc :: Maybe GT.ListId , showDoc :: Maybe GET.GraphSideDoc
, showSidebar :: GT.SidePanelState , showSidebar :: GT.SidePanelState
, sideTab :: GET.SideTab , sideTab :: GET.SideTab
, edgeConfluence :: Range.NumberRange , edgeConfluence :: Range.NumberRange
......
...@@ -162,27 +162,6 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -162,27 +162,6 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
H.div H.div
{ className: "d-flex" } { className: "d-flex" }
[ [
-- View Settings
B.fieldset
{ className: "graph-toolbar__section"
, titleSlot: H.text "View settings"
}
[
-- change type button (?)
centerButton sigmaRef
,
gap
,
edgesToggleButton
{ state: showEdges
, stateAtlas: forceAtlasState
}
,
gap
,
louvainToggleButton { state: showLouvain }
]
,
-- Actions -- Actions
B.fieldset B.fieldset
{ className: "graph-toolbar__section" { className: "graph-toolbar__section"
...@@ -202,6 +181,26 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -202,6 +181,26 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
, reloadForest , reloadForest
} }
] ]
,
-- View Settings
B.fieldset
{ className: "graph-toolbar__section"
, titleSlot: H.text "View settings"
}
[
centerButton sigmaRef
,
gap
,
edgesToggleButton
{ state: showEdges
, stateAtlas: forceAtlasState
}
,
gap
,
louvainToggleButton { state: showLouvain }
]
] ]
, ,
-- Selection Settings -- Selection Settings
......
...@@ -98,6 +98,7 @@ type ListId = Int ...@@ -98,6 +98,7 @@ type ListId = Int
type Version = Int type Version = Int
type CorpusId = Int type CorpusId = Int
type CorpusLabel = String type CorpusLabel = String
type DocId = Int
newtype GraphSideCorpus = GraphSideCorpus newtype GraphSideCorpus = GraphSideCorpus
{ corpusId :: CorpusId { corpusId :: CorpusId
...@@ -107,6 +108,14 @@ newtype GraphSideCorpus = GraphSideCorpus ...@@ -107,6 +108,14 @@ newtype GraphSideCorpus = GraphSideCorpus
derive instance Generic GraphSideCorpus _ derive instance Generic GraphSideCorpus _
instance Eq GraphSideCorpus where eq = genericEq instance Eq GraphSideCorpus where eq = genericEq
newtype GraphSideDoc = GraphSideDoc
{ docId :: DocId
, corpusId :: CorpusId
, listId :: ListId
}
derive instance Generic GraphSideDoc _
instance Eq GraphSideDoc where eq = genericEq
newtype GraphData = GraphData newtype GraphData = GraphData
{ nodes :: Array Node { nodes :: Array Node
, edges :: Array Edge , edges :: Array Edge
......
...@@ -217,10 +217,13 @@ $layout-height: calc(100vh - #{ $topbar-height} ) ...@@ -217,10 +217,13 @@ $layout-height: calc(100vh - #{ $topbar-height} )
&__item &__item
@include clickable @include clickable
// @include ripple-effect($body-bg, $gray-100)
display: flex display: flex
align-items: flex-start align-items: flex-start
transition: $transition-base
&:hover
background-color: $gray-50
&__main &__main
flex-grow: 1 flex-grow: 1
......
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