Add outline and interactions to bostock's clipping venn
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
| package fun; | |
| import java.awt.Color; | |
| import java.awt.Font; | |
| import java.awt.event.KeyEvent; | |
| import java.awt.event.KeyListener; | |
| import java.io.File; | |
| import java.nio.ByteBuffer; | |
| import java.util.GregorianCalendar; | |
| import java.util.Locale; |
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> | |
| <html> | |
| <head> | |
| <title> Drag/Link Test </title> | |
| <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js"></script> | |
| <style> | |
| body { | |
| margin: 1em; |
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
| <html> | |
| <head> | |
| <!-- | |
| <script src="d3.js" charset="utf-8"></script> | |
| <script src="lodash.js"></script> | |
| --> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.9.3/lodash.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script> | |
| <style> |
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
| <html> | |
| <head> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3.js"></script> | |
| <style> | |
| body { | |
| font-family: Tahoma; | |
| font-size: 0.7rem; | |
| } |
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
| <html> | |
| <head> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script> | |
| <script src="stckr.js"></script> | |
| <link rel="stylesheet" href="stckr.css"> | |
| <style> | |
| body { | |
| margin: 1rem; | |
| font-family: Tahoma; | |
| } |
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> | |
| <html> | |
| <head> | |
| <script src="https://d3js.org/d3.v4.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js"></script> | |
| <style> | |
| #d1 { | |
| width: 600px; | |
| height: 600px; | |
| background: #CCC; |
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> | |
| <html> | |
| <head> | |
| <script src="https://d3js.org/d3.v3.min.js"></script> | |
| <style> | |
| #div1 { | |
| width: 500px; | |
| height: 500px; | |
| background: #CCC; | |
| } |
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> | |
| <html> | |
| <head> | |
| <script src="https://d3js.org/d3.v4.min.js"></script> | |
| <style> | |
| #div1 { | |
| width: 500px; | |
| height: 500px; | |
| background: #CCC; | |
| } |
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
| // Based on: https://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient | |
| static PCC(x, y) { | |
| let n = x.length; | |
| let sum_xy = 0; | |
| let sum_x2 = 0; | |
| let sum_y2 = 0; | |
| let meanx = 0, meany = 0; | |
| for (let i=0; i < n; i++) { | |
| sum_xy += x[i]*y[i]; | |
| sum_x2 += x[i]*x[i]; |
OlderNewer