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
0ef9b3c2
Commit
0ef9b3c2
authored
Jan 09, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] implement label size proportional to node size
parent
e124d888
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
Sigma.js
src/Gargantext/Hooks/Sigmax/Sigma.js
+23
-0
No files found.
src/Gargantext/Hooks/Sigmax/Sigma.js
View file @
0ef9b3c2
...
@@ -163,10 +163,33 @@ let sigmaMouseSelector = function(sigma, options) {
...
@@ -163,10 +163,33 @@ let sigmaMouseSelector = function(sigma, options) {
//sigmaMouseSelector(sigma);
//sigmaMouseSelector(sigma);
function
drawLabel
(
context
,
data
,
settings
)
{
if
(
!
data
.
label
)
return
;
const
size
=
data
.
size
,
//settings.labelSize,
font
=
settings
.
labelFont
,
weight
=
settings
.
labelWeight
,
color
=
settings
.
labelColor
.
attribute
?
data
[
settings
.
labelColor
.
attribute
]
||
settings
.
labelColor
.
color
||
"#000"
:
settings
.
labelColor
.
color
;
context
.
fillStyle
=
color
;
context
.
font
=
`
${
weight
}
${
size
}
px
${
font
}
`
;
context
.
fillText
(
data
.
label
,
data
.
x
,
data
.
y
+
size
/
3
);
}
function
_sigma
(
left
,
right
,
el
,
opts
)
{
function
_sigma
(
left
,
right
,
el
,
opts
)
{
try
{
try
{
let
graph
=
new
Graph
();
let
graph
=
new
Graph
();
const
settings
=
{
const
settings
=
{
labelRenderer
:
drawLabel
,
nodeProgramClasses
:
{
nodeProgramClasses
:
{
circle
:
CircleNodeProgram
.
default
,
// TODO why default? It seems that import should be fixed
circle
:
CircleNodeProgram
.
default
,
// TODO why default? It seems that import should be fixed
ccircle
:
ContourCircleNodeProgram
ccircle
:
ContourCircleNodeProgram
...
...
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