Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
47e66a79
Commit
47e66a79
authored
Jul 26, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] graphExplorer sidebar hide/show button and actions
parent
8d009ae8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
53 deletions
+89
-53
custom.css
static/lib/graphExplorer/libs/css2/custom.css
+18
-14
Tinaweb.js
static/lib/graphExplorer/tinawebJS/Tinaweb.js
+55
-22
explorer.html
templates/graphExplorer/explorer.html
+16
-17
No files found.
static/lib/graphExplorer/libs/css2/custom.css
View file @
47e66a79
...
@@ -30,10 +30,10 @@
...
@@ -30,10 +30,10 @@
#defaultop
li
.basicitem
{
#defaultop
li
.basicitem
{
/*font-family: "Helvetica Neue", Helvetica, Arial, sans-serif ;*/
/*font-family: "Helvetica Neue", Helvetica, Arial, sans-serif ;*/
padding-left
:
.
4
em
;
padding-left
:
.
2
em
;
padding-right
:
.
4
em
;
padding-right
:
.
2
em
;
padding-bottom
:
0
;
padding-bottom
:
0
;
font-size
:
90
%
;
font-size
:
75
%
;
}
}
#defaultop
>
div
{
#defaultop
>
div
{
...
@@ -338,7 +338,11 @@
...
@@ -338,7 +338,11 @@
}
}
#aUnfold
{
#aUnfold
{
display
:
block
;
width
:
12px
;
height
:
12px
;
background-image
:
url("../img2/fleches-horiz.png")
;
margin
:
0
auto
;
display
:
block
;
width
:
12px
;
height
:
12px
;
background-image
:
url("../img2/fleches-horiz.png")
;
/*margin: 0 auto;*/
}
}
/*
/*
#saveAs {
#saveAs {
...
...
static/lib/graphExplorer/tinawebJS/Tinaweb.js
View file @
47e66a79
...
@@ -24,12 +24,20 @@
...
@@ -24,12 +24,20 @@
// on window resize
// on window resize
// @param canvasdiv: id of the div (without '#')
// @param canvasdiv: id of the div (without '#')
function
sigmaLimits
(
canvasdiv
)
{
function
sigmaLimits
(
canvasdiv
,
SidecolumnIsInvisible
)
{
console
.
log
(
'FUN t.TinawebJS:sigmaLimits'
)
;
console
.
log
(
'FUN t.TinawebJS:sigmaLimits
(div='
+
canvasdiv
+
')
'
)
;
var
canvas
=
document
.
getElementById
(
canvasdiv
)
;
var
canvas
=
document
.
getElementById
(
canvasdiv
)
;
var
sidecolumn
=
document
.
getElementById
(
'sidecolumn'
)
;
var
sidecolumn
=
document
.
getElementById
(
'sidecolumn'
)
;
var
ancho_total
=
window
.
innerWidth
-
sidecolumn
.
offsetWidth
;
var
alto_total
=
window
.
innerHeight
-
sidecolumn
.
offsetTop
;
var
alto_total
=
window
.
innerHeight
-
sidecolumn
.
offsetTop
;
var
ancho_total
=
-
1
if
(
SidecolumnIsInvisible
)
{
ancho_total
=
window
.
innerWidth
}
else
{
// normal case
ancho_total
=
window
.
innerWidth
-
sidecolumn
.
offsetWidth
;
}
// setting new size
// setting new size
canvas
.
style
.
width
=
ancho_total
-
5
;
canvas
.
style
.
width
=
ancho_total
-
5
;
...
@@ -549,29 +557,40 @@ TinaWebJS = function ( sigmacanvas ) {
...
@@ -549,29 +557,40 @@ TinaWebJS = function ( sigmacanvas ) {
// === un/hide leftpanel === //
// === un/hide leftpanel === //
$
(
"#aUnfold"
).
click
(
function
(
e
)
{
$
(
"#aUnfold"
).
click
(
function
(
e
)
{
// TODO unify with/without jquery
//SHOW sidecolumn
//SHOW sidecolumn
sidebar
=
$
(
"#sidecolumn"
);
sidebar
=
$
(
"#sidecolumn"
);
fullwidth
=
$
(
'#fixedtop'
).
width
();
fullwidth
=
window
.
innerWidth
e
.
preventDefault
();
e
.
preventDefault
();
// $("#wrapper").toggleClass("active");
// $("#wrapper").toggleClass("active");
if
(
parseFloat
(
sidebar
.
css
(
"right"
))
<
0
){
if
(
parseFloat
(
sidebar
.
css
(
"right"
))
<
0
){
sidebar
.
show
()
$
(
"#aUnfold"
).
attr
(
"class"
,
"rightarrow"
);
$
(
"#aUnfold"
).
attr
(
"class"
,
"rightarrow"
);
// apply width from settings on sidecolumn
document
.
getElementById
(
'sidecolumn'
).
style
.
width
=
sidecolumnSize
;
sidebar
.
animate
({
sidebar
.
animate
({
"right"
:
sidebar
.
width
()
+
"px"
"right"
:
"0px"
},
{
duration
:
400
,
queue
:
false
});
$
(
"#ctlzoom"
).
animate
({
"right"
:
(
sidebar
.
width
()
+
10
)
+
"px"
},
{
duration
:
400
,
queue
:
false
});
},
{
duration
:
400
,
queue
:
false
});
// $('#sigma-example').width(fullwidth-sidebar.width());
// $('#sigma-example').width(fullwidth-sidebar.width());
$
(
'#sigma-example'
).
animate
({
// $('#sigma-example').animate({
"width"
:
fullwidth
-
sidebar
.
width
()
+
"px"
// "width": fullwidth-sidecolumnSize+"px"
},
{
duration
:
400
,
queue
:
false
});
// }, { duration: 400, queue: false });
setTimeout
(
function
()
{
setTimeout
(
function
()
{
// reposition the button inside the column
var
btn
=
document
.
getElementById
(
'unfold'
)
btn
.
style
.
position
=
'initial'
;
btn
.
style
.
top
=
undefined
;
btn
.
style
.
right
=
0
;
$
(
'#unfold'
).
insertBefore
(
'#tips'
);
sigmaLimits
(
"sigma-example"
)
partialGraph
.
resize
();
partialGraph
.
resize
();
partialGraph
.
refresh
();
partialGraph
.
refresh
();
},
400
);
},
400
);
console
.
log
(
'ok'
)
}
}
else
{
else
{
//HIDE sidecolumn
//HIDE sidecolumn
...
@@ -580,18 +599,32 @@ TinaWebJS = function ( sigmacanvas ) {
...
@@ -580,18 +599,32 @@ TinaWebJS = function ( sigmacanvas ) {
"right"
:
"-"
+
sidebar
.
width
()
+
"px"
"right"
:
"-"
+
sidebar
.
width
()
+
"px"
},
{
duration
:
400
,
queue
:
false
});
},
{
duration
:
400
,
queue
:
false
});
$
(
"#ctlzoom"
).
animate
({
"right"
:
"0px"
},
{
duration
:
400
,
queue
:
false
});
// $('#sigma-example').width(fullwidth);
// $('#sigma-example').width(fullwidth);
$
(
'#sigma-example'
).
animate
({
// $('#sigma-example').animate({
"width"
:
fullwidth
+
"px"
// "width": fullwidth+"px"
},{
duration
:
400
,
queue
:
false
});
// },{ duration: 400, queue: false });
setTimeout
(
function
()
{
setTimeout
(
function
()
{
// position #aUnfold out of sidecolumn so it remains visible
// var graph = document.getElementById("sigma-example")
var
gtop
=
document
.
getElementById
(
"sidecolumn"
).
offsetTop
+
10
$
(
'#unfold'
).
insertAfter
(
'#sigma-example'
);
var
btn
=
document
.
getElementById
(
'unfold'
)
;
btn
.
style
.
position
=
'fixed'
;
btn
.
style
.
right
=
'20px'
;
btn
.
style
.
top
=
gtop
;
console
.
log
(
'ok'
)
// partialGraph.resize();
sigmaLimits
(
"sigma-example"
,
true
)
partialGraph
.
resize
();
partialGraph
.
resize
();
partialGraph
.
refresh
();
partialGraph
.
refresh
();
sidebar
.
hide
()
},
400
);
},
400
);
}
}
});
});
...
...
templates/graphExplorer/explorer.html
View file @
47e66a79
...
@@ -208,11 +208,7 @@
...
@@ -208,11 +208,7 @@
<!-- <div class="content-header">
<!-- <div class="content-header">
<button id="menu-toggle">X</button>
<button id="menu-toggle">X</button>
</div> -->
</div> -->
<li>
<div
id=
"unfold"
>
<a
href=
"#"
id=
"aUnfold"
class=
"rightarrow"
></a>
</div>
</li>
<!--
<!--
<li>
<li>
<a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomap();">
<a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomap();">
...
@@ -221,7 +217,6 @@
...
@@ -221,7 +217,6 @@
</li>
</li>
-->
-->
<li>
<li>
<a
href=
"#"
id=
"snapicon"
onclick=
"saveGraphIMG();"
>
<a
href=
"#"
id=
"snapicon"
onclick=
"saveGraphIMG();"
>
<img
title=
"Take a photo!"
width=
"34px"
src=
"{% static "
img
/
camera
.
png
"
%}"
></img>
<img
title=
"Take a photo!"
width=
"34px"
src=
"{% static "
img
/
camera
.
png
"
%}"
></img>
...
@@ -259,6 +254,10 @@
...
@@ -259,6 +254,10 @@
<!-- Sidebar -->
<!-- Sidebar -->
<div
id=
"sidecolumn"
>
<div
id=
"sidecolumn"
>
<div
id=
"unfold"
>
<!-- button to be replaced by handle when sidecolumn is hidden -->
<a
href=
"#"
id=
"aUnfold"
class=
"rightarrow"
></a>
</div>
<div
id=
"tips"
></div>
<div
id=
"tips"
></div>
<div
id=
"names"
></div>
<div
id=
"names"
></div>
<div
id=
"ngrams_actions"
></div>
<div
id=
"ngrams_actions"
></div>
...
...
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