Skip to content

Instantly share code, notes, and snippets.

@calderaro
Created August 20, 2019 20:23
Show Gist options
  • Save calderaro/80b93dd0770294fd11e001d61527c91d to your computer and use it in GitHub Desktop.
Save calderaro/80b93dd0770294fd11e001d61527c91d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/sulipiw
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://d3js.org/d3-array.v2.min.js"></script>
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-format.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-time.v1.min.js"></script>
<script src="https://d3js.org/d3-time-format.v2.min.js"></script>
<script src="https://d3js.org/d3-scale.v3.min.js"></script>
</head>
<body>
<script id="jsbin-javascript">
const x = d3.scaleTime()
.domain([new Date(2000, 0, 1), new Date(2000, 0, 20)])
.range([0, 960]);
x.ticks(6).forEach(e => console.log({ date: e.toString(), x: x(e)}))
</script>
<script id="jsbin-source-javascript" type="text/javascript">const x = d3.scaleTime()
.domain([new Date(2000, 0, 1), new Date(2000, 0, 20)])
.range([0, 960]);
x.ticks(6).forEach(e => console.log({ date: e.toString(), x: x(e)}))
</script></body>
</html>
const x = d3.scaleTime()
.domain([new Date(2000, 0, 1), new Date(2000, 0, 20)])
.range([0, 960]);
x.ticks(6).forEach(e => console.log({ date: e.toString(), x: x(e)}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment