-
Notifications
You must be signed in to change notification settings - Fork 45
/
index_template.insert
61 lines (60 loc) · 3.39 KB
/
index_template.insert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jquery.min.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://interactivereport.github.io/cellxgene_VIP/static/stackedbar/d3.v3.min.js"></script>
<link href="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/jspanel.css" rel="stylesheet">
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/jspanel.js"></script>
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/extensions/modal/jspanel.modal.js"></script>
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/extensions/tooltip/jspanel.tooltip.js"></script>
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/extensions/hint/jspanel.hint.js"></script>
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/extensions/layout/jspanel.layout.js"></script>
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/extensions/contextmenu/jspanel.contextmenu.js"></script>
<script src="https://interactivereport.github.io/cellxgene_VIP/static/jspanel/dist/extensions/dock/jspanel.dock.js"></script>
<script>
// execute JavaScript code in panel content
var setInnerHTML = function(elm, html) {
elm.innerHTML = html;
Array.from(elm.querySelectorAll('script')).forEach( oldScript => {
const newScript = document.createElement('script');
Array.from(oldScript.attributes)
.forEach( attr => newScript.setAttribute(attr.name, attr.value) );
newScript.appendChild(document.createTextNode(oldScript.innerHTML));
oldScript.parentNode.replaceChild(newScript, oldScript);
});
}
var plotPanel = jsPanel.create({
panelSize: '190 0',
position: 'left-top 160 6',
dragit: { containment: [-10, -2000, -4000, -2000] }, // set dragging range of VIP window
boxShadow: 1,
border: "solid #D4DBDE thin",
contentOverflow: 'scroll scroll', // adding scrolling bars
headerControls:{
close: 'remove',
minimize: 'remove',
maximize: 'remove'
},
headerTitle: function () {return '<strong>Visualization in Plugin</strong>'},
contentAjax: {
url: window.location.href.replace(/\\\/+$/,'')+'/static/interface.html',
done: function (panel) {
setInnerHTML(panel.content, this.responseText);
}
},
onwindowresize: function(event, panel) {
var jptop = parseInt(this.currentData.top);
var jpleft = parseInt(this.currentData.left);
if (jptop<-10 || window.innerHeight-jptop<10 || window.innerWidth-jpleft<10 || jpleft+parseInt(this.currentData.width)<10) {
this.reposition("left-top 160 6");
}
},
onunsmallified: function (panel, status) {
this.reposition('center-top -370 180');
this.resize({ width: 740, height: function() { return Math.min(480, window.innerHeight*0.6);} });
},
onsmallified: function (panel, status) {
this.reposition('left-top 160 6');
this.style.width = '190px';
}
}).smallify();
plotPanel.headerbar.style.background = "#D4DBDE";
</script>