Skip to content

Commit 72b5699

Browse files
authored
Merge pull request #199 from pynbody/webserver-ui-fixes
Fix hitches in improved web server interface
2 parents 56b9419 + 3bfea91 commit 72b5699

4 files changed

Lines changed: 38 additions & 21 deletions

File tree

tangos/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
from .core import *
2121
from .query import *
2222

23-
__version__ = '1.6.0'
23+
__version__ = '1.6.1'

tangos/web/static/css/stylesheet.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ th {
124124

125125
#imgbox {
126126
overflow: scroll;
127+
height: 100%;
127128
}
128129

129130
#imgbox::-webkit-scrollbar {
@@ -185,6 +186,8 @@ span.step_unavailable a {
185186
max-width: 80vw;
186187
padding: 1em;
187188
box-shadow: -10px 0 10px white;
189+
display: flex;
190+
flex-direction: column;
188191
}
189192

190193

@@ -424,6 +427,9 @@ a.delete::before {
424427
background-repeat: no-repeat;
425428
}
426429

430+
a.download-link {
431+
white-space: nowrap;
432+
}
427433

428434
label.x-plot-radio::before {
429435
content: " ";
@@ -465,4 +471,5 @@ input {
465471
border-right: 2px solid rgba(187, 68, 0, 0.2);
466472
cursor: ew-resize;
467473
z-index: 0;
474+
flex-grow: 1;
468475
}

tangos/web/static/halo_view.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ function updateDownloadButtons () {
203203
if ($('#image_form').values().type === 'tree') {
204204
$('#download-merger-tree').show()
205205
$('#download-csv-link').hide()
206+
$('#options-images').hide()
206207
} else {
207208
$('#download-csv-link').show()
208209
$('#download-merger-tree').hide()
210+
$('#options-images').show()
209211
}
210212
}
211213

@@ -333,6 +335,10 @@ function expandFixedRows() {
333335
});
334336
}
335337

338+
function updateImageBoxSize() {
339+
if(!isDisplayingTree()) fetchPlot(true);
340+
}
341+
336342
$(function () {
337343

338344
prePageUpdate(function () {
@@ -366,8 +372,11 @@ $(function () {
366372
{handles: 'w', minWidth: 200, containment: 'document',
367373
stop: function(event, ui) {
368374
$('#imgbox_container').css('left',''); // otherwise jqueryui leaves it with a fixed left edge, breaking window resizing
369-
if(!isDisplayingTree()) fetchPlot(true); // update for new size of image box
370-
}});
375+
updateImageBoxSize();
376+
}}
377+
);
378+
379+
$(window).resize(updateImageBoxSize);
371380

372381

373382

tangos/web/templates/halo_view.jinja2

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,25 @@
8989
<input name="type" value="tree" type="radio" id="type-tree"><label for="type-tree">Merger tree</label>;
9090
or plot for: <input name="type" value="gather" type="radio" id="type-gather"><label for="type-gather">This timestep</label>
9191
<input name="type" value="cascade" type="radio" id="type-cascade" checked><label for="type-cascade">This halo</label><br/>
92-
<input name="logx" type="checkbox" id="logx"/><label for="logx">log x</label>
93-
<input name="logy" type="checkbox" id="logy"/><label for="logy">log y</label>
94-
<label for="image_format">Image format</label>
95-
<select id="image_format">
96-
<option value='svg' selected>SVG</option>
97-
<option value='png'>PNG</option>
98-
<option value='pdf'>PDF</option>
99-
</select>
100-
<input name="logimage" type="checkbox" id="logimage"/><label for="logimage">log images</label>.
101-
<input type="checkbox" name="use_range" id="use_range" onclick="rangeDisplay()"/><label for="use_range">Use range</label>
102-
<p id="vmin-vmax-range">
103-
<label for="vmin">Vmin</label>
104-
<input name="vmin" type="range" id="vmin" min="0", vmax="100" value="0" onchange="fetchPlot()">
105-
<label for="vmax">Vmax</label>
106-
<input name="vmax" type="range" id="vmax" min="0", vmax="100" value="100" onchange="fetchPlot()">
107-
</p>
108-
<span class="download-area-csv"><a href="#" id="download-csv-link">&#x25BC; Download CSV</a></span>
109-
<span class="download-area-tree"><a href="#" id="download-merger-tree">&#x25BC; Download Merger Tree</a></span>
92+
<span id="options-images">
93+
<select id="image_format">
94+
<option value='svg' selected>SVG</option>
95+
<option value='png'>PNG</option>
96+
<option value='pdf'>PDF</option>
97+
</select>
98+
<input name="logx" type="checkbox" id="logx"/><label for="logx">log x</label>
99+
<input name="logy" type="checkbox" id="logy"/><label for="logy">log y</label>
100+
<input name="logimage" type="checkbox" id="logimage"/><label for="logimage">log images</label>.
101+
<input type="checkbox" name="use_range" id="use_range" onclick="rangeDisplay()"/><label for="use_range">Use range</label>
102+
<p id="vmin-vmax-range">
103+
<label for="vmin">Vmin</label>
104+
<input name="vmin" type="range" id="vmin" min="0", vmax="100" value="0" onchange="fetchPlot()">
105+
<label for="vmax">Vmax</label>
106+
<input name="vmax" type="range" id="vmax" min="0", vmax="100" value="100" onchange="fetchPlot()">
107+
</p>
108+
</span>
109+
<a href="#" id="download-csv-link" class="download-link">&#x25BC; Download CSV</a>
110+
<a href="#" id="download-merger-tree" class="download-link">&#x25BC; Download Merger Tree</a>
110111
</form>
111112
</div>
112113
<div id="imgbox"></div>

0 commit comments

Comments
 (0)