Skip to content

Instantly share code, notes, and snippets.

@anaeliaovalle
Last active February 22, 2017 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaeliaovalle/ae3a447b23d2c26d43502790488592d4 to your computer and use it in GitHub Desktop.
Save anaeliaovalle/ae3a447b23d2c26d43502790488592d4 to your computer and use it in GitHub Desktop.
heat_students
license: gpl-3.0
k_rank_cond_parq5 k_rank_cond_parq4 k_rank_cond_parq3 k_rank_cond_parq2 k_rank_cond_parq1
0.8105 0.7827 0.7177 0.7353 0.9155
0.8084 0.7002 0.7995 0.7820 0.8671
0.7859 0.7905 0.7296 0.7388 0.7257
0.7880 0.7596 0.7136 0.7641 0.7360
0.7578 0.7538 0.7306 0.6988 0.7403
0.7528 0.7650 0.6962 0.6676 0.7909
0.7490 0.7324 0.7259 0.7172 0.6991
0.7441 0.7224 0.7162 0.7129 0.7006
0.7405 0.7179 0.7347 0.7163 0.6909
0.7407 0.7134 0.7118 0.7098 0.6939
0.7320 0.7185 0.7197 0.6990 0.6985
0.7173 0.6992 0.7099 0.6747 0.7071
0.7072 0.7149 0.7155 0.6861 0.6925
0.7191 0.7230 0.6909 0.6940 0.6865
0.7032 0.7187 0.6900 0.6842 0.6757
0.7022 0.6923 0.6720 0.6810 0.6742
0.7382 0.7039 0.6685 0.6962 0.6281
0.7151 0.7100 0.6720 0.6711 0.6701
0.6839 0.7029 0.6856 0.6988 0.6581
0.6938 0.7073 0.6805 0.6880 0.6479
0.6935 0.6944 0.7015 0.6643 0.6661
0.6850 0.7087 0.6980 0.6707 0.6532
0.6898 0.6768 0.6698 0.6733 0.6400
0.6705 0.6642 0.6956 0.6822 0.6529
0.6803 0.6677 0.6598 0.6415 0.6414
0.6944 0.6785 0.6195 0.6458 0.6384
0.6641 0.6830 0.6794 0.6208 0.6553
0.6407 0.6786 0.6703 0.6205 0.6492
0.6611 0.6591 0.6423 0.6381 0.6429
0.6590 0.6573 0.6557 0.6250 0.6237
0.6505 0.6232 0.6758 0.6349 0.6146
0.6635 0.6789 0.6828 0.6165 0.5683
0.6401 0.6289 0.6547 0.6875 0.6093
0.6559 0.6441 0.6315 0.6342 0.6310
0.6535 0.6579 0.5973 0.6433 0.6460
0.6850 0.6359 0.6357 0.5974 0.6046
0.6698 0.6152 0.6210 0.6018 0.6446
0.6447 0.6349 0.6038 0.6172 0.6061
0.6519 0.6639 0.6003 0.6513 0.5880
0.6359 0.6414 0.6302 0.6323 0.6113
0.6326 0.6317 0.6071 0.6180 0.6395
0.6362 0.6422 0.6257 0.6142 0.6168
0.6354 0.6409 0.6170 0.6138 0.6067
0.6612 0.6383 0.6155 0.6050 0.5865
0.6241 0.6631 0.6118 0.6130 0.5797
0.6545 0.6234 0.6197 0.5886 0.6304
0.5961 0.6760 0.5942 0.6712 0.5819
0.6310 0.6398 0.6330 0.6294 0.5683
0.6463 0.6461 0.6371 0.5477 0.6049
0.6272 0.6259 0.6144 0.6078 0.6082
0.6438 0.5787 0.5935 0.6602 0.6058
0.6233 0.6247 0.6163 0.5749 0.6540
0.6493 0.6266 0.6139 0.5765 0.5946
0.5530 0.6094 0.6150 0.6624 0.5818
0.6106 0.6683 0.5646 0.5592 0.6556
0.6454 0.6350 0.6137 0.5998 0.5566
0.5707 0.5783 0.5694 0.7042 0.6370
0.6244 0.6607 0.6672 0.5052 0.5846
0.6184 0.6072 0.6196 0.6094 0.5653
0.6181 0.6038 0.5792 0.5761 0.6294
0.5751 0.5818 0.5874 0.6770 0.5823
0.6427 0.6298 0.6059 0.5225 0.5772
0.6009 0.5950 0.5966 0.6079 0.5724
0.6028 0.5662 0.5632 0.5923 0.6374
0.5866 0.5656 0.5939 0.5920 0.5743
0.6074 0.5988 0.5585 0.5399 0.5689
0.6109 0.5951 0.5651 0.5388 0.5315
0.5885 0.5666 0.5511 0.5486 0.5669
0.5625 0.5442 0.5659 0.6151 0.5027
0.5956 0.5400 0.5670 0.5191 0.5209
0.5449 0.5916 0.5661 0.5325 0.4986
0.5712 0.5602 0.5507 0.5216 0.5145
0.5778 0.5567 0.5464 0.5277 0.5068
0.5814 0.5641 0.5522 0.5078 0.4994
0.5755 0.5653 0.5517 0.5229 0.4855
0.5649 0.5604 0.5522 0.5262 0.5100
0.5893 0.5697 0.5389 0.5274 0.4760
0.5522 0.5510 0.5510 0.5281 0.5162
0.5549 0.5523 0.5327 0.5443 0.5090
0.6298 0.4540 0.5840 0.4910 0.4871
0.5476 0.5654 0.5447 0.5006 0.5176
0.5224 0.5327 0.5391 0.5265 0.5178
0.5680 0.5405 0.5468 0.5088 0.4960
0.5783 0.5415 0.5368 0.5023 0.4769
0.5648 0.5427 0.5545 0.4671 0.5080
0.5568 0.5391 0.5339 0.5096 0.4885
0.5578 0.5489 0.5147 0.5080 0.4943
0.5689 0.5456 0.5292 0.5032 0.4732
0.5426 0.5477 0.5236 0.5109 0.4975
0.5643 0.5475 0.5208 0.5058 0.4797
0.5492 0.5341 0.5230 0.5180 0.4908
0.5573 0.5321 0.5246 0.5126 0.4858
0.5452 0.5398 0.5336 0.5108 0.4856
0.5589 0.5392 0.5315 0.5033 0.4787
0.5396 0.5178 0.5049 0.5498 0.5098
0.5998 0.5168 0.4976 0.5290 0.4595
0.5461 0.5317 0.5256 0.5165 0.4834
0.5589 0.5369 0.5192 0.4947 0.4903
0.5622 0.5451 0.5116 0.4900 0.4851
0.5398 0.5314 0.5131 0.5047 0.4949
0.5517 0.5321 0.5213 0.5031 0.4849
0.5258 0.5229 0.5177 0.5006 0.5033
0.5593 0.5283 0.5194 0.4998 0.4787
0.5157 0.5256 0.5182 0.5037 0.5058
0.5387 0.5339 0.5163 0.5214 0.4659
0.5162 0.5274 0.5156 0.4995 0.5217
0.5484 0.5289 0.4967 0.5098 0.4841
0.5560 0.5423 0.5137 0.4989 0.4580
0.5508 0.5394 0.5031 0.4922 0.4805
0.5233 0.5223 0.5143 0.5061 0.4864
0.5592 0.5282 0.4944 0.4959 0.4811
0.5434 0.5283 0.5126 0.5043 0.4673
0.5489 0.5145 0.5343 0.4964 0.4547
0.5266 0.5330 0.5054 0.5018 0.4799
0.5516 0.5217 0.5220 0.4840 0.4613
0.5435 0.5203 0.5106 0.4858 0.4793
0.5369 0.5138 0.5047 0.4966 0.4818
0.5473 0.5319 0.5109 0.4908 0.4559
0.5002 0.5634 0.4810 0.5108 0.4816
0.5655 0.5257 0.4968 0.4812 0.4808
0.5350 0.5176 0.5076 0.5045 0.4633
0.5195 0.5097 0.5246 0.4972 0.4666
0.5102 0.5335 0.5164 0.4859 0.4898
0.5227 0.5169 0.5090 0.5005 0.4738
0.5304 0.5253 0.5004 0.4989 0.4703
0.5190 0.5016 0.4915 0.4831 0.5117
0.5346 0.5065 0.5058 0.4920 0.4712
0.5138 0.5208 0.5205 0.5574 0.4001
0.5063 0.4826 0.4412 0.5120 0.5657
0.5244 0.5420 0.5080 0.4484 0.4861
0.5395 0.4831 0.5295 0.4884 0.4483
0.5318 0.5117 0.5689 0.4478 0.4199
0.5471 0.5263 0.5462 0.4713 0.3989
0.5547 0.5988 0.4515 0.4045 0.4883
0.5327 0.5321 0.4932 0.4870 0.4366
0.5507 0.5302 0.4954 0.4665 0.4273
0.5148 0.5110 0.4922 0.4825 0.4701
0.6054 0.4848 0.4877 0.4604 0.4565
0.5365 0.5249 0.4960 0.4616 0.4490
0.5254 0.5082 0.4996 0.4938 0.4434
0.5370 0.4963 0.5029 0.4811 0.4445
0.5536 0.5142 0.4887 0.4728 0.4253
0.5153 0.5210 0.4853 0.4870 0.4392
0.5459 0.4985 0.4656 0.5265 0.3971
0.5198 0.5062 0.5040 0.4720 0.4399
0.5361 0.5112 0.4926 0.4683 0.4355
0.5288 0.5228 0.4934 0.4795 0.4107
0.5233 0.5021 0.4925 0.4706 0.4408
0.5218 0.5204 0.4691 0.4722 0.4398
0.5075 0.4899 0.4759 0.4665 0.4456
0.4448 0.5635 0.5028 0.4255 0.4339
0.5339 0.4864 0.4562 0.4508 0.4325
0.5541 0.4325 0.4445 0.4690 0.4443
0.5459 0.4716 0.4350 0.4575 0.4414
0.5272 0.5059 0.4734 0.4475 0.3779
0.4779 0.4784 0.4849 0.4680 0.4178
0.4861 0.4808 0.4792 0.4046 0.4271
0.4954 0.4969 0.4897 0.3736 0.4138
0.5297 0.4693 0.4436 0.4201 0.3836
0.4755 0.4767 0.4481 0.4233 0.3792
0.4578 0.4829 0.4312 0.4207 0.3809
0.4199 0.4512 0.3940 0.4629 0.4007
0.4593 0.3975 0.4670 0.4165 0.3859
0.4462 0.4102 0.4236 0.4198 0.4085
0.6282 0.3004 0.3528 0.3822 0.3844
0.3054 0.4590 0.3781 0.3874 0.3259
0.4125 0.3275 0.3500 0.3961 0.3178
0.3409 0.3317 0.3403 0.3418 0.3452
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.label {
font-weight: bold;
}
.tile {
shape-rendering: crispEdges;
}
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
</style>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>
var margin = {top: 20, right: 90, bottom: 30, left: 50},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var parseDate = d3.time.format("%Y-%m-%d").parse,
formatDate = d3.time.format("%b %d");
var x = d3.time.scale().range([0, width]),
y = d3.scale.linear().range([height, 0]),
z = d3.scale.linear().range(["white", "steelblue"]);
// The size of the buckets in the CSV data file.
// This could be inferred from the data if it weren't sparse.
var xStep = 864e5,
yStep = 100;
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
d3.csv("data.csv", function(error, buckets) {
if (error) throw error;
// Coerce the CSV data to the appropriate types.
buckets.forEach(function(d) {
d.k_rank_cond_parq5 = +d.k_rank_cond_parq5;
d.k_rank_cond_parq4 = d.k_rank_cond_parq4 ;
d.k_rank_cond_parq3 = d.k_rank_cond_parq3;
d.k_rank_cond_parq2 = d.k_rank_cond_parq2;
d.k_rank_cond_parq1 = d.k_rank_cond_parq1;
});
// Compute the scale domains.
x.domain(d3.extent(buckets, function(d) { return d.date; }));
y.domain(d3.extent(buckets, function(d) { return d.bucket; }));
z.domain([0, 1]);
// Extend the x- and y-domain to fit the last bucket.
// For example, the y-bucket 3200 corresponds to values [3200, 3300].
x.domain([x.domain()[0], +x.domain()[1] + xStep]);
y.domain([y.domain()[0], y.domain()[1] + yStep]);
// Display the tiles for each non-zero bucket.
// See http://bl.ocks.org/3074470 for an alternative implementation.
svg.selectAll(".tile")
.data(buckets)
.enter().append("rect")
.attr("class", "tile")
.attr("x", function(d) { return x(d.date); })
.attr("y", function(d) { return y(d.bucket + yStep); })
.attr("width", x(xStep) - x(0))
.attr("height", y(0) - y(yStep))
.style("fill", function(d) { return z(d.count); });
// Add a legend for the color values.
var legend = svg.selectAll(".legend")
.data(z.ticks(6).slice(1).reverse())
.enter().append("g")
.attr("class", "legend")
.attr("transform", function(d, i) { return "translate(" + (width + 20) + "," + (20 + i * 20) + ")"; });
legend.append("rect")
.attr("width", 20)
.attr("height", 20)
.style("fill", z);
legend.append("text")
.attr("x", 26)
.attr("y", 10)
.attr("dy", ".35em")
.text(String);
svg.append("text")
.attr("class", "label")
.attr("x", width + 20)
.attr("y", 10)
.attr("dy", ".35em")
.text("Count");
// Add an x-axis with label.
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(d3.svg.axis().scale(x).ticks(d3.time.days).tickFormat(formatDate).orient("bottom"))
.append("text")
.attr("class", "label")
.attr("x", width)
.attr("y", -6)
.attr("text-anchor", "end")
.text("Date");
// Add a y-axis with label.
svg.append("g")
.attr("class", "y axis")
.call(d3.svg.axis().scale(y).orient("left"))
.append("text")
.attr("class", "label")
.attr("y", 6)
.attr("dy", ".71em")
.attr("text-anchor", "end")
.attr("transform", "rotate(-90)")
.text("Value");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment