Line 17: | Line 17: | ||
<div id="cal-heatmap"></div> | <div id="cal-heatmap"></div> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
+ | var startTimestamp = new Date(2016, 10, 1).getTime()/1000; | ||
+ | function GAconverter(data) { | ||
+ | var i, total, results = {}; | ||
+ | for(i = 0, total = data.length; i < total; i++) { | ||
+ | results[+data[i].Day * 30 + startTimestamp] = +data[i].Visits; | ||
+ | } | ||
+ | return results; | ||
+ | } | ||
+ | |||
+ | |||
var cal = new CalHeatMap(); | var cal = new CalHeatMap(); | ||
cal.init({ | cal.init({ | ||
Line 24: | Line 34: | ||
range: 12, | range: 12, | ||
start : new Date(2016, 10), | start : new Date(2016, 10), | ||
− | data: " | + | data: "https://static.igem.org/mediawiki/2017/2/2f/T--Hong_Kong_UCCKE--heatmap_test_1.csv", |
+ | dataType: "csv", | ||
+ | afterLoadData: GAconverter, | ||
range: 12, | range: 12, | ||
legend: [5, 10, 15, 20, 25, 30], | legend: [5, 10, 15, 20, 25, 30], |
Revision as of 13:31, 13 August 2017
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vel varius libero, a mattis risus. Praesent sit amet ipsum ac odio venenatis consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vel varius libero, a mattis risus. Praesent sit amet ipsum ac odio venenatis consectetur.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vel varius libero, a mattis risus. Praesent sit amet ipsum ac odio venenatis consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vel varius libero, a mattis risus. Praesent sit amet ipsum ac odio venenatis consectetur.
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vel varius libero, a mattis risus. Praesent sit amet ipsum ac odio venenatis consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vel varius libero, a mattis risus. Praesent sit amet ipsum ac odio venenatis consectetur.