Skip to content

Instantly share code, notes, and snippets.

@hoorayimhelping
Created September 18, 2015 21:41
Show Gist options
  • Save hoorayimhelping/d7196072d3afa9586b53 to your computer and use it in GitHub Desktop.
Save hoorayimhelping/d7196072d3afa9586b53 to your computer and use it in GitHub Desktop.
diff --git a/gulpfile.js b/gulpfile.js
index 8dcc89b..282eb4b 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -32,7 +32,7 @@ gulp.task('lint', function() {
paths.js_test + '*.js',
'gulpfile.js'
])
- .pipe(jshint())
+ .pipe(jshint({ esnext: true }))
.pipe(jshint.reporter('default', { verbose: true }))
.pipe(jshint.reporter('fail'));
});
diff --git a/index.html b/index.html
index ff3ee1c..9195573 100644
--- a/index.html
+++ b/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+k<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" media="screen" type="text/css" href="styles/main.css">
@@ -9,4 +9,4 @@
<script type="text/javascript" src="js/app.js"></script>
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/js/graph/renderer.js b/js/graph/renderer.js
new file mode 100644
index 0000000..4f7e89e
--- /dev/null
+++ b/js/graph/renderer.js
@@ -0,0 +1,7 @@
+const renderer = require('../rendering/canvas');
+
+var GraphRenderer = function() {
+
+};
+
+module.exports = GraphRenderer;
diff --git a/js/maps/kerbol_system.js b/js/maps/kerbol_system.js
index def8374..30c32ea 100644
--- a/js/maps/kerbol_system.js
+++ b/js/maps/kerbol_system.js
@@ -29,4 +29,4 @@ var edges = {
// es6 !!
module.exports = {
nodes, edges
-};
\ No newline at end of file
+};
diff --git a/js/rendering/canvas.js b/js/rendering/canvas.js
index 82baa07..251e8fb 100644
--- a/js/rendering/canvas.js
+++ b/js/rendering/canvas.js
@@ -1,4 +1,4 @@
-var Renderer = function(context) {
+const Renderer = function(context) {
this.context = context;
};
@@ -12,35 +12,20 @@ Renderer.prototype = {
this.context.fillRect(0, 0, this.context.canvas.clientWidth, this.context.canvas.clientHeight);
},
- options: function(options) {
- this.defaults();
- if (options.hasOwnProperty('lineWidth')) {
- this.context.lineWidth = options.lineWidth;
- }
-
- if (options.hasOwnProperty('strokeStyle')) {
- this.context.strokeStyle = options.strokeStyle;
- }
- },
-
defaults: function() {
this.context.fillStyle = "#FFF";
this.context.strokeStyle = "#000";
this.context.lineWidth = 5;
},
- circle: function(x, y, radius, options) {
- this.options(options);
-
+ circle: function(x, y, radius) {
this.context.beginPath();
this.context.arc(x, y, radius, 0, 2 * Math.PI);
this.context.stroke();
this.context.closePath();
},
- line: function(start_x, start_y, end_x, end_y, options) {
- this.options(options);
-
+ line: function(start_x, start_y, end_x, end_y) {
this.context.beginPath();
this.context.moveTo(start_x, start_y);
this.context.lineTo(
@@ -53,4 +38,4 @@ Renderer.prototype = {
}
};
-module.exports = Renderer;
\ No newline at end of file
+module.exports = Renderer;
diff --git a/package.json b/package.json
index 6833bde..5bd9d3b 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,9 @@
"gulp-shell": "^0.4.3",
"gulp-tape": "0.0.3",
"guppy-pre-commit": "^0.2.1",
+ "react": "^0.13.3",
"reactify": "^1.1.1",
+ "tape": "^4.2.0",
"vinyl-source-stream": "^1.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment