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",
"version": "0.0.6.8.2",
"version": "0.0.6.8.5",
"scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash",
......@@ -17,9 +17,9 @@
"clean": "rm -Rf output node_modules",
"clean-js": "rm -Rf node_modules",
"clean-ps": "rm -Rf output",
"server": "serve dist",
"server": "serve -l 8000 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:compile": "pulp build -- -g corefn",
"prod:dce": "zephyr -f Main.main",
......
......@@ -40,6 +40,7 @@ to generate this file without the comments in this block.
, "foreign"
, "foreign-object"
, "form-urlencoded"
, "formatters"
, "formula"
, "functions"
, "graphql-client"
......@@ -47,9 +48,7 @@ to generate this file without the comments in this block.
, "integers"
, "js-timers"
, "lists"
-- , "markdown"
, "markdown-it"
--, "markdown-smolder"
, "maybe"
, "media-types"
, "milkis"
......@@ -75,7 +74,6 @@ to generate this file without the comments in this block.
, "simple-json"
, "simple-json-generics"
, "simplecrypto"
-- , "smolder"
, "strings"
, "strings-extra"
, "stringutils"
......
......@@ -2,24 +2,90 @@ module Gargantext.Components.App (app) where
import Gargantext.Prelude
import Data.Tuple.Nested ((/\))
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.App.Store as AppStore
import Gargantext.Components.Router (router)
import Gargantext.Hooks (useHashRouter)
import Gargantext.Hooks.FirstEffect (useFirstEffect')
import Gargantext.Router as Router
import Gargantext.Sessions as Sessions
import Gargantext.Types (CacheParams, defaultCacheParams)
import Gargantext.Utils (getter)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Record as Record
import Toestand as T
here :: R2.Here
here = R2.here "Gargantext.Components.App"
app :: R2.Component ()
app = R.createElement appCpt
app :: R2.Leaf ()
app = R2.leaf appCpt
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
boxes <- AppStore.use
-- tasks <- T.useBox Nothing -- storage for asynchronous tasks reductor
......
......@@ -38,6 +38,7 @@ here = R2.here "Gargantext.Components.App.Store"
type Store =
( backend :: T.Box (Maybe Backend)
, errors :: T.Box (Array FrontendError)
, expandTableEdition :: T.Box Boolean
, forestOpen :: T.Box OpenNodes
, graphVersion :: T2.ReloadS
, handed :: T.Box Handed
......@@ -63,6 +64,7 @@ type Store =
type State =
( backend :: Maybe Backend
, errors :: Array FrontendError
, expandTableEdition :: Boolean
, forestOpen :: OpenNodes
, graphVersion :: T2.Reload
, handed :: Handed
......@@ -89,6 +91,7 @@ options :: Record State
options =
{ backend : Nothing
, errors : []
, expandTableEdition : false
, forestOpen : OpenNodes $ Set.empty
, graphVersion : T2.newReload
, handed : RightHanded
......
......@@ -20,24 +20,24 @@ type Props =
)
type Options =
( status :: ComponentStatus
, size :: Sizing
, variant :: ButtonVariant
, type :: String
( block :: Boolean
, className :: String
, block :: Boolean
, size :: Sizing
, status :: ComponentStatus
, title :: String
, type :: String
, variant :: ButtonVariant
)
options :: Record Options
options =
{ status : Enabled
, size : MediumSize
, variant : ButtonVariant Primary
, type : "button"
{ block : false
, className : ""
, block : false
, status : Enabled
, size : MediumSize
, title : ""
, type : "button"
, variant : ButtonVariant Primary
}
-- | Structural Component for the Bootstrap button
......
......@@ -24,6 +24,7 @@ type Options =
, overlay :: Boolean
, elevation :: Elevation
, variant :: Variant
, focusRing :: Boolean
)
options :: Record Options
......@@ -34,6 +35,7 @@ options =
, overlay : true
, elevation : Level0
, variant : Dark
, focusRing : true
}
-- | Structural Component for a simple Glyphicon element with call-to-action
......@@ -67,6 +69,9 @@ component = R.hooksComponent componentName cpt where
componentName <> "--overlay" $
""
, componentName <> "--" <> show props.elevation
, props.focusRing ?
componentName <> "--focus-ring" $
""
]
contentClassName = intercalate " "
......
......@@ -33,8 +33,8 @@ red :: Color
red = stringColor "red"
blue :: Color
blue = cssColor $ rgba 100 150 200 0.0
-- stringColor "blue"
blue = cssColor $ rgba 100 150 200 1.0
-- stringColor "blue"
magenta :: Color
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(..),
import Gargantext.Components.Forest.Tree.Node.Box (nodePopupView)
import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox)
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.Lang (Lang(EN))
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
import Gargantext.Config.REST (logRESTError)
import Gargantext.Context.Progress (asyncContext, asyncProgress)
import Gargantext.Ends (Frontends, url)
......
......@@ -166,7 +166,7 @@ updatePhyloCpt = here.component "updatePhylo" cpt where
defaultData = Phylo.UpdateData
{ proximity: 0.5
, synchrony: 0.5
, quality: 0.5
, quality: 0.8
, exportFilter: 3.0
, timeUnit: Phylo.Year $ Phylo.TimeUnitCriteria
{ period: 3
......
......@@ -39,7 +39,7 @@ newtype Node = Node {
, children :: Array String
, id_ :: String
, label :: String
, size :: Int
, size :: Number
, type_ :: String
, x :: Number
, y :: Number
......
......@@ -9,7 +9,6 @@ import Data.Int (toNumber)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromJust)
import Data.Nullable (null, Nullable)
import Data.Number as DN
import Data.Sequence as Seq
import Data.Set as Set
import Data.Tuple (Tuple(..))
......@@ -290,7 +289,11 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
convert :: GET.GraphData -> Tuple (Maybe GET.MetaData) SigmaxT.SGraph
convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges}
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) =
Seq.singleton {
borderColor: color
......@@ -302,7 +305,7 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges}
, highlighted: false
, id : n.id_
, label : n.label
, size : DN.log (toNumber n.size + 1.0)
, size : n.size
--, size: toNumber n.size
, type : modeGraphType gargType
, x : n.x -- cos (toNumber i)
......@@ -343,7 +346,8 @@ modeGraphType Types.Authors = "square"
modeGraphType Types.Institutes = "equilateral"
modeGraphType Types.Sources = "star"
--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
[ "text-info", "d-inline" ] $
show termCount
,
H.text $ nbsp 1 <> "terms"
H.text $ nbsp 1 <> "related terms"
,
-- Expand word cloud
B.iconButton
......@@ -643,11 +643,12 @@ updateTermButtonCpt = here.component "updateTermButton" cpt where
badgeSize :: Number -> Number -> Number -> String
badgeSize minSize maxSize size =
let
minFontSize = 10.0
maxFontSize = 24.0
minFontSize = 7.0
maxFontSize = 28.0
sizeScaled = (size - minSize) / (maxSize - minSize) -- in [0; 1] range
scale' = DN.log (sizeScaled + 1.0) / (DN.log 2.0) -- in [0; 1] range
scale = minFontSize + scale' * (maxFontSize - minFontSize)
--scale' = DN.log (sizeScaled + 1.0) / (DN.log 2.0) -- in [0; 1] range
--scale = minFontSize + scale' * (maxFontSize - minFontSize)
scale = minFontSize + sizeScaled * (maxFontSize - minFontSize)
in
show scale <> "px"
......
This diff is collapsed.
......@@ -9,7 +9,7 @@ import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
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.Dashboard.Types as DT
import Gargantext.Components.Nodes.Types (FTFieldList(..), FTFieldsWithIndex(..), defaultField)
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,9 +5,9 @@ import Gargantext.Prelude
import Effect (Effect)
import Effect.Aff (launchAff_)
import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.Corpus.CodeSection (loadCorpusWithChild)
import Gargantext.Components.NgramsTable.Loader (clearCache)
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
import Gargantext.Components.Nodes.Lists.Tabs as Tabs
import Gargantext.Components.Nodes.Lists.Types (CacheState(..))
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