This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <title>D3 Selection UI</title> | |
| <style> | |
| html, | |
| body { | |
| margin: 0; | |
| padding: 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // jquery's method to get total document height dimensions | |
| const height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, | |
| document.documentElement.scrollHeight, document.documentElement.offsetHeight); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <title>D3 Date</title> | |
| <style> | |
| .dates { | |
| margin-left: 200px; | |
| } | |
| } | |
| .entry-date { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // deduplicate array of primitives | |
| let deduped = arr.filter((el, i, arr) => arr.indexOf(el) === i); | |
| // or | |
| deduped = Array.from(new Set(arr)); | |
| // deduplicate array of ojects using a hash table | |
| function dedupe(arr) { | |
| let hashTable = {}; | |
| return arr.filter(function(el) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <title>D3 date</title> | |
| <link href='https://fonts.googleapis.com/css?family=Fira+Sans' rel='stylesheet' type='text/css'> | |
| <style> | |
| .date-row { | |
| margin-left: 100px; | |
| } | |
| .date-area { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // function to replace label with label's explanation on hover. | |
| function mouseover() { | |
| const s = d3.select(this)[0][0]; | |
| s.innerHTML = 'true positive rate'; | |
| s.className = 'explanation'; | |
| } | |
| function mouseout() { | |
| const s = d3.select(this)[0][0]; | |
| s.innerHTML = 'Sensitivity'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <meta charset="UTF-8"> | |
| <title>D3 GeoJSON</title> | |
| <style> | |
| html, | |
| body { | |
| background-color: #000; | |
| } | |
| </style> | |
| <div class="container"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <meta charset="UTF-8"> | |
| <title>D3 Contour Map</title> | |
| <style> | |
| html, | |
| body { | |
| background: #000; | |
| } | |
| .container { |