Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
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
david Chavalarias
clinicaltrials
Commits
aebf89e8
Commit
aebf89e8
authored
May 12, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more safeguards for empty bins
parent
e9ba8fa8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
extras_explorerjs.js
extras_explorerjs.js
+17
-11
sigma.parseCustom.js
tinawebJS/sigma.parseCustom.js
+3
-1
No files found.
extras_explorerjs.js
View file @
aebf89e8
...
@@ -261,6 +261,8 @@ function set_ClustersLegend ( daclass, groupedByTicks ) {
...
@@ -261,6 +261,8 @@ function set_ClustersLegend ( daclass, groupedByTicks ) {
// passed as arg or prepared in parseCustom
// passed as arg or prepared in parseCustom
if
(
!
groupedByTicks
&&
(
!
TW
.
Clusters
[
curType
]
||
!
TW
.
Clusters
[
curType
][
daclass
]))
{
if
(
!
groupedByTicks
&&
(
!
TW
.
Clusters
[
curType
]
||
!
TW
.
Clusters
[
curType
][
daclass
]))
{
console
.
warn
(
`no class bins for
${
daclass
}
, displaying no legend`
)
console
.
warn
(
`no class bins for
${
daclass
}
, displaying no legend`
)
$
(
"#legend_for_clusters"
).
hide
()
}
}
else
{
else
{
var
LegendDiv
=
""
var
LegendDiv
=
""
...
@@ -275,27 +277,31 @@ function set_ClustersLegend ( daclass, groupedByTicks ) {
...
@@ -275,27 +277,31 @@ function set_ClustersLegend ( daclass, groupedByTicks ) {
// get a sample node color for each bin/class
// get a sample node color for each bin/class
var
nMatchedNodes
=
legendInfo
[
l
][
'nids'
].
length
var
nMatchedNodes
=
legendInfo
[
l
][
'nids'
].
length
var
midNid
=
legendInfo
[
l
][
'nids'
][
Math
.
floor
(
3
*
nMatchedNodes
/
4
)]
var
exampleColor
=
TW
.
partialGraph
.
graph
.
nodes
(
midNid
).
color
// create the legend item
if
(
nMatchedNodes
)
{
var
preparedLabel
=
legendInfo
[
l
][
'labl'
]
var
midNid
=
legendInfo
[
l
][
'nids'
][
Math
.
floor
(
3
*
nMatchedNodes
/
4
)]
// console.log("preparedLabel", preparedLabel)
var
exampleColor
=
TW
.
partialGraph
.
graph
.
nodes
(
midNid
).
color
// create the legend item
var
preparedLabel
=
legendInfo
[
l
][
'labl'
]
// console.log("preparedLabel", preparedLabel)
// all-in-one argument for SomeEffect
// all-in-one argument for SomeEffect
var
valueclassId
=
`
${
curType
}
::
${
daclass
}
::
${
l
}
`
var
valueclassId
=
`
${
curType
}
::
${
daclass
}
::
${
l
}
`
var
colorBg
=
`<span style="background:
${
exampleColor
}
;"></span>`
var
colorBg
=
`<span style="background:
${
exampleColor
}
;"></span>`
LegendDiv
+=
`<li onclick='SomeEffect("
${
valueclassId
}
")'>`
LegendDiv
+=
`<li onclick='SomeEffect("
${
valueclassId
}
")'>`
LegendDiv
+=
colorBg
+
preparedLabel
LegendDiv
+=
colorBg
+
preparedLabel
LegendDiv
+=
"</li>
\n
"
LegendDiv
+=
"</li>
\n
"
}
}
}
LegendDiv
+=
' </ul>'
LegendDiv
+=
' </ul>'
LegendDiv
+=
' </div>'
LegendDiv
+=
' </div>'
$
(
"#legend_for_clusters"
).
addClass
(
"my-legend"
);
$
(
"#legend_for_clusters"
).
addClass
(
"my-legend"
);
$
(
"#legend_for_clusters"
).
html
(
LegendDiv
)
$
(
"#legend_for_clusters"
).
html
(
LegendDiv
)
$
(
"#legend_for_clusters"
).
show
()
}
}
}
}
...
...
tinawebJS/sigma.parseCustom.js
View file @
aebf89e8
...
@@ -626,7 +626,9 @@ function dictfyGexf( gexf , categories ){
...
@@ -626,7 +626,9 @@ function dictfyGexf( gexf , categories ){
newTick
.
labl
=
`
${
cat
}
||
${
at
}
||[
${
labLowThres
}
;
${
labHiThres
}
]`
newTick
.
labl
=
`
${
cat
}
||
${
at
}
||[
${
labLowThres
}
;
${
labHiThres
}
]`
// save these bins as the cluster index (aka faceting)
// save these bins as the cluster index (aka faceting)
TW
.
Clusters
[
cat
][
at
].
push
(
newTick
)
if
(
newTick
.
nids
.
length
)
{
TW
.
Clusters
[
cat
][
at
].
push
(
newTick
)
}
}
}
}
}
}
}
...
...
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