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
type SigmaSettings =
( animationsTime :: Number
, autoRescale :: Boolean
, autoResize :: Boolean
, batchEdgesDrawing :: Boolean
, borderSize :: Number
(
--
animationsTime :: Number
--
, autoRescale :: Boolean
--
, autoResize :: Boolean
--
, batchEdgesDrawing :: Boolean
--
, borderSize :: Number
-- , canvasEdgesBatchSize :: Number
-- , clone :: Boolean
-- , defaultEdgeColor :: String
, defaultEdgeHoverColor :: String
,
defaultEdgeType :: String
, defaultHoverLabelBGColor :: String
, defaultHoverLabelColor :: String
, defaultLabelColor :: String
--
, defaultEdgeHoverColor :: String
defaultEdgeType :: String
--
, defaultHoverLabelBGColor :: String
--
, defaultHoverLabelColor :: String
--
, defaultLabelColor :: String
-- , defaultLabelHoverColor :: String
, defaultLabelSize :: Number
, defaultNodeBorderColor :: String
--
, defaultNodeBorderColor :: String
, defaultNodeColor :: String
-- , defaultNodeHoverColor :: String
-- , defaultNodeType :: String
, doubleClickEnabled :: Boolean
--
, doubleClickEnabled :: Boolean
-- , doubleClickTimeout :: Number
-- , doubleClickZoomDuration :: Number
-- , doubleClickZoomingRatio :: Number
...
...
@@ -234,20 +234,20 @@ type SigmaSettings =
-- , dragTimeout :: Number
-- , drawEdgeLabels :: Boolean
-- , drawEdges :: Boolean
, drawLabels :: Boolean
, drawNodes :: Boolean
--
, drawLabels :: Boolean
--
, drawNodes :: Boolean
-- , edgeColor :: String
, edgeHoverColor :: String
, edgeHoverExtremities :: Boolean
, edgeHoverPrecision :: Number
, edgeHoverSizeRatio :: Number
--
, edgeHoverColor :: String
--
, edgeHoverExtremities :: Boolean
--
, edgeHoverPrecision :: Number
--
, edgeHoverSizeRatio :: Number
-- , edgesPowRatio :: Number
-- , enableCamera :: Boolean
, enableEdgeHover
ing
:: Boolean
, enableHovering :: Boolean
, enableEdgeHover
Events
:: Boolean
--
, enableHovering :: Boolean
-- , eventsEnabled :: Boolean
, font :: String
, fontStyle :: String
--
, font :: String
--
, fontStyle :: String
, hideEdgesOnMove :: Boolean
-- , hoverFont :: String
-- , hoverFontStyle :: String
...
...
@@ -257,117 +257,120 @@ type SigmaSettings =
-- , labelHoverColor :: String
-- , labelHoverShadow :: String
-- , labelHoverShadowColor :: String
, labelSize :: String
, labelSizeRatio :: Number
, labelThreshold :: Number
, maxEdgeSize :: Number
, maxNodeSize :: Number
-- , labelSize :: String
-- , labelSizeRatio :: Number
, labelRenderedSizeThreshold :: Number
--, labelThreshold :: Number
-- , maxEdgeSize :: Number
-- , maxNodeSize :: Number
-- , minArrowSize :: Number
, minEdgeSize :: Number
, minNodeSize :: Number
, mouseEnabled :: Boolean
--
, minEdgeSize :: Number
--
, minNodeSize :: Number
--
, mouseEnabled :: Boolean
-- , mouseInertiaDuration :: Number
-- , mouseInertiaRatio :: Number
, mouseSelectorSize :: Number
--
, mouseSelectorSize :: Number
-- , mouseWheelEnabled :: Boolean
, mouseZoomDuration :: Number
, nodeBorderColor :: String
--
, mouseZoomDuration :: Number
--
, nodeBorderColor :: String
-- , nodeHoverColor :: String
--, nodesPowRatio :: Number
, rescaleIgnoreSize :: Boolean
--
, rescaleIgnoreSize :: Boolean
-- , scalingMode :: String
-- , sideMargin :: Number
, singleHover :: Boolean
--
, singleHover :: Boolean
-- , skipErrors :: Boolean
, touchEnabled :: Boolean
--
, touchEnabled :: Boolean
-- , touchInertiaDuration :: Number
-- , touchInertiaRatio :: Number
, twBorderGreyColor :: String
, twEdgeDefaultOpacity :: Number
, twEdgeGreyColor :: String
, twNodeRendBorderColor :: String
, twNodeRendBorderSize :: Number
, twNodesGreyOpacity :: Number
, twSelectedColor :: String
, verbose :: Boolean
--
, twBorderGreyColor :: String
--
, twEdgeDefaultOpacity :: Number
--
, twEdgeGreyColor :: String
--
, twNodeRendBorderColor :: String
--
, twNodeRendBorderSize :: Number
--
, twNodesGreyOpacity :: Number
--
, twSelectedColor :: String
--
, verbose :: Boolean
-- , webglEdgesBatchSize :: Number
-- , webglOversamplingRatio :: Number
, zoomMax :: Number
, zoomMin :: Number
, zoomingRatio :: Number
--
, zoomMax :: Number
--
, zoomMin :: Number
--
, zoomingRatio :: Number
)
-- not selected <=> (1-greyness)
-- selected nodes <=> special label
sigmaSettings :: Themes.Theme -> {|SigmaSettings}
sigmaSettings theme =
{ animationsTime : 30000.0
, autoRescale : true
, autoResize : true
, batchEdgesDrawing : true
, borderSize : 1.0 -- for ex, bigger border when hover
, defaultEdgeHoverColor : "#f00"
, defaultEdgeType : "curv
e" -- 'curve' or 'line' (curve iff ourRendering)
{
--
animationsTime : 30000.0
--
, autoRescale : true
--
, autoResize : true
--
, batchEdgesDrawing : true
--
, borderSize : 1.0 -- for ex, bigger border when hover
--
, defaultEdgeHoverColor : "#f00"
defaultEdgeType : "lin
e" -- 'curve' or 'line' (curve iff ourRendering)
-- , defaultHoverLabelBGColor : "#fff"
-- , defaultHoverLabelColor : "#000"
-- , defaultLabelColor : "#000" -- labels text color
, defaultLabelSize : 15.0 -- (old tina: showLabelsIfZoom)
, defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default'
--
, defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default'
, 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
-- , drawEdges : true
, drawLabels : true
, drawNodes : true
, enableEdgeHovering : fals
e
, edgeHoverExtremities : true
, edgeHoverColor : "edge"
, edgeHoverPrecision
: 2.0
, e
dgeHoverSizeRatio : 2.0
, enableHovering : true
, font : "arial"
, fontStyle : ""
--
, drawLabels : true
--
, drawNodes : true
-- , edgeHoverExtremities : tru
e
-- , edgeHoverColor : "edge"
-- , edgeHoverPrecision : 2.0
-- , edgeHoverSizeRatio
: 2.0
, e
nableEdgeHoverEvents : false
--
, enableHovering : true
--
, font : "arial"
--
, fontStyle : ""
, hideEdgesOnMove : true
, labelSize : "proportional" -- alt : proportional, fixed
--
, labelSize : "proportional" -- alt : proportional, fixed
-- , labelSize : "fixed"
, 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
, maxEdgeSize : 1.0
, maxNodeSize : 10.0
, minEdgeSize : 0.5 -- in fact used in tina as edge size
, minNodeSize : 1.0
, mouseEnabled : true
, mouseSelectorSize : 15.0
, mouseZoomDuration : 150.0
, nodeBorderColor : "default" -- choices: "default" color vs. "node" color
-- , labelSizeRatio : 2.0 -- label size in ratio of node size
, labelRenderedSizeThreshold: 2.0
--, labelThreshold : 5.0 -- 5.0 for more labels -- min node cam size to start showing label
-- , maxEdgeSize : 1.0
-- , maxNodeSize : 10.0
-- , minEdgeSize : 0.5 -- in fact used in tina as edge size
-- , minNodeSize : 1.0
-- , mouseEnabled : true
-- , mouseSelectorSize : 15.0
-- , mouseZoomDuration : 150.0
-- , nodeBorderColor : "default" -- choices: "default" color vs. "node" color
--, nodesPowRatio : 10.8
, rescaleIgnoreSize : false
, singleHover : true
, touchEnabled : true
, twBorderGreyColor : "rgba(100, 100, 100, 0.9)"
, twEdgeDefaultOpacity : 0.4 -- initial opacity added to src/tgt colors
, twEdgeGreyColor : "rgba(100, 100, 100, 0.25)"
, twNodeRendBorderColor : "#FFF"
, twNodeRendBorderSize : 2.5 -- node borders (only iff ourRendering)
, twNodesGreyOpacity : 5.5 -- smaller value: more grey
, twSelectedColor : "node" -- "node" for a label bg like the node color, "default" for white background
, verbose : true
, zoomMax : 1.7
, zoomMin : 0.0
, zoomingRatio : 1.4
} `merge` themeSettings theme
where
themeSettings t
| eq t darksterTheme =
{ defaultHoverLabelBGColor: "#FFF"
, defaultHoverLabelColor : "#000"
, defaultLabelColor: "#FFF"
}
| otherwise =
{ defaultHoverLabelBGColor: "#FFF"
, defaultHoverLabelColor : "#000"
, defaultLabelColor: "#000"
}
-- , rescaleIgnoreSize : false
-- , singleHover : true
-- , touchEnabled : true
-- , twBorderGreyColor : "rgba(100, 100, 100, 0.9)"
-- , twEdgeDefaultOpacity : 0.4 -- initial opacity added to src/tgt colors
-- , twEdgeGreyColor : "rgba(100, 100, 100, 0.25)"
-- , twNodeRendBorderColor : "#FFF"
-- , twNodeRendBorderSize : 2.5 -- node borders (only iff ourRendering)
-- , twNodesGreyOpacity : 5.5 -- smaller value: more grey
-- , twSelectedColor : "node" -- "node" for a label bg like the node color, "default" for white background
-- , verbose : true
-- , zoomMax : 1.7
-- , zoomMin : 0.0
-- , zoomingRatio : 1.4
}
-- `merge` themeSettings theme
-- where
-- themeSettings t
-- | eq t darksterTheme =
-- { defaultHoverLabelBGColor: "#FFF"
-- , defaultHoverLabelColor : "#000"
-- , defaultLabelColor: "#FFF"
-- }
-- | otherwise =
-- { defaultHoverLabelBGColor: "#FFF"
-- , defaultHoverLabelColor : "#000"
-- , defaultLabelColor: "#000"
-- }
type ForceAtlas2Settings =
( adjustSizes :: Boolean
...
...
src/Gargantext/Components/GraphExplorer/Store.purs
View file @
9b1ef410
...
...
@@ -121,7 +121,7 @@ options =
-- Controls
, multiSelectEnabled : false
, labelSize : 14.0
, labelRenderedSizeThreshold :
6
.0
, labelRenderedSizeThreshold :
2
.0
, mouseSelectorSize : 15.0
, edgeConfluence : Range.Closed { min: 0.0, max: 1.0 }
, graphStage : GET.Init
...
...
src/Gargantext/Hooks/Sigmax/Sigma.js
View file @
9b1ef410
...
...
@@ -163,11 +163,13 @@ let sigmaMouseSelector = function(sigma, options) {
function
_sigma
(
left
,
right
,
el
,
opts
)
{
try
{
let
graph
=
new
Graph
();
let
s
=
new
sigma
(
graph
,
el
,
opts
);
console
.
log
(
'initializing sigma with el'
,
el
,
'opts'
,
'sigma'
,
s
);
let
s
=
new
sigma
(
graph
,
el
,
opts
.
settigns
);
console
.
log
(
'[_sigma] initializing sigma with el'
,
el
,
'opts'
,
opts
,
'sigma'
,
s
);
console
.
log
(
'[_sigma] labelRenderedSizeThreshold'
,
opts
.
settings
.
labelRenderedSizeThreshold
);
sigmaMouseSelector
(
s
);
return
right
(
s
);
}
catch
(
e
)
{
console
.
log
(
'[_sigma] error'
,
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