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
143
Issues
143
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
1105cefb
Commit
1105cefb
authored
Sep 29, 2019
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-refactor to enable backend chooser
parent
80557556
Changes
57
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
1544 additions
and
1618 deletions
+1544
-1618
AnnotatedField.purs
src/Gargantext/Components/Annotation/AnnotatedField.purs
+4
-4
Menu.purs
src/Gargantext/Components/Annotation/Menu.purs
+6
-6
App.purs
src/Gargantext/Components/App.purs
+70
-144
Series.purs
src/Gargantext/Components/Charts/Options/Series.purs
+4
-5
ContextMenu.purs
src/Gargantext/Components/ContextMenu/ContextMenu.purs
+1
-1
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+32
-32
EndsChooser.purs
src/Gargantext/Components/EndsChooser.purs
+0
-83
EndsSummary.purs
src/Gargantext/Components/EndsSummary.purs
+0
-13
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+40
-40
Forest.purs
src/Gargantext/Components/Forest.purs
+38
-0
Forms.purs
src/Gargantext/Components/Forms.purs
+22
-0
Graph.purs
src/Gargantext/Components/Graph.purs
+3
-4
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+18
-21
Button.purs
src/Gargantext/Components/GraphExplorer/Button.purs
+2
-7
Controls.purs
src/Gargantext/Components/GraphExplorer/Controls.purs
+1
-2
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+30
-64
ToggleButton.purs
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
+0
-3
Login.purs
src/Gargantext/Components/Login.purs
+162
-169
Modal.purs
src/Gargantext/Components/Modal.purs
+4
-10
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+21
-21
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+29
-27
RangeSlider.purs
src/Gargantext/Components/RangeSlider.purs
+3
-8
SearchBar.purs
src/Gargantext/Components/Search/SearchBar.purs
+29
-32
SearchField.purs
src/Gargantext/Components/Search/SearchField.purs
+3
-5
Types.purs
src/Gargantext/Components/Search/Types.purs
+15
-15
Table.purs
src/Gargantext/Components/Table.purs
+2
-7
Tree.purs
src/Gargantext/Components/Tree.purs
+66
-64
Config.purs
src/Gargantext/Config.purs
+22
-438
Ends.purs
src/Gargantext/Ends.purs
+167
-0
Global.purs
src/Gargantext/Global.purs
+0
-16
Loader.purs
src/Gargantext/Hooks/Loader.purs
+1
-3
Router.purs
src/Gargantext/Hooks/Router.purs
+16
-0
Sigmax.purs
src/Gargantext/Hooks/Sigmax.purs
+7
-11
Sigmajs.purs
src/Gargantext/Hooks/Sigmax/Sigmajs.purs
+1
-3
Annuaire.purs
src/Gargantext/Pages/Annuaire.purs
+27
-25
Contacts.purs
src/Gargantext/Pages/Annuaire/User/Contacts.purs
+16
-21
Tabs.purs
src/Gargantext/Pages/Annuaire/User/Contacts/Tabs.purs
+11
-11
Corpus.purs
src/Gargantext/Pages/Corpus.purs
+2
-4
Histo.purs
src/Gargantext/Pages/Corpus/Chart/Histo.purs
+22
-23
Metrics.purs
src/Gargantext/Pages/Corpus/Chart/Metrics.purs
+25
-26
Pie.purs
src/Gargantext/Pages/Corpus/Chart/Pie.purs
+24
-24
Tree.purs
src/Gargantext/Pages/Corpus/Chart/Tree.purs
+18
-19
Dashboard.purs
src/Gargantext/Pages/Corpus/Dashboard.purs
+6
-7
Document.purs
src/Gargantext/Pages/Corpus/Document.purs
+27
-23
Tabs.purs
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
+8
-9
Home.purs
src/Gargantext/Pages/Home.purs
+14
-21
Lists.purs
src/Gargantext/Pages/Lists.purs
+13
-11
Tabs.purs
src/Gargantext/Pages/Lists/Tabs.purs
+16
-16
Texts.purs
src/Gargantext/Pages/Texts.purs
+13
-11
Tabs.purs
src/Gargantext/Pages/Texts/Tabs.purs
+24
-33
Router.purs
src/Gargantext/Router.purs
+4
-52
Routes.purs
src/Gargantext/Routes.purs
+62
-0
Sessions.purs
src/Gargantext/Sessions.purs
+112
-0
Types.purs
src/Gargantext/Types.purs
+240
-3
Utils.purs
src/Gargantext/Utils.purs
+4
-0
Reactix.purs
src/Gargantext/Utils/Reactix.purs
+29
-14
Main.purs
src/Main.purs
+8
-7
No files found.
src/Gargantext/Components/Annotation/AnnotatedField.purs
View file @
1105cefb
...
...
@@ -22,10 +22,9 @@ import Reactix as R
import Reactix.DOM.HTML as HTML
import Reactix.SyntheticEvent as E
import Gargantext.Config (CTabNgramType(..))
import Gargantext.Types ( TermList )
import Gargantext.Types (CTabNgramType(..), TermList)
import Gargantext.Components.Annotation.Utils ( termBootstrapClass )
import Gargantext.Components.NgramsTable.Core (
NgramsTerm, NgramsTable(..), highlightNgrams, findNgramTermList
)
import Gargantext.Components.NgramsTable.Core (
NgramsTable, NgramsTerm, findNgramTermList, highlightNgrams
)
import Gargantext.Components.Annotation.Menu ( AnnotationMenu, annotationMenu, MenuType(..) )
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Selection as Sel
...
...
@@ -69,6 +68,7 @@ annotatedFieldComponent = R.hooksComponent "AnnotatedField" cpt
pure $ HTML.div wrapperProps [maybeAddMenu setMenu runs menu]
-- forall e. IsMouseEvent e => R2.Setter (Maybe AnnotationMenu) -> R2.Setter ? -> ? -> e -> Effect Unit
maybeShowMenu setMenu setTermList ngrams event = do
s <- Sel.getSelection
case s of
...
...
@@ -118,6 +118,6 @@ annotatedRunComponent = R.staticComponent "AnnotatedRun" cpt
HTML.span { className: className list
, onClick: mkEffectFn1 $ \e -> onSelect text (Just list) e} [ HTML.text text ]
where
className
list = "annotation-run bg-" <> termBootstrapClass list
className
list' = "annotation-run bg-" <> termBootstrapClass list'
src/Gargantext/Components/Annotation/Menu.purs
View file @
1105cefb
...
...
@@ -2,16 +2,16 @@
module Gargantext.Components.Annotation.Menu where
import Prelude (
Unit, (==), ($), (<>), unit, pure, otherwise, const
)
import Prelude (
Unit, pure, ($), (<>), (==)
)
import Data.Array as A
import Data.Maybe (
Maybe(..), maybe'
)
import Effect (
Effect
)
import Effect.Uncurried (
mkEffectFn1
)
import Data.Maybe (
Maybe(..)
)
import Effect (
Effect
)
import Effect.Uncurried (
mkEffectFn1
)
import Reactix as R
import Reactix.DOM.HTML as HTML
import Gargantext.Types (
TermList(..), termListName
)
import Gargantext.Components.Annotation.Utils (
termBootstrapClass
)
import Gargantext.Types (
TermList(..), termListName
)
import Gargantext.Components.Annotation.Utils (
termBootstrapClass
)
import Gargantext.Components.ContextMenu.ContextMenu as CM
import Gargantext.Utils.Reactix as R2
...
...
src/Gargantext/Components/
Layout
.purs
→
src/Gargantext/Components/
App
.purs
View file @
1105cefb
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Charts/Options/Series.purs
View file @
1105cefb
module Gargantext.Components.Charts.Options.Series where
import Data.Maybe
import Prelude (class Show, bind, map, pure, show, ($), (+), (<<<), (<>))
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Array (foldl)
import Data.Maybe (Maybe(..), maybe)
import Record.Unsafe (unsafeSet)
import Unsafe.Coerce (unsafeCoerce)
import Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Gargantext.Types (class Optional)
import Gargantext.Components.Charts.Options.Font (ItemStyle, Tooltip)
import Gargantext.Components.Charts.Options.Data (DataD1, DataD2)
...
...
@@ -181,7 +180,7 @@ toJsTree maybeSurname (TreeNode x) =
, children : (map (toJsTree (Just name)) x.children)
}
where
name = maybe "" (\x
-> x
<> ">") maybeSurname <> x.name
name = maybe "" (\x
' -> x'
<> ">") maybeSurname <> x.name
data TreeNode = TreeNode { name :: String
, value :: Int
...
...
src/Gargantext/Components/ContextMenu/ContextMenu.purs
View file @
1105cefb
...
...
@@ -15,7 +15,7 @@ import DOM.Simple.Window ( window )
import DOM.Simple.Document ( document )
import DOM.Simple.Types ( DOMRect )
import Effect (Effect)
import FFI.Simple (
(...), (..), delay
)
import FFI.Simple (
(..)
)
import Reactix as R
import Reactix.DOM.HTML as HTML
...
...
src/Gargantext/Components/DocsTable.purs
View file @
1105cefb
-- TODO: this module should be replaced by FacetsTable
module Gargantext.Components.DocsTable where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Prelude
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Array (drop, take)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
...
...
@@ -15,24 +16,24 @@ import Data.Set as Set
import Data.Symbol (SProxy(..))
import Data.Tuple (Tuple(..), fst)
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log)
import DOM.Simple.Event as DE
import Effect (Effect)
import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect)
import Effect.Uncurried (EffectFn1, mkEffectFn1)
import Reactix as R
import Reactix.DOM.HTML as H
------------------------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Config (Ends, NodeType(..), OrderBy(..), BackendRoute(..), TabType, TabPostQuery(..), url)
import Gargantext.Config.REST (get, put, post, deleteWithBody, delete)
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Config.REST (post, delete)
import Gargantext.Components.Search.Types (Category(..), CategoryQuery(..), favCategory, trashCategory, decodeCategory, putCategories)
import Gargantext.Components.Table as T
import Gargantext.Ends (url)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Utils.DecodeMaybe ((.|))
import Gargantext.Utils.Reactix as R2
import Gargantext.Router as Router
import Gargantext.Routes as Routes
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session)
import Gargantext.Types (NodeType(..), OrderBy(..), TabType, TabPostQuery(..))
------------------------------------------------------------------------
type NodeID = Int
...
...
@@ -46,7 +47,7 @@ type Props =
, listId :: Int
, corpusId :: Maybe Int
, showSearch :: Boolean
,
ends :: Ends
)
,
session :: Session
)
-- ^ tabType is not ideal here since it is too much entangled with tabs and
-- ngramtable. Let's see how this evolves. )
...
...
@@ -57,7 +58,7 @@ type PageLoaderProps =
, listId :: Int
, corpusId :: Maybe Int
, query :: Query
,
ends :: Ends
)
,
session :: Session
)
type LocalCategories = Map Int Category
type Query = String
...
...
@@ -136,23 +137,22 @@ layoutDocview :: R.State Query -> R.State T.Params -> Record Props -> R.Element
layoutDocview query tableParams@(params /\ _) p = R.createElement el p []
where
el = R.hooksComponent "LayoutDocView" cpt
cpt {
ends
, nodeId, tabType, listId, corpusId, totalRecords, chart, showSearch} _children = do
cpt {
session
, nodeId, tabType, listId, corpusId, totalRecords, chart, showSearch} _children = do
pure $ H.div {className: "container1"}
[ H.div {className: "row"}
[ chart
, if showSearch then searchBar query else H.div {} []
, H.div {className: "col-md-12"}
[ pageLoader tableParams {
ends
, nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ] ] ]
onClickTrashAll nodeId = mkEffectFn1 $ \_ ->
do
launchAff $ deleteAllDocuments p.ends
nodeId
[ pageLoader tableParams {
session
, nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ] ] ]
-- onClickTrashAll nodeId _ =
do
-- launchAff $ deleteAllDocuments p.session
nodeId
{-, H.div {className: "col-md-1 col-md-offset-11"}
[ pageLoader p.
ends
tableParams {nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ]
[ pageLoader p.
session
tableParams {nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ]
, H.div {className: "col-md-1 col-md-offset-11"}
[ H.button { className: "btn"
, style: {backgroundColor: "peru", color : "white", border : "white"}
, onClick: onClickTrashAll nodeId
}
, on: { click: onClickTrashAll nodeId } }
[ H.i {className: "glyphitem glyphicon glyphicon-trash"} []
, H.text "Trash all"
]
...
...
@@ -211,11 +211,11 @@ type PageParams = { nodeId :: Int
, query :: Query
, params :: T.Params}
loadPage ::
Ends
-> PageParams -> Aff (Array DocumentsView)
loadPage
ends
{nodeId, tabType, query, listId, corpusId, params: {limit, offset, orderBy}} = do
l
ogs
"loading documents page: loadPage with Offset and limit"
loadPage ::
Session
-> PageParams -> Aff (Array DocumentsView)
loadPage
session
{nodeId, tabType, query, listId, corpusId, params: {limit, offset, orderBy}} = do
l
iftEffect $ log
"loading documents page: loadPage with Offset and limit"
-- res <- get $ toUrl endConfigStateful Back (Tab tabType offset limit (convOrderBy <$> orderBy)) (Just nodeId)
let url2 = (url
ends
(NodeAPI Node (Just nodeId))) <> "/table"
let url2 = (url
session
(NodeAPI Node (Just nodeId))) <> "/table"
res <- post url2 $ TabPostQuery {
offset
, limit
...
...
@@ -256,10 +256,10 @@ renderPage (_ /\ setTableParams) p res = R.createElement el p []
gi _ = "glyphicon glyphicon-star-empty"
trashStyle Trash = {textDecoration: "line-through"}
trashStyle _ = {textDecoration: "none"}
corpusDocument (Just corpusId) = Route
r
.CorpusDocument corpusId
corpusDocument _ = Route
r
.Document
corpusDocument (Just corpusId) = Route
s
.CorpusDocument corpusId
corpusDocument _ = Route
s
.Document
cpt {
ends
, nodeId, corpusId, listId, totalRecords} _children = do
cpt {
session
, nodeId, corpusId, listId, totalRecords} _children = do
localCategories <- R.useState' (mempty :: LocalCategories)
pure $ T.table
{ rows: rows localCategories
...
...
@@ -292,15 +292,15 @@ renderPage (_ /\ setTableParams) p res = R.createElement el p []
onClick (_ /\ setLocalCategories) catType nid cat = \_-> do
let newCat = if (catType == Favorite) then (favCategory cat) else (trashCategory cat)
setLocalCategories $ insert nid newCat
void $ launchAff $ putCategories
ends
nodeId $ CategoryQuery {nodeIds: [nid], category: newCat}
void $ launchAff $ putCategories
session
nodeId $ CategoryQuery {nodeIds: [nid], category: newCat}
pageLoader :: R.State T.Params -> Record PageLoaderProps -> R.Element
pageLoader tableParams@(pageParams /\ _) p = R.createElement el p []
where
el = R.hooksComponent "PageLoader" cpt
cpt p
@{ends
, nodeId, listId, corpusId, tabType, query} _children = do
useLoader {nodeId, listId, corpusId, tabType, query, params: pageParams} (loadPage
ends
) $
\loaded -> renderPage tableParams p loaded
cpt p
rops@{session
, nodeId, listId, corpusId, tabType, query} _children = do
useLoader {nodeId, listId, corpusId, tabType, query, params: pageParams} (loadPage
session
) $
\loaded -> renderPage tableParams p
rops
loaded
---------------------------------------------------------
sampleData' :: DocumentsView
...
...
@@ -344,11 +344,11 @@ searchResults :: SearchQuery -> Aff Int
searchResults squery = post "http://localhost:8008/count" unit
-- TODO
documentsUrl ::
Ends
-> Int -> String
documentsUrl
ends nodeId = url ends
(NodeAPI Node (Just nodeId)) <> "/documents"
documentsUrl ::
Session
-> Int -> String
documentsUrl
session nodeId = url session
(NodeAPI Node (Just nodeId)) <> "/documents"
deleteAllDocuments ::
Ends
-> Int -> Aff (Array Int)
deleteAllDocuments
ends = delete <<< documentsUrl ends
deleteAllDocuments ::
Session
-> Int -> Aff (Array Int)
deleteAllDocuments
session = delete <<< documentsUrl session
-- TODO: not optimal but Data.Set lacks some function (Set.alter)
toggleSet :: forall a. Ord a => a -> Set a -> Set a
...
...
src/Gargantext/Components/EndsChooser.purs
deleted
100644 → 0
View file @
80557556
-- |
module Gargantext.Components.EndsChooser
-- (
-- )
where
import Prelude (($), pure)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Config (Backend, Ends, defaultEnds, defaultEnds')
import Gargantext.Utils.Reactix as R2
type Props = ( ends :: R.State Ends )
useEnds :: R.Hooks (R.State Ends)
useEnds = R.useState' defaultEnds
endsChooser :: Record Props -> R.Element
endsChooser props = R.createElement endsChooserCpt props []
endsChooserCpt :: R.Component Props
endsChooserCpt = R.hooksComponent "G.C.EndsChooser.endsChooser" cpt
where
cpt {ends} _ = do
pure $ R.fragment []
-- el = R.hooksComponent "EndConfigChooserCpt" cpt
-- cpt {state} _children = do
-- R.useEffect $ pure $
-- if (configState /= state) then do
-- _ <- log2 "update state: " configState
-- _ <- d $ ConfigStateA $ C.UpdateState configState
-- _ <- log2 "logout" ""
-- d $ Logout
-- else
-- pure $ unit
-- pure $ H.span {}
-- [ endConfigChooser (configState /\ setConfigState)
-- , H.span {className: "text-info"}
-- [ H.text $ C.endConfigDisplayName configState.endConfig ]
-- , H.span {className: "text-danger"}
-- [ H.text $ C.endConfigDisplayName state.endConfig ]
-- ]
-- endConfigChooser :: R.State Ends -> R.Element
-- endConfigChooser (configState /\ setConfigState) = R.createElement el {} []
-- where
-- el = R.hooksComponent "EndConfigChooser" cpt
-- cpt {} _ = do
-- -- NOTE Need to rebind the component after rerender
-- R.useEffect do
-- _ <- pure $ createDropdown "end-config-chooser"
-- pure $ pure unit
-- pure $ H.li {className: "dropdown"}
-- [ H.a { className: "navbar-text dropdown-toggle"
-- , href: "#"
-- , role: "button"
-- , data: {toggle: "dropdown"}
-- , id: "end-config-chooser"
-- }
-- [ H.text $ C.endConfigDisplayName configState.endConfig ]
-- , H.ul { className: "dropdown-menu"
-- } (liItem <$> C.endConfigOptions)
-- ]
-- liItem :: C.EndConfigOption -> R.Element
-- liItem {endConfig, displayName} =
-- H.li {on: {click: onClick endConfig}}
-- [ H.a {href: "#"} [H.text displayName] ]
-- onClick endConfig = \_ -> do
-- log2 "set end config" endConfig
-- setConfigState $ \st -> st {endConfig = endConfig}
-- type BackendProps = ( ends :: R.State Ends, backend :: Backend )
-- backendCpt :: R.Component BackendProps
-- backendCpt = R.hooksComponent "G.C.EndsChooser.backend" cpt
-- where
-- cpt {ends, backend} _ = do
src/Gargantext/Components/EndsSummary.purs
deleted
100644 → 0
View file @
80557556
module Gargantext.Components.EndsSummary
-- (
-- )
where
import Reactix as R
import Reactix.DOM.HTML as H
import Data.Semigroup ((<>))
import Gargantext.Config (Ends)
endsSummary :: Ends -> R.Element
endsSummary ends = H.div {className: "text-info"} [ H.text text ]
where text = "Connected to " <> ends.backend.name
src/Gargantext/Components/FacetsTable.purs
View file @
1105cefb
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest.purs
0 → 100644
View file @
1105cefb
module Gargantext.Components.Forest where
import Prelude (const, show)
import Data.Maybe (Maybe(..))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Ends (Frontends)
import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..), Sessions, unSessions)
import Gargantext.Components.Tree (treeView)
import Gargantext.Utils.Reactix as R2
type Props =
( sessions :: Sessions
, route :: AppRoute
, frontends :: Frontends
, showLogin :: R2.Setter Boolean )
forest :: Record Props -> R.Element
forest props = R.createElement forestCpt props []
forestCpt :: R.Component Props
forestCpt = R.staticComponent "G.C.Forest.forest" cpt where
cpt {sessions, route, frontends, showLogin} _ =
R.fragment [ plus showLogin, trees ]
where
trees =
case unSessions sessions of
Nothing -> R.fragment []
Just s@(Session {treeId}) ->
R.fragment
[ H.text (show s)
, treeView { root: treeId, mCurrentRoute: Just route, session: s } ]
plus :: R2.Setter Boolean -> R.Element
plus showLogin =
H.button {on: {click: \_ -> showLogin (const true)}}
[ H.text "+" ]
src/Gargantext/Components/Forms.purs
0 → 100644
View file @
1105cefb
module Gargantext.Components.Forms where
import Reactix as R
import Reactix.DOM.HTML as H
clearfix :: _ -> R.Element
clearfix _ = H.div {className: "clearfix"} []
formGroup :: Array R.Element -> R.Element
formGroup = H.div {className: "form-group"}
center :: Array R.Element -> R.Element
center = H.div {className: "center"}
card :: Array R.Element -> R.Element
card = H.div {className: "card"}
cardBlock :: Array R.Element -> R.Element
cardBlock = H.div {className: "card-block"}
cardGroup :: Array R.Element -> R.Element
cardGroup = H.div {className: "card-group"}
src/Gargantext/Components/Graph.purs
View file @
1105cefb
...
...
@@ -4,10 +4,9 @@ module Gargantext.Components.Graph
-- , forceAtlas2Settings, ForceAtlas2Settings, ForceAtlas2OptionalSettings
-- )
where
import Prelude
import Data.Maybe (Maybe(..))
import Data.Nullable (Nullable, null)
import DOM.Simple.Console (log2)
import Prelude (bind, discard, pure, ($))
import Data.Maybe (Maybe)
import Data.Nullable (null)
import Reactix as R
import Reactix.DOM.HTML as RH
import Gargantext.Hooks.Sigmax
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
1105cefb
...
...
@@ -5,19 +5,16 @@ import Gargantext.Prelude hiding (max,min)
import Data.FoldableWithIndex (foldMapWithIndex)
import Data.Foldable (foldMap)
import Data.Int (toNumber)
import Data.Maybe (Maybe(..)
, fromJust, fromMaybe
)
import Data.Maybe (Maybe(..))
import Data.Sequence as Seq
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (Aff)
import Thermite (Render, Spec, simpleSpec)
import Reactix as R
import Reactix.DOM.HTML as RH
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma (Sigma)
import Gargantext.Hooks.Sigmax (Sigma)
import Gargantext.Hooks.Sigmax.Types as Sigmax
import Gargantext.Components.GraphExplorer.Controls as Controls
import Gargantext.Components.GraphExplorer.Sidebar as Sidebar
...
...
@@ -25,19 +22,19 @@ import Gargantext.Components.GraphExplorer.ToggleButton as Toggle
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.Graph as Graph
import Gargantext.Components.Tree as Tree
import Gargantext.Config (Ends, url)
import Gargantext.Config as Config
import Gargantext.Config.REST (get)
import Gargantext.Router (Routes(..))
import Gargantext.Utils.Reactix as R2
import Gargantext.Ends (url)
import Gargantext.Routes (SessionRoute(NodeAPI), AppRoute)
import Gargantext.Sessions (Session)
import Gargantext.Types (NodeType(Graph))
type GraphId = Int
type LayoutProps =
( graphId :: GraphId
, mCurrentRoute :: Maybe
Routes
, mCurrentRoute :: Maybe
AppRoute
, treeId :: Maybe Int
,
ends :: Ends
)
,
session :: Session
)
type Props = ( graph :: Maybe Graph.Graph | LayoutProps )
...
...
@@ -48,10 +45,10 @@ explorerLayout props = R.createElement explorerLayoutCpt props []
explorerLayoutCpt :: R.Component LayoutProps
explorerLayoutCpt = R.hooksComponent "G.C.GraphExplorer.explorerLayout" cpt
where
cpt {graphId, mCurrentRoute, treeId,
ends
} _ =
useLoader graphId (getNodes
ends
) handler
cpt {graphId, mCurrentRoute, treeId,
session
} _ =
useLoader graphId (getNodes
session
) handler
where
handler loaded = explorer {graphId, mCurrentRoute, treeId,
ends
, graph}
handler loaded = explorer {graphId, mCurrentRoute, treeId,
session
, graph}
where graph = Just (convert loaded)
explorer :: Record Props -> R.Element
...
...
@@ -60,7 +57,7 @@ explorer props = R.createElement explorerCpt props []
explorerCpt :: R.Component Props
explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
where
cpt {
ends
, graphId, mCurrentRoute, treeId, graph} _ = do
cpt {
session
, graphId, mCurrentRoute, treeId, graph} _ = do
controls <- Controls.useGraphControls
state <- useExplorerState
pure $
...
...
@@ -88,9 +85,9 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
where
tree {treeId: Nothing} _ = RH.div { id: "tree" } []
tree _ {showTree: false /\ _} = RH.div { id: "tree" } []
tree {mCurrentRoute
, treeId: Just treeId
} _ =
tree {mCurrentRoute
: m, treeId: Just root
} _ =
RH.div { id: "tree", className: "col-md-2" }
[ Tree.treeView {mCurrentRoute
, root: treeId, ends: ends
} ]
[ Tree.treeView {mCurrentRoute
: m, root, session: session
} ]
outer = RH.div { className: "col-md-12" }
inner = RH.div { className: "container-fluid", style: { paddingTop: "90px" } }
row1 = RH.div { className: "row", style: { paddingBottom: "10px", marginTop: "-24px" } }
...
...
@@ -100,7 +97,7 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
pullRight = RH.div { className: "pull-right" }
mGraph :: R.Ref (Maybe Sigma
x.Sigma
) -> {graphId :: GraphId, graph :: Maybe Graph.Graph} -> R.Element
mGraph :: R.Ref (Maybe Sigma) -> {graphId :: GraphId, graph :: Maybe Graph.Graph} -> R.Element
mGraph _ {graph: Nothing} = RH.div {} []
mGraph sigmaRef {graphId, graph: Just graph} = graphView sigmaRef {graphId, graph}
...
...
@@ -127,7 +124,7 @@ type GraphProps = (
, graph :: Graph.Graph
)
graphView :: R.Ref (Maybe Sigma
x.Sigma
) -> Record GraphProps -> R.Element
graphView :: R.Ref (Maybe Sigma) -> Record GraphProps -> R.Element
--graphView sigmaRef props = R.createElement (R.memo el memoCmp) props []
graphView sigmaRef props = R.createElement el props []
where
...
...
@@ -288,5 +285,5 @@ defaultPalette = ["#5fa571","#ab9ba2","#da876d","#bdd3ff","#b399df","#ffdfed","#
-- ]
getNodes ::
Ends
-> GraphId -> Aff GET.GraphData
getNodes
ends graphId = get $ url ends $ Config.NodeAPI Config.
Graph (Just graphId)
getNodes ::
Session
-> GraphId -> Aff GET.GraphData
getNodes
session graphId = get $ url session $ NodeAPI
Graph (Just graphId)
src/Gargantext/Components/GraphExplorer/Button.purs
View file @
1105cefb
module Gargantext.Components.GraphExplorer.Button
(
centerButton
( centerButton
, Props
, simpleButton
) where
import Global (readFloat)
import Prelude
import Data.Maybe (Maybe(..))
import Data.Tuple (snd)
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log, log2)
import DOM.Simple.Console (log2)
import Effect (Effect)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Utils.Reactix as R2
type Props = (
onClick :: forall e. e -> Effect Unit
...
...
src/Gargantext/Components/GraphExplorer/Controls.purs
View file @
1105cefb
...
...
@@ -11,8 +11,7 @@ module Gargantext.Components.GraphExplorer.Controls
, getMultiNodeSelect, setMultiNodeSelect
) where
import Data.Maybe (Maybe(..))
import DOM.Simple as DOM
import Data.Maybe (Maybe)
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Prelude
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
1105cefb
module Gargantext.Components.GraphExplorer.Sidebar
where
(Props, sidebar)
where
import Data.Tuple.Nested ((/\))
import Prelude
import Reactix as R
import Reactix.DOM.HTML as RH
import Gargantext.Components.GraphExplorer.Controls as Controls
import Gargantext.Utils.Reactix as R2
type Props = (
showSidePanel :: Boolean
)
type Props = ( showSidePanel :: Boolean )
sidebar :: Record Props -> R.Element
sidebar props = R.createElement sidebarCpt props []
...
...
@@ -24,72 +18,44 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
pure $ RH.div {} []
cpt props _children = do
pure $
RH.div { id: "sp-container"
, className: "col-md-2" }
[
RH.div {}
[
RH.div { className: "row" }
[
RH.div { className: "col-md-12" }
[
RH.ul { id: "myTab"
, className: "nav nav-tabs"
, role: "tablist"}
[
RH.li { className: "nav-item" }
[
RH.a { id: "home-tab"
RH.div { id: "sp-container", className: "col-md-2" }
[ RH.div {}
[ RH.div { className: "row" }
[ RH.div { className: "col-md-12" }
[ RH.ul { id: "myTab", className: "nav nav-tabs", role: "tablist"}
[ RH.li { className: "nav-item" }
[ RH.a { id: "home-tab"
, className: "nav-link active"
, data: {toggle: "tab"}
, href: "#home"
, role: "tab"
, aria: {controls: "home", selected: "true"}}
[
RH.text "Neighbours"
]
]
]
, RH.div { className: "tab-content"
, id: "myTabContent" }
[ RH.div { className: ""
, id: "home"
, role: "tabpanel" }
[ badge "objects"
, badge "evaluation"
, badge "dynamics"
, badge "virtual environments"
, badge "virtual reality"
, badge "performance analysis"
, badge "software engineering"
, badge "complex systems"
, badge "wireless communications"
]
]
]
, RH.div { className: "col-md-12"
, id: "horizontal-checkbox" }
[
RH.ul {}
[
checkbox "Pubs"
[ RH.text "Neighbours" ] ] ]
, RH.div { className: "tab-content", id: "myTabContent" }
[ RH.div { className: "", id: "home", role: "tabpanel" }
(badge <$> badges) ] ]
, RH.div { className: "col-md-12", id: "horizontal-checkbox" }
[ RH.ul {}
[ checkbox "Pubs"
, checkbox "Projects"
, checkbox "Patents"
, checkbox "Others"
]
]
]
]
]
, checkbox "Others" ] ] ] ] ]
badge text =
RH.a { className: "badge badge-light" } [ RH.text text ]
checkbox text =
RH.li {}
[
RH.span {} [ RH.text text ]
[ RH.span {} [ RH.text text ]
, RH.input { type: "checkbox"
, className: "checkbox"
, checked: true
, title: "Mark as completed" }
]
, title: "Mark as completed" } ]
badges =
[ "objects"
, "evaluation"
, "dynamics"
, "virtual environments"
, "virtual reality"
, "performance analysis"
, "software engineering"
, "complex systems"
, "wireless communications" ]
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
View file @
1105cefb
...
...
@@ -12,15 +12,12 @@ import Prelude
import Data.Maybe (Maybe(..))
import Data.Tuple (snd)
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Utils.Reactix as R2
type Props = (
state :: R.State Boolean
...
...
src/Gargantext/Components/Login.purs
View file @
1105cefb
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Modal.purs
View file @
1105cefb
...
...
@@ -3,23 +3,17 @@
-- | content. Clicking outside of the box will close the modal
module Gargantext.Components.Modal where
import Prelude hiding (div)
import Data.Maybe ( Maybe(..), maybe )
import Data.Nullable ( Nullable, null, toMaybe )
import Data.Tuple ( Tuple(..) )
import Data.Tuple.Nested ( (/\) )
import Prelude (Unit, bind, const, discard, pure, unit, ($))
import Data.Maybe ( maybe )
import Data.Nullable ( Nullable, null )
import DOM.Simple as DOM
import DOM.Simple.Console
import DOM.Simple.EventListener ( Callback, callback )
import DOM.Simple.EventListener ( callback )
import DOM.Simple.Element as Element
import DOM.Simple.Event (MouseEvent, target)
import DOM.Simple.Document ( document )
import Effect (Effect)
import Effect.Uncurried ( mkEffectFn1 )
import FFI.Simple ( (...), (..), delay )
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.SyntheticEvent as E
import Gargantext.Utils.Reactix as R2
type Props = ( setVisible :: R2.Setter Boolean )
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
1105cefb
module Gargantext.Components.NgramsTable where
import Prelude
import Data.Array as A
import Data.Lens (to, view, (%~), (.~), (^.), (^..))
import Data.Lens.Common (_Just)
...
...
@@ -25,13 +26,12 @@ import React.DOM.Props (_id, _type, checked, className, name, onChange, onClick,
import React.DOM.Props as DOM
import Thermite (PerformAction, Render, Spec, defaultPerformAction, modifyState_, simpleSpec, createClass)