Commit a051df3e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graph] add gexf file download button

parent 9e7d3ff3
......@@ -140,6 +140,7 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
}
, mSidebar mMetaData { frontends
, graph
, graphId
, graphVersion
, removedNodeIds: controls.removedNodeIds
, session
......@@ -171,6 +172,7 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
mSidebar :: Maybe GET.MetaData
-> { frontends :: Frontends
, graph :: SigmaxT.SGraph
, graphId :: GraphId
, graphVersion :: R.State Int
, removedNodeIds :: R.State SigmaxT.NodeIds
, showSidePanel :: GET.SidePanelState
......@@ -178,9 +180,10 @@ explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt
, session :: Session }
-> R.Element
mSidebar Nothing _ = RH.div {} []
mSidebar (Just metaData) {frontends, graph, graphVersion, removedNodeIds, session, selectedNodeIds, showSidePanel} =
mSidebar (Just metaData) {frontends, graph, graphId, graphVersion, removedNodeIds, session, selectedNodeIds, showSidePanel} =
Sidebar.sidebar { frontends
, graph
, graphId
, graphVersion
, metaData
, removedNodeIds
......
......@@ -24,15 +24,18 @@ import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.Nodes.Corpus.Graph.Tabs as GT
import Gargantext.Components.RandomText (words)
import Gargantext.Data.Array (mapMaybe)
import Gargantext.Ends (Frontends)
import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session)
import Gargantext.Types (CTabNgramType, TabSubType(..), TabType(..), TermList(..), modeTabType)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
type Props =
( frontends :: Frontends
, graph :: SigmaxT.SGraph
, graphId :: Int
, graphVersion :: R.State Int
, metaData :: GET.MetaData
, removedNodeIds :: R.State SigmaxT.NodeIds
......@@ -64,6 +67,11 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
[ RH.div { className: "", role: "tabpanel" }
(Seq.toUnfoldable $ (Seq.map (badge props.selectedNodeIds) (badges props.graph props.selectedNodeIds)))
]
, RH.div { className: "gexf" } [
RH.a { className: "btn btn-default"
, href: gexfHref props.session props.graphId
, target: "_blank" } [ RH.text "Download GEXF" ]
]
, RH.div { className: "tab-content" }
[
removeButton "Remove candidate" CandidateTerm props nodesMap
......@@ -123,6 +131,9 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
snd props.removedNodeIds $ const $ fst props.selectedNodeIds
snd props.selectedNodeIds $ const SigmaxT.emptyNodeIds
gexfHref :: Session -> Int -> String
gexfHref session graphId = url session $ Routes.NodeAPI GT.Graph (Just graphId) "gexf"
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge (_ /\ setNodeIds) {id, label} =
......
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