Figuring out how to make React and D3 work together.
This blog post by
Tom Macwright has some good ideas. The <Axis />
component is adapted from
this gist
he wrote. The chart is a replication of the example found in the documentation
for ggplot2's facet_wrap()
function. The data also come from
this R package.
xxxxxxxxxx
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,500" rel="stylesheet">
<style>
html {
font-family: 'Raleway', sans-serif;
}
a {
color: inherit;
text-decoration: none;
border-bottom: 1px dashed #888;
}
#app {
width: 960px;
}
.plot {
float: left;
}
.plot-title h3 {
margin-top: 7px;
}
.plot-title p {
font-size: 13px;
}
.axis-label {
font-size: 10px;
color: #888;
}
.chart-title {
font-size: 18px;
font-weight: 500;
}
.Axis path,
.Axis line {
stroke: #888;
}
.Axis text {
fill: #888;
}
</style>
</head>
<body>
<div id="app"></div>
<script src="index.js"></script>
</body>
</html>