Skip to content

Commit

Permalink
fix spelling of focusRangeMS
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand committed Oct 17, 2017
1 parent e433cc8 commit 38d3539
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/client/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ function init (client, d3, $) {

var updateBrush = d3.select('.brush').transition();
updateBrush
.call(chart.brush.extent([new Date(dataRange[1].getTime() - client.foucusRangeMS), dataRange[1]]));
.call(chart.brush.extent([new Date(dataRange[1].getTime() - client.focusRangeMS), dataRange[1]]));
client.brushed(true);

renderer.addContextCircles();
Expand Down
14 changes: 7 additions & 7 deletions lib/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ client.load = function load(serverSettings, callback) {

client.hashauth.initAuthentication(client.afterAuth);

client.foucusRangeMS = times.hours(client.settings.focusHours).msecs;
client.focusRangeMS = times.hours(client.settings.focusHours).msecs;
$('.focus-range li[data-hours=' + client.settings.focusHours + ']').addClass('selected');
client.brushed = brushed;
client.formatTime = formatTime;
Expand Down Expand Up @@ -365,7 +365,7 @@ client.load = function load(serverSettings, callback) {
d3.select('.brush')
.transition()
.duration(UPDATE_TRANS_MS)
.call(chart.brush.extent([new Date(dataRange[1].getTime() - client.foucusRangeMS), dataRange[1]]));
.call(chart.brush.extent([new Date(dataRange[1].getTime() - client.focusRangeMS), dataRange[1]]));

if (!skipBrushing) {
brushed();
Expand All @@ -385,14 +385,14 @@ client.load = function load(serverSettings, callback) {
var brushExtent = chart.brush.extent();

// ensure that brush extent is fixed at 3.5 hours
if (brushExtent[1].getTime() - brushExtent[0].getTime() !== client.foucusRangeMS) {
if (brushExtent[1].getTime() - brushExtent[0].getTime() !== client.focusRangeMS) {
// ensure that brush updating is with the time range
if (brushExtent[0].getTime() + client.foucusRangeMS > client.dataExtent()[1].getTime()) {
brushExtent[0] = new Date(brushExtent[1].getTime() - client.foucusRangeMS);
if (brushExtent[0].getTime() + client.focusRangeMS > client.dataExtent()[1].getTime()) {
brushExtent[0] = new Date(brushExtent[1].getTime() - client.focusRangeMS);
d3.select('.brush')
.call(chart.brush.extent([brushExtent[0], brushExtent[1]]));
} else {
brushExtent[1] = new Date(brushExtent[0].getTime() + client.foucusRangeMS);
brushExtent[1] = new Date(brushExtent[0].getTime() + client.focusRangeMS);
d3.select('.brush')
.call(chart.brush.extent([brushExtent[0], brushExtent[1]]));
}
Expand Down Expand Up @@ -868,7 +868,7 @@ client.load = function load(serverSettings, callback) {
$('.focus-range li').removeClass('selected');
li.addClass('selected');
var hours = Number(li.data('hours'));
client.foucusRangeMS = times.hours(hours).msecs;
client.focusRangeMS = times.hours(hours).msecs;
Storages.localStorage.set('focusHours', hours);
refreshChart();
} else {
Expand Down

0 comments on commit 38d3539

Please sign in to comment.