[graph explorer] [WIP] attempts to fixes for graph snapshot

parent 6adf6f7e
Pipeline #3599 failed with stage
in 0 seconds
......@@ -80,10 +80,11 @@ instance JSON.WriteForeign Node where
newtype Edge = Edge {
confluence :: Number
, id_ :: String
, source :: String
, target :: String
, weight :: Number
, hidden :: Maybe Boolean
, id_ :: String
, source :: String
, target :: String
, weight :: Number
}
......
......@@ -265,7 +265,7 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
-- todo Cache this?
R.useEffect' $ do
here.log2 "[graphView] transformedGraph" $ transformGraph graph' transformParams
--here.log2 "[graphView] transformedGraph" $ transformGraph graph' transformParams
--let louvain = Louvain.louvain unit in
--let cluster = Louvain.init louvain (SigmaxT.louvainNodes graph') (SigmaxT.louvainEdges graph') in
......
......@@ -25,7 +25,7 @@ import Gargantext.Utils.Lens as GUL
import Gargantext.Utils.Seq as GUS
stEdgeToGET :: Record ST.Edge -> GEGT.Edge
stEdgeToGET { _original } = _original
stEdgeToGET { _original: GEGT.Edge original, hidden } = GEGT.Edge $ original { hidden = Just hidden }
stNodeToGET :: Record ST.Node -> GEGT.Node
stNodeToGET { id, label, x, y, _original: GEGT.Node { attributes, size, type_ } } = GEGT.Node {
......
......@@ -72,16 +72,16 @@ queryGql session name q = do
-- Schema
type Schema
= { imt_schools :: {} ==> Array GQLIMT.School
= { annuaire_contacts :: { contact_id :: Int } ==> Array AnnuaireContact
, contexts :: { context_id :: Int, node_id :: Int } ==> Array GQLCTX.NodeContext
, contexts_for_ngrams :: { corpus_id :: Int, ngrams_ids :: Array Int } ==> Array GQLCTX.Context
, nodes :: { node_id :: Int } ==> Array Node
, imt_schools :: {} ==> Array GQLIMT.School
, node_parent :: { node_id :: Int, parent_type :: String } ==> Array Node -- TODO: parent_type :: NodeType
, nodes :: { node_id :: Int } ==> Array Node
, user_infos :: { user_id :: Int } ==> Array UserInfo
, users :: { user_id :: Int } ==> Array User
, tree :: { root_id :: Int } ==> TreeFirstLevel
, annuaire_contacts :: { contact_id :: Int } ==> Array AnnuaireContact
, team :: { team_node_id :: Int } ==> Team
, tree :: { root_id :: Int } ==> TreeFirstLevel
}
type Mutation
......
......@@ -86,7 +86,7 @@ nodeContextQuery
type ContextsForNgramsQuery
= { contexts_for_ngrams :: Args
{ corpus_id :: Var "corpus_id" Int
, ngrams_ids :: Var "ngrams_ids" (Array Int)}
, ngrams_ids :: Var "ngrams_ids" (Array Int) }
{ c_id :: Unit
, c_name :: Unit
, c_typename :: Unit
......
......@@ -108,11 +108,11 @@ getNodeContext session context_id node_id = do
Nothing -> pure $ Left $ CustomError "no node context found"
Just context -> pure $ Right context -- TODO: error handling
getContextsForNgrams :: Session -> Int -> Array Int -> AffRESTError (Array GQLCTX.Context)
getContextsForNgrams session corpus_id ngrams_ids = do
{ contexts_for_ngrams } <- queryGql session "get contexts for ngrams" $
GQLCTX.contextsForNgramsQuery `withVars` { corpus_id, ngrams_ids }
pure $ Right contexts_for_ngrams
-- getContextsForNgrams :: Session -> Int -> Array Int -> AffRESTError (Array GQLCTX.Context)
-- getContextsForNgrams session corpus_id ngrams_ids = do
-- { contexts_for_ngrams } <- queryGql session "get contexts for ngrams" $
-- GQLCTX.contextsForNgramsQuery `withVars` { corpus_id, ngrams_ids }
-- pure $ Right contexts_for_ngrams
updateNodeContextCategory :: Session -> Int -> Int -> Int -> AffRESTError Int
updateNodeContextCategory session context_id node_id category = do
......
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