territories-dashboard-lib 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of territories-dashboard-lib might be problematic. Click here for more details.
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/css/website.css +956 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/chart.js +13 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/chartjs-plugin-datalabels.js +1 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/html2canvas.js +20 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/comparaison/data.mjs +62 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/comparaison/history.mjs +98 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/comparaison/main-values.mjs +30 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/comparaison/page.mjs +105 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/comparaison/territory-chart.mjs +141 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/data.mjs +59 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/histogram.mjs +130 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/map.mjs +25 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/page.mjs +96 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/proportions.mjs +77 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/sankey.mjs +27 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/table.mjs +229 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/top10.mjs +76 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/details/utils.mjs +8 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/dom.mjs +92 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/enums.mjs +104 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/export-graph.mjs +15 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/export.mjs +20 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/filters.mjs +159 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/format.mjs +54 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/side_panel.mjs +103 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/theme/history.mjs +89 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/theme/main-value.mjs +22 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/theme/page.mjs +162 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/theme/statistics.mjs +42 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/indicators/utils.mjs +93 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/pages/static/page.mjs +35 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/patternomaly.js +1452 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/react18.js +31 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/reactdom18.js +267 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/supersetEmbed.js +355 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/react/indicatorMap.bundle.js +2 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/react/sankeyGraph.bundle.js +2 -0
- territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/react/vendors-node_modules_mapbox-gl_dist_mapbox-gl_js.bundle.js +2 -0
- territories_dashboard_lib/website_lib/templates/admin/indicators_lib/indicator/change_form.html +8 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/404.html +10 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/500.html +10 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/layout/base.html +42 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/layout/base.js +47 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/layout/footer.html +96 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/layout/header.html +101 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/layout/header.js +102 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/comparaison/[theme]/components/indicateur-card.html +48 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/comparaison/[theme]/page.html +52 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/chart-buttons.html +29 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/geo_params.html +71 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/indicator-card.html +52 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/loader.html +28 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/side_panel.html +27 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/side_panel_geo.html +80 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/side_panel_geo.js +85 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/side_panel_methodo.html +45 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/side_panel_methodo.js +19 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/themes-list.html +9 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/themes-nav.html +33 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/components/title.html +28 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/details/components/filters-reminder.html +19 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/details/components/table.html +123 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/details/page.html +166 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/themes/components/extremum.html +15 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/themes/components/indicateur-card.html +76 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/indicators/themes/page.html +66 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/lexique/page.html +17 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/page.html +14 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/sitemap/page.html +71 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/static/page.html +16 -0
- territories_dashboard_lib/website_lib/templates/territories_dashboard_lib/website/pages/superset/page.html +55 -0
- {territories_dashboard_lib-0.1.1.dist-info → territories_dashboard_lib-0.1.2.dist-info}/METADATA +1 -1
- territories_dashboard_lib-0.1.2.dist-info/RECORD +138 -0
- territories_dashboard_lib-0.1.1.dist-info/RECORD +0 -67
- {territories_dashboard_lib-0.1.1.dist-info → territories_dashboard_lib-0.1.2.dist-info}/WHEEL +0 -0
- {territories_dashboard_lib-0.1.1.dist-info → territories_dashboard_lib-0.1.2.dist-info}/top_level.txt +0 -0
territories_dashboard_lib/website_lib/static/territories_dashboard_lib/website/js/patternomaly.js
ADDED
|
@@ -0,0 +1,1452 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined"
|
|
3
|
+
? (module.exports = factory())
|
|
4
|
+
: typeof define === "function" && define.amd
|
|
5
|
+
? define(factory)
|
|
6
|
+
: (global.pattern = factory());
|
|
7
|
+
})(this, function () {
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
var BACKGROUND_COLOR = "rgba(100, 100, 100, 0.7)";
|
|
11
|
+
var PATTERN_COLOR = "rgba(155, 155, 155, 0.8)";
|
|
12
|
+
var POINT_STYLE = "round";
|
|
13
|
+
|
|
14
|
+
var asyncGenerator = (function () {
|
|
15
|
+
function AwaitValue(value) {
|
|
16
|
+
this.value = value;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function AsyncGenerator(gen) {
|
|
20
|
+
var front, back;
|
|
21
|
+
|
|
22
|
+
function send(key, arg) {
|
|
23
|
+
return new Promise(function (resolve, reject) {
|
|
24
|
+
var request = {
|
|
25
|
+
key: key,
|
|
26
|
+
arg: arg,
|
|
27
|
+
resolve: resolve,
|
|
28
|
+
reject: reject,
|
|
29
|
+
next: null,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
if (back) {
|
|
33
|
+
back = back.next = request;
|
|
34
|
+
} else {
|
|
35
|
+
front = back = request;
|
|
36
|
+
resume(key, arg);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function resume(key, arg) {
|
|
42
|
+
try {
|
|
43
|
+
var result = gen[key](arg);
|
|
44
|
+
var value = result.value;
|
|
45
|
+
|
|
46
|
+
if (value instanceof AwaitValue) {
|
|
47
|
+
Promise.resolve(value.value).then(
|
|
48
|
+
function (arg) {
|
|
49
|
+
resume("next", arg);
|
|
50
|
+
},
|
|
51
|
+
function (arg) {
|
|
52
|
+
resume("throw", arg);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
} else {
|
|
56
|
+
settle(result.done ? "return" : "normal", result.value);
|
|
57
|
+
}
|
|
58
|
+
} catch (err) {
|
|
59
|
+
settle("throw", err);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function settle(type, value) {
|
|
64
|
+
switch (type) {
|
|
65
|
+
case "return":
|
|
66
|
+
front.resolve({
|
|
67
|
+
value: value,
|
|
68
|
+
done: true,
|
|
69
|
+
});
|
|
70
|
+
break;
|
|
71
|
+
|
|
72
|
+
case "throw":
|
|
73
|
+
front.reject(value);
|
|
74
|
+
break;
|
|
75
|
+
|
|
76
|
+
default:
|
|
77
|
+
front.resolve({
|
|
78
|
+
value: value,
|
|
79
|
+
done: false,
|
|
80
|
+
});
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
front = front.next;
|
|
85
|
+
|
|
86
|
+
if (front) {
|
|
87
|
+
resume(front.key, front.arg);
|
|
88
|
+
} else {
|
|
89
|
+
back = null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
this._invoke = send;
|
|
94
|
+
|
|
95
|
+
if (typeof gen.return !== "function") {
|
|
96
|
+
this.return = undefined;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (typeof Symbol === "function" && Symbol.asyncIterator) {
|
|
101
|
+
AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
|
|
102
|
+
return this;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
AsyncGenerator.prototype.next = function (arg) {
|
|
107
|
+
return this._invoke("next", arg);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
AsyncGenerator.prototype.throw = function (arg) {
|
|
111
|
+
return this._invoke("throw", arg);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
AsyncGenerator.prototype.return = function (arg) {
|
|
115
|
+
return this._invoke("return", arg);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
wrap: function (fn) {
|
|
120
|
+
return function () {
|
|
121
|
+
return new AsyncGenerator(fn.apply(this, arguments));
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
await: function (value) {
|
|
125
|
+
return new AwaitValue(value);
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
})();
|
|
129
|
+
|
|
130
|
+
var classCallCheck = function (instance, Constructor) {
|
|
131
|
+
if (!(instance instanceof Constructor)) {
|
|
132
|
+
throw new TypeError("Cannot call a class as a function");
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var createClass = (function () {
|
|
137
|
+
function defineProperties(target, props) {
|
|
138
|
+
for (var i = 0; i < props.length; i++) {
|
|
139
|
+
var descriptor = props[i];
|
|
140
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
141
|
+
descriptor.configurable = true;
|
|
142
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
143
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return function (Constructor, protoProps, staticProps) {
|
|
148
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
149
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
150
|
+
return Constructor;
|
|
151
|
+
};
|
|
152
|
+
})();
|
|
153
|
+
|
|
154
|
+
var _extends =
|
|
155
|
+
Object.assign ||
|
|
156
|
+
function (target) {
|
|
157
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
158
|
+
var source = arguments[i];
|
|
159
|
+
|
|
160
|
+
for (var key in source) {
|
|
161
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
162
|
+
target[key] = source[key];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return target;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var inherits = function (subClass, superClass) {
|
|
171
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
172
|
+
throw new TypeError(
|
|
173
|
+
"Super expression must either be null or a function, not " +
|
|
174
|
+
typeof superClass
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
179
|
+
constructor: {
|
|
180
|
+
value: subClass,
|
|
181
|
+
enumerable: false,
|
|
182
|
+
writable: true,
|
|
183
|
+
configurable: true,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
if (superClass)
|
|
187
|
+
Object.setPrototypeOf
|
|
188
|
+
? Object.setPrototypeOf(subClass, superClass)
|
|
189
|
+
: (subClass.__proto__ = superClass);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
var possibleConstructorReturn = function (self, call) {
|
|
193
|
+
if (!self) {
|
|
194
|
+
throw new ReferenceError(
|
|
195
|
+
"this hasn't been initialised - super() hasn't been called"
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return call && (typeof call === "object" || typeof call === "function")
|
|
200
|
+
? call
|
|
201
|
+
: self;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
var Shape = (function () {
|
|
205
|
+
function Shape() {
|
|
206
|
+
var size =
|
|
207
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
208
|
+
? arguments[0]
|
|
209
|
+
: 20;
|
|
210
|
+
var backgroundColor =
|
|
211
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
212
|
+
? arguments[1]
|
|
213
|
+
: BACKGROUND_COLOR;
|
|
214
|
+
var patternColor =
|
|
215
|
+
arguments.length > 2 && arguments[2] !== undefined
|
|
216
|
+
? arguments[2]
|
|
217
|
+
: PATTERN_COLOR;
|
|
218
|
+
classCallCheck(this, Shape);
|
|
219
|
+
|
|
220
|
+
this._canvas = document.createElement("canvas");
|
|
221
|
+
this._context = this._canvas.getContext("2d");
|
|
222
|
+
|
|
223
|
+
this._canvas.width = size;
|
|
224
|
+
this._canvas.height = size;
|
|
225
|
+
|
|
226
|
+
this._context.fillStyle = backgroundColor;
|
|
227
|
+
this._context.fillRect(
|
|
228
|
+
0,
|
|
229
|
+
0,
|
|
230
|
+
this._canvas.width,
|
|
231
|
+
this._canvas.height
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
this._size = size;
|
|
235
|
+
this._patternColor = patternColor;
|
|
236
|
+
|
|
237
|
+
return this;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
createClass(Shape, [
|
|
241
|
+
{
|
|
242
|
+
key: "setStrokeProps",
|
|
243
|
+
value: function setStrokeProps() {
|
|
244
|
+
this._context.strokeStyle = this._patternColor;
|
|
245
|
+
this._context.lineWidth = this._size / 10;
|
|
246
|
+
this._context.lineJoin = POINT_STYLE;
|
|
247
|
+
this._context.lineCap = POINT_STYLE;
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
key: "setFillProps",
|
|
252
|
+
value: function setFillProps() {
|
|
253
|
+
this._context.fillStyle = this._patternColor;
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
]);
|
|
257
|
+
return Shape;
|
|
258
|
+
})();
|
|
259
|
+
|
|
260
|
+
var Plus = (function (_Shape) {
|
|
261
|
+
inherits(Plus, _Shape);
|
|
262
|
+
|
|
263
|
+
function Plus() {
|
|
264
|
+
classCallCheck(this, Plus);
|
|
265
|
+
return possibleConstructorReturn(
|
|
266
|
+
this,
|
|
267
|
+
(Plus.__proto__ || Object.getPrototypeOf(Plus)).apply(
|
|
268
|
+
this,
|
|
269
|
+
arguments
|
|
270
|
+
)
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
createClass(Plus, [
|
|
275
|
+
{
|
|
276
|
+
key: "drawTile",
|
|
277
|
+
value: function drawTile() {
|
|
278
|
+
var halfSize = this._size / 2;
|
|
279
|
+
|
|
280
|
+
this._context.beginPath();
|
|
281
|
+
|
|
282
|
+
this.setStrokeProps();
|
|
283
|
+
|
|
284
|
+
this.drawPlus();
|
|
285
|
+
this.drawPlus(halfSize, halfSize);
|
|
286
|
+
|
|
287
|
+
this._context.stroke();
|
|
288
|
+
|
|
289
|
+
return this._canvas;
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
key: "drawPlus",
|
|
294
|
+
value: function drawPlus() {
|
|
295
|
+
var offsetX =
|
|
296
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
297
|
+
? arguments[0]
|
|
298
|
+
: 0;
|
|
299
|
+
var offsetY =
|
|
300
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
301
|
+
? arguments[1]
|
|
302
|
+
: 0;
|
|
303
|
+
|
|
304
|
+
var size = this._size;
|
|
305
|
+
var halfSize = size / 2;
|
|
306
|
+
var quarterSize = size / 4;
|
|
307
|
+
|
|
308
|
+
this._context.moveTo(quarterSize + offsetX, 0 + offsetY);
|
|
309
|
+
this._context.lineTo(
|
|
310
|
+
quarterSize + offsetX,
|
|
311
|
+
halfSize + offsetY
|
|
312
|
+
);
|
|
313
|
+
this._context.moveTo(0 + offsetX, quarterSize + offsetY);
|
|
314
|
+
this._context.lineTo(
|
|
315
|
+
halfSize + offsetX,
|
|
316
|
+
quarterSize + offsetY
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
this._context.closePath();
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
]);
|
|
323
|
+
return Plus;
|
|
324
|
+
})(Shape);
|
|
325
|
+
|
|
326
|
+
var Cross = (function (_Shape) {
|
|
327
|
+
inherits(Cross, _Shape);
|
|
328
|
+
|
|
329
|
+
function Cross() {
|
|
330
|
+
classCallCheck(this, Cross);
|
|
331
|
+
return possibleConstructorReturn(
|
|
332
|
+
this,
|
|
333
|
+
(Cross.__proto__ || Object.getPrototypeOf(Cross)).apply(
|
|
334
|
+
this,
|
|
335
|
+
arguments
|
|
336
|
+
)
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
createClass(Cross, [
|
|
341
|
+
{
|
|
342
|
+
key: "drawTile",
|
|
343
|
+
value: function drawTile() {
|
|
344
|
+
var halfSize = this._size / 2;
|
|
345
|
+
|
|
346
|
+
this._context.beginPath();
|
|
347
|
+
|
|
348
|
+
this.setStrokeProps();
|
|
349
|
+
|
|
350
|
+
this.drawCross();
|
|
351
|
+
this.drawCross(halfSize, halfSize);
|
|
352
|
+
|
|
353
|
+
this._context.stroke();
|
|
354
|
+
|
|
355
|
+
return this._canvas;
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
key: "drawCross",
|
|
360
|
+
value: function drawCross() {
|
|
361
|
+
var offsetX =
|
|
362
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
363
|
+
? arguments[0]
|
|
364
|
+
: 0;
|
|
365
|
+
var offsetY =
|
|
366
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
367
|
+
? arguments[1]
|
|
368
|
+
: 0;
|
|
369
|
+
|
|
370
|
+
var size = this._size;
|
|
371
|
+
var halfSize = size / 2;
|
|
372
|
+
var gap = 2;
|
|
373
|
+
|
|
374
|
+
this._context.moveTo(offsetX + gap, offsetY + gap);
|
|
375
|
+
this._context.lineTo(
|
|
376
|
+
halfSize - gap + offsetX,
|
|
377
|
+
halfSize - gap + offsetY
|
|
378
|
+
);
|
|
379
|
+
this._context.moveTo(
|
|
380
|
+
offsetX + gap,
|
|
381
|
+
halfSize - gap + offsetY
|
|
382
|
+
);
|
|
383
|
+
this._context.lineTo(
|
|
384
|
+
halfSize - gap + offsetX,
|
|
385
|
+
offsetY + gap
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
this._context.closePath();
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
]);
|
|
392
|
+
return Cross;
|
|
393
|
+
})(Shape);
|
|
394
|
+
|
|
395
|
+
var Dash = (function (_Shape) {
|
|
396
|
+
inherits(Dash, _Shape);
|
|
397
|
+
|
|
398
|
+
function Dash() {
|
|
399
|
+
classCallCheck(this, Dash);
|
|
400
|
+
return possibleConstructorReturn(
|
|
401
|
+
this,
|
|
402
|
+
(Dash.__proto__ || Object.getPrototypeOf(Dash)).apply(
|
|
403
|
+
this,
|
|
404
|
+
arguments
|
|
405
|
+
)
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
createClass(Dash, [
|
|
410
|
+
{
|
|
411
|
+
key: "drawTile",
|
|
412
|
+
value: function drawTile() {
|
|
413
|
+
var halfSize = this._size / 2;
|
|
414
|
+
|
|
415
|
+
this._context.beginPath();
|
|
416
|
+
|
|
417
|
+
this.setStrokeProps();
|
|
418
|
+
|
|
419
|
+
this.drawDash();
|
|
420
|
+
this.drawDash(halfSize, halfSize);
|
|
421
|
+
|
|
422
|
+
this._context.stroke();
|
|
423
|
+
|
|
424
|
+
return this._canvas;
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
key: "drawDash",
|
|
429
|
+
value: function drawDash() {
|
|
430
|
+
var offsetX =
|
|
431
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
432
|
+
? arguments[0]
|
|
433
|
+
: 0;
|
|
434
|
+
var offsetY =
|
|
435
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
436
|
+
? arguments[1]
|
|
437
|
+
: 0;
|
|
438
|
+
|
|
439
|
+
var size = this._size;
|
|
440
|
+
var halfSize = size / 2;
|
|
441
|
+
var gap = 2;
|
|
442
|
+
|
|
443
|
+
this._context.moveTo(offsetX + gap, offsetY + gap);
|
|
444
|
+
this._context.lineTo(
|
|
445
|
+
halfSize - gap + offsetX,
|
|
446
|
+
halfSize - gap + offsetY
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
this._context.closePath();
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
]);
|
|
453
|
+
return Dash;
|
|
454
|
+
})(Shape);
|
|
455
|
+
|
|
456
|
+
var CrossDash = (function (_Shape) {
|
|
457
|
+
inherits(CrossDash, _Shape);
|
|
458
|
+
|
|
459
|
+
function CrossDash() {
|
|
460
|
+
classCallCheck(this, CrossDash);
|
|
461
|
+
return possibleConstructorReturn(
|
|
462
|
+
this,
|
|
463
|
+
(CrossDash.__proto__ || Object.getPrototypeOf(CrossDash)).apply(
|
|
464
|
+
this,
|
|
465
|
+
arguments
|
|
466
|
+
)
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
createClass(CrossDash, [
|
|
471
|
+
{
|
|
472
|
+
key: "drawTile",
|
|
473
|
+
value: function drawTile() {
|
|
474
|
+
var halfSize = this._size / 2;
|
|
475
|
+
this._context.beginPath();
|
|
476
|
+
|
|
477
|
+
this.setStrokeProps();
|
|
478
|
+
|
|
479
|
+
var cross = new Cross();
|
|
480
|
+
cross.drawCross.call(this);
|
|
481
|
+
|
|
482
|
+
var dash = new Dash();
|
|
483
|
+
dash.drawDash.call(this, halfSize, halfSize);
|
|
484
|
+
|
|
485
|
+
this._context.stroke();
|
|
486
|
+
|
|
487
|
+
return this._canvas;
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
]);
|
|
491
|
+
return CrossDash;
|
|
492
|
+
})(Shape);
|
|
493
|
+
|
|
494
|
+
var Dot = (function (_Shape) {
|
|
495
|
+
inherits(Dot, _Shape);
|
|
496
|
+
|
|
497
|
+
function Dot() {
|
|
498
|
+
classCallCheck(this, Dot);
|
|
499
|
+
return possibleConstructorReturn(
|
|
500
|
+
this,
|
|
501
|
+
(Dot.__proto__ || Object.getPrototypeOf(Dot)).apply(
|
|
502
|
+
this,
|
|
503
|
+
arguments
|
|
504
|
+
)
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
createClass(Dot, [
|
|
509
|
+
{
|
|
510
|
+
key: "drawTile",
|
|
511
|
+
value: function drawTile() {
|
|
512
|
+
var halfSize = this._size / 2;
|
|
513
|
+
|
|
514
|
+
this._context.beginPath();
|
|
515
|
+
|
|
516
|
+
this.setFillProps();
|
|
517
|
+
|
|
518
|
+
this.drawDot();
|
|
519
|
+
this.drawDot(halfSize, halfSize);
|
|
520
|
+
|
|
521
|
+
this._context.fill();
|
|
522
|
+
|
|
523
|
+
return this._canvas;
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
key: "drawDot",
|
|
528
|
+
value: function drawDot() {
|
|
529
|
+
var offsetX =
|
|
530
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
531
|
+
? arguments[0]
|
|
532
|
+
: 0;
|
|
533
|
+
var offsetY =
|
|
534
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
535
|
+
? arguments[1]
|
|
536
|
+
: 0;
|
|
537
|
+
var diameter =
|
|
538
|
+
arguments.length > 2 && arguments[2] !== undefined
|
|
539
|
+
? arguments[2]
|
|
540
|
+
: this._size / 10;
|
|
541
|
+
|
|
542
|
+
var size = this._size;
|
|
543
|
+
var quarterSize = size / 4;
|
|
544
|
+
var x = quarterSize + offsetX;
|
|
545
|
+
var y = quarterSize + offsetY;
|
|
546
|
+
|
|
547
|
+
this._context.moveTo(x + quarterSize, y);
|
|
548
|
+
this._context.arc(x, y, diameter, 0, 2 * Math.PI);
|
|
549
|
+
|
|
550
|
+
this._context.closePath();
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
]);
|
|
554
|
+
return Dot;
|
|
555
|
+
})(Shape);
|
|
556
|
+
|
|
557
|
+
var DotDash = (function (_Shape) {
|
|
558
|
+
inherits(DotDash, _Shape);
|
|
559
|
+
|
|
560
|
+
function DotDash() {
|
|
561
|
+
classCallCheck(this, DotDash);
|
|
562
|
+
return possibleConstructorReturn(
|
|
563
|
+
this,
|
|
564
|
+
(DotDash.__proto__ || Object.getPrototypeOf(DotDash)).apply(
|
|
565
|
+
this,
|
|
566
|
+
arguments
|
|
567
|
+
)
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
createClass(DotDash, [
|
|
572
|
+
{
|
|
573
|
+
key: "drawTile",
|
|
574
|
+
value: function drawTile() {
|
|
575
|
+
var halfSize = this._size / 2;
|
|
576
|
+
|
|
577
|
+
this._context.beginPath();
|
|
578
|
+
|
|
579
|
+
this.setStrokeProps();
|
|
580
|
+
|
|
581
|
+
var dash = new Dash();
|
|
582
|
+
dash.drawDash.call(this, halfSize, halfSize);
|
|
583
|
+
|
|
584
|
+
this._context.closePath();
|
|
585
|
+
this._context.stroke();
|
|
586
|
+
|
|
587
|
+
this.setFillProps();
|
|
588
|
+
|
|
589
|
+
var dot = new Dot();
|
|
590
|
+
dot.drawDot.call(this);
|
|
591
|
+
|
|
592
|
+
this._context.fill();
|
|
593
|
+
|
|
594
|
+
return this._canvas;
|
|
595
|
+
},
|
|
596
|
+
},
|
|
597
|
+
]);
|
|
598
|
+
return DotDash;
|
|
599
|
+
})(Shape);
|
|
600
|
+
|
|
601
|
+
var Disc = (function (_Dot) {
|
|
602
|
+
inherits(Disc, _Dot);
|
|
603
|
+
|
|
604
|
+
function Disc() {
|
|
605
|
+
classCallCheck(this, Disc);
|
|
606
|
+
return possibleConstructorReturn(
|
|
607
|
+
this,
|
|
608
|
+
(Disc.__proto__ || Object.getPrototypeOf(Disc)).apply(
|
|
609
|
+
this,
|
|
610
|
+
arguments
|
|
611
|
+
)
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
createClass(Disc, [
|
|
616
|
+
{
|
|
617
|
+
key: "drawTile",
|
|
618
|
+
value: function drawTile() {
|
|
619
|
+
var halfSize = this._size / 2;
|
|
620
|
+
var diameter = this._size / 5;
|
|
621
|
+
|
|
622
|
+
this._context.beginPath();
|
|
623
|
+
|
|
624
|
+
this.setFillProps();
|
|
625
|
+
|
|
626
|
+
this.drawDot(0, 0, diameter);
|
|
627
|
+
this.drawDot(halfSize, halfSize, diameter);
|
|
628
|
+
|
|
629
|
+
this._context.fill();
|
|
630
|
+
|
|
631
|
+
return this._canvas;
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
]);
|
|
635
|
+
return Disc;
|
|
636
|
+
})(Dot);
|
|
637
|
+
|
|
638
|
+
var Ring = (function (_Dot) {
|
|
639
|
+
inherits(Ring, _Dot);
|
|
640
|
+
|
|
641
|
+
function Ring() {
|
|
642
|
+
classCallCheck(this, Ring);
|
|
643
|
+
return possibleConstructorReturn(
|
|
644
|
+
this,
|
|
645
|
+
(Ring.__proto__ || Object.getPrototypeOf(Ring)).apply(
|
|
646
|
+
this,
|
|
647
|
+
arguments
|
|
648
|
+
)
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
createClass(Ring, [
|
|
653
|
+
{
|
|
654
|
+
key: "drawTile",
|
|
655
|
+
value: function drawTile() {
|
|
656
|
+
var halfSize = this._size / 2;
|
|
657
|
+
var diameter = this._size / 5;
|
|
658
|
+
|
|
659
|
+
this._context.beginPath();
|
|
660
|
+
|
|
661
|
+
this.setStrokeProps();
|
|
662
|
+
|
|
663
|
+
this.drawDot(0, 0, diameter);
|
|
664
|
+
this.drawDot(halfSize, halfSize, diameter);
|
|
665
|
+
|
|
666
|
+
this._context.stroke();
|
|
667
|
+
|
|
668
|
+
return this._canvas;
|
|
669
|
+
},
|
|
670
|
+
},
|
|
671
|
+
]);
|
|
672
|
+
return Ring;
|
|
673
|
+
})(Dot);
|
|
674
|
+
|
|
675
|
+
var Line = (function (_Shape) {
|
|
676
|
+
inherits(Line, _Shape);
|
|
677
|
+
|
|
678
|
+
function Line() {
|
|
679
|
+
classCallCheck(this, Line);
|
|
680
|
+
return possibleConstructorReturn(
|
|
681
|
+
this,
|
|
682
|
+
(Line.__proto__ || Object.getPrototypeOf(Line)).apply(
|
|
683
|
+
this,
|
|
684
|
+
arguments
|
|
685
|
+
)
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
createClass(Line, [
|
|
690
|
+
{
|
|
691
|
+
key: "drawTile",
|
|
692
|
+
value: function drawTile() {
|
|
693
|
+
var halfSize = this._size / 2;
|
|
694
|
+
|
|
695
|
+
this._context.beginPath();
|
|
696
|
+
|
|
697
|
+
this.setStrokeProps();
|
|
698
|
+
|
|
699
|
+
this.drawLine();
|
|
700
|
+
this.drawLine(halfSize, halfSize);
|
|
701
|
+
|
|
702
|
+
this._context.stroke();
|
|
703
|
+
|
|
704
|
+
return this._canvas;
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
key: "drawLine",
|
|
709
|
+
value: function drawLine() {
|
|
710
|
+
var offsetX =
|
|
711
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
712
|
+
? arguments[0]
|
|
713
|
+
: 0;
|
|
714
|
+
var offsetY =
|
|
715
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
716
|
+
? arguments[1]
|
|
717
|
+
: 0;
|
|
718
|
+
|
|
719
|
+
var size = this._size;
|
|
720
|
+
var quarterSize = size / 4;
|
|
721
|
+
|
|
722
|
+
this._context.moveTo(0, quarterSize + offsetY);
|
|
723
|
+
this._context.lineTo(this._size, quarterSize + offsetY);
|
|
724
|
+
|
|
725
|
+
this._context.closePath();
|
|
726
|
+
},
|
|
727
|
+
},
|
|
728
|
+
]);
|
|
729
|
+
return Line;
|
|
730
|
+
})(Shape);
|
|
731
|
+
|
|
732
|
+
var VerticalLine = (function (_Line) {
|
|
733
|
+
inherits(VerticalLine, _Line);
|
|
734
|
+
|
|
735
|
+
function VerticalLine() {
|
|
736
|
+
classCallCheck(this, VerticalLine);
|
|
737
|
+
return possibleConstructorReturn(
|
|
738
|
+
this,
|
|
739
|
+
(
|
|
740
|
+
VerticalLine.__proto__ ||
|
|
741
|
+
Object.getPrototypeOf(VerticalLine)
|
|
742
|
+
).apply(this, arguments)
|
|
743
|
+
);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
createClass(VerticalLine, [
|
|
747
|
+
{
|
|
748
|
+
key: "drawTile",
|
|
749
|
+
value: function drawTile() {
|
|
750
|
+
this._context.translate(this._size, 0);
|
|
751
|
+
this._context.rotate((90 * Math.PI) / 180);
|
|
752
|
+
|
|
753
|
+
Line.prototype.drawTile.call(this);
|
|
754
|
+
|
|
755
|
+
return this._canvas;
|
|
756
|
+
},
|
|
757
|
+
},
|
|
758
|
+
]);
|
|
759
|
+
return VerticalLine;
|
|
760
|
+
})(Line);
|
|
761
|
+
|
|
762
|
+
var Weave = (function (_Shape) {
|
|
763
|
+
inherits(Weave, _Shape);
|
|
764
|
+
|
|
765
|
+
function Weave() {
|
|
766
|
+
classCallCheck(this, Weave);
|
|
767
|
+
return possibleConstructorReturn(
|
|
768
|
+
this,
|
|
769
|
+
(Weave.__proto__ || Object.getPrototypeOf(Weave)).apply(
|
|
770
|
+
this,
|
|
771
|
+
arguments
|
|
772
|
+
)
|
|
773
|
+
);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
createClass(Weave, [
|
|
777
|
+
{
|
|
778
|
+
key: "drawTile",
|
|
779
|
+
value: function drawTile() {
|
|
780
|
+
this._context.beginPath();
|
|
781
|
+
|
|
782
|
+
this.setStrokeProps();
|
|
783
|
+
|
|
784
|
+
this.drawWeave(0, 0);
|
|
785
|
+
|
|
786
|
+
this._context.stroke();
|
|
787
|
+
|
|
788
|
+
return this._canvas;
|
|
789
|
+
},
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
key: "drawWeave",
|
|
793
|
+
value: function drawWeave(offsetX, offsetY) {
|
|
794
|
+
var size = this._size;
|
|
795
|
+
var halfSize = size / 2;
|
|
796
|
+
|
|
797
|
+
this._context.moveTo(offsetX + 1, offsetY + 1);
|
|
798
|
+
this._context.lineTo(halfSize - 1, halfSize - 1);
|
|
799
|
+
|
|
800
|
+
this._context.moveTo(halfSize + 1, size - 1);
|
|
801
|
+
this._context.lineTo(size - 1, halfSize + 1);
|
|
802
|
+
|
|
803
|
+
this._context.closePath();
|
|
804
|
+
},
|
|
805
|
+
},
|
|
806
|
+
]);
|
|
807
|
+
return Weave;
|
|
808
|
+
})(Shape);
|
|
809
|
+
|
|
810
|
+
var Zigzag = (function (_Shape) {
|
|
811
|
+
inherits(Zigzag, _Shape);
|
|
812
|
+
|
|
813
|
+
function Zigzag() {
|
|
814
|
+
classCallCheck(this, Zigzag);
|
|
815
|
+
return possibleConstructorReturn(
|
|
816
|
+
this,
|
|
817
|
+
(Zigzag.__proto__ || Object.getPrototypeOf(Zigzag)).apply(
|
|
818
|
+
this,
|
|
819
|
+
arguments
|
|
820
|
+
)
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
createClass(Zigzag, [
|
|
825
|
+
{
|
|
826
|
+
key: "drawTile",
|
|
827
|
+
value: function drawTile() {
|
|
828
|
+
this._context.beginPath();
|
|
829
|
+
|
|
830
|
+
this.setStrokeProps();
|
|
831
|
+
|
|
832
|
+
this.drawZigzag();
|
|
833
|
+
this.drawZigzag(this._size / 2);
|
|
834
|
+
|
|
835
|
+
this._context.stroke();
|
|
836
|
+
|
|
837
|
+
return this._canvas;
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
key: "drawZigzag",
|
|
842
|
+
value: function drawZigzag() {
|
|
843
|
+
var offsetY =
|
|
844
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
845
|
+
? arguments[0]
|
|
846
|
+
: 0;
|
|
847
|
+
|
|
848
|
+
var size = this._size;
|
|
849
|
+
var quarterSize = size / 4;
|
|
850
|
+
var halfSize = size / 2;
|
|
851
|
+
var tenthSize = size / 10;
|
|
852
|
+
|
|
853
|
+
this._context.moveTo(0, tenthSize + offsetY);
|
|
854
|
+
this._context.lineTo(
|
|
855
|
+
quarterSize,
|
|
856
|
+
halfSize - tenthSize + offsetY
|
|
857
|
+
);
|
|
858
|
+
this._context.lineTo(halfSize, tenthSize + offsetY);
|
|
859
|
+
this._context.lineTo(
|
|
860
|
+
size - quarterSize,
|
|
861
|
+
halfSize - tenthSize + offsetY
|
|
862
|
+
);
|
|
863
|
+
this._context.lineTo(size, tenthSize + offsetY);
|
|
864
|
+
},
|
|
865
|
+
},
|
|
866
|
+
]);
|
|
867
|
+
return Zigzag;
|
|
868
|
+
})(Shape);
|
|
869
|
+
|
|
870
|
+
var ZigzagVertical = (function (_Zigzag) {
|
|
871
|
+
inherits(ZigzagVertical, _Zigzag);
|
|
872
|
+
|
|
873
|
+
function ZigzagVertical() {
|
|
874
|
+
classCallCheck(this, ZigzagVertical);
|
|
875
|
+
return possibleConstructorReturn(
|
|
876
|
+
this,
|
|
877
|
+
(
|
|
878
|
+
ZigzagVertical.__proto__ ||
|
|
879
|
+
Object.getPrototypeOf(ZigzagVertical)
|
|
880
|
+
).apply(this, arguments)
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
createClass(ZigzagVertical, [
|
|
885
|
+
{
|
|
886
|
+
key: "drawTile",
|
|
887
|
+
value: function drawTile() {
|
|
888
|
+
this._context.translate(this._size, 0);
|
|
889
|
+
this._context.rotate((90 * Math.PI) / 180);
|
|
890
|
+
|
|
891
|
+
Zigzag.prototype.drawTile.call(this);
|
|
892
|
+
|
|
893
|
+
return this._canvas;
|
|
894
|
+
},
|
|
895
|
+
},
|
|
896
|
+
]);
|
|
897
|
+
return ZigzagVertical;
|
|
898
|
+
})(Zigzag);
|
|
899
|
+
|
|
900
|
+
var Diagonal = (function (_Shape) {
|
|
901
|
+
inherits(Diagonal, _Shape);
|
|
902
|
+
|
|
903
|
+
function Diagonal() {
|
|
904
|
+
classCallCheck(this, Diagonal);
|
|
905
|
+
return possibleConstructorReturn(
|
|
906
|
+
this,
|
|
907
|
+
(Diagonal.__proto__ || Object.getPrototypeOf(Diagonal)).apply(
|
|
908
|
+
this,
|
|
909
|
+
arguments
|
|
910
|
+
)
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
createClass(Diagonal, [
|
|
915
|
+
{
|
|
916
|
+
key: "drawTile",
|
|
917
|
+
value: function drawTile() {
|
|
918
|
+
var halfSize = this._size / 2;
|
|
919
|
+
|
|
920
|
+
this._context.beginPath();
|
|
921
|
+
|
|
922
|
+
this.setStrokeProps();
|
|
923
|
+
|
|
924
|
+
this.drawDiagonalLine();
|
|
925
|
+
this.drawDiagonalLine(halfSize, halfSize);
|
|
926
|
+
|
|
927
|
+
this._context.stroke();
|
|
928
|
+
|
|
929
|
+
return this._canvas;
|
|
930
|
+
},
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
key: "drawDiagonalLine",
|
|
934
|
+
value: function drawDiagonalLine() {
|
|
935
|
+
var offsetX =
|
|
936
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
937
|
+
? arguments[0]
|
|
938
|
+
: 0;
|
|
939
|
+
var offsetY =
|
|
940
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
941
|
+
? arguments[1]
|
|
942
|
+
: 0;
|
|
943
|
+
|
|
944
|
+
var size = this._size;
|
|
945
|
+
var halfSize = size / 2;
|
|
946
|
+
var gap = 1;
|
|
947
|
+
|
|
948
|
+
this._context.moveTo(
|
|
949
|
+
halfSize - gap - offsetX,
|
|
950
|
+
gap * -1 + offsetY
|
|
951
|
+
);
|
|
952
|
+
this._context.lineTo(
|
|
953
|
+
size + 1 - offsetX,
|
|
954
|
+
halfSize + 1 + offsetY
|
|
955
|
+
);
|
|
956
|
+
|
|
957
|
+
this._context.closePath();
|
|
958
|
+
},
|
|
959
|
+
},
|
|
960
|
+
]);
|
|
961
|
+
return Diagonal;
|
|
962
|
+
})(Shape);
|
|
963
|
+
|
|
964
|
+
var DiagonalRightLeft = (function (_Diagonal) {
|
|
965
|
+
inherits(DiagonalRightLeft, _Diagonal);
|
|
966
|
+
|
|
967
|
+
function DiagonalRightLeft() {
|
|
968
|
+
classCallCheck(this, DiagonalRightLeft);
|
|
969
|
+
return possibleConstructorReturn(
|
|
970
|
+
this,
|
|
971
|
+
(
|
|
972
|
+
DiagonalRightLeft.__proto__ ||
|
|
973
|
+
Object.getPrototypeOf(DiagonalRightLeft)
|
|
974
|
+
).apply(this, arguments)
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
createClass(DiagonalRightLeft, [
|
|
979
|
+
{
|
|
980
|
+
key: "drawTile",
|
|
981
|
+
value: function drawTile() {
|
|
982
|
+
this._context.translate(this._size, 0);
|
|
983
|
+
this._context.rotate((90 * Math.PI) / 180);
|
|
984
|
+
|
|
985
|
+
Diagonal.prototype.drawTile.call(this);
|
|
986
|
+
|
|
987
|
+
return this._canvas;
|
|
988
|
+
},
|
|
989
|
+
},
|
|
990
|
+
]);
|
|
991
|
+
return DiagonalRightLeft;
|
|
992
|
+
})(Diagonal);
|
|
993
|
+
|
|
994
|
+
var Square = (function (_Shape) {
|
|
995
|
+
inherits(Square, _Shape);
|
|
996
|
+
|
|
997
|
+
function Square() {
|
|
998
|
+
classCallCheck(this, Square);
|
|
999
|
+
return possibleConstructorReturn(
|
|
1000
|
+
this,
|
|
1001
|
+
(Square.__proto__ || Object.getPrototypeOf(Square)).apply(
|
|
1002
|
+
this,
|
|
1003
|
+
arguments
|
|
1004
|
+
)
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
createClass(Square, [
|
|
1009
|
+
{
|
|
1010
|
+
key: "drawTile",
|
|
1011
|
+
value: function drawTile() {
|
|
1012
|
+
var halfSize = this._size / 2;
|
|
1013
|
+
|
|
1014
|
+
this._context.beginPath();
|
|
1015
|
+
|
|
1016
|
+
this.setFillProps();
|
|
1017
|
+
|
|
1018
|
+
this.drawSquare();
|
|
1019
|
+
this.drawSquare(halfSize, halfSize);
|
|
1020
|
+
|
|
1021
|
+
this._context.fill();
|
|
1022
|
+
|
|
1023
|
+
return this._canvas;
|
|
1024
|
+
},
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
key: "drawSquare",
|
|
1028
|
+
value: function drawSquare() {
|
|
1029
|
+
var offsetX =
|
|
1030
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
1031
|
+
? arguments[0]
|
|
1032
|
+
: 0;
|
|
1033
|
+
var offsetY =
|
|
1034
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
1035
|
+
? arguments[1]
|
|
1036
|
+
: 0;
|
|
1037
|
+
|
|
1038
|
+
var size = this._size;
|
|
1039
|
+
var halfSize = size / 2;
|
|
1040
|
+
var gap = size / 20;
|
|
1041
|
+
|
|
1042
|
+
this._context.fillRect(
|
|
1043
|
+
offsetX + gap,
|
|
1044
|
+
offsetY + gap,
|
|
1045
|
+
halfSize - gap * 2,
|
|
1046
|
+
halfSize - gap * 2
|
|
1047
|
+
);
|
|
1048
|
+
|
|
1049
|
+
this._context.closePath();
|
|
1050
|
+
},
|
|
1051
|
+
},
|
|
1052
|
+
]);
|
|
1053
|
+
return Square;
|
|
1054
|
+
})(Shape);
|
|
1055
|
+
|
|
1056
|
+
var Box = (function (_Shape) {
|
|
1057
|
+
inherits(Box, _Shape);
|
|
1058
|
+
|
|
1059
|
+
function Box() {
|
|
1060
|
+
classCallCheck(this, Box);
|
|
1061
|
+
return possibleConstructorReturn(
|
|
1062
|
+
this,
|
|
1063
|
+
(Box.__proto__ || Object.getPrototypeOf(Box)).apply(
|
|
1064
|
+
this,
|
|
1065
|
+
arguments
|
|
1066
|
+
)
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
createClass(Box, [
|
|
1071
|
+
{
|
|
1072
|
+
key: "drawTile",
|
|
1073
|
+
value: function drawTile() {
|
|
1074
|
+
var halfSize = this._size / 2;
|
|
1075
|
+
|
|
1076
|
+
this._context.beginPath();
|
|
1077
|
+
|
|
1078
|
+
this.setStrokeProps();
|
|
1079
|
+
|
|
1080
|
+
this.drawBox();
|
|
1081
|
+
this.drawBox(halfSize, halfSize);
|
|
1082
|
+
|
|
1083
|
+
this._context.stroke();
|
|
1084
|
+
|
|
1085
|
+
return this._canvas;
|
|
1086
|
+
},
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
key: "drawBox",
|
|
1090
|
+
value: function drawBox() {
|
|
1091
|
+
var offsetX =
|
|
1092
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
1093
|
+
? arguments[0]
|
|
1094
|
+
: 0;
|
|
1095
|
+
var offsetY =
|
|
1096
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
1097
|
+
? arguments[1]
|
|
1098
|
+
: 0;
|
|
1099
|
+
|
|
1100
|
+
var size = this._size;
|
|
1101
|
+
var halfSize = size / 2;
|
|
1102
|
+
var gap = size / 20;
|
|
1103
|
+
|
|
1104
|
+
this._context.strokeRect(
|
|
1105
|
+
offsetX + gap,
|
|
1106
|
+
offsetY + gap,
|
|
1107
|
+
halfSize - gap * 4,
|
|
1108
|
+
halfSize - gap * 4
|
|
1109
|
+
);
|
|
1110
|
+
|
|
1111
|
+
this._context.closePath();
|
|
1112
|
+
},
|
|
1113
|
+
},
|
|
1114
|
+
]);
|
|
1115
|
+
return Box;
|
|
1116
|
+
})(Shape);
|
|
1117
|
+
|
|
1118
|
+
var Triangle = (function (_Shape) {
|
|
1119
|
+
inherits(Triangle, _Shape);
|
|
1120
|
+
|
|
1121
|
+
function Triangle() {
|
|
1122
|
+
classCallCheck(this, Triangle);
|
|
1123
|
+
return possibleConstructorReturn(
|
|
1124
|
+
this,
|
|
1125
|
+
(Triangle.__proto__ || Object.getPrototypeOf(Triangle)).apply(
|
|
1126
|
+
this,
|
|
1127
|
+
arguments
|
|
1128
|
+
)
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
createClass(Triangle, [
|
|
1133
|
+
{
|
|
1134
|
+
key: "drawTile",
|
|
1135
|
+
value: function drawTile() {
|
|
1136
|
+
var halfSize = this._size / 2;
|
|
1137
|
+
|
|
1138
|
+
this._context.beginPath();
|
|
1139
|
+
|
|
1140
|
+
this.setFillProps();
|
|
1141
|
+
|
|
1142
|
+
this.drawTriangle();
|
|
1143
|
+
this.drawTriangle(halfSize, halfSize);
|
|
1144
|
+
|
|
1145
|
+
this._context.fill();
|
|
1146
|
+
|
|
1147
|
+
return this._canvas;
|
|
1148
|
+
},
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
key: "drawTriangle",
|
|
1152
|
+
value: function drawTriangle() {
|
|
1153
|
+
var offsetX =
|
|
1154
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
1155
|
+
? arguments[0]
|
|
1156
|
+
: 0;
|
|
1157
|
+
var offsetY =
|
|
1158
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
1159
|
+
? arguments[1]
|
|
1160
|
+
: 0;
|
|
1161
|
+
|
|
1162
|
+
var size = this._size;
|
|
1163
|
+
var halfSize = size / 2;
|
|
1164
|
+
var quarterSize = size / 4;
|
|
1165
|
+
|
|
1166
|
+
this._context.moveTo(quarterSize + offsetX, offsetY);
|
|
1167
|
+
this._context.lineTo(
|
|
1168
|
+
halfSize + offsetX,
|
|
1169
|
+
halfSize + offsetY
|
|
1170
|
+
);
|
|
1171
|
+
this._context.lineTo(offsetX, halfSize + offsetY);
|
|
1172
|
+
|
|
1173
|
+
this._context.closePath();
|
|
1174
|
+
},
|
|
1175
|
+
},
|
|
1176
|
+
]);
|
|
1177
|
+
return Triangle;
|
|
1178
|
+
})(Shape);
|
|
1179
|
+
|
|
1180
|
+
var TriangleVertical = (function (_Triangle) {
|
|
1181
|
+
inherits(TriangleVertical, _Triangle);
|
|
1182
|
+
|
|
1183
|
+
function TriangleVertical() {
|
|
1184
|
+
classCallCheck(this, TriangleVertical);
|
|
1185
|
+
return possibleConstructorReturn(
|
|
1186
|
+
this,
|
|
1187
|
+
(
|
|
1188
|
+
TriangleVertical.__proto__ ||
|
|
1189
|
+
Object.getPrototypeOf(TriangleVertical)
|
|
1190
|
+
).apply(this, arguments)
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
createClass(TriangleVertical, [
|
|
1195
|
+
{
|
|
1196
|
+
key: "drawTile",
|
|
1197
|
+
value: function drawTile() {
|
|
1198
|
+
var size = this._size;
|
|
1199
|
+
|
|
1200
|
+
this._context.translate(size, size);
|
|
1201
|
+
this._context.rotate((180 * Math.PI) / 180);
|
|
1202
|
+
|
|
1203
|
+
Triangle.prototype.drawTile.call(this);
|
|
1204
|
+
|
|
1205
|
+
return this._canvas;
|
|
1206
|
+
},
|
|
1207
|
+
},
|
|
1208
|
+
]);
|
|
1209
|
+
return TriangleVertical;
|
|
1210
|
+
})(Triangle);
|
|
1211
|
+
|
|
1212
|
+
var Diamond = (function (_Shape) {
|
|
1213
|
+
inherits(Diamond, _Shape);
|
|
1214
|
+
|
|
1215
|
+
function Diamond() {
|
|
1216
|
+
classCallCheck(this, Diamond);
|
|
1217
|
+
return possibleConstructorReturn(
|
|
1218
|
+
this,
|
|
1219
|
+
(Diamond.__proto__ || Object.getPrototypeOf(Diamond)).apply(
|
|
1220
|
+
this,
|
|
1221
|
+
arguments
|
|
1222
|
+
)
|
|
1223
|
+
);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
createClass(Diamond, [
|
|
1227
|
+
{
|
|
1228
|
+
key: "drawTile",
|
|
1229
|
+
value: function drawTile() {
|
|
1230
|
+
var halfSize = this._size / 2;
|
|
1231
|
+
|
|
1232
|
+
this._context.beginPath();
|
|
1233
|
+
|
|
1234
|
+
this.setFillProps();
|
|
1235
|
+
|
|
1236
|
+
this.drawDiamond();
|
|
1237
|
+
this.drawDiamond(halfSize, halfSize);
|
|
1238
|
+
|
|
1239
|
+
this._context.fill();
|
|
1240
|
+
|
|
1241
|
+
return this._canvas;
|
|
1242
|
+
},
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
key: "drawDiamond",
|
|
1246
|
+
value: function drawDiamond() {
|
|
1247
|
+
var offsetX =
|
|
1248
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
1249
|
+
? arguments[0]
|
|
1250
|
+
: 0;
|
|
1251
|
+
var offsetY =
|
|
1252
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
1253
|
+
? arguments[1]
|
|
1254
|
+
: 0;
|
|
1255
|
+
|
|
1256
|
+
var size = this._size;
|
|
1257
|
+
var halfSize = size / 2;
|
|
1258
|
+
var quarterSize = size / 4;
|
|
1259
|
+
|
|
1260
|
+
this._context.moveTo(quarterSize + offsetX, offsetY);
|
|
1261
|
+
this._context.lineTo(
|
|
1262
|
+
halfSize + offsetX,
|
|
1263
|
+
quarterSize + offsetY
|
|
1264
|
+
);
|
|
1265
|
+
this._context.lineTo(
|
|
1266
|
+
quarterSize + offsetX,
|
|
1267
|
+
halfSize + offsetY
|
|
1268
|
+
);
|
|
1269
|
+
this._context.lineTo(offsetX, quarterSize + offsetY);
|
|
1270
|
+
|
|
1271
|
+
this._context.closePath();
|
|
1272
|
+
},
|
|
1273
|
+
},
|
|
1274
|
+
]);
|
|
1275
|
+
return Diamond;
|
|
1276
|
+
})(Shape);
|
|
1277
|
+
|
|
1278
|
+
var DiamondBox = (function (_Diamond) {
|
|
1279
|
+
inherits(DiamondBox, _Diamond);
|
|
1280
|
+
|
|
1281
|
+
function DiamondBox() {
|
|
1282
|
+
classCallCheck(this, DiamondBox);
|
|
1283
|
+
return possibleConstructorReturn(
|
|
1284
|
+
this,
|
|
1285
|
+
(
|
|
1286
|
+
DiamondBox.__proto__ || Object.getPrototypeOf(DiamondBox)
|
|
1287
|
+
).apply(this, arguments)
|
|
1288
|
+
);
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
createClass(DiamondBox, [
|
|
1292
|
+
{
|
|
1293
|
+
key: "drawTile",
|
|
1294
|
+
value: function drawTile() {
|
|
1295
|
+
var halfSize = this._size / 2;
|
|
1296
|
+
|
|
1297
|
+
this._context.beginPath();
|
|
1298
|
+
|
|
1299
|
+
this.setStrokeProps();
|
|
1300
|
+
|
|
1301
|
+
this.drawDiamond();
|
|
1302
|
+
this.drawDiamond(halfSize, halfSize);
|
|
1303
|
+
|
|
1304
|
+
this._context.stroke();
|
|
1305
|
+
|
|
1306
|
+
return this._canvas;
|
|
1307
|
+
},
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
key: "drawDiamond",
|
|
1311
|
+
value: function drawDiamond() {
|
|
1312
|
+
var offsetX =
|
|
1313
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
1314
|
+
? arguments[0]
|
|
1315
|
+
: 0;
|
|
1316
|
+
var offsetY =
|
|
1317
|
+
arguments.length > 1 && arguments[1] !== undefined
|
|
1318
|
+
? arguments[1]
|
|
1319
|
+
: 0;
|
|
1320
|
+
|
|
1321
|
+
var size = this._size;
|
|
1322
|
+
var halfSize = size / 2 - 1;
|
|
1323
|
+
var quarterSize = size / 4;
|
|
1324
|
+
|
|
1325
|
+
this._context.moveTo(quarterSize + offsetX, offsetY + 1);
|
|
1326
|
+
this._context.lineTo(
|
|
1327
|
+
halfSize + offsetX,
|
|
1328
|
+
quarterSize + offsetY
|
|
1329
|
+
);
|
|
1330
|
+
this._context.lineTo(
|
|
1331
|
+
quarterSize + offsetX,
|
|
1332
|
+
halfSize + offsetY
|
|
1333
|
+
);
|
|
1334
|
+
this._context.lineTo(offsetX + 1, quarterSize + offsetY);
|
|
1335
|
+
|
|
1336
|
+
this._context.closePath();
|
|
1337
|
+
},
|
|
1338
|
+
},
|
|
1339
|
+
]);
|
|
1340
|
+
return DiamondBox;
|
|
1341
|
+
})(Diamond);
|
|
1342
|
+
|
|
1343
|
+
var shapes = {
|
|
1344
|
+
plus: Plus,
|
|
1345
|
+
cross: Cross,
|
|
1346
|
+
dash: Dash,
|
|
1347
|
+
"cross-dash": CrossDash,
|
|
1348
|
+
dot: Dot,
|
|
1349
|
+
"dot-dash": DotDash,
|
|
1350
|
+
disc: Disc,
|
|
1351
|
+
ring: Ring,
|
|
1352
|
+
line: Line,
|
|
1353
|
+
"line-vertical": VerticalLine,
|
|
1354
|
+
weave: Weave,
|
|
1355
|
+
zigzag: Zigzag,
|
|
1356
|
+
"zigzag-vertical": ZigzagVertical,
|
|
1357
|
+
diagonal: Diagonal,
|
|
1358
|
+
"diagonal-right-left": DiagonalRightLeft,
|
|
1359
|
+
square: Square,
|
|
1360
|
+
box: Box,
|
|
1361
|
+
triangle: Triangle,
|
|
1362
|
+
"triangle-inverted": TriangleVertical,
|
|
1363
|
+
diamond: Diamond,
|
|
1364
|
+
"diamond-box": DiamondBox,
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
var deprecatedShapes = {
|
|
1368
|
+
circle: shapes["disc"],
|
|
1369
|
+
"triangle-vertical": shapes["triangle-inverted"],
|
|
1370
|
+
"line-horizontal": shapes["line"],
|
|
1371
|
+
"line-diagonal-lr": shapes["diagonal"],
|
|
1372
|
+
"line-diagonal-rl": shapes["diagonal-right-left"],
|
|
1373
|
+
"zigzag-horizontal": shapes["zigzag"],
|
|
1374
|
+
"diamond-outline": shapes["diamond-box"],
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1377
|
+
var completeShapesList = [];
|
|
1378
|
+
|
|
1379
|
+
function getRandomShape() {
|
|
1380
|
+
var excludedShapeTypes =
|
|
1381
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
1382
|
+
? arguments[0]
|
|
1383
|
+
: [];
|
|
1384
|
+
|
|
1385
|
+
var shapesList = Object.keys(shapes);
|
|
1386
|
+
|
|
1387
|
+
excludedShapeTypes.forEach(function (shapeType) {
|
|
1388
|
+
shapesList.splice(shapesList.indexOf(shapeType), 1);
|
|
1389
|
+
});
|
|
1390
|
+
|
|
1391
|
+
var randomIndex = Math.floor(Math.random() * shapesList.length);
|
|
1392
|
+
|
|
1393
|
+
return shapesList[randomIndex];
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
_extends(completeShapesList, shapes, deprecatedShapes);
|
|
1397
|
+
|
|
1398
|
+
function draw() {
|
|
1399
|
+
var shapeType =
|
|
1400
|
+
arguments.length > 0 && arguments[0] !== undefined
|
|
1401
|
+
? arguments[0]
|
|
1402
|
+
: "square";
|
|
1403
|
+
var backgroundColor = arguments[1];
|
|
1404
|
+
var patternColor = arguments[2];
|
|
1405
|
+
var size = arguments[3];
|
|
1406
|
+
|
|
1407
|
+
var patternCanvas = document.createElement("canvas");
|
|
1408
|
+
var patternContext = patternCanvas.getContext("2d");
|
|
1409
|
+
var outerSize = size * 2;
|
|
1410
|
+
|
|
1411
|
+
var Shape = completeShapesList[shapeType];
|
|
1412
|
+
var shape = new Shape(size, backgroundColor, patternColor);
|
|
1413
|
+
|
|
1414
|
+
var pattern = patternContext.createPattern(shape.drawTile(), "repeat");
|
|
1415
|
+
|
|
1416
|
+
patternCanvas.width = outerSize;
|
|
1417
|
+
patternCanvas.height = outerSize;
|
|
1418
|
+
|
|
1419
|
+
pattern.shapeType = shapeType;
|
|
1420
|
+
|
|
1421
|
+
return pattern;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
function generate(colorList) {
|
|
1425
|
+
var firstShapeType = void 0;
|
|
1426
|
+
var previousShapeType = void 0;
|
|
1427
|
+
|
|
1428
|
+
return colorList.map(function (color, index, list) {
|
|
1429
|
+
var shapeType = void 0;
|
|
1430
|
+
|
|
1431
|
+
if (index === 0) {
|
|
1432
|
+
shapeType = getRandomShape();
|
|
1433
|
+
previousShapeType = shapeType;
|
|
1434
|
+
firstShapeType = previousShapeType;
|
|
1435
|
+
} else if (index === list.length - 1) {
|
|
1436
|
+
shapeType = getRandomShape([previousShapeType, firstShapeType]);
|
|
1437
|
+
} else {
|
|
1438
|
+
shapeType = getRandomShape([previousShapeType]);
|
|
1439
|
+
previousShapeType = shapeType;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
return draw(shapeType, color);
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
var pattern = {
|
|
1447
|
+
draw: draw,
|
|
1448
|
+
generate: generate,
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
return pattern;
|
|
1452
|
+
});
|