forked from escher/escher.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
builder.html
132 lines (113 loc) · 10 KB
/
builder.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang="en">
<head>
<title>Escher Builder</title>
<!-- These are not generally used within the notebook. -->
<script src="escher/lib/jquery-2.1.0.min.js"></script>
<script src="escher/lib/bootstrap-3.1.1.min.js"></script>
<link rel="stylesheet" href="escher/lib/bootstrap-3.1.1.min.css"/>
<link rel="stylesheet" href="escher/css/builder-1.2.1.css"/>
<!-- Require only loaded in standalone file. -->
<script src="escher/lib/require.min.js"></script>
<link rel="shortcut icon" href="escher/resources/favicon.ico" />
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, height=device-height,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"/>
</head>
<body>
<div style="height: 100%; width: 100%;" id="static"></div>
<script>
var map_data_static = null;
var model_data_static = null;
var reaction_data_static = null;
var metabolite_data_static = null;
var gene_data_static = null;
var embedded_css_static = '@charset "utf-8";svg.escher-svg #mouse-node { fill: none;}svg.escher-svg #canvas { stroke: #ccc; stroke-width: 7px; fill: white;}svg.escher-svg .resize-rect { fill: black; opacity: 0; stroke: none;}svg.escher-svg .label { font-family: sans-serif; font-style: italic; font-weight: bold; font-size: 8px; fill: black; stroke: none; text-rendering: optimizelegibility; cursor: default;}svg.escher-svg .reaction-label { font-size: 30px; fill: rgb(32, 32, 120); text-rendering: optimizelegibility;}svg.escher-svg .node-label { font-size: 20px;}svg.escher-svg .gene-label { font-size: 18px; fill: rgb(32, 32, 120); text-rendering: optimizelegibility; cursor: default;}svg.escher-svg .text-label .label { font-size: 50px;}svg.escher-svg .text-label-input { font-size: 50px;}svg.escher-svg .node-circle { stroke-width: 2px;}svg.escher-svg .midmarker-circle, svg.escher-svg .multimarker-circle { fill: white; fill-opacity: 0.2; stroke: rgb(50, 50, 50);}svg.escher-svg g.selected .node-circle{ stroke-width: 6px; stroke: rgb(20, 113, 199);}svg.escher-svg g.selected .label { fill: rgb(20, 113, 199);}svg.escher-svg .metabolite-circle { stroke: rgb(162, 69, 16); fill: rgb(224, 134, 91);}svg.escher-svg g.selected .metabolite-circle { stroke: rgb(5, 2, 0);}svg.escher-svg .segment { stroke: #334E75; stroke-width: 10px; fill: none;}svg.escher-svg .arrowhead { fill: #334E75;}svg.escher-svg .stoichiometry-label-rect { fill: white; opacity: 0.5;}svg.escher-svg .stoichiometry-label { fill: #334E75; font-size: 17px;}svg.escher-svg .membrane { fill: none; stroke: rgb(255, 187, 0);}svg.escher-svg .brush .extent { fill-opacity: 0.1; fill: black; stroke: #fff; shape-rendering: crispEdges;}svg.escher-svg #brush-container .background { fill: none;}svg.escher-svg .bezier-circle { fill: rgb(255,255,255);}svg.escher-svg .bezier-circle.b1 { stroke: red;}svg.escher-svg .bezier-circle.b2 { stroke: blue;}svg.escher-svg .connect-line{ stroke: rgb(200,200,200);}svg.escher-svg .direction-arrow { stroke: black; stroke-width: 1px; fill: white; opacity: 0.3;}svg.escher-svg .start-reaction-cursor { cursor: pointer;}svg.escher-svg .start-reaction-target { stroke: rgb(100,100,100); fill: none; opacity: 0.5;}svg.escher-svg .rotation-center-line { stroke: red; stroke-width: 5px;}svg.escher-svg .highlight { fill: #D97000; text-decoration: underline;}svg.escher-svg .cursor-grab { cursor: grab; cursor: -webkit-grab;}svg.escher-svg .cursor-grabbing { cursor: grabbing; cursor: -webkit-grabbing;}svg.escher-svg .edit-text-cursor { cursor: text;}';
</script>
<script>
function escher_load_lib(url, callback){
var s = document.createElement('script');
s.src = url;
s.async = true;
s.onreadystatechange = s.onload = callback;
s.onerror = function() { console.warn("failed to load library " + url); };
document.getElementsByTagName("head")[0].appendChild(s);
}
if (typeof define === "function" && define.amd) {
// require.js is available: use it to load d3 and escher
require.config({paths: { d3: "escher/lib/d3.min",
escher: "escher/lib/escher-1.2.1.min" }});
require(["d3", "escher"], function(d3, escher) {
window.d3 = d3;
options = { enable_editing: true,
menu: "all",
enable_keys: true,
scroll_behavior: "pan",
fill_screen: true,
reaction_data: reaction_data_static,
metabolite_data: metabolite_data_static,
gene_data: gene_data_static,
never_ask_before_quit: false,
};
escher.static.load_map_model_from_url("1-0-0/3/maps/", "1-0-0/3/models/",
{"models": [{"organism": "Escherichia coli", "model_name": "e_coli_core"}, {"organism": "Escherichia coli", "model_name": "iJO1366"}, {"organism": "Homo sapiens", "model_name": "RECON1"}, {"organism": "Saccharomyces cerevisiae", "model_name": "iMM904"}], "maps": [{"map_name": "e_coli_core.Core metabolism", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Central metabolism", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Fatty acid beta-oxidation", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Fatty acid biosynthesis (saturated)", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Nucleotide metabolism", "organism": "Escherichia coli"}, {"map_name": "RECON1.Amino acid metabolism (partial)", "organism": "Homo sapiens"}, {"map_name": "RECON1.Carbohydrate metabolism", "organism": "Homo sapiens"}, {"map_name": "RECON1.Glycolysis TCA PPP", "organism": "Homo sapiens"}, {"map_name": "RECON1.Inositol retinol metabolism", "organism": "Homo sapiens"}, {"map_name": "RECON1.Tryptophan metabolism", "organism": "Homo sapiens"}, {"map_name": "iMM904.Central carbon metabolism", "organism": "Saccharomyces cerevisiae"}]},
options, function(map_data_static, model_data_static, options) {
escher.Builder(map_data_static, model_data_static, embedded_css_static, d3.select("#static"), options);
});
});
} else {
if (window.escher !== undefined && window.d3 !== undefined) {
// already loaded: just create the figure
!function(escher, d3) {
options = { enable_editing: true,
menu: "all",
enable_keys: true,
scroll_behavior: "pan",
fill_screen: true,
reaction_data: reaction_data_static,
metabolite_data: metabolite_data_static,
gene_data: gene_data_static,
never_ask_before_quit: false,
};
escher.static.load_map_model_from_url("1-0-0/3/maps/", "1-0-0/3/models/",
{"models": [{"organism": "Escherichia coli", "model_name": "e_coli_core"}, {"organism": "Escherichia coli", "model_name": "iJO1366"}, {"organism": "Homo sapiens", "model_name": "RECON1"}, {"organism": "Saccharomyces cerevisiae", "model_name": "iMM904"}], "maps": [{"map_name": "e_coli_core.Core metabolism", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Central metabolism", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Fatty acid beta-oxidation", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Fatty acid biosynthesis (saturated)", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Nucleotide metabolism", "organism": "Escherichia coli"}, {"map_name": "RECON1.Amino acid metabolism (partial)", "organism": "Homo sapiens"}, {"map_name": "RECON1.Carbohydrate metabolism", "organism": "Homo sapiens"}, {"map_name": "RECON1.Glycolysis TCA PPP", "organism": "Homo sapiens"}, {"map_name": "RECON1.Inositol retinol metabolism", "organism": "Homo sapiens"}, {"map_name": "RECON1.Tryptophan metabolism", "organism": "Homo sapiens"}, {"map_name": "iMM904.Central carbon metabolism", "organism": "Saccharomyces cerevisiae"}]},
options, function(map_data_static, model_data_static, options) {
escher.Builder(map_data_static, model_data_static, embedded_css_static, d3.select("#static"), options);
});
}(window.escher, window.d3);
} else {
// require.js not available: dynamically load d3 & escher
escher_load_lib("escher/lib/d3.min.js", function() {
escher_load_lib("escher/lib/escher-1.2.1.min.js", function() {
options = { enable_editing: true,
menu: "all",
enable_keys: true,
scroll_behavior: "pan",
fill_screen: true,
reaction_data: reaction_data_static,
metabolite_data: metabolite_data_static,
gene_data: gene_data_static,
never_ask_before_quit: false,
};
escher.static.load_map_model_from_url("1-0-0/3/maps/", "1-0-0/3/models/",
{"models": [{"organism": "Escherichia coli", "model_name": "e_coli_core"}, {"organism": "Escherichia coli", "model_name": "iJO1366"}, {"organism": "Homo sapiens", "model_name": "RECON1"}, {"organism": "Saccharomyces cerevisiae", "model_name": "iMM904"}], "maps": [{"map_name": "e_coli_core.Core metabolism", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Central metabolism", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Fatty acid beta-oxidation", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Fatty acid biosynthesis (saturated)", "organism": "Escherichia coli"}, {"map_name": "iJO1366.Nucleotide metabolism", "organism": "Escherichia coli"}, {"map_name": "RECON1.Amino acid metabolism (partial)", "organism": "Homo sapiens"}, {"map_name": "RECON1.Carbohydrate metabolism", "organism": "Homo sapiens"}, {"map_name": "RECON1.Glycolysis TCA PPP", "organism": "Homo sapiens"}, {"map_name": "RECON1.Inositol retinol metabolism", "organism": "Homo sapiens"}, {"map_name": "RECON1.Tryptophan metabolism", "organism": "Homo sapiens"}, {"map_name": "iMM904.Central carbon metabolism", "organism": "Saccharomyces cerevisiae"}]},
options, function(map_data_static, model_data_static, options) {
escher.Builder(map_data_static, model_data_static, embedded_css_static, d3.select("#static"), options);
});
})
});
}
}
</script>
<script>
// temporary fixes for mobile browsers (currently iOS)
if (navigator.userAgent.match(/.*OS 7_\d/i)) {
$(".fill-screen-div").css('height', window.innerHeight +"px");
$(window).resize(function(){
$(".fill-screen-div").css('height', window.innerHeight +"px");
document.body.scrollTop = 0;
})
}
</script>
</body>
</html>