Skip to content

Commit 557295b

Browse files
committed
Update material
1 parent 30f09f3 commit 557295b

File tree

5 files changed

+56
-27
lines changed

5 files changed

+56
-27
lines changed

introDataVisD3/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This material is for the presentation in this YouTube video: ["Introduction to Data Visualization"](https://www.youtube.com/watch?v=itNlukt5x18&feature=youtu.be). You can [open the presentation](http://curran.github.io/screencasts/introDataVisD3/) to follow along, and you can use the built-in editor to edit and fork the examples.
1+
This material is for the presentation in this YouTube video: ["Introduction to Data Visualization"](https://www.youtube.com/watch?v=itNlukt5x18&feature=youtu.be). You can [open the presentation](http://curran.github.io/screencasts/introDataVisD3/) to follow along (use arrow keys), and you can use the built-in [Blockbuilder editor](http://blockbuilder.org) to edit and fork the examples.

introDataVisD3/dist/main-build.js

+19-11
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@
136136
return controller;
137137
}
138138

139+
// Images are hosted by GitHub Pages (so they don't bloat the datavis-tech repository or hose our servers).
140+
var imageRootUrl = "http://curran.github.io/screencasts/introDataVisD3/images";
141+
139142
var ContentPane = React.createClass({
140143
displayName: "ContentPane",
141144

@@ -176,7 +179,7 @@
176179
return React.createElement(
177180
"div",
178181
{ className: "content" },
179-
React.createElement("img", { className: "img", style: { backgroundImage: "url(images/" + item.name + ")" } }),
182+
React.createElement("img", { className: "img", style: { backgroundImage: "url(" + imageRootUrl + "/" + item.name + ")" } }),
180183
React.createElement(
181184
"div",
182185
{ className: "footnote" },
@@ -226,15 +229,20 @@
226229
arrowKeyNavigation(controller);
227230
loadData(controller);
228231

229-
// Display video from the camera on the video element.
230-
// Example code from http://www.html5rocks.com/en/tutorials/getusermedia/intro/
231-
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
232-
233-
navigator.getUserMedia({ video: true }, function (localMediaStream) {
234-
var video = document.querySelector('.face-video');
235-
video.src = window.URL.createObjectURL(localMediaStream);
236-
}, function (e) {
237-
console.log("Error " + e);
238-
});
232+
//Commented out for production.
233+
//
234+
// // Display video from the camera on the video element.
235+
// // Example code from http://www.html5rocks.com/en/tutorials/getusermedia/intro/
236+
// navigator.getUserMedia = navigator.getUserMedia ||
237+
// navigator.webkitGetUserMedia ||
238+
// navigator.mozGetUserMedia ||
239+
// navigator.msGetUserMedia;
240+
//
241+
// navigator.getUserMedia({ video: true }, function (localMediaStream) {
242+
// var video = document.querySelector('.face-video');
243+
// video.src = window.URL.createObjectURL(localMediaStream);
244+
// }, function (e) {
245+
// console.log("Error " + e);
246+
// });
239247

240248
}());

introDataVisD3/index.html

+16-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,23 @@
2323

2424

2525
<!-- This box shows my face live from the camera. -->
26-
<!-- from https://github.com/curran/screencasts/blob/gh-pages/splittingCharts/examples/viewer/index.html -->
26+
<!-- from https://github.com/curran/screencasts/blob/gh-pages/splittingCharts/examples/viewer/index.html
2727
<video class="face-video" width="300" autoplay></video>
2828
29+
Commented out for production.
30+
31+
-->
32+
33+
<script>
34+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
35+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
36+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
37+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
38+
39+
ga('create', 'UA-73285761-1', 'auto');
40+
ga('send', 'pageview');
41+
42+
</script>
43+
2944
</body>
3045
</html>

introDataVisD3/src/contentPane.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
// Images are hosted by GitHub Pages (so they don't bloat the datavis-tech repository or hose our servers).
3+
var imageRootUrl = "http://curran.github.io/screencasts/introDataVisD3/images";
4+
15
var ContentPane = React.createClass({
26
render: function (){
37
var item = this.props.item;
@@ -29,7 +33,7 @@ var ContentPane = React.createClass({
2933
} else if (item.type === "image"){
3034
return (
3135
<div className="content">
32-
<img className="img" style={{backgroundImage: "url(images/" + item.name + ")"}}/>
36+
<img className="img" style={{backgroundImage: "url(" + imageRootUrl + "/" + item.name + ")"}}/>
3337
<div className="footnote">{source}: {item.description}</div>
3438
</div>
3539
);

introDataVisD3/src/main.js

+15-13
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ loadData(controller);
4040

4141

4242

43-
// Display video from the camera on the video element.
44-
// Example code from http://www.html5rocks.com/en/tutorials/getusermedia/intro/
45-
navigator.getUserMedia = navigator.getUserMedia ||
46-
navigator.webkitGetUserMedia ||
47-
navigator.mozGetUserMedia ||
48-
navigator.msGetUserMedia;
49-
50-
navigator.getUserMedia({ video: true }, function (localMediaStream) {
51-
var video = document.querySelector('.face-video');
52-
video.src = window.URL.createObjectURL(localMediaStream);
53-
}, function (e) {
54-
console.log("Error " + e);
55-
});
43+
//Commented out for production.
44+
//
45+
// // Display video from the camera on the video element.
46+
// // Example code from http://www.html5rocks.com/en/tutorials/getusermedia/intro/
47+
// navigator.getUserMedia = navigator.getUserMedia ||
48+
// navigator.webkitGetUserMedia ||
49+
// navigator.mozGetUserMedia ||
50+
// navigator.msGetUserMedia;
51+
//
52+
// navigator.getUserMedia({ video: true }, function (localMediaStream) {
53+
// var video = document.querySelector('.face-video');
54+
// video.src = window.URL.createObjectURL(localMediaStream);
55+
// }, function (e) {
56+
// console.log("Error " + e);
57+
// });

0 commit comments

Comments
 (0)