Start work on D3 cal-heatmap

This commit is contained in:
Michael Q Larson
2015-02-19 17:18:44 -08:00
parent 85f6c6eb4d
commit 2e8c6461e6
2 changed files with 20 additions and 13 deletions

7
app.js
View File

@ -139,11 +139,16 @@ var trusted = [
'*.ionicframework.com', '*.ionicframework.com',
'https://syndication.twitter.com', 'https://syndication.twitter.com',
'*.youtube.com', '*.youtube.com',
'*.jsdelivr.net'
]; ];
app.use(helmet.contentSecurityPolicy({ app.use(helmet.contentSecurityPolicy({
defaultSrc: trusted, defaultSrc: trusted,
scriptSrc: ['*.optimizely.com', '*.aspnetcdn.com'].concat(trusted), scriptSrc: [
'*.optimizely.com',
'*.aspnetcdn.com',
'*.d3js.org',
].concat(trusted),
'connect-src': [ 'connect-src': [
'ws://*.rafflecopter.com', 'ws://*.rafflecopter.com',
'wss://*.rafflecopter.com', 'wss://*.rafflecopter.com',

View File

@ -98,15 +98,17 @@ block content
| Try it out | Try it out
- if (ch[0] > 0) - if (ch[0] > 0)
.col-sm-12 html.
table.table.table-striped <script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script>
thead <script type="text/javascript" src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js"></script>
tr <link rel="stylesheet" href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
th Challenge
th Date Finished .col-xs-12
for challenge in challenges p= ch
if ch[challenge.challengeNumber] > 0 .embed-responsive.embed-responsive-16by9
tr #cal-heatmap
td= challenges[challenge.challengeNumber].name script.
td= moment(ch[challenge.challengeNumber], 'X').format("MMM DD, YYYY") var cal = new CalHeatMap();
br cal.init({
"domain": "day"
});