Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
9b1ef410
Commit
9b1ef410
authored
Oct 12, 2022
by
Przemyslaw Kaminski
Committed by
Alexandre Delanoë
Oct 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] some settings refactorings, label size threshold at 2
parent
757a3597
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
107 deletions
+112
-107
Resources.purs
src/Gargantext/Components/GraphExplorer/Resources.purs
+107
-104
Store.purs
src/Gargantext/Components/GraphExplorer/Store.purs
+1
-1
Sigma.js
src/Gargantext/Hooks/Sigmax/Sigma.js
+4
-2
No files found.
src/Gargantext/Components/GraphExplorer/Resources.purs
View file @
9b1ef410
...
@@ -207,26 +207,26 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
...
@@ -207,26 +207,26 @@ drawGraphCpt = R.memo' $ here.component "graph" cpt where
type SigmaSettings =
type SigmaSettings =
( animationsTime :: Number
(
--
animationsTime :: Number
, autoRescale :: Boolean
--
, autoRescale :: Boolean
, autoResize :: Boolean
--
, autoResize :: Boolean
, batchEdgesDrawing :: Boolean
--
, batchEdgesDrawing :: Boolean
, borderSize :: Number
--
, borderSize :: Number
-- , canvasEdgesBatchSize :: Number
-- , canvasEdgesBatchSize :: Number
-- , clone :: Boolean
-- , clone :: Boolean
-- , defaultEdgeColor :: String
-- , defaultEdgeColor :: String
, defaultEdgeHoverColor :: String
--
, defaultEdgeHoverColor :: String
,
defaultEdgeType :: String
defaultEdgeType :: String
, defaultHoverLabelBGColor :: String
--
, defaultHoverLabelBGColor :: String
, defaultHoverLabelColor :: String
--
, defaultHoverLabelColor :: String
, defaultLabelColor :: String
--
, defaultLabelColor :: String
-- , defaultLabelHoverColor :: String
-- , defaultLabelHoverColor :: String
, defaultLabelSize :: Number
, defaultLabelSize :: Number
, defaultNodeBorderColor :: String
--
, defaultNodeBorderColor :: String
, defaultNodeColor :: String
, defaultNodeColor :: String
-- , defaultNodeHoverColor :: String
-- , defaultNodeHoverColor :: String
-- , defaultNodeType :: String
-- , defaultNodeType :: String
, doubleClickEnabled :: Boolean
--
, doubleClickEnabled :: Boolean
-- , doubleClickTimeout :: Number
-- , doubleClickTimeout :: Number
-- , doubleClickZoomDuration :: Number
-- , doubleClickZoomDuration :: Number
-- , doubleClickZoomingRatio :: Number
-- , doubleClickZoomingRatio :: Number
...
@@ -234,20 +234,20 @@ type SigmaSettings =
...
@@ -234,20 +234,20 @@ type SigmaSettings =
-- , dragTimeout :: Number
-- , dragTimeout :: Number
-- , drawEdgeLabels :: Boolean
-- , drawEdgeLabels :: Boolean
-- , drawEdges :: Boolean
-- , drawEdges :: Boolean
, drawLabels :: Boolean
--
, drawLabels :: Boolean
, drawNodes :: Boolean
--
, drawNodes :: Boolean
-- , edgeColor :: String
-- , edgeColor :: String
, edgeHoverColor :: String
--
, edgeHoverColor :: String
, edgeHoverExtremities :: Boolean
--
, edgeHoverExtremities :: Boolean
, edgeHoverPrecision :: Number
--
, edgeHoverPrecision :: Number
, edgeHoverSizeRatio :: Number
--
, edgeHoverSizeRatio :: Number
-- , edgesPowRatio :: Number
-- , edgesPowRatio :: Number
-- , enableCamera :: Boolean
-- , enableCamera :: Boolean
, enableEdgeHover
ing
:: Boolean
, enableEdgeHover
Events
:: Boolean
, enableHovering :: Boolean
--
, enableHovering :: Boolean
-- , eventsEnabled :: Boolean
-- , eventsEnabled :: Boolean
, font :: String
--
, font :: String
, fontStyle :: String
--
, fontStyle :: String
, hideEdgesOnMove :: Boolean
, hideEdgesOnMove :: Boolean
-- , hoverFont :: String
-- , hoverFont :: String
-- , hoverFontStyle :: String
-- , hoverFontStyle :: String
...
@@ -257,117 +257,120 @@ type SigmaSettings =
...
@@ -257,117 +257,120 @@ type SigmaSettings =
-- , labelHoverColor :: String
-- , labelHoverColor :: String
-- , labelHoverShadow :: String
-- , labelHoverShadow :: String
-- , labelHoverShadowColor :: String
-- , labelHoverShadowColor :: String
, labelSize :: String
-- , labelSize :: String
, labelSizeRatio :: Number
-- , labelSizeRatio :: Number
, labelThreshold :: Number
, labelRenderedSizeThreshold :: Number
, maxEdgeSize :: Number
--, labelThreshold :: Number
, maxNodeSize :: Number
-- , maxEdgeSize :: Number
-- , maxNodeSize :: Number
-- , minArrowSize :: Number
-- , minArrowSize :: Number
, minEdgeSize :: Number
--
, minEdgeSize :: Number
, minNodeSize :: Number
--
, minNodeSize :: Number
, mouseEnabled :: Boolean
--
, mouseEnabled :: Boolean
-- , mouseInertiaDuration :: Number
-- , mouseInertiaDuration :: Number
-- , mouseInertiaRatio :: Number
-- , mouseInertiaRatio :: Number
, mouseSelectorSize :: Number
--
, mouseSelectorSize :: Number
-- , mouseWheelEnabled :: Boolean
-- , mouseWheelEnabled :: Boolean
, mouseZoomDuration :: Number
--
, mouseZoomDuration :: Number
, nodeBorderColor :: String
--
, nodeBorderColor :: String
-- , nodeHoverColor :: String
-- , nodeHoverColor :: String
--, nodesPowRatio :: Number
--, nodesPowRatio :: Number
, rescaleIgnoreSize :: Boolean
--
, rescaleIgnoreSize :: Boolean
-- , scalingMode :: String
-- , scalingMode :: String
-- , sideMargin :: Number
-- , sideMargin :: Number
, singleHover :: Boolean
--
, singleHover :: Boolean
-- , skipErrors :: Boolean
-- , skipErrors :: Boolean
, touchEnabled :: Boolean
--
, touchEnabled :: Boolean
-- , touchInertiaDuration :: Number
-- , touchInertiaDuration :: Number
-- , touchInertiaRatio :: Number
-- , touchInertiaRatio :: Number
, twBorderGreyColor :: String
--
, twBorderGreyColor :: String
, twEdgeDefaultOpacity :: Number
--
, twEdgeDefaultOpacity :: Number
, twEdgeGreyColor :: String
--
, twEdgeGreyColor :: String
, twNodeRendBorderColor :: String
--
, twNodeRendBorderColor :: String
, twNodeRendBorderSize :: Number
--
, twNodeRendBorderSize :: Number
, twNodesGreyOpacity :: Number
--
, twNodesGreyOpacity :: Number
, twSelectedColor :: String
--
, twSelectedColor :: String
, verbose :: Boolean
--
, verbose :: Boolean
-- , webglEdgesBatchSize :: Number
-- , webglEdgesBatchSize :: Number
-- , webglOversamplingRatio :: Number
-- , webglOversamplingRatio :: Number
, zoomMax :: Number
--
, zoomMax :: Number
, zoomMin :: Number
--
, zoomMin :: Number
, zoomingRatio :: Number
--
, zoomingRatio :: Number
)
)
-- not selected <=> (1-greyness)
-- not selected <=> (1-greyness)
-- selected nodes <=> special label
-- selected nodes <=> special label
sigmaSettings :: Themes.Theme -> {|SigmaSettings}
sigmaSettings :: Themes.Theme -> {|SigmaSettings}
sigmaSettings theme =
sigmaSettings theme =
{ animationsTime : 30000.0
{
--
animationsTime : 30000.0
, autoRescale : true
--
, autoRescale : true
, autoResize : true
--
, autoResize : true
, batchEdgesDrawing : true
--
, batchEdgesDrawing : true
, borderSize : 1.0 -- for ex, bigger border when hover
--
, borderSize : 1.0 -- for ex, bigger border when hover
, defaultEdgeHoverColor : "#f00"
--
, defaultEdgeHoverColor : "#f00"
, defaultEdgeType : "curv
e" -- 'curve' or 'line' (curve iff ourRendering)
defaultEdgeType : "lin
e" -- 'curve' or 'line' (curve iff ourRendering)
-- , defaultHoverLabelBGColor : "#fff"
-- , defaultHoverLabelBGColor : "#fff"
-- , defaultHoverLabelColor : "#000"
-- , defaultHoverLabelColor : "#000"
-- , defaultLabelColor : "#000" -- labels text color
-- , defaultLabelColor : "#000" -- labels text color
, defaultLabelSize : 15.0 -- (old tina: showLabelsIfZoom)
, defaultLabelSize : 15.0 -- (old tina: showLabelsIfZoom)
, defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default'
--
, defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default'
, defaultNodeColor : "#FFF"
, defaultNodeColor : "#FFF"
, doubleClickEnabled : false -- indicates whether or not the graph can be zoomed on double-click
--
, doubleClickEnabled : false -- indicates whether or not the graph can be zoomed on double-click
-- , drawEdgeLabels : true
-- , drawEdgeLabels : true
-- , drawEdges : true
-- , drawEdges : true
, drawLabels : true
--
, drawLabels : true
, drawNodes : true
--
, drawNodes : true
, enableEdgeHovering : fals
e
-- , edgeHoverExtremities : tru
e
, edgeHoverExtremities : true
-- , edgeHoverColor : "edge"
, edgeHoverColor : "edge"
-- , edgeHoverPrecision : 2.0
, edgeHoverPrecision
: 2.0
-- , edgeHoverSizeRatio
: 2.0
, e
dgeHoverSizeRatio : 2.0
, e
nableEdgeHoverEvents : false
, enableHovering : true
--
, enableHovering : true
, font : "arial"
--
, font : "arial"
, fontStyle : ""
--
, fontStyle : ""
, hideEdgesOnMove : true
, hideEdgesOnMove : true
, labelSize : "proportional" -- alt : proportional, fixed
--
, labelSize : "proportional" -- alt : proportional, fixed
-- , labelSize : "fixed"
-- , labelSize : "fixed"
, labelSizeRatio : 2.0 -- label size in ratio of node size
-- , labelSizeRatio : 2.0 -- label size in ratio of node size
, labelThreshold : 9.0 -- 5.0 for more labels -- min node cam size to start showing label
, labelRenderedSizeThreshold: 2.0
, maxEdgeSize : 1.0
--, labelThreshold : 5.0 -- 5.0 for more labels -- min node cam size to start showing label
, maxNodeSize : 10.0
-- , maxEdgeSize : 1.0
, minEdgeSize : 0.5 -- in fact used in tina as edge size
-- , maxNodeSize : 10.0
, minNodeSize : 1.0
-- , minEdgeSize : 0.5 -- in fact used in tina as edge size
, mouseEnabled : true
-- , minNodeSize : 1.0
, mouseSelectorSize : 15.0
-- , mouseEnabled : true
, mouseZoomDuration : 150.0
-- , mouseSelectorSize : 15.0
, nodeBorderColor : "default" -- choices: "default" color vs. "node" color
-- , mouseZoomDuration : 150.0
-- , nodeBorderColor : "default" -- choices: "default" color vs. "node" color
--, nodesPowRatio : 10.8
--, nodesPowRatio : 10.8
, rescaleIgnoreSize : false
-- , rescaleIgnoreSize : false
, singleHover : true
-- , singleHover : true
, touchEnabled : true
-- , touchEnabled : true
, twBorderGreyColor : "rgba(100, 100, 100, 0.9)"
-- , twBorderGreyColor : "rgba(100, 100, 100, 0.9)"
, twEdgeDefaultOpacity : 0.4 -- initial opacity added to src/tgt colors
-- , twEdgeDefaultOpacity : 0.4 -- initial opacity added to src/tgt colors
, twEdgeGreyColor : "rgba(100, 100, 100, 0.25)"
-- , twEdgeGreyColor : "rgba(100, 100, 100, 0.25)"
, twNodeRendBorderColor : "#FFF"
-- , twNodeRendBorderColor : "#FFF"
, twNodeRendBorderSize : 2.5 -- node borders (only iff ourRendering)
-- , twNodeRendBorderSize : 2.5 -- node borders (only iff ourRendering)
, twNodesGreyOpacity : 5.5 -- smaller value: more grey
-- , twNodesGreyOpacity : 5.5 -- smaller value: more grey
, twSelectedColor : "node" -- "node" for a label bg like the node color, "default" for white background
-- , twSelectedColor : "node" -- "node" for a label bg like the node color, "default" for white background
, verbose : true
-- , verbose : true
, zoomMax : 1.7
-- , zoomMax : 1.7
, zoomMin : 0.0
-- , zoomMin : 0.0
, zoomingRatio : 1.4
-- , zoomingRatio : 1.4
} `merge` themeSettings theme
}
where
-- `merge` themeSettings theme
themeSettings t
-- where
| eq t darksterTheme =
-- themeSettings t
{ defaultHoverLabelBGColor: "#FFF"
-- | eq t darksterTheme =
, defaultHoverLabelColor : "#000"
-- { defaultHoverLabelBGColor: "#FFF"
, defaultLabelColor: "#FFF"
-- , defaultHoverLabelColor : "#000"
}
-- , defaultLabelColor: "#FFF"
| otherwise =
-- }
{ defaultHoverLabelBGColor: "#FFF"
-- | otherwise =
, defaultHoverLabelColor : "#000"
-- { defaultHoverLabelBGColor: "#FFF"
, defaultLabelColor: "#000"
-- , defaultHoverLabelColor : "#000"
}
-- , defaultLabelColor: "#000"
-- }
type ForceAtlas2Settings =
type ForceAtlas2Settings =
( adjustSizes :: Boolean
( adjustSizes :: Boolean
...
...
src/Gargantext/Components/GraphExplorer/Store.purs
View file @
9b1ef410
...
@@ -121,7 +121,7 @@ options =
...
@@ -121,7 +121,7 @@ options =
-- Controls
-- Controls
, multiSelectEnabled : false
, multiSelectEnabled : false
, labelSize : 14.0
, labelSize : 14.0
, labelRenderedSizeThreshold :
6
.0
, labelRenderedSizeThreshold :
2
.0
, mouseSelectorSize : 15.0
, mouseSelectorSize : 15.0
, edgeConfluence : Range.Closed { min: 0.0, max: 1.0 }
, edgeConfluence : Range.Closed { min: 0.0, max: 1.0 }
, graphStage : GET.Init
, graphStage : GET.Init
...
...
src/Gargantext/Hooks/Sigmax/Sigma.js
View file @
9b1ef410
...
@@ -163,11 +163,13 @@ let sigmaMouseSelector = function(sigma, options) {
...
@@ -163,11 +163,13 @@ let sigmaMouseSelector = function(sigma, options) {
function
_sigma
(
left
,
right
,
el
,
opts
)
{
function
_sigma
(
left
,
right
,
el
,
opts
)
{
try
{
try
{
let
graph
=
new
Graph
();
let
graph
=
new
Graph
();
let
s
=
new
sigma
(
graph
,
el
,
opts
);
let
s
=
new
sigma
(
graph
,
el
,
opts
.
settigns
);
console
.
log
(
'initializing sigma with el'
,
el
,
'opts'
,
'sigma'
,
s
);
console
.
log
(
'[_sigma] initializing sigma with el'
,
el
,
'opts'
,
opts
,
'sigma'
,
s
);
console
.
log
(
'[_sigma] labelRenderedSizeThreshold'
,
opts
.
settings
.
labelRenderedSizeThreshold
);
sigmaMouseSelector
(
s
);
sigmaMouseSelector
(
s
);
return
right
(
s
);
return
right
(
s
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
'[_sigma] error'
,
e
);
return
left
(
e
);
return
left
(
e
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment