Commit f7cd32be authored by Karen Konou's avatar Karen Konou

Merge branch 'dev' into 450-dev-filter-histo-multiple-dates

parents 930256db 41668044
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.6.8.2", "version": "0.0.6.8.5",
"scripts": { "scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix", "generate-purs-packages-nix": "./nix/generate-purs-packages.nix",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash", "generate-psc-packages-nix": "./nix/generate-packages-json.bash",
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
"clean": "rm -Rf output node_modules", "clean": "rm -Rf output node_modules",
"clean-js": "rm -Rf node_modules", "clean-js": "rm -Rf node_modules",
"clean-ps": "rm -Rf output", "clean-ps": "rm -Rf output",
"server": "serve dist", "server": "serve -l 8000 dist",
"server-ssl": "ssl-serve --ssl dist", "server-ssl": "ssl-serve --ssl dist",
"build": "spago build && pulp browserify --skip-compile -t dist/bundle.js --src-path output", "build": "spago bundle-app --main Main --to dist/bundle.js",
"prod": "yarn prod:compile && yarn prod:dce && yarn prod:bundle && yarn prod:pack", "prod": "yarn prod:compile && yarn prod:dce && yarn prod:bundle && yarn prod:pack",
"prod:compile": "pulp build -- -g corefn", "prod:compile": "pulp build -- -g corefn",
"prod:dce": "zephyr -f Main.main", "prod:dce": "zephyr -f Main.main",
......
...@@ -40,6 +40,7 @@ to generate this file without the comments in this block. ...@@ -40,6 +40,7 @@ to generate this file without the comments in this block.
, "foreign" , "foreign"
, "foreign-object" , "foreign-object"
, "form-urlencoded" , "form-urlencoded"
, "formatters"
, "formula" , "formula"
, "functions" , "functions"
, "graphql-client" , "graphql-client"
...@@ -47,9 +48,7 @@ to generate this file without the comments in this block. ...@@ -47,9 +48,7 @@ to generate this file without the comments in this block.
, "integers" , "integers"
, "js-timers" , "js-timers"
, "lists" , "lists"
-- , "markdown"
, "markdown-it" , "markdown-it"
--, "markdown-smolder"
, "maybe" , "maybe"
, "media-types" , "media-types"
, "milkis" , "milkis"
...@@ -75,7 +74,6 @@ to generate this file without the comments in this block. ...@@ -75,7 +74,6 @@ to generate this file without the comments in this block.
, "simple-json" , "simple-json"
, "simple-json-generics" , "simple-json-generics"
, "simplecrypto" , "simplecrypto"
-- , "smolder"
, "strings" , "strings"
, "strings-extra" , "strings-extra"
, "stringutils" , "stringutils"
......
...@@ -2,24 +2,90 @@ module Gargantext.Components.App (app) where ...@@ -2,24 +2,90 @@ module Gargantext.Components.App (app) where
import Gargantext.Prelude import Gargantext.Prelude
import Data.Tuple.Nested ((/\))
import Gargantext.AsyncTasks as GAT import Gargantext.AsyncTasks as GAT
import Gargantext.Components.App.Store as AppStore import Gargantext.Components.App.Store as AppStore
import Gargantext.Components.Router (router) import Gargantext.Components.Router (router)
import Gargantext.Hooks (useHashRouter) import Gargantext.Hooks (useHashRouter)
import Gargantext.Hooks.FirstEffect (useFirstEffect')
import Gargantext.Router as Router import Gargantext.Router as Router
import Gargantext.Sessions as Sessions import Gargantext.Sessions as Sessions
import Gargantext.Types (CacheParams, defaultCacheParams)
import Gargantext.Utils (getter)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
import Record as Record
import Toestand as T import Toestand as T
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.App" here = R2.here "Gargantext.Components.App"
app :: R2.Component ()
app = R.createElement appCpt app :: R2.Leaf ()
app = R2.leaf appCpt
appCpt :: R.Component () appCpt :: R.Component ()
appCpt = here.component "app" cpt where appCpt = here.component "container" cpt where
cpt _ _ = do
-- | States
-- |
cache' /\ cache <- R2.useBox' (defaultCacheParams :: CacheParams)
-- | Hooks
-- |
-- load Local Storage cache (if exists)
useFirstEffect' $
R2.loadLocalStorageState R2.appParamsKey cache
-- | Render
-- |
pure $
hydrateStore
{ cacheParams: cache'
}
--------------------------------------------------------------
type HydrateStoreProps =
( cacheParams :: CacheParams
)
hydrateStore :: R2.Leaf HydrateStoreProps
hydrateStore = R2.leaf hydrateStoreCpt
hydrateStoreCpt :: R.Component HydrateStoreProps
hydrateStoreCpt = here.component "hydrateStore" cpt where
cpt { cacheParams
} _ = do
-- | Computed
-- |
(state :: Record AppStore.State) <- pure $
-- (cache options)
{ expandTableEdition: getter _.expandTableEdition cacheParams
-- (default options)
} `Record.merge` AppStore.options
-- | Render
-- |
pure $
AppStore.provide
state
[
mainApp
{}
]
--------------------------------------------------------------
mainApp :: R2.Leaf ()
mainApp = R2.leaf mainAppCpt
mainAppCpt :: R.Component ()
mainAppCpt = here.component "main" cpt where
cpt _ _ = do cpt _ _ = do
boxes <- AppStore.use boxes <- AppStore.use
-- tasks <- T.useBox Nothing -- storage for asynchronous tasks reductor -- tasks <- T.useBox Nothing -- storage for asynchronous tasks reductor
......
...@@ -38,6 +38,7 @@ here = R2.here "Gargantext.Components.App.Store" ...@@ -38,6 +38,7 @@ here = R2.here "Gargantext.Components.App.Store"
type Store = type Store =
( backend :: T.Box (Maybe Backend) ( backend :: T.Box (Maybe Backend)
, errors :: T.Box (Array FrontendError) , errors :: T.Box (Array FrontendError)
, expandTableEdition :: T.Box Boolean
, forestOpen :: T.Box OpenNodes , forestOpen :: T.Box OpenNodes
, graphVersion :: T2.ReloadS , graphVersion :: T2.ReloadS
, handed :: T.Box Handed , handed :: T.Box Handed
...@@ -63,6 +64,7 @@ type Store = ...@@ -63,6 +64,7 @@ type Store =
type State = type State =
( backend :: Maybe Backend ( backend :: Maybe Backend
, errors :: Array FrontendError , errors :: Array FrontendError
, expandTableEdition :: Boolean
, forestOpen :: OpenNodes , forestOpen :: OpenNodes
, graphVersion :: T2.Reload , graphVersion :: T2.Reload
, handed :: Handed , handed :: Handed
...@@ -89,6 +91,7 @@ options :: Record State ...@@ -89,6 +91,7 @@ options :: Record State
options = options =
{ backend : Nothing { backend : Nothing
, errors : [] , errors : []
, expandTableEdition : false
, forestOpen : OpenNodes $ Set.empty , forestOpen : OpenNodes $ Set.empty
, graphVersion : T2.newReload , graphVersion : T2.newReload
, handed : RightHanded , handed : RightHanded
......
...@@ -20,24 +20,24 @@ type Props = ...@@ -20,24 +20,24 @@ type Props =
) )
type Options = type Options =
( status :: ComponentStatus ( block :: Boolean
, size :: Sizing
, variant :: ButtonVariant
, type :: String
, className :: String , className :: String
, block :: Boolean , size :: Sizing
, status :: ComponentStatus
, title :: String , title :: String
, type :: String
, variant :: ButtonVariant
) )
options :: Record Options options :: Record Options
options = options =
{ status : Enabled { block : false
, size : MediumSize
, variant : ButtonVariant Primary
, type : "button"
, className : "" , className : ""
, block : false , status : Enabled
, size : MediumSize
, title : "" , title : ""
, type : "button"
, variant : ButtonVariant Primary
} }
-- | Structural Component for the Bootstrap button -- | Structural Component for the Bootstrap button
......
...@@ -24,6 +24,7 @@ type Options = ...@@ -24,6 +24,7 @@ type Options =
, overlay :: Boolean , overlay :: Boolean
, elevation :: Elevation , elevation :: Elevation
, variant :: Variant , variant :: Variant
, focusRing :: Boolean
) )
options :: Record Options options :: Record Options
...@@ -34,6 +35,7 @@ options = ...@@ -34,6 +35,7 @@ options =
, overlay : true , overlay : true
, elevation : Level0 , elevation : Level0
, variant : Dark , variant : Dark
, focusRing : true
} }
-- | Structural Component for a simple Glyphicon element with call-to-action -- | Structural Component for a simple Glyphicon element with call-to-action
...@@ -67,6 +69,9 @@ component = R.hooksComponent componentName cpt where ...@@ -67,6 +69,9 @@ component = R.hooksComponent componentName cpt where
componentName <> "--overlay" $ componentName <> "--overlay" $
"" ""
, componentName <> "--" <> show props.elevation , componentName <> "--" <> show props.elevation
, props.focusRing ?
componentName <> "--focus-ring" $
""
] ]
contentClassName = intercalate " " contentClassName = intercalate " "
......
...@@ -33,8 +33,8 @@ red :: Color ...@@ -33,8 +33,8 @@ red :: Color
red = stringColor "red" red = stringColor "red"
blue :: Color blue :: Color
blue = cssColor $ rgba 100 150 200 0.0 blue = cssColor $ rgba 100 150 200 1.0
-- stringColor "blue" -- stringColor "blue"
magenta :: Color magenta :: Color
magenta = stringColor "magenta" magenta = stringColor "magenta"
......
This diff is collapsed.
This diff is collapsed.
module Gargantext.Components.Corpus.EditionBlock
( editionBlock
) where
import Gargantext.Prelude
import Data.Maybe (Maybe(..), isJust)
import Data.Tuple.Nested ((/\))
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Corpus.CodeSection (loadCorpus')
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Nodes.Corpus.Types (CorpusInfo(..), Hyperdata(..), getCorpusInfo)
import Gargantext.Components.Table (tableHeaderEditionBlock)
import Gargantext.Config.REST (logRESTError)
import Gargantext.Hooks.Loader (useLoaderEffect)
import Gargantext.Hooks.Session (useSession)
import Gargantext.Types (ID)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
type Props =
( nodeId :: ID
)
here :: R2.Here
here = R2.here "Gargantext.Components.Corpus.EditionBlock"
editionBlock :: R2.Leaf Props
editionBlock = R2.leaf editionBlockCpt
editionBlockCpt :: R.Component Props
editionBlockCpt = here.component "main" cpt where
cpt { nodeId
} _ = do
-- | States
-- |
session <- useSession
state' /\ state <- R2.useBox' Nothing
-- | Computed
-- |
let
errorHandler = logRESTError here "[corpusLayout]"
-- | Hooks
-- |
useLoaderEffect
{ errorHandler
, loader: loadCorpus'
, path: { nodeId, session }
, state
}
-- | Render
-- |
pure $
B.cloak
{ isDisplayed: isJust state'
, cloakSlot:
-- (?) quick and dirty placeholder for the <tableHeaderEditionBlock>
H.div
{ style:
{ width: "100%"
, height: "136px"
, position: "relative"
}
}
[
B.preloader
{}
]
, defaultSlot:
R2.fromMaybe state' \hyperdata ->
editionBlock_
{ nodeId
, hyperdata
}
}
----------------------------------------------------------------
type Props_ =
( nodeId :: ID
, hyperdata :: NodePoly Hyperdata
)
editionBlock_ :: R2.Leaf Props_
editionBlock_ = R2.leaf editionBlockCpt_
editionBlockCpt_ :: R.Component Props_
editionBlockCpt_ = here.component "main_" cpt where
cpt { nodeId
, hyperdata
} _ = do
-- | Computed
-- |
let
NodePoly { name, date, hyperdata } = hyperdata
Hyperdata h = hyperdata
corpusInfo = getCorpusInfo h.fields
CorpusInfo { title, desc, query, authors } = corpusInfo
-- -- | States
-- -- |
corpusInfoS <- T.useBox corpusInfo
session <- useSession
-- -- | Render
-- -- |
pure $
tableHeaderEditionBlock
{ hyperdata
, nodeId
, session
, corpusInfoS
, defaultData:
{ name
, date
, query
, desc
, title
, authors
}
}
This diff is collapsed.
This diff is collapsed.
...@@ -23,9 +23,9 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType(..), ...@@ -23,9 +23,9 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType(..),
import Gargantext.Components.Forest.Tree.Node.Box (nodePopupView) import Gargantext.Components.Forest.Tree.Node.Box (nodePopupView)
import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox) import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox)
import Gargantext.Components.Forest.Tree.Node.Tools.Sync (nodeActionsGraph, nodeActionsNodeList) import Gargantext.Components.Forest.Tree.Node.Tools.Sync (nodeActionsGraph, nodeActionsNodeList)
import Gargantext.Components.Corpus.CodeSection (loadCorpusWithChild)
import Gargantext.Components.GraphExplorer.API as GraphAPI import Gargantext.Components.GraphExplorer.API as GraphAPI
import Gargantext.Components.Lang (Lang(EN)) import Gargantext.Components.Lang (Lang(EN))
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
import Gargantext.Config.REST (logRESTError) import Gargantext.Config.REST (logRESTError)
import Gargantext.Context.Progress (asyncContext, asyncProgress) import Gargantext.Context.Progress (asyncContext, asyncProgress)
import Gargantext.Ends (Frontends, url) import Gargantext.Ends (Frontends, url)
......
...@@ -166,7 +166,7 @@ updatePhyloCpt = here.component "updatePhylo" cpt where ...@@ -166,7 +166,7 @@ updatePhyloCpt = here.component "updatePhylo" cpt where
defaultData = Phylo.UpdateData defaultData = Phylo.UpdateData
{ proximity: 0.5 { proximity: 0.5
, synchrony: 0.5 , synchrony: 0.5
, quality: 0.5 , quality: 0.8
, exportFilter: 3.0 , exportFilter: 3.0
, timeUnit: Phylo.Year $ Phylo.TimeUnitCriteria , timeUnit: Phylo.Year $ Phylo.TimeUnitCriteria
{ period: 3 { period: 3
......
...@@ -39,7 +39,7 @@ newtype Node = Node { ...@@ -39,7 +39,7 @@ newtype Node = Node {
, children :: Array String , children :: Array String
, id_ :: String , id_ :: String
, label :: String , label :: String
, size :: Int , size :: Number
, type_ :: String , type_ :: String
, x :: Number , x :: Number
, y :: Number , y :: Number
......
...@@ -9,7 +9,6 @@ import Data.Int (toNumber) ...@@ -9,7 +9,6 @@ import Data.Int (toNumber)
import Data.Map as Map import Data.Map as Map
import Data.Maybe (Maybe(..), fromJust) import Data.Maybe (Maybe(..), fromJust)
import Data.Nullable (null, Nullable) import Data.Nullable (null, Nullable)
import Data.Number as DN
import Data.Sequence as Seq import Data.Sequence as Seq
import Data.Set as Set import Data.Set as Set
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
...@@ -290,7 +289,11 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where ...@@ -290,7 +289,11 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
convert :: GET.GraphData -> Tuple (Maybe GET.MetaData) SigmaxT.SGraph convert :: GET.GraphData -> Tuple (Maybe GET.MetaData) SigmaxT.SGraph
convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges} convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges}
where where
nodes = foldMapWithIndex nodeFn $ GEU.normalizeNodeSize 1 10000 r.nodes normalizedNodes :: Array GEGT.Node
normalizedNodes = GEGT.Node <$> (GEU.normalizeNodeSizeDefault $ (\(GEGT.Node n) -> n) <$> r.nodes)
nodes :: Seq.Seq (Record SigmaxT.Node)
nodes = foldMapWithIndex nodeFn normalizedNodes
nodeFn :: Int -> GEGT.Node -> Seq.Seq (Record SigmaxT.Node)
nodeFn _i nn@(GEGT.Node n) = nodeFn _i nn@(GEGT.Node n) =
Seq.singleton { Seq.singleton {
borderColor: color borderColor: color
...@@ -302,7 +305,7 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges} ...@@ -302,7 +305,7 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges}
, highlighted: false , highlighted: false
, id : n.id_ , id : n.id_
, label : n.label , label : n.label
, size : DN.log (toNumber n.size + 1.0) , size : n.size
--, size: toNumber n.size --, size: toNumber n.size
, type : modeGraphType gargType , type : modeGraphType gargType
, x : n.x -- cos (toNumber i) , x : n.x -- cos (toNumber i)
...@@ -343,7 +346,8 @@ modeGraphType Types.Authors = "square" ...@@ -343,7 +346,8 @@ modeGraphType Types.Authors = "square"
modeGraphType Types.Institutes = "equilateral" modeGraphType Types.Institutes = "equilateral"
modeGraphType Types.Sources = "star" modeGraphType Types.Sources = "star"
--modeGraphType Types.Terms = "def" --modeGraphType Types.Terms = "def"
modeGraphType Types.Terms = "circle" --modeGraphType Types.Terms = "circle"
modeGraphType Types.Terms = "ccircle"
-------------------------------------------------------------- --------------------------------------------------------------
......
...@@ -509,7 +509,7 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt where ...@@ -509,7 +509,7 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt where
[ "text-info", "d-inline" ] $ [ "text-info", "d-inline" ] $
show termCount show termCount
, ,
H.text $ nbsp 1 <> "terms" H.text $ nbsp 1 <> "related terms"
, ,
-- Expand word cloud -- Expand word cloud
B.iconButton B.iconButton
...@@ -643,11 +643,12 @@ updateTermButtonCpt = here.component "updateTermButton" cpt where ...@@ -643,11 +643,12 @@ updateTermButtonCpt = here.component "updateTermButton" cpt where
badgeSize :: Number -> Number -> Number -> String badgeSize :: Number -> Number -> Number -> String
badgeSize minSize maxSize size = badgeSize minSize maxSize size =
let let
minFontSize = 10.0 minFontSize = 7.0
maxFontSize = 24.0 maxFontSize = 28.0
sizeScaled = (size - minSize) / (maxSize - minSize) -- in [0; 1] range sizeScaled = (size - minSize) / (maxSize - minSize) -- in [0; 1] range
scale' = DN.log (sizeScaled + 1.0) / (DN.log 2.0) -- in [0; 1] range --scale' = DN.log (sizeScaled + 1.0) / (DN.log 2.0) -- in [0; 1] range
scale = minFontSize + scale' * (maxFontSize - minFontSize) --scale = minFontSize + scale' * (maxFontSize - minFontSize)
scale = minFontSize + sizeScaled * (maxFontSize - minFontSize)
in in
show scale <> "px" show scale <> "px"
......
This diff is collapsed.
...@@ -9,7 +9,7 @@ import Effect (Effect) ...@@ -9,7 +9,7 @@ import Effect (Effect)
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Gargantext.Components.App.Store (Boxes) import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.Nodes.Corpus (fieldsCodeEditor) import Gargantext.Components.Corpus.CodeSection (fieldsCodeEditor)
import Gargantext.Components.Nodes.Corpus.Chart.Predefined as P import Gargantext.Components.Nodes.Corpus.Chart.Predefined as P
import Gargantext.Components.Nodes.Dashboard.Types as DT import Gargantext.Components.Nodes.Dashboard.Types as DT
import Gargantext.Components.Nodes.Types (FTFieldList(..), FTFieldsWithIndex(..), defaultField) import Gargantext.Components.Nodes.Types (FTFieldList(..), FTFieldsWithIndex(..), defaultField)
......
This diff is collapsed.
This diff is collapsed.
...@@ -5,9 +5,9 @@ import Gargantext.Prelude ...@@ -5,9 +5,9 @@ import Gargantext.Prelude
import Effect (Effect) import Effect (Effect)
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Gargantext.Components.App.Store (Boxes) import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.Corpus.CodeSection (loadCorpusWithChild)
import Gargantext.Components.NgramsTable.Loader (clearCache) import Gargantext.Components.NgramsTable.Loader (clearCache)
import Gargantext.Components.Node (NodePoly(..)) import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
import Gargantext.Components.Nodes.Lists.Tabs as Tabs import Gargantext.Components.Nodes.Lists.Tabs as Tabs
import Gargantext.Components.Nodes.Lists.Types (CacheState(..)) import Gargantext.Components.Nodes.Lists.Types (CacheState(..))
import Gargantext.Components.Table as Table import Gargantext.Components.Table as Table
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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