Skip to content
This repository was archived by the owner on Oct 7, 2022. It is now read-only.

Commit 4078efe

Browse files
committed
Testing mirror
1 parent 232826e commit 4078efe

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

mdb/spectra_search/templates/spectra_search/basic_search.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -634,12 +634,15 @@ <h5 class="mb-0">
634634
//~ $('#col-left').addClass('col-6');
635635
document.getElementById('spectra-viz').style.display = 'block';
636636
var margin = {top: 10, right: 30, bottom: 30, left: 60},
637-
width = 860 - margin.left - margin.right,
637+
width = 1000 - margin.left - margin.right,
638638
height = 500 - margin.top - margin.bottom;
639639
var svg = d3.select('#spectra-viz')
640640
.append('svg')
641-
.attr('width', width + margin.left + margin.right)
642-
.attr('height', height + margin.top + margin.bottom)
641+
.attr('width', width + margin.left + margin.right)
642+
.attr('height', height + margin.top + margin.bottom)
643+
.call(d3.zoom().on('zoom', function (event, d) {
644+
svg.attr('transform', event.transform)
645+
}))
643646
.append('g')
644647
.attr('transform',
645648
'translate(' + margin.left + ',' + margin.top + ')');
@@ -707,7 +710,7 @@ <h5 class="mb-0">
707710
.attr('width', 0.5);
708711
// mirror original x, for matching
709712
for (var i in p1) {
710-
var x = Math.round(parseFloat(p1[i]) * 100) / 100; // Keeps two digits
713+
var x = Math.round(parseFloat(p1[i]));// / 1; // zero digit
711714
mirror.x_peaks[x] = true;
712715
}
713716
//~ svg.append("path")
@@ -766,7 +769,7 @@ <h5 class="mb-0">
766769
g.selectAll('*').remove();
767770

768771
var color = function(x) {
769-
x = Math.round(parseFloat(x) * 100) / 100;
772+
x = Math.round(parseFloat(x));// / 1; // zero digit
770773
return (mirror.x_peaks[x]) ? '#0000ff' : '#000000';
771774
}
772775
//allStrains.push(dx.strain.trim().replace(/\s/g, ''));

mdb/spectra_search/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ def process_file(request, file, form, owner):
196196

197197
obj = CollapsedCosineScore.objects.create(
198198
spectra = n1,
199-
library = form.cleaned_data['library'], # lib unnecessary in ccs model
199+
library = form.cleaned_data['library'], # lib unneces
200+
sary in ccs model
200201
scores = ','.join(map(str, list(o.values()))),
201202
spectra_ids = ','.join(map(str, o.keys())))
202203

0 commit comments

Comments
 (0)