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
a9d885b7
Commit
a9d885b7
authored
Oct 17, 2014
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isolated nodes as circunference
parent
4b809aec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
41 deletions
+96
-41
explorerjs.html
explorerjs.html
+3
-3
settings_explorerjs.js
settings_explorerjs.js
+1
-0
enviroment.js
tinawebJS/js/enviroment.js
+3
-3
minimap.js
tinawebJS/js/minimap.js
+14
-0
sigma.forceatlas2.js
tinawebJS/js/sigma.forceatlas2.js
+75
-35
No files found.
explorerjs.html
View file @
a9d885b7
...
...
@@ -101,13 +101,13 @@
</a>
</li>
<!--
<li>
<a>
<button type="button" onclick="
makeEdgeWeightUndef
();" class="btn btn-sm">wu</button>
<button
type=
"button"
onclick=
"
partialGraph.stopForceAtlas2
();"
class=
"btn btn-sm"
>
wu
</button>
</a>
</li>
-->
</ul>
...
...
settings_explorerjs.js
View file @
a9d885b7
...
...
@@ -52,6 +52,7 @@ var stopcriteria = false;
var
iterationsFA2
=
1000
;
var
seed
=
999999999
;
//defaultseed
var
semanticConverged
=
false
;
var
isolatedBCauseFilter
=
0
;
var
showLabelsIfZoom
=
2.0
;
...
...
tinawebJS/js/enviroment.js
View file @
a9d885b7
...
...
@@ -229,7 +229,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
}
partialGraph
.
stopForceAtlas2
()
//
partialGraph.stopForceAtlas2()
for
(
var
i
in
finalarray
)
{
ids
=
finalarray
[
i
]
if
(
i
>=
low
&&
i
<=
high
){
...
...
@@ -267,7 +267,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
partialGraph
.
refresh
()
partialGraph
.
draw
()
fa2enabled
=
true
;
partialGraph
.
startForceAtlas2
()
//
fa2enabled=true; partialGraph.startForceAtlas2()
// });
}
});
//doTimeout
...
...
@@ -362,7 +362,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
partialGraph
.
refresh
()
partialGraph
.
draw
()
fa2enabled
=
true
;
partialGraph
.
startForceAtlas2
()
//
fa2enabled=true; partialGraph.startForceAtlas2()
}
}
...
...
tinawebJS/js/minimap.js
View file @
a9d885b7
function
draw1Circle
(
ctx
,
x
,
y
,
color
)
{
ctx
.
strokeStyle
=
'#000'
;
ctx
.
lineWidth
=
1
;
ctx
.
fillStyle
=
color
;
ctx
.
globalAlpha
=
0.5
;
ctx
.
beginPath
();
ctx
.
arc
(
x
,
y
,
10
,
0
,
Math
.
PI
*
2
,
true
);
ctx
.
closePath
();
ctx
.
fill
();
ctx
.
stroke
();
}
function
trackMouse
()
{
if
(
!
shift_key
)
{
// $.doTimeout(300,function (){
...
...
tinawebJS/js/sigma.forceatlas2.js
View file @
a9d885b7
...
...
@@ -993,6 +993,15 @@ sigma.publicPrototype.startForceAtlas2 = function() {
//if(!this.forceatlas2) {
if
(
fa2enabled
)
{
isolatedBCauseFilter
=
0
;
for
(
var
i
in
this
.
_core
.
graph
.
nodesIndex
)
{
if
(
this
.
_core
.
graph
.
nodesIndex
[
i
].
degree
==
0
)
{
this
.
_core
.
graph
.
nodesIndex
[
i
].
hidden
=
true
;
isolatedBCauseFilter
++
;
}
}
// // -- UPDATING THE DEGREE --
// for (var i in this._core.graph.nodesIndex) {
// pr(i+" -> "+this._core.graph.nodesIndex[i].degree)
...
...
@@ -1072,47 +1081,78 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
partialGraph
.
refresh
();
if
(
minimap
)
$
(
"#overviewzone"
).
show
();
for
(
var
i
in
this
.
_core
.
graph
.
nodes
)
{
if
(
!
this
.
_core
.
graph
.
nodes
[
i
].
hidden
&&
this
.
_core
.
graph
.
nodes
[
i
].
degree
>
0
)
{
if
(
this
.
_core
.
graph
.
nodes
[
i
].
x
<
minx
)
minx
=
this
.
_core
.
graph
.
nodes
[
i
].
x
if
(
this
.
_core
.
graph
.
nodes
[
i
].
x
>
maxx
)
maxx
=
this
.
_core
.
graph
.
nodes
[
i
].
x
if
(
this
.
_core
.
graph
.
nodes
[
i
].
y
<
miny
)
miny
=
this
.
_core
.
graph
.
nodes
[
i
].
y
if
(
this
.
_core
.
graph
.
nodes
[
i
].
y
>
maxy
)
maxy
=
this
.
_core
.
graph
.
nodes
[
i
].
y
}
// calc dimensions of connected subgraphs
minx
=
1000.0
;
maxx
=
0.0
;
miny
=
1000.0
;
maxy
=
0.0
;
for
(
var
i
in
this
.
_core
.
graph
.
nodes
)
{
if
(
!
this
.
_core
.
graph
.
nodes
[
i
].
hidden
&&
this
.
_core
.
graph
.
nodes
[
i
].
degree
>
0
)
{
if
(
this
.
_core
.
graph
.
nodes
[
i
].
x
<
minx
)
minx
=
this
.
_core
.
graph
.
nodes
[
i
].
x
if
(
this
.
_core
.
graph
.
nodes
[
i
].
x
>
maxx
)
maxx
=
this
.
_core
.
graph
.
nodes
[
i
].
x
if
(
this
.
_core
.
graph
.
nodes
[
i
].
y
<
miny
)
miny
=
this
.
_core
.
graph
.
nodes
[
i
].
y
if
(
this
.
_core
.
graph
.
nodes
[
i
].
y
>
maxy
)
maxy
=
this
.
_core
.
graph
.
nodes
[
i
].
y
}
}
var
ybuffer
=
miny
;
for
(
var
i
in
this
.
_core
.
graph
.
nodesIndex
)
{
if
(
swMacro
&&
this
.
_core
.
graph
.
nodesIndex
[
i
].
degree
>
0
)
{
Nodes
[
i
].
x
=
this
.
_core
.
graph
.
nodesIndex
[
i
].
x
;
Nodes
[
i
].
y
=
this
.
_core
.
graph
.
nodesIndex
[
i
].
y
;
}
// var ybuffer = miny;
// for (var i in this._core.graph.nodesIndex) {
if
(
this
.
_core
.
graph
.
nodesIndex
[
i
].
degree
==
0
)
{
// this._core.graph.nodesIndex[i].color = "#000000"
// // if (swMacro && this._core.graph.nodesIndex[i].degree>0) {
// // Nodes[i].x = this._core.graph.nodesIndex[i].x;
// // Nodes[i].y = this._core.graph.nodesIndex[i].y;
// // }
this
.
_core
.
graph
.
nodesIndex
[
i
].
x
=
minx
-
10
this
.
_core
.
graph
.
nodesIndex
[
i
].
y
=
ybuffer
this
.
_core
.
graph
.
nodesIndex
[
i
].
displayX
=
minx
-
10
this
.
_core
.
graph
.
nodesIndex
[
i
].
displayY
=
ybuffer
// this._core.graph.nodesIndex[i].hidden = true;
// this._core.graph.nodesIndex[i].fixed = true;
ybuffer
=
ybuffer
+
Math
.
pow
(
this
.
_core
.
graph
.
nodesIndex
[
i
].
displaySize
,
2
);
// pr(ybuffer)
}
// this._core.graph.nodesIndex[i].hidden = true;
// pr(i+" -> "+this._core.graph.nodesIndex[i].degree)
}
// -- / UPDATING THE DEGREE --
// if(this._core.graph.nodesIndex[i].degree==0) {
// pr(this._core.graph.nodesIndex[i].label);
// this._core.graph.nodesIndex[i].x = minx-10
// this._core.graph.nodesIndex[i].y = ybuffer
// ybuffer = ybuffer + Math.pow(this._core.graph.nodesIndex[i].displaySize,2);
// }
// }
// pr("minx: "+minx)
// pr("maxx: "+maxx)
// pr("miny: "+miny)
// pr("maxy: "+maxy)
// pr("")
// pr("minx: "+minx)
// pr("maxx: "+maxx)
// pr("miny: "+miny)
// pr("maxy: "+maxy)
// pr("")
Ox
=
(
minx
+
maxx
)
/
2
;
Oy
=
(
miny
+
maxy
)
/
2
;
Ax
=
minx
;
Ay
=
miny
;
// var ctx = partialGraph._core.domElements.mouse.getContext('2d');
// ctx.globalCompositeOperation = "source-over";
// ctx.clearRect(0, 0, partialGraph._core.domElements.nodes.width, partialGraph._core.domElements.nodes.height);
// draw1Circle(ctx,minx,miny,"aqua") // point A
// draw1Circle(ctx,maxx,miny,"blue") // point B
// draw1Circle(ctx,minx,maxy,"coral") //point C
// draw1Circle(ctx,maxx,maxy,"darkorange") // point D
// draw1Circle(ctx, Ox , Oy ,"red") // Center
var
R
=
Math
.
sqrt
(
Math
.
pow
((
Ox
-
Ax
),
2
)
+
Math
.
pow
((
Oy
-
Ay
),
2
)
);
R
=
R
*
1.2
;
stepDeg
=
2
/
parseFloat
(
isolatedBCauseFilter
);
var
mult
=
1
;
for
(
var
i
in
this
.
_core
.
graph
.
nodes
)
{
if
(
this
.
_core
.
graph
.
nodes
[
i
].
degree
==
0
)
{
this
.
_core
.
graph
.
nodes
[
i
].
hidden
=
false
;
this
.
_core
.
graph
.
nodes
[
i
].
x
=
Ox
+
R
*
Math
.
cos
(
Math
.
PI
*
stepDeg
*
mult
);
this
.
_core
.
graph
.
nodes
[
i
].
y
=
Oy
+
R
*
Math
.
sin
(
Math
.
PI
*
stepDeg
*
mult
);
mult
++
;
}
}
};
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