1

More cleanup

This commit is contained in:
Alex Yatskov 2014-10-31 11:51:11 +09:00
parent 0abb488acd
commit 97d13f5e41
3 changed files with 49 additions and 46 deletions

View File

@ -14,39 +14,39 @@
</div>
<!-- query input -->
<!-- <div id="input" class="form-horizontal"> -->
<!-- <div class="form-group"> -->
<!-- <label for="keywordsToSearch" class="col-md-2 control-label">Keywords</label> -->
<!-- <div class="col-md-10"> -->
<!-- <select id="keywordsToSearch" class="form-control" multiple="multiple" data-max-options="4" data-live-search="data-live-search"></select> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="form-group"> -->
<!-- <label for="minScore" class="col-md-2 control-label">Minimum score</label> -->
<!-- <div class="col-md-10"> -->
<!-- <input class="form-control" type="number" step="any" value="0.25" id="minScore"> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="form-group"> -->
<!-- <label for="hintSteps" class="col-md-2 control-label">Hint steps</label> -->
<!-- <div class="col-md-10"> -->
<!-- <input class="form-control" type="number" value="20" id="hintSteps"> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="form-group"> -->
<!-- <label for="maxResults" class="col-md-2 control-label">Max results</label> -->
<!-- <div class="col-md-10"> -->
<!-- <input class="form-control" type="number" value="100" id="maxResults"> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="form-group"> -->
<!-- <div class="col-md-offset-2 col-md-10"> -->
<!-- <button class="btn btn-primary" id="searchKeywords" type="button" disabled="disabled"> -->
<!-- <span class="glyphicon glyphicon-search"></span> Search -->
<!-- </button> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<div id="input" class="form-horizontal">
<div class="form-group">
<label for="keywordsToSearch" class="col-md-2 control-label">Keywords</label>
<div class="col-md-10">
<select id="keywordsToSearch" class="form-control" multiple="multiple" data-max-options="4" data-live-search="data-live-search"></select>
</div>
</div>
<div class="form-group">
<label for="minScore" class="col-md-2 control-label">Minimum score</label>
<div class="col-md-10">
<input class="form-control" type="number" step="any" value="0.25" id="minScore">
</div>
</div>
<div class="form-group">
<label for="hintSteps" class="col-md-2 control-label">Hint steps</label>
<div class="col-md-10">
<input class="form-control" type="number" value="20" id="hintSteps">
</div>
</div>
<div class="form-group">
<label for="maxResults" class="col-md-2 control-label">Max results</label>
<div class="col-md-10">
<input class="form-control" type="number" value="100" id="maxResults">
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<button class="btn btn-primary" id="searchKeywords" type="button" disabled="disabled">
<span class="glyphicon glyphicon-search"></span> Search
</button>
</div>
</div>
</div>
<!-- options dialog -->
<div class="modal fade" id="optionsDialog" tabindex="-1">
@ -130,9 +130,6 @@
</symbol>
<use xlink:href="#graph" x="0" y="0"/>
<use xlink:href="#graph" x="110" y="0"/>
<use xlink:href="#graph" x="220" y="0"/>
<use xlink:href="#graph" x="330" y="0"/>
</svg>
<!-- query output -->

View File

@ -70,7 +70,13 @@
ctx.hintSteps = query.hintSteps;
ctx.maxResults = query.maxResults;
ctx.grapher = new grapher.Grapher('grapher', ctx.searchRange, 150, true, true);
ctx.grapher = new grapher.Grapher({
canvas: null,
columnRange: ctx.searchRange,
columnWidth: 150,
useLocalScale: true,
useRelativeScale: true
});
ctx.grapher.setColumns(results.columns);
ctx.grapher.setValueChangedListener(onAdjust);
@ -86,9 +92,9 @@
var useRelativeScale = $('#useRelativeScale').is(':checked');
ctx.grapher.setUseRelativeScale(useRelativeScale);
});
$('#input').fadeOut(function() {
$('#output').fadeIn();
});
// $('#input').fadeOut(function() {
// $('#output').fadeIn();
// });
});
}

View File

@ -238,7 +238,7 @@
for (var name in columns) {
var data = columns[name];
if (useLocalScale) {
scale = this.computeLocalScale(column.hints);
scale = this.computeLocalScale(data.hints);
}
var column = this.columns[name];
@ -246,13 +246,13 @@
column.update(data, scale);
}
else {
this.columns.push(new Column({
this.columns[name] = new Column({
canvas: this.canvas,
data: column,
name: name,
range: this.range,
scale: scale,
}));
});
}
}
};
@ -300,9 +300,9 @@
this.canvas = params.canvas;
this.columnData = null;
this.columnPadding = 10;
this.columnPadding = params.columnPadding || 10;
this.columnRange = new Range(-1.0, 1.0);
this.columnWidth = 100;
this.columnWidth = params.columnWidth || 100;
this.columns = {};
this.useLocalScale = params.useLocalScale || true;
this.useRelativeScale = params.useRelativeScale || true;