Permalink
Browse files

update textures.js and textures.min.js. Closes #23

tools:
- coffee-script@1.10.0
- uglify-js@2.7.0
  • Loading branch information...
1 parent fd87a02 commit 9d1b15b0b65b3eb85ae2c61f39e98b5cffbaecab @joemaller joemaller committed Jul 10, 2016
Showing with 15 additions and 69 deletions.
  1. +14 −68 textures.js
  2. +1 −1 textures.min.js
View
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.10.0
(function() {
var rand, umd,
slice = [].slice;
@@ -29,42 +29,19 @@
stroke = "#343434";
strokeWidth = 0;
id = rand();
- circles = function() {
+ circles = function(sel) {
var corner, g, i, len, ref, results;
- g = this.append("defs").append("pattern").attr({
- id: id,
- patternUnits: "userSpaceOnUse",
- width: size,
- height: size
- });
+ g = sel.append("defs").append("pattern").attr("id", id).attr("patternUnits", "userSpaceOnUse").attr("width", size).attr("height", size);
if (background) {
- g.append("rect").attr({
- width: size,
- height: size,
- fill: background
- });
+ g.append("rect").attr("width", size).attr("height", size).attr("fill", background);
}
- g.append("circle").attr({
- cx: size / 2,
- cy: size / 2,
- r: radius,
- fill: fill,
- stroke: stroke,
- "stroke-width": strokeWidth
- });
+ g.append("circle").attr("cx", size / 2).attr("cy", size / 2).attr("r", radius).attr("fill", fill).attr("stroke", stroke).attr("stroke-width", strokeWidth);
if (complement) {
ref = [[0, 0], [0, size], [size, 0], [size, size]];
results = [];
for (i = 0, len = ref.length; i < len; i++) {
corner = ref[i];
- results.push(g.append("circle").attr({
- cx: corner[0],
- cy: corner[1],
- r: radius,
- fill: fill,
- stroke: stroke,
- "stroke-width": strokeWidth
- }));
+ results.push(g.append("circle").attr("cx", corner[0]).attr("cy", corner[1]).attr("r", radius).attr("fill", fill).attr("stroke", stroke).attr("stroke-width", strokeWidth));
}
return results;
}
@@ -203,31 +180,16 @@
})(size);
}
};
- lines = function() {
+ lines = function(sel) {
var g, i, len, o, results;
- g = this.append("defs").append("pattern").attr({
- id: id,
- patternUnits: "userSpaceOnUse",
- width: size,
- height: size
- });
+ g = sel.append("defs").append("pattern").attr("id", id).attr("patternUnits", "userSpaceOnUse").attr("width", size).attr("height", size);
if (background) {
- g.append("rect").attr({
- width: size,
- height: size,
- fill: background
- });
+ g.append("rect").attr("width", size).attr("height", size).attr("fill", background);
}
results = [];
for (i = 0, len = orientation.length; i < len; i++) {
o = orientation[i];
- results.push(g.append("path").attr({
- d: path(o),
- "stroke-width": strokeWidth,
- "shape-rendering": shapeRendering,
- stroke: stroke,
- "stroke-linecap": "square"
- }));
+ results.push(g.append("path").attr("d", path(o)).attr("stroke-width", strokeWidth).attr("shape-rendering", shapeRendering).attr("stroke", stroke).attr("stroke-linecap", "square"));
}
return results;
};
@@ -350,31 +312,15 @@
return _(size);
}
};
- paths = function() {
+ paths = function(sel) {
var g, path;
path = svgPath(d);
id = rand();
- g = this.append("defs").append("pattern").attr({
- id: id,
- patternUnits: "userSpaceOnUse",
- width: size * width,
- height: size * height
- });
+ g = sel.append("defs").append("pattern").attr("id", id).attr("patternUnits", "userSpaceOnUse").attr("width", size * width).attr("height", size * height);
if (background) {
- g.append("rect").attr({
- width: size * width,
- height: size * height,
- fill: background
- });
+ g.append("rect").attr("width", size * width).attr("height", size * height).attr("fill", background);
}
- return g.append("path").attr({
- d: path,
- fill: fill,
- "stroke-width": strokeWidth,
- "shape-rendering": shapeRendering,
- stroke: stroke,
- "stroke-linecap": "square"
- });
+ return g.append("path").attr("d", path).attr("fill", fill).attr("stroke-width", strokeWidth).attr("shape-rendering", shapeRendering).attr("stroke", stroke).attr("stroke-linecap", "square");
};
paths.background = function(_) {
background = _;
Oops, something went wrong.

0 comments on commit 9d1b15b

Please sign in to comment.