forked from DKirwan/calendar-heatmap
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Krypternite/master
Merging with upstream changes
- Loading branch information
Showing
7 changed files
with
235 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>D3.js Calendar Heatmap</title> | ||
<link rel="stylesheet" type="text/css" href="../src/calendar-heatmap.css"> | ||
</head> | ||
<body> | ||
<div class="container"></div> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" charset="utf-8"></script> | ||
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script> | ||
<script src="../src/calendar-heatmap.js"></script> | ||
<script type="text/javascript"> | ||
var now = moment().endOf('day').toDate(); | ||
var yearAgo = moment().startOf('day').subtract(1, 'year').toDate(); | ||
var chartData = d3.time.days(yearAgo, now).map(function (dateElement) { | ||
return { | ||
date: dateElement, | ||
count: (dateElement.getDay() !== 0 && dateElement.getDay() !== 6) ? Math.floor(Math.random() * 60) : Math.floor(Math.random() * 10) | ||
}; | ||
}); | ||
|
||
var heatmap = calendarHeatmap() | ||
.data(chartData) | ||
.selector('.container') | ||
.tooltipEnabled(true) | ||
.colorRange(['#f4f7f7', '#79a8a9']) | ||
.onClick(function (data) { | ||
console.log('data', data); | ||
}); | ||
heatmap(); // render the chart | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>D3.js v4 Calendar Heatmap</title> | ||
<link rel="stylesheet" type="text/css" href="../src/calendar-heatmap.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"></div> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" charset="utf-8"></script> | ||
<script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script> | ||
<script src="../src/calendar-heatmap.js"></script> | ||
<script type="text/javascript"> | ||
var now = moment().endOf('day').toDate(); | ||
var yearAgo = moment().startOf('day').subtract(1, 'year').toDate(); | ||
var chartData = d3.timeDays(yearAgo, now).map(function (dateElement) { | ||
return { | ||
date: dateElement, | ||
count: (dateElement.getDay() !== 0 && dateElement.getDay() !== 6) ? Math.floor(Math.random() * 60) : Math.floor(Math.random() * 10) | ||
}; | ||
}); | ||
|
||
var heatmap = calendarHeatmap() | ||
.data(chartData) | ||
.selector('.container') | ||
.tooltipEnabled(true) | ||
.colorRange(['#f4f7f7', '#79a8a9']) | ||
.onClick(function (data) { | ||
console.log('data', data); | ||
}); | ||
heatmap(); // render the chart | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,16 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>D3.js Calendar Heatmap</title> | ||
<link rel="stylesheet" type="text/css" href="../src/calendar-heatmap.css"> | ||
</head> | ||
<body> | ||
<div class="container"></div> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" charset="utf-8"></script> | ||
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script> | ||
<script src="../src/calendar-heatmap.js"></script> | ||
<script type="text/javascript"> | ||
var now = moment().endOf('day').toDate(); | ||
var yearAgo = moment().startOf('day').subtract(1, 'year').toDate(); | ||
var chartData = d3.time.days(yearAgo, now).map(function (dateElement) { | ||
return { | ||
date: dateElement, | ||
count: (dateElement.getDay() !== 0 && dateElement.getDay() !== 6) ? Math.floor(Math.random() * 60) : Math.floor(Math.random() * 10) | ||
}; | ||
}); | ||
|
||
var heatmap = calendarHeatmap() | ||
.data(chartData) | ||
.selector('.container') | ||
.tooltipEnabled(true) | ||
.colorRange(['#f4f7f7', '#79a8a9']) | ||
.onClick(function (data) { | ||
console.log('data', data); | ||
}); | ||
heatmap(); // render the chart | ||
</script> | ||
</body> | ||
</html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>D3.js Calendar Heatmap</title> | ||
<link rel="stylesheet" type="text/css" href="../src/calendar-heatmap.css"> | ||
</head> | ||
|
||
<body> | ||
<h1>v3</h1> | ||
<iframe src="_v3.html" frameborder="0" width="1000" height="200"></iframe> | ||
<h1>v4</h1> | ||
<iframe src="_v4.html" frameborder="0" width="1000" height="200"></iframe> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.