Commit 5006bca0 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski
parent d576e672
......@@ -6,7 +6,7 @@ import Record.Unsafe (unsafeSet)
import Unsafe.Coerce (unsafeCoerce)
import Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
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)
......@@ -192,9 +192,9 @@ data TreeNode = TreeNode { name :: String
instance decodeTreeNode :: DecodeJson TreeNode where
decodeJson json = do
obj <- decodeJson json
name <- obj .? "label"
value <- obj .? "value"
children <- obj .? "children"
name <- obj .: "label"
value <- obj .: "value"
children <- obj .: "children"
pure $ TreeNode {name, value, children}
......
-- TODO: this module should be replaced by FacetsTable
module Gargantext.Components.DocsTable where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.?), (:=), (~>))
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Array (drop, take)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
......@@ -102,18 +102,18 @@ newtype Hyperdata = Hyperdata
instance decodeHyperdata :: DecodeJson Hyperdata where
decodeJson json = do
obj <- decodeJson json
title <- obj .? "title"
source <- obj .? "source"
pub_year <- obj .? "publication_year"
title <- obj .: "title"
source <- obj .: "source"
pub_year <- obj .: "publication_year"
pure $ Hyperdata { title,source, pub_year}
instance decodeResponse :: DecodeJson Response where
decodeJson json = do
obj <- decodeJson json
cid <- obj .? "id"
favorite <- obj .? "favorite"
ngramCount <- obj .? "id"
hyperdata <- obj .? "hyperdata"
cid <- obj .: "id"
favorite <- obj .: "favorite"
ngramCount <- obj .: "id"
hyperdata <- obj .: "hyperdata"
pure $ Response { cid, category: decodeCategory favorite, ngramCount, hyperdata }
......
......@@ -4,7 +4,7 @@
module Gargantext.Components.FacetsTable where
import Control.Monad.Cont.Trans (lift)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.?), (:=), (~>))
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Array (filter, (!!))
import Data.Foldable (intercalate)
import Data.Generic.Rep (class Generic)
......@@ -54,7 +54,7 @@ newtype SearchResults = SearchResults { results :: Array Response }
instance decodeSearchResults :: DecodeJson SearchResults where
decodeJson json = do
obj <- decodeJson json
results <- obj .? "results"
results <- obj .: "results"
pure $ SearchResults {results}
type Props =
......@@ -129,16 +129,16 @@ newtype Hyperdata = Hyperdata
--instance decodeHyperdata :: DecodeJson Hyperdata where
-- decodeJson json = do
-- obj <- decodeJson json
-- title <- obj .? "title"
-- source <- obj .? "source"
-- title <- obj .: "title"
-- source <- obj .: "source"
-- pure $ Hyperdata { title,source }
instance decodePair :: DecodeJson Pair where
decodeJson json = do
obj <- decodeJson json
id <- obj .? "id"
label <- obj .? "label"
id <- obj .: "id"
label <- obj .: "label"
pure $ Pair { id, label }
instance decodeHyperdata :: DecodeJson Hyperdata where
......@@ -152,23 +152,23 @@ instance decodeHyperdata :: DecodeJson Hyperdata where
instance decodeResponse :: DecodeJson Response where
decodeJson json = do
obj <- decodeJson json
id <- obj .? "id"
-- date <- obj .? "date" -- TODO
id <- obj .: "id"
-- date <- obj .: "date" -- TODO
date <- pure "2018"
score <- obj .? "score"
hyperdata <- obj .? "hyperdata"
pairs <- obj .? "pairs"
score <- obj .: "score"
hyperdata <- obj .: "hyperdata"
pairs <- obj .: "pairs"
pure $ Response { id, date, score, hyperdata, pairs }
-}
instance decodeResponse :: DecodeJson Response where
decodeJson json = do
obj <- decodeJson json
id <- obj .? "id"
created <- obj .? "created"
hyperdata <- obj .? "hyperdata"
favorite <- obj .? "favorite"
--ngramCount <- obj .? "ngramCount"
id <- obj .: "id"
created <- obj .: "created"
hyperdata <- obj .: "hyperdata"
favorite <- obj .: "favorite"
--ngramCount <- obj .: "ngramCount"
let ngramCount = 1
pure $ Response { id, created, hyperdata, category: decodeCategory favorite, ngramCount}
......
......@@ -8,7 +8,7 @@ import Data.Sequence (Seq)
import Data.Traversable (foldMap)
import Reactix as R
import Reactix.DOM.HTML as RH
import Gargantext.Components.GraphExplorer.Types (Cluster(..), MetaData(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData, intColor)
import Gargantext.Components.GraphExplorer.Types (Legend(..), intColor)
type Props = ( items :: Seq Legend )
......
......@@ -3,7 +3,7 @@ module Gargantext.Components.GraphExplorer.Types where
import Prelude
import Partial.Unsafe (unsafePartial)
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Array ((!!), length)
import Data.Maybe (Maybe(..), fromJust)
import Data.Newtype (class Newtype)
......@@ -152,13 +152,13 @@ initialState = fromStateGlue initialStateGlue
instance decodeJsonGraphData :: DecodeJson GraphData where
decodeJson json = do
obj <- decodeJson json
nodes <- obj .? "nodes"
edges <- obj .? "edges"
nodes <- obj .: "nodes"
edges <- obj .: "edges"
-- TODO: sides
metadata <- obj .? "metadata"
corpusIds <- metadata .? "corpusId"
listId' <- metadata .? "listId"
metaData <- obj .? "metadata"
metadata <- obj .: "metadata"
corpusIds <- metadata .: "corpusId"
listId' <- metadata .: "listId"
metaData <- obj .: "metadata"
let side x = GraphSideCorpus { corpusId: x, corpusLabel: "Publications", listId : listId'}
let sides = side <$> corpusIds
pure $ GraphData { nodes, edges, sides, metaData }
......@@ -166,49 +166,49 @@ instance decodeJsonGraphData :: DecodeJson GraphData where
instance decodeJsonNode :: DecodeJson Node where
decodeJson json = do
obj <- decodeJson json
id_ <- obj .? "id"
type_ <- obj .? "type"
label <- obj .? "label"
size <- obj .? "size"
attributes <- obj .? "attributes"
x <- obj .? "x_coord"
y <- obj .? "y_coord"
id_ <- obj .: "id"
type_ <- obj .: "type"
label <- obj .: "label"
size <- obj .: "size"
attributes <- obj .: "attributes"
x <- obj .: "x_coord"
y <- obj .: "y_coord"
pure $ Node { id_, type_, size, label, attributes, x, y }
instance decodeJsonMetaData :: DecodeJson MetaData where
decodeJson json = do
obj <- decodeJson json
title <- obj .? "title"
legend <- obj .? "legend"
corpusId <- obj .? "corpusId"
listId <- obj .? "listId"
title <- obj .: "title"
legend <- obj .: "legend"
corpusId <- obj .: "corpusId"
listId <- obj .: "listId"
pure $ MetaData { title, legend, corpusId, listId}
instance decodeJsonLegend :: DecodeJson Legend where
decodeJson json = do
obj <- decodeJson json
id_ <- obj .? "id"
color <- obj .? "color"
label <- obj .? "label"
id_ <- obj .: "id"
color <- obj .: "color"
label <- obj .: "label"
pure $ Legend { id_, color, label }
instance decodeJsonCluster :: DecodeJson Cluster where
decodeJson json = do
obj <- decodeJson json
clustDefault <- obj .? "clust_default"
clustDefault <- obj .: "clust_default"
pure $ Cluster { clustDefault }
instance decodeJsonEdge :: DecodeJson Edge where
decodeJson json = do
obj <- decodeJson json
id_ <- obj .? "id"
source <- obj .? "source"
target <- obj .? "target"
weight <- obj .? "weight"
confluence <- obj .? "confluence"
id_ <- obj .: "id"
source <- obj .: "source"
target <- obj .: "target"
weight <- obj .: "weight"
confluence <- obj .: "confluence"
pure $ Edge { id_, source, target, weight, confluence }
newtype Legend = Legend {id_ ::Int , color :: String, label :: String}
......
......@@ -2,7 +2,7 @@ module Gargantext.Components.Login.Types where
import Prelude
import Data.Argonaut ( class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject
, (.?), (.??), (:=), (~>)
, (.:), (.:!), (:=), (~>)
)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
......@@ -44,21 +44,21 @@ _AuthData = iso (\(AuthData v) -> v) AuthData
instance decodeAuthInvalid :: DecodeJson AuthInvalid where
decodeJson json = do
obj <- decodeJson json
message <- obj .? "message"
message <- obj .: "message"
pure $ AuthInvalid {message}
instance decodeAuthResponse :: DecodeJson AuthResponse where
decodeJson json = do
obj <- decodeJson json
valid <- obj .?? "valid"
inval <- obj .?? "inval"
valid <- obj .:! "valid"
inval <- obj .:! "inval"
pure $ AuthResponse {valid, inval}
instance decodeAuthData :: DecodeJson AuthData where
decodeJson json = do
obj <- decodeJson json
token <- obj .? "token"
tree_id <- obj .? "tree_id"
token <- obj .: "token"
tree_id <- obj .: "tree_id"
pure $ AuthData {token, tree_id}
instance encodeAuthRequest :: EncodeJson AuthRequest where
......
......@@ -2,7 +2,7 @@ module Gargantext.Components.Node
where
import Gargantext.Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
newtype NodePoly a =
NodePoly { id :: Int
......@@ -19,14 +19,14 @@ instance decodeNodePoly :: (DecodeJson a)
=> DecodeJson (NodePoly a) where
decodeJson json = do
obj <- decodeJson json
id <- obj .? "id"
typename <- obj .? "typename"
userId <- obj .? "userId"
parentId <- obj .? "parentId"
name <- obj .? "name"
date <- obj .? "date"
hyperdata <- obj .? "hyperdata"
id <- obj .: "id"
typename <- obj .: "typename"
userId <- obj .: "userId"
parentId <- obj .: "parentId"
name <- obj .: "name"
date <- obj .: "date"
hyperdata <- obj .: "hyperdata"
hyperdata' <- decodeJson hyperdata
pure $ NodePoly { id : id
......@@ -43,6 +43,6 @@ newtype HyperdataList = HyperdataList { preferences :: String}
instance decodeHyperdataList :: DecodeJson HyperdataList where
decodeJson json = do
obj <- decodeJson json
pref <- obj .? "preferences"
pref <- obj .: "preferences"
pure $ HyperdataList { preferences : pref}
......@@ -2,7 +2,7 @@ module Gargantext.Pages.Annuaire where
import Gargantext.Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.?), (.??))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.:!))
import Data.Array (head)
import Data.Either (Either(..))
import Data.Lens (Prism', prism)
......@@ -177,8 +177,8 @@ data HyperdataAnnuaire = HyperdataAnnuaire
instance decodeHyperdataAnnuaire :: DecodeJson HyperdataAnnuaire where
decodeJson json = do
obj <- decodeJson json
title <- obj .?? "title"
desc <- obj .?? "desc"
title <- obj .:! "title"
desc <- obj .:! "desc"
pure $ HyperdataAnnuaire { title, desc }
------------------------------------------------------------------------------
......@@ -194,13 +194,13 @@ newtype AnnuaireInfo = AnnuaireInfo { id :: Int
instance decodeAnnuaireInfo :: DecodeJson AnnuaireInfo where
decodeJson json = do
obj <- decodeJson json
id <- obj .? "id"
typename <- obj .? "typename"
userId <- obj .? "userId"
parentId <- obj .? "parentId"
name <- obj .? "name"
date <- obj .? "date"
hyperdata <- obj .? "hyperdata"
id <- obj .: "id"
typename <- obj .: "typename"
userId <- obj .: "userId"
parentId <- obj .: "parentId"
name <- obj .: "name"
date <- obj .: "date"
hyperdata <- obj .: "hyperdata"
pure $ AnnuaireInfo { id : id
, typename : typename
, userId : userId
......
......@@ -2,19 +2,12 @@ module Gargantext.Pages.Annuaire.User.Contacts.Types where
import Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.?), (.??))
import Data.Either (Either(..))
import Data.Lens (Lens', Prism', lens, prism)
import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Map (Map(..))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.:!))
import Data.Maybe (Maybe, fromMaybe)
import Data.Map (Map)
import React (ReactElement)
import React.DOM (div)
import Gargantext.Components.Loader as Loader
import Gargantext.Components.Tab as Tab
import Gargantext.Utils.DecodeMaybe ((.?|))
import Data.Newtype
import Data.Newtype (class Newtype)
-- TODO: should it be a NodePoly HyperdataContact ?
newtype Contact = Contact {
......@@ -43,11 +36,11 @@ instance decodeContactWho :: DecodeJson ContactWho
where
decodeJson json = do
obj <- decodeJson json
idWho <- obj .?? "id"
firstName <- obj .?? "firstName"
lastName <- obj .?? "lastName"
keywords <- obj .?? "keywords"
freetags <- obj .?? "freetags"
idWho <- obj .:! "id"
firstName <- obj .:! "firstName"
lastName <- obj .:! "lastName"
keywords <- obj .:! "keywords"
freetags <- obj .:! "freetags"
let k = fromMaybe [] keywords
let f = fromMaybe [] freetags
......@@ -75,15 +68,15 @@ instance decodeContactWhere :: DecodeJson ContactWhere
where
decodeJson json = do
obj <- decodeJson json
organization <- obj .?? "organization"
labTeamDepts <- obj .?? "labTeamDepts"
role <- obj .?? "role"
office <- obj .?? "office"
country <- obj .?? "country"
city <- obj .?? "city"
touch <- obj .?? "touch"
entry <- obj .?? "entry"
exit <- obj .?? "exit"
organization <- obj .:! "organization"
labTeamDepts <- obj .:! "labTeamDepts"
role <- obj .:! "role"
office <- obj .:! "office"
country <- obj .:! "country"
city <- obj .:! "city"
touch <- obj .:! "touch"
entry <- obj .:! "entry"
exit <- obj .:! "exit"
let o = fromMaybe [] organization
let l = fromMaybe [] labTeamDepts
......@@ -101,9 +94,9 @@ instance decodeContactTouch :: DecodeJson ContactTouch
where
decodeJson json = do
obj <- decodeJson json
mail <- obj .?? "mail"
phone <- obj .?? "phone"
url <- obj .?? "url"
mail <- obj .:! "mail"
phone <- obj .:! "phone"
url <- obj .:! "url"
pure $ ContactTouch {mail, phone, url}
......@@ -123,14 +116,14 @@ instance decodeHyperdataContact :: DecodeJson HyperdataContact
where
decodeJson json = do
obj <- decodeJson json
bdd <- obj .?? "bdd"
who <- obj .?? "who"
ou <- obj .?? "where"
title <- obj .?? "title"
source <- obj .?? "source"
lastValidation <- obj .?? "lastValidation"
uniqId <- obj .?? "uniqId"
uniqIdBdd <- obj .?? "uniqIdBdd"
bdd <- obj .:! "bdd"
who <- obj .:! "who"
ou <- obj .:! "where"
title <- obj .:! "title"
source <- obj .:! "source"
lastValidation <- obj .:! "lastValidation"
uniqId <- obj .:! "uniqId"
uniqIdBdd <- obj .:! "uniqIdBdd"
let ou' = fromMaybe [] ou
......@@ -155,13 +148,13 @@ instance decodeUserHyperData :: (DecodeJson c, DecodeJson s) =>
instance decodeUser :: DecodeJson Contact where
decodeJson json = do
obj <- decodeJson json
id <- obj .? "id"
id <- obj .: "id"
typename <- obj .?| "typename"
userId <- obj .?? "userId"
userId <- obj .:! "userId"
parentId <- obj .?| "parentId"
name <- obj .?? "name"
name <- obj .:! "name"
date <- obj .?| "date"
hyperdata <- obj .? "hyperdata"
hyperdata <- obj .: "hyperdata"
pure $ Contact { id, typename, userId
, parentId, name, date
, hyperdata
......
module Gargantext.Pages.Corpus.Chart.Histo where
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff)
import Gargantext.Config -- (End(..), Path(..), TabType, toUrl)
......@@ -30,7 +30,7 @@ newtype ChartMetrics = ChartMetrics
instance decodeChartMetrics :: DecodeJson ChartMetrics where
decodeJson json = do
obj <- decodeJson json
d <- obj .? "data"
d <- obj .: "data"
pure $ ChartMetrics { "data": d }
newtype HistoMetrics = HistoMetrics
......@@ -41,8 +41,8 @@ newtype HistoMetrics = HistoMetrics
instance decodeHistoMetrics :: DecodeJson HistoMetrics where
decodeJson json = do
obj <- decodeJson json
d <- obj .? "dates"
c <- obj .? "count"
d <- obj .: "dates"
c <- obj .: "count"
pure $ HistoMetrics { dates : d , count: c}
type Loaded = HistoMetrics
......
module Gargantext.Pages.Corpus.Chart.Metrics where
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Map as Map
import Data.Map (Map)
import Data.Maybe (Maybe(..))
......@@ -39,10 +39,10 @@ newtype Metric = Metric
instance decodeMetric :: DecodeJson Metric where
decodeJson json = do
obj <- decodeJson json
label <- obj .? "label"
x <- obj .? "x"
y <- obj .? "y"
cat <- obj .? "cat"
label <- obj .: "label"
x <- obj .: "x"
y <- obj .: "y"
cat <- obj .: "cat"
pure $ Metric { label, x, y, cat }
newtype Metrics = Metrics
......@@ -52,7 +52,7 @@ newtype Metrics = Metrics
instance decodeMetrics :: DecodeJson Metrics where
decodeJson json = do
obj <- decodeJson json
d <- obj .? "data"
d <- obj .: "data"
pure $ Metrics { "data": d }
type Loaded = Array Metric
......@@ -76,16 +76,16 @@ scatterOptions metrics = Options
map2series ms = toSeries <$> Map.toUnfoldable ms
where
-- TODO colors are not respected yet
toSeries (Tuple k ms) =
seriesScatterD2 {symbolSize: 5.0} (toSerie color <$> ms)
toSeries (Tuple k ms') =
seriesScatterD2 {symbolSize: 5.0} (toSerie color <$> ms')
where
color =
case k of
StopTerm -> red
GraphTerm -> green
CandidateTerm -> grey
toSerie color (Metric {label,x,y}) =
dataSerie { name: label, itemStyle: itemStyle {color}
toSerie color' (Metric {label,x,y}) =
dataSerie { name: label, itemStyle: itemStyle {color: color'}
-- , label: {show: true}
, value: [x,y]
}
......@@ -108,8 +108,8 @@ metricsLoadView :: R.State Int -> Path -> R.Element
metricsLoadView setReload p = R.createElement el p []
where
el = R.hooksComponent "MetricsLoadedView" cpt
cpt p _ = do
useLoader p getMetrics $ \{loaded} ->
cpt p' _ = do
useLoader p' getMetrics $ \{loaded} ->
loadedMetricsView setReload loaded
loadedMetricsView :: R.State Int -> Loaded -> R.Element
......
module Gargantext.Pages.Corpus.Chart.Pie where
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Array (zip, filter)
import Data.Array as A
import Data.Maybe (Maybe(..))
......@@ -34,7 +34,7 @@ newtype ChartMetrics = ChartMetrics
instance decodeChartMetrics :: DecodeJson ChartMetrics where
decodeJson json = do
obj <- decodeJson json
d <- obj .? "data"
d <- obj .: "data"
pure $ ChartMetrics { "data": d }
newtype HistoMetrics = HistoMetrics
......@@ -45,8 +45,8 @@ newtype HistoMetrics = HistoMetrics
instance decodeHistoMetrics :: DecodeJson HistoMetrics where
decodeJson json = do
obj <- decodeJson json
d <- obj .? "dates"
c <- obj .? "count"
d <- obj .: "dates"
c <- obj .: "count"
pure $ HistoMetrics { dates : d , count: c}
type Loaded = HistoMetrics
......
module Gargantext.Pages.Corpus.Chart.Tree where
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff)
import Gargantext.Config -- (End(..), Path(..), TabType, toUrl)
......@@ -33,7 +33,7 @@ newtype Metrics = Metrics
instance decodeMetrics :: DecodeJson Metrics where
decodeJson json = do
obj <- decodeJson json
d <- obj .? "data"
d <- obj .: "data"
pure $ Metrics { "data": d }
type Loaded = Array TreeNode
......
module Gargantext.Pages.Lists.Tabs.Types where
import Data.Argonaut (class DecodeJson, decodeJson, (.?), (.??))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.:!))
import Data.Maybe (Maybe(..))
--------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Loader as Loader
newtype CorpusInfo = CorpusInfo { title :: String
, desc :: String
......@@ -35,11 +34,11 @@ corpusInfoDefault = NodePoly { id : 0
instance decodeCorpusInfo :: DecodeJson CorpusInfo where
decodeJson json = do
obj <- decodeJson json
title <- obj .? "title"
desc <- obj .? "desc"
query <- obj .? "query"
authors <- obj .? "authors"
chart <- obj .?? "chart"
title <- obj .: "title"
desc <- obj .: "desc"
query <- obj .: "query"
authors <- obj .: "authors"
chart <- obj .:! "chart"
let totalRecords = 47361 -- TODO
pure $ CorpusInfo {title, desc, query, authors, chart, totalRecords}
......
module Gargantext.Pages.Texts.Tabs.Types where
import Data.Argonaut (class DecodeJson, decodeJson, (.?), (.??))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.:!))
import Data.Maybe (Maybe(..))
--------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Loader as Loader
newtype CorpusInfo = CorpusInfo { title :: String
, desc :: String
......@@ -35,11 +34,11 @@ corpusInfoDefault = NodePoly { id : 0
instance decodeCorpusInfo :: DecodeJson CorpusInfo where
decodeJson json = do
obj <- decodeJson json
title <- obj .? "title"
desc <- obj .? "desc"
query <- obj .? "query"
authors <- obj .? "authors"
chart <- obj .?? "chart"
title <- obj .: "title"
desc <- obj .: "desc"
query <- obj .: "query"
authors <- obj .: "authors"
chart <- obj .:! "chart"
let totalRecords = 47361 -- TODO
pure $ CorpusInfo {title, desc, query, authors, chart, totalRecords}
......
module Gargantext.Types where
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson
, jsonEmptyObject, (:=), (~>), (.?), (.??) )
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson )
import Data.Maybe (Maybe(..))
import Data.Either (Either(..))
import Prim.Row (class Union)
......
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