|
34 | 34 | <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> |
35 | 35 | <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> |
36 | 36 | <![endif]--> |
| 37 | + <style type="text/css"> |
| 38 | + #chart-tooltip { |
| 39 | + position: absolute; |
| 40 | + width: 400px; |
| 41 | + height: auto; |
| 42 | + padding: 5px; |
| 43 | + z-index: 9999999; |
| 44 | + background-color: #ffffff; |
| 45 | + -webkit-border-radius: 4px; |
| 46 | + -moz-border-radius: 4px; |
| 47 | + border-radius: 4px; |
| 48 | + -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2); |
| 49 | + -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2); |
| 50 | + box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2); |
| 51 | + pointer-events: none; |
| 52 | + } |
37 | 53 |
|
| 54 | + #chart-tooltip.hidden { |
| 55 | + display: none; |
| 56 | + } |
| 57 | +
|
| 58 | + #chart-tooltip p { |
| 59 | + margin: 0; |
| 60 | + font-family: sans-serif; |
| 61 | + font-size: 16px; |
| 62 | + line-height: 20px; |
| 63 | + } |
| 64 | + </style> |
38 | 65 | </head> |
39 | 66 | <body> |
40 | 67 | <c:url var="homeUrl" value="${baseSiteUrl}/index"/> |
|
78 | 105 | </ul> |
79 | 106 | </div> |
80 | 107 | </nav> |
81 | | - |
| 108 | +<div id="chart-tooltip" class="hidden"> |
| 109 | + <p><strong><span id="value">123</span> Attendees</strong></p> |
| 110 | + <p><span id="session-title">title</span></p> |
| 111 | + <p><span id="session-speaker">speaker</span></p> |
| 112 | +</div> |
82 | 113 | <!-- Intro Header --> |
83 | 114 | <section id="index--intro" class="module parallax index--parallax-1"> |
84 | 115 | <div class="container header"> |
|
102 | 133 | <div class="col-md-10 col-md-offset-1"> |
103 | 134 | <div id="tagline">Join the <span><dev/></span>olution.</div> |
104 | 135 | </div> |
105 | | - <div class="col-md-6 col-md-offset-3"> |
106 | | - <p class="lead">Welcome to the premier conference for professional software developers! |
107 | | - It’s show-time! Let’s rock and have some fun!</p> |
108 | | - <p class="lead text-center"><strong>The Wifi credentials are:</strong></p> |
109 | | - <p class="lead text-center">Network: <strong>devnexus2015</strong> | Password: <strong>awesome</strong></p> |
| 136 | + <div class="col-md-8 col-md-offset-2"> |
| 137 | + <p class="lead">THANK YOU ALL for attending the show!! |
| 138 | + Grab the <a href="https://github.com/devnexus/devnexus2015" target="_blank">presentation slides</a> |
| 139 | + from GitHub or check out the download links under <a href="${ctx}/s/presentations" target="_blank">presentations</a>. |
| 140 | + The videos of the sessions will be posted via <a href="http://www.dzone.com/" target="_blank">DZone</a> within a couple of weeks.</p> |
110 | 141 | </div> |
111 | 142 | </div> |
112 | 143 | <div class="row" style="margin-bottom: 20px;"> |
|
125 | 156 | </div> |
126 | 157 | </div> |
127 | 158 | <div class="row"> |
128 | | - <div class="col-sm-6 col-sm-offset-3 text-center"> |
129 | | - <a href="${ctx}/s/evaluations/add" class="btn btn-primary registerButton">Send us Evaluations</a> |
| 159 | + <div id="d3chart" class="col-md-10 col-md-offset-1"> |
130 | 160 | </div> |
131 | 161 | </div> |
132 | 162 | </div> |
|
455 | 485 | }); |
456 | 486 |
|
457 | 487 | $("#tagline").fitText().fitText(1.05); |
| 488 | +
|
| 489 | + var container = d3.select("#d3chart") |
| 490 | +
|
| 491 | + var width = $("#d3chart").width(); |
| 492 | + var height = 120 |
| 493 | +
|
| 494 | + var svg = container.append("svg"); |
| 495 | + svg.attr("height", height); |
| 496 | + svg.attr("width", width); |
| 497 | + svg.attr("viewBox", "0 0 " + width + " " + height); |
| 498 | + svg.attr("perserveAspectRatio", "xMinYMid"); |
| 499 | +
|
| 500 | + $(window).on("resize", function() { |
| 501 | + svg.attr("width", $("#d3chart").width()); |
| 502 | + svg.attr("height", 120); |
| 503 | + }); |
| 504 | +
|
| 505 | + var barWidth = 4; |
| 506 | +
|
| 507 | + function processData(data) { |
| 508 | +
|
| 509 | + var maxValue = d3.max(data, function(el) { |
| 510 | + return parseInt(el.attendees) |
| 511 | + }); |
| 512 | + var minValue = d3.min(data, function(el) { |
| 513 | + return parseInt(el.attendees) |
| 514 | + }); |
| 515 | + var meanValue = d3.mean(data, function(el) { |
| 516 | + return parseInt(el.attendees) |
| 517 | + }); |
| 518 | +
|
| 519 | + var xScale = d3.scale.linear().domain([0, data.length]).range([0, width]); |
| 520 | + var yScale = d3.scale.linear().domain([0, maxValue]).range([0, height]); |
| 521 | +
|
| 522 | + svg.selectAll('rect').data(data).enter() |
| 523 | + .append('rect') |
| 524 | + .attr('width', barWidth) |
| 525 | + .attr('height', function(d) { |
| 526 | + return yScale(d.attendees); |
| 527 | + }) |
| 528 | + .attr("x", function(d,i) {return xScale(i)}) |
| 529 | + .attr("y", function(d,i) {return height-yScale(d.attendees)}) |
| 530 | + .style("fill", function(d,i) {return d.color}) |
| 531 | +
|
| 532 | + .on("mouseover", function(d) { |
| 533 | + d3.select(this).style("fill", "orange"); |
| 534 | + d3.select("#chart-tooltip") |
| 535 | + .style("left", $('#d3chart').offset().left + ($('#d3chart').width() / 2) - ($('#chart-tooltip').width() / 2)+ "px") |
| 536 | + .style("top", $('#d3chart').offset().top + "px") |
| 537 | +
|
| 538 | + d3.select("#value").text(d.attendees); |
| 539 | + d3.select("#session-title").text(d.session_title); |
| 540 | + d3.select("#session-speaker").text(d.speaker); |
| 541 | + d3.select("#chart-tooltip") |
| 542 | + .style("opacity", 0) |
| 543 | + .classed("hidden", false) |
| 544 | + .transition() |
| 545 | + .duration(250) |
| 546 | + .style("opacity", 1); |
| 547 | + }) |
| 548 | + .on("mouseout", function(d) { |
| 549 | + d3.select("#chart-tooltip") |
| 550 | + .transition() |
| 551 | + .duration(250) |
| 552 | + .style("opacity", 0) |
| 553 | + d3.select(this) |
| 554 | + .transition() |
| 555 | + .duration(250) |
| 556 | + .style("fill", function(d,i) {return d.color}); |
| 557 | + }) |
| 558 | + .style("opacity", 1) |
| 559 | + .append("title").text(function(d) { |
| 560 | + return d.session_title + ': ' + d.attendees + ' attendees.'; |
| 561 | + }); |
| 562 | +
|
| 563 | + } |
| 564 | +
|
| 565 | + d3.csv('${ctx}/static/2015/devnexus-stats.csv', function(data) { |
| 566 | + processData(data); |
| 567 | + }); |
| 568 | +
|
458 | 569 | }); |
459 | 570 |
|
460 | 571 | </script> |
|
0 commit comments