提交 93fd1955 authored 作者: Christof Angermueller's avatar Christof Angermueller

Update menu bar

上级 e7750bc4
...@@ -4,7 +4,15 @@ svg { ...@@ -4,7 +4,15 @@ svg {
display:block; display:block;
position: fixed; position: fixed;
border: 0px solid black; border: 0px solid black;
top:5%; left:0%; right:0% bottom=10% top: 32px; left:0%; right:0% bottom=0%
}
.menuBar {
border-bottom: 1px solid black;
height: 22px;
}
input.menuBar {
} }
.nodeRect { .nodeRect {
......
...@@ -34,6 +34,11 @@ class PyDotFormatter(object): ...@@ -34,6 +34,11 @@ class PyDotFormatter(object):
:param compact: if True, will remove intermediate variables without :param compact: if True, will remove intermediate variables without
name. name.
""" """
if not pydot_imported:
raise RuntimeError("Failed to import pydot. You must install pydot"
" for `pydotprint` to work.")
self.compact = compact self.compact = compact
self.node_colors = {'input': 'limegreen', self.node_colors = {'input': 'limegreen',
'constant_input': 'SpringGreen', 'constant_input': 'SpringGreen',
...@@ -106,9 +111,6 @@ class PyDotFormatter(object): ...@@ -106,9 +111,6 @@ class PyDotFormatter(object):
outputs=fct) outputs=fct)
outputs = fct.outputs outputs = fct.outputs
topo = fct.toposort() topo = fct.toposort()
if not pydot_imported:
raise RuntimeError("Failed to import pydot. You must install pydot"
" for `pydotprint` to work.")
outputs = list(outputs) outputs = list(outputs)
# Loop over apply nodes # Loop over apply nodes
......
...@@ -10,20 +10,20 @@ ...@@ -10,20 +10,20 @@
<script type='text/javascript' src="%% JS_DIR %%/d3-context-menu.js"></script> <script type='text/javascript' src="%% JS_DIR %%/d3-context-menu.js"></script>
</head> </head>
<body> <body>
<div id='menu'> <div id='menu' class='menuBar'>
<input name="resetNodes" <input name="resetNodes"
type="button" type="button"
value="Reset nodes" value="Reset nodes"
onclick="resetNodes()"/> onclick="resetNodes()"/>
<input name="releaseNodes" <input name="releaseNodes"
type="button" type="button"
value="Release nodes" value="Release nodes"
onclick="releaseNodes()"/> onclick="releaseNodes()"/>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
// Path to DOT file // Path to DOT file
var path = '%% DOT_FILE %%'; var path = '%% DOT_FILE %%'; // '%% DOT_FILE %%';
// Backend graph in DOT format // Backend graph in DOT format
var dotGraph; var dotGraph;
// Frontend graph for visualization // Frontend graph for visualization
......
...@@ -424,13 +424,13 @@ function drawConvexHull(d) { ...@@ -424,13 +424,13 @@ function drawConvexHull(d) {
* Positions will be updated by updateGraph(). * Positions will be updated by updateGraph().
*/ */
function drawGraph() { function drawGraph() {
d3.select('body').select('#menu').select('#toggleColors').remove();
if (isProfiled) { if (isProfiled) {
d3.select('body').select('#menu').append('input') d3.select('body').select('#menu').append('input')
.attr('name', 'tColors') .attr('id', 'toggleColors')
.attr('type', 'button') .attr('type', 'button')
.attr('value', 'Toggle profile colors') .attr('value', 'Toggle profile colors')
.attr('onclick', "toggleNodeColors()"); .attr('onclick', "toggleNodeColors()");
maxProfilePer = 0; maxProfilePer = 0;
for (i in graph.nodes) { for (i in graph.nodes) {
var p = graph.nodes[i].value.profile; var p = graph.nodes[i].value.profile;
...@@ -601,11 +601,9 @@ function drawGraph() { ...@@ -601,11 +601,9 @@ function drawGraph() {
.nodes(graph.nodes) .nodes(graph.nodes)
.links(graph.edges) .links(graph.edges)
.size(graph.size) .size(graph.size)
.linkDistance(function(d) { .linkDistance(200)
return 300; .charge(-1000)
}) .linkStrength(0.2)
.charge(-600)
.linkStrength(1)
.gravity(0.05) .gravity(0.05)
.friction(0.5) .friction(0.5)
.on('tick', updateGraph) .on('tick', updateGraph)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论