Skip to content

Instantly share code, notes, and snippets.

@benjchristensen
Created June 5, 2012 17:44
Show Gist options
  • Save benjchristensen/2876507 to your computer and use it in GitHub Desktop.
Save benjchristensen/2876507 to your computer and use it in GitHub Desktop.
Issue 655 Fix #2
<html>
<head>
<title>Issue 655</title>
<script src="https://github.com/benjchristensen/d3/raw/fix-log-ticks/d3.v2.js"></script>
</head>
<body>
<a href="https://github.com/mbostock/d3/issues/655">D3.js Issue 655</a>
<p>
Testing this code:
<pre>
var y = d3.scale.log().domain([1e-1, 1e7]);
y.ticks(6).map(y.tickFormat(6));
</pre>
View the Javascript console to see output of testing.
<script>
var y = d3.scale.log().domain([1e-1, 1e5]);
var ticks = y.ticks(6).map(y.tickFormat(6));
console.log("working [1e-1, 1e5] => " + ticks)
console.log("*************************************************************")
/*
var y = d3.scale.log().domain([1e-1, 1e6]);
var ticks = y.ticks(6).map(y.tickFormat(6));
console.log("broken [1e-1, 1e6] => " + ticks)
console.log("*************************************************************")
var y = d3.scale.log().domain([1e-1, 1e7]);
var ticks = y.ticks(6).map(y.tickFormat(6));
console.log("broken [1e-1, 1e7] => " + ticks)
console.log("*************************************************************")
*/
var y = d3.scale.log().domain([1e-1, 1e9]);
var ticks = y.ticks(6).map(y.tickFormat(6));
console.log("broken [1e-1, 1e9] => " + ticks)
console.log("*************************************************************")
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment