Commit e6298f58 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[GRAPH] Version number of List in Graph Type

parent 6e9a3233
Pipeline #4655 failed with stage
in 9 minutes and 23 seconds
......@@ -83,11 +83,23 @@ instance ToSchema LegendField where
declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "_lf_")
makeLenses ''LegendField
---------------------------------------------------------------
type Version = Int
data ListForGraph = ListForGraph { _lfg_listId :: ListId
, _lfg_version :: Version
} deriving (Show, Generic)
$(deriveJSON (unPrefix "_lfg_") ''ListForGraph)
instance ToSchema ListForGraph where
declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "_lfg_")
makeLenses ''ListForGraph
--
data GraphMetadata = GraphMetadata { _gm_title :: Text -- title of the graph
, _gm_corpusId :: [NodeId] -- we can map with different corpus
, _gm_legend :: [LegendField] -- legend of the Graph
, _gm_listId :: ListId
, _gm_list :: ListForGraph
, _gm_version :: Int
}
deriving (Show, Generic)
......
......@@ -98,12 +98,13 @@ getGraph uId nId = do
computeGraph :: CorpusId -> NgramsType -> Int -> GargServer (Get '[JSON] Graph)
computeGraph cId nt v = do
lId <- defaultList cId
v' <- currentVersion
let metadata = GraphMetadata "Title" [cId]
[ LegendField 1 "#FFF" "Cluster"
, LegendField 2 "#FFF" "Cluster"
]
lId
(ListForGraph lId v')
v
-- (map (\n -> LegendField n "#FFFFFF" (pack $ show n)) [1..10])
......
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