D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
benjchristensen
Full window
Github gist
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>
https://github.com/benjchristensen/d3/raw/fix-log-ticks/d3.v2.js