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
62fd836e
Commit
62fd836e
authored
Nov 12, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-graphql
parents
4aeb7376
887d03a2
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
58 additions
and
42 deletions
+58
-42
Dockerfile.dev
Dockerfile.dev
+1
-0
README.md
README.md
+2
-10
package.json
package.json
+2
-1
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+4
-4
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+4
-3
Status.purs
src/Gargantext/Components/Forest/Tree/Node/Status.purs
+2
-2
Controls.purs
src/Gargantext/Components/GraphExplorer/Controls.purs
+1
-1
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+23
-2
ToggleButton.purs
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
+5
-5
Router.purs
src/Gargantext/Components/Router.purs
+2
-2
Router.purs
src/Gargantext/Router.purs
+1
-1
Routes.purs
src/Gargantext/Routes.purs
+4
-4
Types.purs
src/Gargantext/Types.purs
+7
-7
No files found.
Dockerfile.dev
View file @
62fd836e
...
...
@@ -10,6 +10,7 @@ RUN apt-get update && apt-get install -y yarn
RUN curl -L https://github.com/coot/zephyr/releases/download/v0.3.2/Linux.tar.gz | tar zx -C /usr/bin --strip-components=1 zephyr/zephyr
RUN curl -L https://github.com/dhall-lang/dhall-haskell/releases/download/1.38.1/dhall-json-1.7.6-x86_64-linux.tar.bz2 | tar jx -C /usr/bin --strip-components=2 ./bin/dhall-to-json
RUN yarn global add purescript spago pulp
WORKDIR /opt/app
EXPOSE 5000/tcp
...
...
README.md
View file @
62fd836e
...
...
@@ -144,11 +144,10 @@ the docker container.
### Basic tasks
Now we must install our javascript and purescript dependencies:
*Note: if you're installing manually you might also need to manually install [psc-package](https://github.com/purescript/psc-package)*
```
shell
darn
install
-D
&&
darn install-ps
# for docker setup
yarn
install
-D
&&
yarn install-ps
# for manual setup
darn
install
-D
# for docker setup
yarn
install
-D
# for manual setup
```
You will likely want to check your work in a browser. We provide a
...
...
@@ -166,13 +165,6 @@ darn build # for docker setup
yarn build
# for manual setup
```
If you are rapidly iterating and just want to type check your code:
```
shell
darn compile
# for docker setup
yarn compile
# for manual setup
```
You may access a purescript repl if you want to explore:
```
shell
...
...
package.json
View file @
62fd836e
{
"name"
:
"Gargantext"
,
"version"
:
"0.0.4.
6
"
,
"version"
:
"0.0.4.
7
"
,
"scripts"
:
{
"generate-purs-packages-nix"
:
"./nix/generate-purs-packages.nix"
,
"generate-psc-packages-nix"
:
"./nix/generate-packages-json.bash"
,
...
...
@@ -18,6 +18,7 @@
"clean-js"
:
"rm -Rf node_modules"
,
"clean-ps"
:
"rm -Rf output"
,
"server"
:
"serve dist"
,
"build"
:
"spago build && pulp browserify --skip-compile -t dist/bundle.js --src-path output"
,
"prod"
:
"yarn prod:compile && yarn prod:dce && yarn prod:bundle && yarn prod:pack"
,
"prod:compile"
:
"pulp build -- -g corefn"
,
"prod:dce"
:
"zephyr -f Main.main"
,
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
62fd836e
...
...
@@ -41,10 +41,10 @@ update = R.createElement updateCpt
updateCpt :: R.Component UpdateProps
updateCpt = here.component "update" cpt where
cpt props@{ nodeType: Dashboard } _ = pure $ updateDashboard props []
cpt props@{ nodeType: Graph
} _
= pure $ updateGraph props []
cpt props@{ nodeType: NodeList
} _
= pure $ updateNodeList props []
cpt props@{ nodeType:
Texts } _
= pure $ updateTexts props []
cpt props@{ nodeType: _
} _
= pure $ updateOther props []
cpt props@{ nodeType: Graph
} _
= pure $ updateGraph props []
cpt props@{ nodeType: NodeList
} _
= pure $ updateNodeList props []
cpt props@{ nodeType:
NodeTexts } _
= pure $ updateTexts props []
cpt props@{ nodeType: _
} _
= pure $ updateOther props []
updateDashboard :: R2.Component UpdateProps
updateDashboard = R.createElement updateDashboardCpt
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
62fd836e
...
...
@@ -181,7 +181,8 @@ settingsBox Corpus =
, SearchBox
, Download
--, Clone
, Add [ NodeList
, Add [ NodeTexts
, NodeList
, Graph
, Dashboard
, NodeFrameWrite
...
...
@@ -195,10 +196,10 @@ settingsBox Corpus =
]
}
settingsBox Texts =
settingsBox
Node
Texts =
SettingsBox { show : true
, edit : false
, doc : Documentation Texts
, doc : Documentation
Node
Texts
, buttons : [ Refresh
, Upload
, Download
...
...
src/Gargantext/Components/Forest/Tree/Node/Status.purs
View file @
62fd836e
...
...
@@ -13,8 +13,8 @@ hasStatus _ Refresh = Dev
hasStatus _ Config = Dev
hasStatus _ (Merge _) = Dev
hasStatus _ (Documentation _) = Dev
hasStatus Annuaire
Upload
= Dev
hasStatus
Texts Upload
= Dev
hasStatus Annuaire
Upload
= Dev
hasStatus
NodeTexts Upload
= Dev
hasStatus Corpus (Add _) = Dev
hasStatus _ _ = Stable
src/Gargantext/Components/GraphExplorer/Controls.purs
View file @
62fd836e
...
...
@@ -20,7 +20,7 @@ import Gargantext.Components.Graph as Graph
import Gargantext.Components.GraphExplorer.Button (centerButton, cameraButton)
import Gargantext.Components.GraphExplorer.RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl)
import Gargantext.Components.GraphExplorer.SlideButton (labelSizeButton, mouseSelectorSizeButton)
import Gargantext.Components.GraphExplorer.ToggleButton (multiSelectEnabledButton, edgesToggleButton, louvainToggleButton, pauseForceAtlasButton
, resetForceAtlasButton
)
import Gargantext.Components.GraphExplorer.ToggleButton (multiSelectEnabledButton, edgesToggleButton, louvainToggleButton, pauseForceAtlasButton
{-, resetForceAtlasButton-}
)
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax as Sigmax
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
62fd836e
...
...
@@ -220,6 +220,12 @@ selectedNodesCpt = here.component "selectedNodes" cpt
where
commonProps = RX.pick props :: Record Common
data TagCloudState = Folded | Unfolded
derive instance Eq TagCloudState
flipFold :: TagCloudState -> TagCloudState
flipFold Folded = Unfolded
flipFold Unfolded = Folded
neighborhood :: R2.Component Props
neighborhood = R.createElement neighborhoodCpt
neighborhoodCpt :: R.Component Props
...
...
@@ -230,10 +236,21 @@ neighborhoodCpt = here.component "neighborhood" cpt
} _ = do
{ selectedNodeIds } <- GEST.focusedSidePanel sidePanelGraph
selectedNodeIds' <- T.useLive T.unequal selectedNodeIds
state <- T.useBox Folded
state' <- T.useLive T.unequal state
let badges' = neighbourBadges graph selectedNodeIds'
let numberOfBadgesToShowWhenFolded = 5
badges' = neighbourBadges graph selectedNodeIds'
minSize = F.foldl Math.min 0.0 (Seq.map _.size (SigmaxT.graphNodes graph))
maxSize = F.foldl Math.max 0.0 (Seq.map _.size (SigmaxT.graphNodes graph))
orderedBadges = A.sortWith (\n -> -n.size) $ Seq.toUnfoldable badges' -- reverse sort (largest size first)
displayBadges = case state' of
Folded -> A.take numberOfBadgesToShowWhenFolded orderedBadges
Unfolded -> orderedBadges
stateText = case state' of
Folded -> "Show more"
Unfolded -> "Show less"
showFoldedTooltip = A.length orderedBadges > numberOfBadgesToShowWhenFolded
pure $ RH.div { className: "tab-content", id: "myTabContent" }
[ RH.div { -- className: "flex-space-around d-flex justify-content-center"
...
...
@@ -241,8 +258,12 @@ neighborhoodCpt = here.component "neighborhood" cpt
, id: "home"
, role: "tabpanel"
}
(Seq.toUnfoldable $ Seq.map (\node -> badge { maxSize, minSize, node, selectedNodeIds }) badges')
((\node -> badge { maxSize, minSize, node, selectedNodeIds }) <$> displayBadges) <>
RH.a { className: "" -- with empty class name, bootstrap renders this blue
, on: { click: toggleUnfold state} } [ RH.text stateText ]
]
where
toggleUnfold state = T.modify_ flipFold state
type UpdateTermButtonProps = (
...
...
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
View file @
62fd836e
...
...
@@ -155,11 +155,11 @@ pauseForceAtlasButtonCpt = here.component "forceAtlasToggleButton" cpt
cls SigmaxTypes.Running = "active"
cls _ = ""
text SigmaxTypes.InitialRunning = "Pause
Force Atlas
"
text SigmaxTypes.InitialStopped = "Start
Force Atlas
"
text SigmaxTypes.Running = "Pause
Force Atlas
"
text SigmaxTypes.Paused = "Start
Force Atlas
"
text SigmaxTypes.Killed = "Start
Force Atlas
"
text SigmaxTypes.InitialRunning = "Pause"
text SigmaxTypes.InitialStopped = "Start"
text SigmaxTypes.Running = "Pause"
text SigmaxTypes.Paused = "Start"
text SigmaxTypes.Killed = "Start"
onClick state _ = T.modify_ SigmaxTypes.toggleForceAtlasState state
...
...
src/Gargantext/Components/Router.purs
View file @
62fd836e
...
...
@@ -267,7 +267,7 @@ renderRouteCpt = here.component "renderRoute" cpt where
GR.RouteFrameCode s n -> routeFrame (Record.merge { nodeType: NodeFrameNotebook } $ sessionNodeProps s n) []
GR.RouteFrameVisio s n -> routeFrame (Record.merge { nodeType: NodeFrameVisio } $ sessionNodeProps s n) []
GR.Team s n -> team (sessionNodeProps s n) []
GR.
Texts s n
-> texts (sessionNodeProps s n) []
GR.
NodeTexts s n
-> texts (sessionNodeProps s n) []
GR.UserPage s n -> user (sessionNodeProps s n) []
]
...
...
@@ -328,7 +328,7 @@ openedSidePanelCpt = here.component "openedSidePanel" cpt where
, metaData
, session
} [] ]
GR.Texts _s _n -> do
GR.
Node
Texts _s _n -> do
pure $ wrapper
[ Texts.textsSidePanel { boxes
, session
...
...
src/Gargantext/Router.purs
View file @
62fd836e
...
...
@@ -26,7 +26,7 @@ router = oneOf
, Dashboard <$> (route "dashboard" *> sid) <*> int
, PGraphExplorer <$> (route "graph" *> sid) <*> int
, PhyloExplorer <$> (route "phylo" *> sid) <*> int
,
Texts
<$> (route "texts" *> sid) <*> int
,
NodeTexts
<$> (route "texts" *> sid) <*> int
, Lists <$> (route "lists" *> sid) <*> int
, ContactPage <$> (route "annuaire" *> sid) <*> int
<*> (lit "contact" *> int)
...
...
src/Gargantext/Routes.purs
View file @
62fd836e
...
...
@@ -30,7 +30,7 @@ data AppRoute
| RouteFrameWrite SessionId Int
| RouteFrameVisio SessionId Int
| Team SessionId Int
|
Texts
SessionId Int
|
NodeTexts
SessionId Int
| UserPage SessionId Int
...
...
@@ -74,7 +74,7 @@ instance Show AppRoute where
show (PGraphExplorer s i) = "graphExplorer" <> show i <> " (" <> show s <> ")"
show (PhyloExplorer s i) = "phyloExplorer" <> show i <> " (" <> show s <> ")"
show (Dashboard s i) = "Dashboard" <> show i <> " (" <> show s <> ")"
show (
Texts
s i) = "texts" <> show i <> " (" <> show s <> ")"
show (
NodeTexts
s i) = "texts" <> show i <> " (" <> show s <> ")"
show (Lists s i) = "lists" <> show i <> " (" <> show s <> ")"
show (Annuaire s i) = "Annuaire" <> show i <> " (" <> show s <> ")"
show (UserPage s i) = "User" <> show i <> " (" <> show s <> ")"
...
...
@@ -101,7 +101,7 @@ appPath (Document s l i) = "list/" <> show s <> "/" <> show l <> "
appPath (Dashboard s i) = "dashboard/" <> show s <> "/" <> show i
appPath (PGraphExplorer s i) = "graph/" <> show s <> "/" <> show i
appPath (PhyloExplorer s i) = "phylo/" <> show s <> "/" <> show i
appPath (
Texts s i)
= "texts/" <> show s <> "/" <> show i
appPath (
NodeTexts s i)
= "texts/" <> show s <> "/" <> show i
appPath (Lists s i) = "lists/" <> show s <> "/" <> show i
appPath (Annuaire s i) = "annuaire/" <> show s <> "/" <> show i
appPath (UserPage s i) = "user/" <> show s <> "/" <> show i
...
...
@@ -127,7 +127,7 @@ nodeTypeAppRoute GT.NodeFile s i = Just $ RouteFile s i
nodeTypeAppRoute GT.NodeList s i = Just $ Lists s i
nodeTypeAppRoute GT.NodeUser s i = Just $ UserPage s i
nodeTypeAppRoute GT.Team s i = Just $ Team s i
nodeTypeAppRoute GT.
Texts s i = Just $
Texts s i
nodeTypeAppRoute GT.
NodeTexts s i = Just $ Node
Texts s i
nodeTypeAppRoute GT.NodeFrameWrite s i = Just $ RouteFrameWrite s i
nodeTypeAppRoute GT.NodeFrameCalc s i = Just $ RouteFrameCalc s i
nodeTypeAppRoute GT.NodeFrameVisio s i = Just $ RouteFrameVisio s i
...
...
src/Gargantext/Types.purs
View file @
62fd836e
...
...
@@ -148,7 +148,7 @@ data NodeType = Annuaire
| Nodes
| Phylo
| Team
| Texts
|
Node
Texts
| Tree
| Url_Document
-- TODO Optional Nodes
...
...
@@ -190,7 +190,7 @@ instance Show NodeType where
show Tree = "NodeTree"
show Team = "NodeTeam"
show NodeList = "NodeList"
show
Texts = "NodeDoc
s"
show
NodeTexts = "NodeText
s"
show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc"
show NodeFrameNotebook = "NodeFrameNotebook"
...
...
@@ -218,7 +218,7 @@ instance Read NodeType where
read "Tree" = Just Tree
read "NodeTeam" = Just Team
read "NodeList" = Just NodeList
read "NodeTexts" = Just Texts
read "NodeTexts" = Just
Node
Texts
read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc
...
...
@@ -254,7 +254,7 @@ translateFR = case _ of
Nodes -> "Nœuds"
Phylo -> "Phylo"
Team -> "Équipe"
Texts -> "Texte
s"
NodeTexts -> "Doc
s"
Tree -> "Arbre"
Url_Document -> "Document URL"
--
...
...
@@ -284,7 +284,7 @@ translateEN = case _ of
Nodes -> "Nodes"
Phylo -> "Phylo"
Team -> "Team"
Texts -> "Text
s"
NodeTexts -> "Doc
s"
Tree -> "Tree"
Url_Document -> "URL document"
--
...
...
@@ -322,7 +322,7 @@ getIcon Corpus false = "book-circle"
getIcon Phylo _ = "code-fork"
getIcon Graph _ = "hubzilla"
getIcon Texts _ = "newspaper-o"
getIcon
Node
Texts _ = "newspaper-o"
getIcon Dashboard _ = "signal"
getIcon NodeList _ = "list"
getIcon NodeFile _ = "file" -- TODO depending on mime type we can use fa-file-image etc
...
...
@@ -397,7 +397,7 @@ nodeTypePath NodeUser = "user"
nodeTypePath NodeContact = "contact"
nodeTypePath Tree = "tree"
nodeTypePath NodeList = "lists"
nodeTypePath
Texts
= "texts"
nodeTypePath
NodeTexts
= "texts"
nodeTypePath Team = "team"
nodeTypePath NodeFrameWrite = "write"
nodeTypePath NodeFrameCalc = "calc"
...
...
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