Commit 61a19df3 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-warnings-cleanup

parents f794707a 5e03363b
...@@ -215,7 +215,7 @@ sigmaSettings = ...@@ -215,7 +215,7 @@ sigmaSettings =
, drawEdges: true , drawEdges: true
, drawLabels: true , drawLabels: true
, drawNodes: true , drawNodes: true
, enableEdgeHovering: true , enableEdgeHovering: false
, edgeHoverExtremities: true , edgeHoverExtremities: true
, edgeHoverColor: "edge" , edgeHoverColor: "edge"
, edgeHoverPrecision: 2.0 , edgeHoverPrecision: 2.0
...@@ -226,11 +226,11 @@ sigmaSettings = ...@@ -226,11 +226,11 @@ sigmaSettings =
, hideEdgesOnMove: true , hideEdgesOnMove: true
, labelSize : "fixed" , labelSize : "fixed"
, labelSizeRatio: 1.0 -- label size in ratio of node size , labelSizeRatio: 1.0 -- label size in ratio of node size
, labelThreshold: 1.0 -- min node cam size to start showing label , labelThreshold: 5.0 -- min node cam size to start showing label
, maxEdgeSize: 2.0 , maxEdgeSize: 1.0
, maxNodeSize: 10.0 , maxNodeSize: 7.0
, minEdgeSize: 0.5 -- in fact used in tina as edge size , minEdgeSize: 0.5 -- in fact used in tina as edge size
, minNodeSize: 5.0 , minNodeSize: 0.1
, mouseEnabled: true , mouseEnabled: true
, mouseZoomDuration: 150.0 , mouseZoomDuration: 150.0
, nodeBorderColor: "node" -- choices: 'default' color vs. node color , nodeBorderColor: "node" -- choices: 'default' color vs. node color
......
...@@ -17,6 +17,7 @@ import DOM.Simple.Types (Element) ...@@ -17,6 +17,7 @@ import DOM.Simple.Types (Element)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as RH import Reactix.DOM.HTML as RH
import Math (log)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Sigmax (Sigma) import Gargantext.Hooks.Sigmax (Sigma)
...@@ -207,7 +208,7 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxTypes.Graph {nodes, edges} ...@@ -207,7 +208,7 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxTypes.Graph {nodes, edges}
nodeFn i (GET.Node n) = nodeFn i (GET.Node n) =
Seq.singleton Seq.singleton
{ id : n.id_ { id : n.id_
, size : toNumber n.size , size : log (toNumber n.size + 1.0)
, label : n.label , label : n.label
, x : n.x -- cos (toNumber i) , x : n.x -- cos (toNumber i)
, y : n.y -- sin (toNumber i) , y : n.y -- sin (toNumber i)
......
...@@ -62,6 +62,7 @@ newtype MetaData = MetaData ...@@ -62,6 +62,7 @@ newtype MetaData = MetaData
, legend :: Array Legend , legend :: Array Legend
, corpusId :: Array Int , corpusId :: Array Int
, listId :: ListId , listId :: ListId
, version :: Int
} }
getLegend :: GraphData -> Maybe (Array Legend) getLegend :: GraphData -> Maybe (Array Legend)
...@@ -97,7 +98,7 @@ initialGraphData = GraphData { ...@@ -97,7 +98,7 @@ initialGraphData = GraphData {
nodes: [] nodes: []
, edges: [] , edges: []
, sides: [] , sides: []
, metaData : Just $ MetaData {title : "", legend : [], corpusId : [], listId : 0} , metaData : Just $ MetaData {title : "", legend : [], corpusId : [], listId : 0, version : 0}
} }
instance decodeJsonGraphData :: DecodeJson GraphData where instance decodeJsonGraphData :: DecodeJson GraphData where
...@@ -134,7 +135,8 @@ instance decodeJsonMetaData :: DecodeJson MetaData where ...@@ -134,7 +135,8 @@ instance decodeJsonMetaData :: DecodeJson MetaData where
legend <- obj .: "legend" legend <- obj .: "legend"
corpusId <- obj .: "corpusId" corpusId <- obj .: "corpusId"
listId <- obj .: "listId" listId <- obj .: "listId"
pure $ MetaData { title, legend, corpusId, listId} version <- obj .: "version"
pure $ MetaData { title, legend, corpusId, listId, version}
instance decodeJsonLegend :: DecodeJson Legend where instance decodeJsonLegend :: DecodeJson Legend where
......
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