a work-in-progress d3 v4 fork of the bl.ock reusable updating exploding boxplot from @tennisvisuals
currently stuck in this strange limbo state where there are no errors in the Chrome devtools console, yet there is no visualization rendered on-screen.
I suspect that the missing piece has something to do with one of these three d3 API changes:
click the Default Colors radio button, then open up the console to see the strange lack of errors for yourself 😅
If you figure out how to render vis with d3 v4 do tweet what you find at @micahstubbs 😄
README.md
var container = d3.select('body');
var xbp = explodingBoxplot();
xbp.options({
data: {
group: 'Set Score',
color_index: 'Set Score',
identifier: 'h2h'
},
axes: {
x: { label: 'Set Score' },
y: { label: 'Total Points' }
}
});
xbp.data(data);
container.call(xbp);
xbp.update();
Change the dimension for y axis:
xbp.options( { axes: { y: { label: 'Total Shots' } } });
xbp.update();
Data for this example was generated by mcpParse
xxxxxxxxxx
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'>
<meta name='Keywords' content='Tennis, Set Scores, ATP World Tour, interactive, TennisVisuals, sport, infographic, graphic, data visualisation'>
<meta name='viewport' content='width=device-width'>
<title>Point Distributions by Set Scores</title>
<meta name='twitter:creator' content='@TennisVisuals'>
<meta name='twitter:url' content='https://TennisVisuals.com/Distributions'/>
<meta name='twitter:title' content='Point Distributions by Set Score'>
<meta name='twitter:description' content='Compare Tennis Set Scores by Number of Points and Number of Shots Played'>
<meta name='twitter:image' content=''>
<meta name='og:url' content='https://TennisVisuals.com/Distributions'/>
​
<script src='https://d3js.org/d3.v4.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js'></script>
<script src='d3-tip.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.10.3/babel.min.js'></script>
​
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css' rel='stylesheet'>
<link rel='icon' href='data:;base64,iVBORw0KGgo='>
​
<script src='pDxbp.js' lang='babel' type='text/babel'></script>
<script src='explodingBoxplot.js' lang='babel' type='text/babel'></script>
<link rel='stylesheet' type='text/css' href='./explodingBoxplot.css'>
</head>
​
<body id='body'>
<div id='container' class='container-fluid text-center'>
<h5 id='title' style='color: #3B3B3B;'></h5>
<div class='col-sm-9'>
<div id='pointDistributions'></div>
</div>
<div class='col-sm-3'>
<div id='controls'>
</div>
</div>
</div>
​
<script lang='babel' type='text/babel'>
// boxPlotFunctions.defaultDistribution('popover');
boxPlotFunctions.defaultDistribution('d3-tip');
boxPlotFunctions.demoSetup();
</script>
</body>
​
</html>
​
https://d3js.org/d3.v4.js
https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js
https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.10.3/babel.min.js