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',
'https://syndication.twitter.com',
'*.youtube.com',
'*.jsdelivr.net'
];
app.use(helmet.contentSecurityPolicy({
defaultSrc: trusted,
scriptSrc: ['*.optimizely.com', '*.aspnetcdn.com'].concat(trusted),
scriptSrc: [
'*.optimizely.com',
'*.aspnetcdn.com',
'*.d3js.org',
].concat(trusted),
'connect-src': [
'ws://*.rafflecopter.com',
'wss://*.rafflecopter.com',

View File

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