Skip to content

Commit

Permalink
Use var
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Jun 15, 2020
1 parent 96b8f4b commit da99948
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/linear.js
Expand Up @@ -4,37 +4,37 @@ import {initRange} from "./init.js";
import tickFormat from "./tickFormat.js";

export function linearish(scale) {
const domain = scale.domain;
var domain = scale.domain;

scale.ticks = function(count) {
const d = domain();
var d = domain();
return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
};

scale.tickFormat = function(count, specifier) {
const d = domain();
var d = domain();
return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
};

scale.nice = function(count) {
if (count == null) count = 10;

const d = domain();
let i0 = 0;
let i1 = d.length - 1;
let start = d[i0];
let stop = d[i1];
let prestep;
let step;
let maxIter = 10;
var d = domain();
var i0 = 0;
var i1 = d.length - 1;
var start = d[i0];
var stop = d[i1];
var prestep;
var step;
var maxIter = 10;

if (stop < start) {
step = start, start = stop, stop = step;
step = i0, i0 = i1, i1 = step;
}

while (maxIter-- > 0) {
const step = tickIncrement(start, stop, count);
step = tickIncrement(start, stop, count);
if (step === prestep) {
d[i0] = start
d[i1] = stop
Expand All @@ -58,7 +58,7 @@ export function linearish(scale) {
}

export default function linear() {
const scale = continuous();
var scale = continuous();

scale.copy = function() {
return copy(scale, linear());
Expand Down

0 comments on commit da99948

Please sign in to comment.