Skip to content

Commit

Permalink
bootstrap all examples and add index/source links
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Jun 7, 2016
1 parent 1dc00b9 commit d8ba9a4
Show file tree
Hide file tree
Showing 33 changed files with 161 additions and 11 deletions.
4 changes: 4 additions & 0 deletions web/examples/area.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Area Chart Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="test"></div>

<script type="text/javascript" src="../js/d3.js"></script>
Expand Down Expand Up @@ -60,5 +63,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/bar-extra-line.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Bar Chart with Extra Line Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>

<div id="test"></div>

Expand Down Expand Up @@ -74,5 +77,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/bar-single-select.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Bar Chart Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<p>Frequently asked question: how to enable single-select on an ordinal chart?</p>

<div id="test">
Expand Down Expand Up @@ -51,5 +54,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Bar Chart Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="test"></div>

<script type="text/javascript" src="../js/d3.js"></script>
Expand Down Expand Up @@ -43,5 +46,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/box-plot-time.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Box-Plot Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="box-test"></div>
<div id="pie-chart"></div>

Expand Down Expand Up @@ -67,5 +70,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/box-plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Box-Plot Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="box-test"></div>
<div id="pie-chart"></div>

Expand Down Expand Up @@ -70,5 +73,6 @@

</script>

</div>
</body>
</html>
27 changes: 20 additions & 7 deletions web/examples/complex-reduce.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@
<head>
<title>dc.js - Complex Reductions Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
<style>
label {
display: inline;
padding-left: 1em;
}
label input {
vertical-align: top;
}
</style>
</head>
<body>

<div class="container">

<script type="text/javascript" src="header.js"></script>
<p>Frequently asked question: how to show the minimum/maximum of some value in the rows?</p>

<p>Some kinds of reductions require the entire set of values at every step: median, mode, minimum,
maximum. (It is almost by accident that you can get away with calculating the mean without looking
at all the rows.) This example shows how to keep the set of
values. <a href="http://github.com/dc-js/dc.js/tree/develop/web/examples/complex-reduce.html">See
the source</a> for details.</p>
maximum. (The mean just needs a running sum.)</p>

<p>This example shows how to keep the set of values.</p>

<div id="select-operation">
<input type=radio name="operation" value="median" checked="true">median
<input type=radio name="operation" value="min">min
<input type=radio name="operation" value="max">max
<label><input type=radio name="operation" value="median" checked="true">&nbsp;median</label>
<label><input type=radio name="operation" value="min">&nbsp;min</label>
<label><input type=radio name="operation" value="max">&nbsp;max</label>
</div>
<div id="test-run">
<h4>Run</h4>
Expand Down Expand Up @@ -135,5 +147,6 @@ <h4>Experiment</h4>

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/composite.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Composite Chart Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="test_composed"></div>

<script type="text/javascript" src="http://d3js.org/queue.v1.min.js"></script>
Expand Down Expand Up @@ -59,5 +62,6 @@

});
</script>
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/download-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Filtering Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="chart-ring-year" style="width:300px; height:300px">
<div class="reset" style="visibility: hidden;">selected: <span class="filter"></span>
<a href="javascript:yearRingChart.filterAll();dc.redrawAll();">reset</a>
Expand Down Expand Up @@ -106,5 +109,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/filtering-removing.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Filtering Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<p>Example demonstrating using a "<a href="https://github.com/dc-js/dc.js/wiki/FAQ#fake-groups">Fake Group</a>" to remove
the empty bars of an ordinal bar chart when their values drop to zero.</p>

Expand Down Expand Up @@ -90,5 +93,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/filtering.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Filtering Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="chart-ring-year" style="width:300px; height:300px">
<div class="reset" style="visibility: hidden;">selected: <span class="filter"></span>
<a href="javascript:yearRingChart.filterAll();dc.redrawAll();">reset</a>
Expand Down Expand Up @@ -83,5 +86,6 @@

</script>

</div>
</body>
</html>
10 changes: 10 additions & 0 deletions web/examples/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document.write([
'<div id="header">',
'<div id="links" style="padding:10px 0px 0px 10px">',
'<a href=".">all examples</a>&nbsp;&nbsp;<a href="',
document.location.pathname.replace(/^.*\/examples/, 'https://github.com/dc-js/dc.js/tree/master/web/examples'),
'">source</a>',
'</div>',
'<hr>',
'</div>'
].join(''));
5 changes: 5 additions & 0 deletions web/examples/heat.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title>dc.js - Heatmap Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
<style>
.heat-box {
Expand All @@ -12,6 +13,9 @@
</style>
</head>
<body>
<div class="container">
<script type="text/javascript" src="header.js"></script>

<h2>Michelson–Morley experiment</h2>
<div id="test"></div>

Expand Down Expand Up @@ -47,5 +51,6 @@ <h2>Michelson–Morley experiment</h2>

</script>

</div>
</body>
</html>
5 changes: 5 additions & 0 deletions web/examples/heatmap-filtering.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
<head>
<title>dc.js - Heatmap Filtering Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
<style>
</style>
</head>
<body>
<div class="container">
<script type="text/javascript" src="header.js"></script>

<h2>Michelson–Morley experiment</h2>
<div id="heatmap"></div>
<div id="barchart"></div>
Expand Down Expand Up @@ -127,5 +131,6 @@ <h2>Michelson–Morley experiment</h2>

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/line.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Line Chart Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="test"></div>

<script type="text/javascript" src="../js/d3.js"></script>
Expand Down Expand Up @@ -44,5 +47,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/multi-focus.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Filter Group Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="test1"></div>
<div id="test2"></div>
<div id="test3"></div>
Expand Down Expand Up @@ -106,5 +109,6 @@

</script>

</div>
</body>
</html>
4 changes: 4 additions & 0 deletions web/examples/multi-scatter.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<head>
<title>dc.js - Scatter Plot Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/dc.css"/>
</head>
<body>

<div class="container">
<script type="text/javascript" src="header.js"></script>
<div id="test"></div>

<script type="text/javascript" src="../js/d3.js"></script>
Expand Down Expand Up @@ -55,5 +58,6 @@

</script>

</div>
</body>
</html>
Loading

0 comments on commit d8ba9a4

Please sign in to comment.