Biostatistics & Medical Informatics, University of Wisconsin – Madison
kbroman.org
github.com/kbroman
@kwbroman
slides: bit.ly/gene2016
2
3
4
5
6
6
7
kbroman.wordpress.com/2012/04/25/microarrays-suck
8
kbroman.wordpress.com/2012/04/25/microarrays-suck
9
10
11
12
13
You just need to learn html, css, svg, and javascript.
And don’t forget .enter()
14
<!doctype html>
<html> <head>
<title>Example html</title>
<style>body { font-family: sans-serif; }</style>
</head>
<body>
<h2>Example html</h2>
<p>Learn more at
<a href="http://w3schools.com/html">w3schools</a>.
</p>
</body>
</html>
15
<svg height="100" width="200">
<circle cx="45" cy="45" r="40"
stroke="black" stroke-width="3"
fill="slateblue" opacity="0.5"/>
<rect x="50" y="50" width="100" height="40"
stroke="black" stroke-width="2"
fill="Orchid" opacity="0.5"/>
</svg>
16
svg.selectAll("empty")
.data(my_data)
.enter()
.append("circle")
.attr("cx", function(d) { return d.x })
.attr("cy", function(d) { return d.y })
.attr("r", 3)
.attr("fill", function(d,i) {
if(sex[i]=="male") return "gray"
return "white" })
17
svg.selectAll("empty")
.data(my_data)
.enter()
.append("circle")
.attr("cx", function(d) { return d.x })
.attr("cy", function(d) { return d.y })
.attr("r", 3)
.attr("fill", function(d,i) {
if(sex[i]=="male") return "gray"
return "white" })
17
svg.selectAll("empty")
.data(my_data)
.enter()
.append("circle")
.attr("cx", function(d) { return d.x })
.attr("cy", function(d) { return d.y })
.attr("r", 3)
.attr("fill", function(d,i) {
if(sex[i]=="male") return "gray"
return "white" })
17
svg.selectAll("empty")
.data(my_data)
.enter()
.append("circle")
.attr("cx", function(d) { return d.x })
.attr("cy", function(d) { return d.y })
.attr("r", 3)
.attr("fill", function(d,i) {
if(sex[i]=="male") return "gray"
return "white" }
)
17
18
blob.attr("x", (d) -> d.x)
height = options?.height ? 500
19
blob.attr("x", (d) -> d.x)
height = options?.height ? 500
19
20
21
Why not Shiny, Plotly, or Vega?
22
23
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
24
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
25
26
27
Alan Attie Mark Keller |
Biochemistry, UW–Madison | |
Brian Yandell | Statistics and Horticulture, UW–Madison | |
Christina Kendziorski Aimee Teo Broman |
Biostatistics & Medical Informatics, UW–Madison | |
Eric Schadt | Mount Sinai | |
Danielle Greenawalt Amit Kulkarni |
Merck & Co., Inc. | |
Śaunak Sen | Epidemiology & Biostatistics, UC-San Francisco | |
Edgar Spalding Candace Moore Logan Johnson |
Botany, UW-Madison |
28
29