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
02ebf355
Commit
02ebf355
authored
Jul 21, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 311-tree-node-list-upload-file-as-json
parents
2e02f0f5
4a8401b5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
29 deletions
+75
-29
README.md
README.md
+36
-17
ECharts.purs
src/Gargantext/Components/Charts/Options/ECharts.purs
+7
-4
Type.purs
src/Gargantext/Components/Charts/Options/Type.purs
+16
-0
Histo.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Histo.purs
+1
-1
Texts.purs
src/Gargantext/Components/Nodes/Texts.purs
+14
-6
Types.purs
src/Gargantext/Types.purs
+1
-1
No files found.
README.md
View file @
02ebf355
# Gargantext
Purescript
# Gargantext
with Purescript (FrontEnd instance)
## About th
is
project
## About th
e
project
Gargan
text is a collaborative web platform for the exploration of sets
Gargan
Text is a collaborative web-decentralized-based macro-service
of unstructured documents. It combines tools from natural language
platform for the exploration of unstructured texts. It combines tools
processing, text-mining, complex networks analysis and interactive data
from natural language processing, text-data-mining tricks, complex
visualization to pave the way toward new kinds of interactions with your
networks analysis algorithms and interactive data visualization tools to
digital corpora.
pave the way toward new kinds of interactions with your
digital corpora.
This repo deals with the frontend or client which needs
This software is free software, developed and offered by the CNRS
a backend server running or being granted access to a
Complex Systems Institute of Paris Île-de-France (ISC-PIF) and its
partners.
GarganText Project: this repo builds the
frontend for the backend server built by
[
backend
](
https://gitlab.iscpif.fr/gargantext/haskell-gargantext
)
.
[
backend
](
https://gitlab.iscpif.fr/gargantext/haskell-gargantext
)
.
This software is free software, developed by the CNRS Complex Systems
Institute of Paris Île-de-France (ISC-PIF) and its partners.
## Getting set up
## Getting set up
There are two approaches to working with the build:
There are two approaches to working with the build:
1.
Use our
d
ocker setup
1.
Use our
Nix or D
ocker setup
2.
Install our dependencies yourself
2.
Install our dependencies yourself
The javascript ecosystem kind of assumes if you're on linux, you're
### With Nix setup
running on debian or ubuntu. I haven't yet managed to get garg to
build on alpine linux, for example. If you're on an oddball system, I
First install
[
nix
](
https://nixos.org/guides/install-nix.html
)
:
*strongly*
recommend you just use the docker setup.
```
shell
sh <
(
curl
-L
https://nixos.org/nix/install
)
--daemon
```
Verify the installation is complete
```
shell
$
nix-env
nix-env
(
Nix
)
2.3.12
```
To build the frontend just do:
```
nix-shell --run build
```
Just serve dist/index.html with any server and you are ready to be
connected to any backend.
### Docker setup
###
With
Docker setup
You will need docker and docker-compose installed.
You will need docker and docker-compose installed.
...
...
src/Gargantext/Components/Charts/Options/ECharts.purs
View file @
02ebf355
...
@@ -21,8 +21,7 @@ import Unsafe.Coerce (unsafeCoerce)
...
@@ -21,8 +21,7 @@ import Unsafe.Coerce (unsafeCoerce)
foreign import eChartsClass :: ReactClass Echarts
foreign import eChartsClass :: ReactClass Echarts
foreign import listenerFn1 :: forall evt. (evt -> Effect Unit) -> Effect Unit
foreign import listenerFn1 :: forall evt. (evt -> Effect Unit) -> Effect Unit
-- | @XXX some eCharts "actions" not working ("select", ...)
-- | https://echarts.apache.org/v4/en/api.html#echartsInstance.dispatchAction
-- | https://echarts.apache.org/en/api.html#echartsInstance.dispatchAction
foreign import dispatchAction :: forall payload. EChartsInstance -> payload -> Effect Unit
foreign import dispatchAction :: forall payload. EChartsInstance -> payload -> Effect Unit
chart :: Options -> R.Element
chart :: Options -> R.Element
...
@@ -59,7 +58,11 @@ chartWith options =
...
@@ -59,7 +58,11 @@ chartWith options =
execOnInit fn = toMaybe >>> case _ of
execOnInit fn = toMaybe >>> case _ of
Nothing -> pure unit
Nothing -> pure unit
Just (ref :: Record EChartRef) -> pure unit -- fn =<< ref.getEchartsInstance
-- Just (ref :: Record EChartRef) -> fn =<< ref.getEchartsInstance
-- ^ this line can break for some reasons... (see Issue #312)
Just (ref :: Record EChartRef) -> do
i <- ref.getEchartsInstance
fn i
echarts :: Echarts -> R.Element
echarts :: Echarts -> R.Element
echarts c = R2.buff $ unsafeCreateElementDynamic (unsafeCoerce eChartsClass) c []
echarts c = R2.buff $ unsafeCreateElementDynamic (unsafeCoerce eChartsClass) c []
...
@@ -190,7 +193,7 @@ data Options = Options
...
@@ -190,7 +193,7 @@ data Options = Options
-- it intends to return the `eChartsInstance` used for every
-- it intends to return the `eChartsInstance` used for every
-- library actions
-- library actions
--
--
-- [1] https://echarts.apache.org/en/api.html#echarts.init
-- [1] https://echarts.apache.org/
v4/
en/api.html#echarts.init
, onInit :: Maybe (EChartsInstance -> Effect Unit)
, onInit :: Maybe (EChartsInstance -> Effect Unit)
}
}
...
...
src/Gargantext/Components/Charts/Options/Type.purs
View file @
02ebf355
...
@@ -216,3 +216,19 @@ type EChartRef =
...
@@ -216,3 +216,19 @@ type EChartRef =
( getEchartsInstance :: Effect EChartsInstance
( getEchartsInstance :: Effect EChartsInstance
-- ...
-- ...
)
)
----
-- | As "dispatchAction" call has a variadic arity, we can dissociate a type
-- | where the cliked item (bar, pie section, etc.) need this dispatchAction
-- | To do so, we have to trimmed its given properties to match this example [1]
-- |
-- | [1] https://echarts.apache.org/en/api.html#action.highlight
type EChartActionData =
( dataIndex :: Int
, name :: String
, seriesId :: Nullable String
, seriesIndex :: Int
, seriesName :: String
, type :: String
)
src/Gargantext/Components/Nodes/Corpus/Chart/Histo.purs
View file @
02ebf355
...
@@ -67,7 +67,7 @@ chartOptions { onClick, onInit } (HistoMetrics { dates: dates', count: count'})
...
@@ -67,7 +67,7 @@ chartOptions { onClick, onInit } (HistoMetrics { dates: dates', count: count'})
, emphasis: { itemStyle: itemStyle { color: blue } }
, emphasis: { itemStyle: itemStyle { color: blue } }
-- @XXX "select" action not working
-- @XXX "select" action not working
-- , selectedMode: selectedMode Single
-- , selectedMode: selectedMode Single
, select: { itemStyle: itemStyle { color: green }}
--
, select: { itemStyle: itemStyle { color: green }}
}
}
series =
series =
...
...
src/Gargantext/Components/Nodes/Texts.purs
View file @
02ebf355
module Gargantext.Components.Nodes.Texts where
module Gargantext.Components.Nodes.Texts where
import DOM.Simple.Console (log2)
import Gargantext.Prelude
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Show.Generic (genericShow)
import Data.Show.Generic (genericShow)
import Data.Symbol (SProxy(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Effect.Aff (launchAff_)
import Effect.Aff (launchAff_)
import Gargantext.Components.Charts.Options.ECharts (dispatchAction)
import Gargantext.Components.Charts.Options.ECharts (dispatchAction)
import Gargantext.Components.Charts.Options.Type (EChartsInstance)
import Gargantext.Components.Charts.Options.Type (EChartsInstance
, EChartActionData
)
import Gargantext.Components.DocsTable as DT
import Gargantext.Components.DocsTable as DT
import Gargantext.Components.DocsTable.Types (Year)
import Gargantext.Components.DocsTable.Types (Year)
import Gargantext.Components.NgramsTable.Loader (clearCache)
import Gargantext.Components.NgramsTable.Loader (clearCache)
...
@@ -23,13 +23,11 @@ import Gargantext.Components.Tab as Tab
...
@@ -23,13 +23,11 @@ import Gargantext.Components.Tab as Tab
import Gargantext.Components.Table as Table
import Gargantext.Components.Table as Table
import Gargantext.Ends (Frontends)
import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude
import Gargantext.Sessions (WithSession, Session, getCacheState)
import Gargantext.Sessions (WithSession, Session, getCacheState)
import Gargantext.Types (CTabNgramType(..), ListId, NodeID, SidePanelState(..), TabSubType(..), TabType(..))
import Gargantext.Types (CTabNgramType(..), ListId, NodeID, SidePanelState(..), TabSubType(..), TabType(..))
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Record (set)
import Toestand as T
import Toestand as T
here :: R2.Here
here :: R2.Here
...
@@ -170,8 +168,18 @@ tabsCpt = here.component "tabs" cpt
...
@@ -170,8 +168,18 @@ tabsCpt = here.component "tabs" cpt
-- @XXX due to lack of support for "echart.select" action,
-- @XXX due to lack of support for "echart.select" action,
-- have to manually rely on a set/unset selection
-- have to manually rely on a set/unset selection
-- targeting the "echart.emphasis" action
-- targeting the "echart.emphasis" action
let
opts' :: Record EChartActionData
opts' =
{ dataIndex : opts.dataIndex
, name : opts.name
, seriesId : opts.seriesId
, seriesIndex : opts.seriesIndex
, seriesName : opts.seriesName
, type : "highlight"
}
dispatchAction i { type: "downplay" }
dispatchAction i { type: "downplay" }
dispatchAction i
$ set (SProxy :: SProxy "type") "highlight" opts
dispatchAction i
opts'
activeTab <- T.useBox 0
activeTab <- T.useBox 0
...
...
src/Gargantext/Types.purs
View file @
02ebf355
...
@@ -670,7 +670,7 @@ asyncTaskTypePath :: AsyncTaskType -> String
...
@@ -670,7 +670,7 @@ asyncTaskTypePath :: AsyncTaskType -> String
asyncTaskTypePath AddNode = "async/nobody/"
asyncTaskTypePath AddNode = "async/nobody/"
asyncTaskTypePath Form = "add/form/async/"
asyncTaskTypePath Form = "add/form/async/"
asyncTaskTypePath GraphRecompute = "async/recompute/"
asyncTaskTypePath GraphRecompute = "async/recompute/"
asyncTaskTypePath ListUpload = "add/form/async/"
asyncTaskTypePath ListUpload = "add/form/async/
nobody
"
asyncTaskTypePath Query = "query/"
asyncTaskTypePath Query = "query/"
asyncTaskTypePath UpdateNgramsCharts = "ngrams/async/charts/update/"
asyncTaskTypePath UpdateNgramsCharts = "ngrams/async/charts/update/"
asyncTaskTypePath UpdateNode = "update/"
asyncTaskTypePath UpdateNode = "update/"
...
...
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