p5 2.0.0 → 2.0.1
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.
- package/{src → dist}/accessibility/color_namer.js +48 -3
- package/{src → dist}/accessibility/describe.js +2 -2
- package/{src → dist}/accessibility/gridOutput.js +2 -2
- package/dist/accessibility/index.js +60 -0
- package/{src → dist}/accessibility/outputs.js +2 -2
- package/{src → dist}/accessibility/textOutput.js +2 -2
- package/dist/app.js +120 -0
- package/{src → dist}/color/color_conversion.js +48 -10
- package/{src → dist}/color/color_spaces/hsb.js +3 -1
- package/dist/color/creating_reading.js +3 -0
- package/dist/color/index.js +13 -0
- package/dist/color/p5.Color.culori.js +1 -0
- package/dist/color/p5.Color.js +3 -0
- package/{src → dist}/color/setting.js +9 -6
- package/{src/core/constants.js → dist/constants-C-g_eAdC.js} +266 -130
- package/{src → dist}/core/States.js +3 -1
- package/dist/core/constants.js +1 -0
- package/{src → dist}/core/environment.js +7 -6
- package/{src → dist}/core/friendly_errors/browser_errors.js +1 -1
- package/{src → dist}/core/friendly_errors/fes_core.js +14 -44
- package/{src → dist}/core/friendly_errors/file_errors.js +6 -3
- package/dist/core/friendly_errors/index.js +23 -0
- package/dist/core/friendly_errors/param_validator.js +5455 -0
- package/{src → dist}/core/friendly_errors/sketch_reader.js +50 -4
- package/{src → dist}/core/friendly_errors/sketch_verifier.js +6 -6
- package/{src → dist}/core/friendly_errors/stacktrace.js +3 -5
- package/{src → dist}/core/friendly_errors/validate_params.js +50 -41
- package/{src → dist}/core/helpers.js +9 -6
- package/dist/core/init.js +105 -0
- package/dist/core/internationalization.js +302 -0
- package/dist/core/legacy.js +73 -0
- package/dist/core/main.js +44 -0
- package/dist/core/noop.js +3 -0
- package/dist/core/p5.Graphics.js +40 -0
- package/dist/core/p5.Renderer.js +11 -0
- package/dist/core/p5.Renderer2D.js +44 -0
- package/dist/core/reference.js +1 -0
- package/dist/core/rendering.js +40 -0
- package/{src → dist}/core/structure.js +3 -3
- package/{src → dist}/core/transform.js +2 -2
- package/{src/color/creating_reading.js → dist/creating_reading-D4AAKRbx.js} +841 -13
- package/{src → dist}/data/index.js +3 -1
- package/{src → dist}/data/local_storage.js +2 -8
- package/{src → dist}/dom/dom.js +11 -5
- package/dist/dom/index.js +18 -0
- package/{src → dist}/dom/p5.Element.js +14 -12
- package/{src → dist}/dom/p5.File.js +4 -4
- package/{src → dist}/dom/p5.MediaElement.js +10 -4
- package/{src → dist}/events/acceleration.js +2 -2
- package/{src → dist}/events/index.js +3 -1
- package/{src → dist}/events/keyboard.js +14 -11
- package/{src → dist}/events/pointer.js +16 -17
- package/dist/image/const.js +9 -0
- package/{src → dist}/image/filterRenderer2D.js +57 -37
- package/{src → dist}/image/filters.js +1 -3
- package/dist/image/image.js +40 -0
- package/dist/image/index.js +51 -0
- package/dist/image/loading_displaying.js +40 -0
- package/dist/image/p5.Image.js +11 -0
- package/{src → dist}/image/pixels.js +4 -3
- package/{src → dist}/io/csv.js +72 -70
- package/dist/io/files.js +40 -0
- package/dist/io/index.js +51 -0
- package/{src → dist}/io/p5.Table.js +6 -6
- package/{src → dist}/io/p5.TableRow.js +3 -4
- package/{src → dist}/io/p5.XML.js +2 -5
- package/{src → dist}/io/utilities.js +1 -1
- package/{src/core/p5.Renderer2D.js → dist/main-s72KWcUy.js} +735 -57
- package/{src → dist}/math/Matrices/Matrix.js +10 -8
- package/{src → dist}/math/Matrices/MatrixInterface.js +5 -3
- package/{src → dist}/math/Matrices/MatrixNumjs.js +12 -26
- package/{src → dist}/math/calculation.js +2 -2
- package/{src → dist}/math/index.js +6 -3
- package/{src → dist}/math/math.js +2 -2
- package/{src → dist}/math/noise.js +2 -2
- package/{src → dist}/math/p5.Matrix.js +7 -4
- package/{src → dist}/math/p5.Vector.js +6 -6
- package/{src → dist}/math/random.js +2 -2
- package/{src → dist}/math/trigonometry.js +16 -15
- package/{src/image/p5.Image.js → dist/p5.Renderer-CwAYZOC2.js} +390 -19
- package/dist/rendering--aAe5aq3.js +24925 -0
- package/{src → dist}/shape/2d_primitives.js +18 -17
- package/{src → dist}/shape/attributes.js +18 -17
- package/{src → dist}/shape/curves.js +2 -2
- package/{src → dist}/shape/custom_shapes.js +44 -64
- package/{src → dist}/shape/index.js +10 -2
- package/{src → dist}/shape/vertex.js +2 -3
- package/dist/type/index.js +25 -0
- package/{src → dist}/type/lib/Typr.js +76 -94
- package/{src → dist}/type/p5.Font.js +37 -61
- package/{src → dist}/type/textCore.js +34 -57
- package/{src → dist}/type/unicodeRanges.js +3 -1
- package/{src → dist}/utilities/conversion.js +2 -2
- package/{src → dist}/utilities/index.js +3 -1
- package/{src → dist}/utilities/time_date.js +6 -7
- package/{src → dist}/utilities/utility_functions.js +2 -2
- package/dist/webgl/3d_primitives.js +40 -0
- package/{src → dist}/webgl/GeometryBufferCache.js +3 -1
- package/{src → dist}/webgl/GeometryBuilder.js +12 -8
- package/{src → dist}/webgl/ShaderGenerator.js +79 -82
- package/{src → dist}/webgl/ShapeBuilder.js +26 -23
- package/dist/webgl/index.js +76 -0
- package/{src → dist}/webgl/interaction.js +7 -6
- package/dist/webgl/light.js +40 -0
- package/{src → dist}/webgl/loading.js +45 -12
- package/dist/webgl/material.js +40 -0
- package/dist/webgl/p5.Camera.js +40 -0
- package/{src → dist}/webgl/p5.DataArray.js +3 -5
- package/dist/webgl/p5.Framebuffer.js +40 -0
- package/{src → dist}/webgl/p5.Geometry.js +12 -15
- package/{src → dist}/webgl/p5.Quat.js +5 -4
- package/{src → dist}/webgl/p5.RenderBuffer.js +2 -3
- package/dist/webgl/p5.RendererGL.js +40 -0
- package/dist/webgl/p5.Shader.js +40 -0
- package/dist/webgl/p5.Texture.js +40 -0
- package/{src → dist}/webgl/text.js +51 -9
- package/lib/p5.esm.js +102 -48
- package/lib/p5.js +102 -48
- package/lib/p5.min.js +1 -1
- package/package.json +17 -16
- package/translations/dev.js +6 -6
- package/translations/index.js +1 -1
- package/src/README.md +0 -27
- package/src/accessibility/index.js +0 -13
- package/src/app.js +0 -61
- package/src/color/index.js +0 -9
- package/src/color/p5.Color.culori.js +0 -66
- package/src/color/p5.Color.js +0 -851
- package/src/core/README.md +0 -91
- package/src/core/friendly_errors/index.js +0 -13
- package/src/core/friendly_errors/param_validator.js +0 -561
- package/src/core/init.js +0 -58
- package/src/core/internationalization.js +0 -195
- package/src/core/legacy.js +0 -29
- package/src/core/main.js +0 -689
- package/src/core/noop.js +0 -1
- package/src/core/p5.Graphics.js +0 -696
- package/src/core/p5.Renderer.js +0 -408
- package/src/core/reference.js +0 -2060
- package/src/core/rendering.js +0 -697
- package/src/dom/index.js +0 -11
- package/src/image/const.js +0 -6
- package/src/image/image.js +0 -731
- package/src/image/index.js +0 -15
- package/src/image/loading_displaying.js +0 -1431
- package/src/io/files.js +0 -2210
- package/src/io/index.js +0 -11
- package/src/math/README.md +0 -40
- package/src/type/index.js +0 -9
- package/src/webgl/3d_primitives.js +0 -2741
- package/src/webgl/index.js +0 -37
- package/src/webgl/light.js +0 -1851
- package/src/webgl/material.js +0 -3854
- package/src/webgl/p5.Camera.js +0 -4010
- package/src/webgl/p5.Framebuffer.js +0 -1865
- package/src/webgl/p5.RendererGL.js +0 -2867
- package/src/webgl/p5.Shader.js +0 -1505
- package/src/webgl/p5.Texture.js +0 -541
- package/src/webgl/shaders/basic.frag +0 -6
- package/src/webgl/shaders/filters/base.frag +0 -22
- package/src/webgl/shaders/filters/base.vert +0 -19
- package/src/webgl/shaders/filters/blur.frag +0 -60
- package/src/webgl/shaders/filters/default.vert +0 -18
- package/src/webgl/shaders/filters/dilate.frag +0 -39
- package/src/webgl/shaders/filters/erode.frag +0 -39
- package/src/webgl/shaders/filters/gray.frag +0 -16
- package/src/webgl/shaders/filters/invert.frag +0 -15
- package/src/webgl/shaders/filters/opaque.frag +0 -12
- package/src/webgl/shaders/filters/posterize.frag +0 -29
- package/src/webgl/shaders/filters/threshold.frag +0 -23
- package/src/webgl/shaders/font.frag +0 -216
- package/src/webgl/shaders/font.vert +0 -44
- package/src/webgl/shaders/imageLight.vert +0 -33
- package/src/webgl/shaders/imageLightDiffused.frag +0 -82
- package/src/webgl/shaders/imageLightSpecular.frag +0 -134
- package/src/webgl/shaders/light.vert +0 -37
- package/src/webgl/shaders/light_texture.frag +0 -26
- package/src/webgl/shaders/lighting.glsl +0 -227
- package/src/webgl/shaders/line.frag +0 -74
- package/src/webgl/shaders/line.vert +0 -294
- package/src/webgl/shaders/normal.frag +0 -6
- package/src/webgl/shaders/normal.vert +0 -72
- package/src/webgl/shaders/phong.frag +0 -84
- package/src/webgl/shaders/phong.vert +0 -87
- package/src/webgl/shaders/point.frag +0 -29
- package/src/webgl/shaders/point.vert +0 -19
- package/src/webgl/shaders/sphereMapping.frag +0 -26
- package/src/webgl/shaders/webgl2Compatibility.glsl +0 -34
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import Filters from './filters.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @module Image
|
|
3
5
|
* @submodule Pixels
|
|
@@ -5,7 +7,6 @@
|
|
|
5
7
|
* @requires core
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
|
-
import Filters from './filters';
|
|
9
10
|
|
|
10
11
|
function pixels(p5, fn){
|
|
11
12
|
/**
|
|
@@ -1117,8 +1118,8 @@ function pixels(p5, fn){
|
|
|
1117
1118
|
};
|
|
1118
1119
|
}
|
|
1119
1120
|
|
|
1120
|
-
export default pixels;
|
|
1121
|
-
|
|
1122
1121
|
if(typeof p5 !== 'undefined'){
|
|
1123
1122
|
pixels(p5, p5.prototype);
|
|
1124
1123
|
}
|
|
1124
|
+
|
|
1125
|
+
export { pixels as default };
|
package/{src → dist}/io/csv.js
RENAMED
|
@@ -22,15 +22,15 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
22
22
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
23
23
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
const ctx = Object.create(null)
|
|
27
|
-
ctx.options = options || {}
|
|
28
|
-
ctx.reviver = reviver
|
|
29
|
-
ctx.value = ''
|
|
30
|
-
ctx.entry = []
|
|
31
|
-
ctx.output = []
|
|
32
|
-
ctx.col = 1
|
|
33
|
-
ctx.row = 1
|
|
25
|
+
function parse (csv, options, reviver = v => v) {
|
|
26
|
+
const ctx = Object.create(null);
|
|
27
|
+
ctx.options = options || {};
|
|
28
|
+
ctx.reviver = reviver;
|
|
29
|
+
ctx.value = '';
|
|
30
|
+
ctx.entry = [];
|
|
31
|
+
ctx.output = [];
|
|
32
|
+
ctx.col = 1;
|
|
33
|
+
ctx.row = 1;
|
|
34
34
|
|
|
35
35
|
ctx.options.delimiter = ctx.options.delimiter === undefined ? '"' : options.delimiter;
|
|
36
36
|
if(ctx.options.delimiter.length > 1 || ctx.options.delimiter.length === 0)
|
|
@@ -40,78 +40,78 @@ export function parse (csv, options, reviver = v => v) {
|
|
|
40
40
|
if(ctx.options.separator.length > 1 || ctx.options.separator.length === 0)
|
|
41
41
|
throw Error(`CSVError: separator must be one character [${ctx.options.separator}]`)
|
|
42
42
|
|
|
43
|
-
const lexer = new RegExp(`${escapeRegExp(ctx.options.delimiter)}|${escapeRegExp(ctx.options.separator)}|\r\n|\n|\r|[^${escapeRegExp(ctx.options.delimiter)}${escapeRegExp(ctx.options.separator)}\r\n]+`, 'y')
|
|
44
|
-
const isNewline = /^(\r\n|\n|\r)
|
|
43
|
+
const lexer = new RegExp(`${escapeRegExp(ctx.options.delimiter)}|${escapeRegExp(ctx.options.separator)}|\r\n|\n|\r|[^${escapeRegExp(ctx.options.delimiter)}${escapeRegExp(ctx.options.separator)}\r\n]+`, 'y');
|
|
44
|
+
const isNewline = /^(\r\n|\n|\r)$/;
|
|
45
45
|
|
|
46
|
-
let matches = []
|
|
47
|
-
let match = ''
|
|
48
|
-
let state = 0
|
|
46
|
+
let matches = [];
|
|
47
|
+
let match = '';
|
|
48
|
+
let state = 0;
|
|
49
49
|
|
|
50
50
|
while ((matches = lexer.exec(csv)) !== null) {
|
|
51
|
-
match = matches[0]
|
|
51
|
+
match = matches[0];
|
|
52
52
|
|
|
53
53
|
switch (state) {
|
|
54
54
|
case 0: // start of entry
|
|
55
55
|
switch (true) {
|
|
56
56
|
case match === ctx.options.delimiter:
|
|
57
|
-
state = 3
|
|
57
|
+
state = 3;
|
|
58
58
|
break
|
|
59
59
|
case match === ctx.options.separator:
|
|
60
|
-
state = 0
|
|
61
|
-
valueEnd(ctx)
|
|
60
|
+
state = 0;
|
|
61
|
+
valueEnd(ctx);
|
|
62
62
|
break
|
|
63
63
|
case isNewline.test(match):
|
|
64
|
-
state = 0
|
|
65
|
-
valueEnd(ctx)
|
|
66
|
-
entryEnd(ctx)
|
|
64
|
+
state = 0;
|
|
65
|
+
valueEnd(ctx);
|
|
66
|
+
entryEnd(ctx);
|
|
67
67
|
break
|
|
68
68
|
default:
|
|
69
|
-
ctx.value += match
|
|
70
|
-
state = 2
|
|
69
|
+
ctx.value += match;
|
|
70
|
+
state = 2;
|
|
71
71
|
break
|
|
72
72
|
}
|
|
73
73
|
break
|
|
74
74
|
case 2: // un-delimited input
|
|
75
75
|
switch (true) {
|
|
76
76
|
case match === ctx.options.separator:
|
|
77
|
-
state = 0
|
|
78
|
-
valueEnd(ctx)
|
|
77
|
+
state = 0;
|
|
78
|
+
valueEnd(ctx);
|
|
79
79
|
break
|
|
80
80
|
case isNewline.test(match):
|
|
81
|
-
state = 0
|
|
82
|
-
valueEnd(ctx)
|
|
83
|
-
entryEnd(ctx)
|
|
81
|
+
state = 0;
|
|
82
|
+
valueEnd(ctx);
|
|
83
|
+
entryEnd(ctx);
|
|
84
84
|
break
|
|
85
85
|
default:
|
|
86
|
-
state = 4
|
|
86
|
+
state = 4;
|
|
87
87
|
throw Error(`CSVError: Illegal state [row:${ctx.row}, col:${ctx.col}]`)
|
|
88
88
|
}
|
|
89
89
|
break
|
|
90
90
|
case 3: // delimited input
|
|
91
91
|
switch (true) {
|
|
92
92
|
case match === ctx.options.delimiter:
|
|
93
|
-
state = 4
|
|
93
|
+
state = 4;
|
|
94
94
|
break
|
|
95
95
|
default:
|
|
96
|
-
state = 3
|
|
97
|
-
ctx.value += match
|
|
96
|
+
state = 3;
|
|
97
|
+
ctx.value += match;
|
|
98
98
|
break
|
|
99
99
|
}
|
|
100
100
|
break
|
|
101
101
|
case 4: // escaped or closing delimiter
|
|
102
102
|
switch (true) {
|
|
103
103
|
case match === ctx.options.delimiter:
|
|
104
|
-
state = 3
|
|
105
|
-
ctx.value += match
|
|
104
|
+
state = 3;
|
|
105
|
+
ctx.value += match;
|
|
106
106
|
break
|
|
107
107
|
case match === ctx.options.separator:
|
|
108
|
-
state = 0
|
|
109
|
-
valueEnd(ctx)
|
|
108
|
+
state = 0;
|
|
109
|
+
valueEnd(ctx);
|
|
110
110
|
break
|
|
111
111
|
case isNewline.test(match):
|
|
112
|
-
state = 0
|
|
113
|
-
valueEnd(ctx)
|
|
114
|
-
entryEnd(ctx)
|
|
112
|
+
state = 0;
|
|
113
|
+
valueEnd(ctx);
|
|
114
|
+
entryEnd(ctx);
|
|
115
115
|
break
|
|
116
116
|
default:
|
|
117
117
|
throw Error(`CSVError: Illegal state [row:${ctx.row}, col:${ctx.col}]`)
|
|
@@ -122,20 +122,20 @@ export function parse (csv, options, reviver = v => v) {
|
|
|
122
122
|
|
|
123
123
|
// flush the last value
|
|
124
124
|
if (ctx.entry.length !== 0) {
|
|
125
|
-
valueEnd(ctx)
|
|
126
|
-
entryEnd(ctx)
|
|
125
|
+
valueEnd(ctx);
|
|
126
|
+
entryEnd(ctx);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
return ctx.output
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
const ctx = Object.create(null)
|
|
134
|
-
ctx.options = options
|
|
135
|
-
ctx.options.eof = ctx.options.eof !== undefined ? ctx.options.eof : true
|
|
136
|
-
ctx.row = 1
|
|
137
|
-
ctx.col = 1
|
|
138
|
-
ctx.output = ''
|
|
132
|
+
function stringify (array, options = {}, replacer = v => v) {
|
|
133
|
+
const ctx = Object.create(null);
|
|
134
|
+
ctx.options = options;
|
|
135
|
+
ctx.options.eof = ctx.options.eof !== undefined ? ctx.options.eof : true;
|
|
136
|
+
ctx.row = 1;
|
|
137
|
+
ctx.col = 1;
|
|
138
|
+
ctx.output = '';
|
|
139
139
|
|
|
140
140
|
ctx.options.delimiter = ctx.options.delimiter === undefined ? '"' : options.delimiter;
|
|
141
141
|
if(ctx.options.delimiter.length > 1 || ctx.options.delimiter.length === 0)
|
|
@@ -145,53 +145,53 @@ export function stringify (array, options = {}, replacer = v => v) {
|
|
|
145
145
|
if(ctx.options.separator.length > 1 || ctx.options.separator.length === 0)
|
|
146
146
|
throw Error(`CSVError: separator must be one character [${ctx.options.separator}]`)
|
|
147
147
|
|
|
148
|
-
const needsDelimiters = new RegExp(`${escapeRegExp(ctx.options.delimiter)}|${escapeRegExp(ctx.options.separator)}|\r\n|\n|\r`)
|
|
148
|
+
const needsDelimiters = new RegExp(`${escapeRegExp(ctx.options.delimiter)}|${escapeRegExp(ctx.options.separator)}|\r\n|\n|\r`);
|
|
149
149
|
|
|
150
150
|
array.forEach((row, rIdx) => {
|
|
151
|
-
let entry = ''
|
|
152
|
-
ctx.col = 1
|
|
151
|
+
let entry = '';
|
|
152
|
+
ctx.col = 1;
|
|
153
153
|
row.forEach((col, cIdx) => {
|
|
154
154
|
if (typeof col === 'string') {
|
|
155
|
-
col = col.replace(new RegExp(ctx.options.delimiter, 'g'), `${ctx.options.delimiter}${ctx.options.delimiter}`)
|
|
156
|
-
col = needsDelimiters.test(col) ? `${ctx.options.delimiter}${col}${ctx.options.delimiter}` : col
|
|
155
|
+
col = col.replace(new RegExp(ctx.options.delimiter, 'g'), `${ctx.options.delimiter}${ctx.options.delimiter}`);
|
|
156
|
+
col = needsDelimiters.test(col) ? `${ctx.options.delimiter}${col}${ctx.options.delimiter}` : col;
|
|
157
157
|
}
|
|
158
|
-
entry += replacer(col, ctx.row, ctx.col)
|
|
158
|
+
entry += replacer(col, ctx.row, ctx.col);
|
|
159
159
|
if (cIdx !== row.length - 1) {
|
|
160
|
-
entry += ctx.options.separator
|
|
160
|
+
entry += ctx.options.separator;
|
|
161
161
|
}
|
|
162
|
-
ctx.col
|
|
163
|
-
})
|
|
162
|
+
ctx.col++;
|
|
163
|
+
});
|
|
164
164
|
switch (true) {
|
|
165
165
|
case ctx.options.eof:
|
|
166
166
|
case !ctx.options.eof && rIdx !== array.length - 1:
|
|
167
|
-
ctx.output += `${entry}\n
|
|
167
|
+
ctx.output += `${entry}\n`;
|
|
168
168
|
break
|
|
169
169
|
default:
|
|
170
|
-
ctx.output += `${entry}
|
|
170
|
+
ctx.output += `${entry}`;
|
|
171
171
|
break
|
|
172
172
|
}
|
|
173
|
-
ctx.row
|
|
174
|
-
})
|
|
173
|
+
ctx.row++;
|
|
174
|
+
});
|
|
175
175
|
|
|
176
176
|
return ctx.output
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
function valueEnd (ctx) {
|
|
180
|
-
const value = ctx.options.typed ? inferType(ctx.value) : ctx.value
|
|
181
|
-
ctx.entry.push(ctx.reviver(value, ctx.row, ctx.col))
|
|
182
|
-
ctx.value = ''
|
|
183
|
-
ctx.col
|
|
180
|
+
const value = ctx.options.typed ? inferType(ctx.value) : ctx.value;
|
|
181
|
+
ctx.entry.push(ctx.reviver(value, ctx.row, ctx.col));
|
|
182
|
+
ctx.value = '';
|
|
183
|
+
ctx.col++;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
function entryEnd (ctx) {
|
|
187
|
-
ctx.output.push(ctx.entry)
|
|
188
|
-
ctx.entry = []
|
|
189
|
-
ctx.row
|
|
190
|
-
ctx.col = 1
|
|
187
|
+
ctx.output.push(ctx.entry);
|
|
188
|
+
ctx.entry = [];
|
|
189
|
+
ctx.row++;
|
|
190
|
+
ctx.col = 1;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
function inferType (value) {
|
|
194
|
-
const isNumber =
|
|
194
|
+
const isNumber = /.\./;
|
|
195
195
|
|
|
196
196
|
switch (true) {
|
|
197
197
|
case value === 'true':
|
|
@@ -209,3 +209,5 @@ function inferType (value) {
|
|
|
209
209
|
function escapeRegExp(str) {
|
|
210
210
|
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
211
211
|
}
|
|
212
|
+
|
|
213
|
+
export { parse, stringify };
|
package/dist/io/files.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import '../p5.Renderer-CwAYZOC2.js';
|
|
2
|
+
export { d as default, a as request } from '../rendering--aAe5aq3.js';
|
|
3
|
+
import './csv.js';
|
|
4
|
+
import './utilities.js';
|
|
5
|
+
import '../creating_reading-D4AAKRbx.js';
|
|
6
|
+
import 'colorjs.io/fn';
|
|
7
|
+
import '../color/color_spaces/hsb.js';
|
|
8
|
+
import '../constants-C-g_eAdC.js';
|
|
9
|
+
import '../image/filters.js';
|
|
10
|
+
import '../math/p5.Vector.js';
|
|
11
|
+
import '../shape/custom_shapes.js';
|
|
12
|
+
import '../core/States.js';
|
|
13
|
+
import '../dom/p5.Element.js';
|
|
14
|
+
import '../dom/p5.File.js';
|
|
15
|
+
import './p5.XML.js';
|
|
16
|
+
import '../dom/p5.MediaElement.js';
|
|
17
|
+
import '../shape/2d_primitives.js';
|
|
18
|
+
import '../core/helpers.js';
|
|
19
|
+
import '../shape/attributes.js';
|
|
20
|
+
import '../shape/curves.js';
|
|
21
|
+
import '../shape/vertex.js';
|
|
22
|
+
import '../color/setting.js';
|
|
23
|
+
import 'omggif';
|
|
24
|
+
import 'gifenc';
|
|
25
|
+
import '../image/pixels.js';
|
|
26
|
+
import '../core/transform.js';
|
|
27
|
+
import '../webgl/GeometryBuilder.js';
|
|
28
|
+
import '../math/p5.Matrix.js';
|
|
29
|
+
import '../math/Matrices/Matrix.js';
|
|
30
|
+
import '../math/Matrices/MatrixInterface.js';
|
|
31
|
+
import '../webgl/p5.Geometry.js';
|
|
32
|
+
import '../webgl/p5.DataArray.js';
|
|
33
|
+
import '../webgl/p5.Quat.js';
|
|
34
|
+
import '../webgl/p5.RenderBuffer.js';
|
|
35
|
+
import '../webgl/ShapeBuilder.js';
|
|
36
|
+
import 'libtess';
|
|
37
|
+
import '../webgl/GeometryBufferCache.js';
|
|
38
|
+
import '../image/const.js';
|
|
39
|
+
import '../math/trigonometry.js';
|
|
40
|
+
import 'file-saver';
|
package/dist/io/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { d as files } from '../rendering--aAe5aq3.js';
|
|
2
|
+
import table from './p5.Table.js';
|
|
3
|
+
import tableRow from './p5.TableRow.js';
|
|
4
|
+
import xml from './p5.XML.js';
|
|
5
|
+
import '../constants-C-g_eAdC.js';
|
|
6
|
+
import '../creating_reading-D4AAKRbx.js';
|
|
7
|
+
import 'colorjs.io/fn';
|
|
8
|
+
import '../color/color_spaces/hsb.js';
|
|
9
|
+
import '../dom/p5.Element.js';
|
|
10
|
+
import '../dom/p5.File.js';
|
|
11
|
+
import '../p5.Renderer-CwAYZOC2.js';
|
|
12
|
+
import '../image/filters.js';
|
|
13
|
+
import '../math/p5.Vector.js';
|
|
14
|
+
import '../shape/custom_shapes.js';
|
|
15
|
+
import '../core/States.js';
|
|
16
|
+
import './utilities.js';
|
|
17
|
+
import 'file-saver';
|
|
18
|
+
import '../dom/p5.MediaElement.js';
|
|
19
|
+
import '../shape/2d_primitives.js';
|
|
20
|
+
import '../core/helpers.js';
|
|
21
|
+
import '../shape/attributes.js';
|
|
22
|
+
import '../shape/curves.js';
|
|
23
|
+
import '../shape/vertex.js';
|
|
24
|
+
import '../color/setting.js';
|
|
25
|
+
import 'omggif';
|
|
26
|
+
import './csv.js';
|
|
27
|
+
import 'gifenc';
|
|
28
|
+
import '../image/pixels.js';
|
|
29
|
+
import '../core/transform.js';
|
|
30
|
+
import '../webgl/GeometryBuilder.js';
|
|
31
|
+
import '../math/p5.Matrix.js';
|
|
32
|
+
import '../math/Matrices/Matrix.js';
|
|
33
|
+
import '../math/Matrices/MatrixInterface.js';
|
|
34
|
+
import '../webgl/p5.Geometry.js';
|
|
35
|
+
import '../webgl/p5.DataArray.js';
|
|
36
|
+
import '../webgl/p5.Quat.js';
|
|
37
|
+
import '../webgl/p5.RenderBuffer.js';
|
|
38
|
+
import '../webgl/ShapeBuilder.js';
|
|
39
|
+
import 'libtess';
|
|
40
|
+
import '../webgl/GeometryBufferCache.js';
|
|
41
|
+
import '../image/const.js';
|
|
42
|
+
import '../math/trigonometry.js';
|
|
43
|
+
|
|
44
|
+
function io(p5){
|
|
45
|
+
p5.registerAddon(files);
|
|
46
|
+
p5.registerAddon(table);
|
|
47
|
+
p5.registerAddon(tableRow);
|
|
48
|
+
p5.registerAddon(xml);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { io as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { stringify } from './csv.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @module IO
|
|
3
5
|
* @submodule Table
|
|
4
6
|
* @requires core
|
|
5
7
|
*/
|
|
6
8
|
|
|
7
|
-
import { stringify } from './csv';
|
|
8
9
|
|
|
9
10
|
class Table {
|
|
10
11
|
constructor(rows) {
|
|
@@ -16,7 +17,7 @@ class Table {
|
|
|
16
17
|
let rows = this.rows.map((row) => row.arr);
|
|
17
18
|
|
|
18
19
|
if(!this.columns.some((column) => column === null)){
|
|
19
|
-
rows = [this.columns, ...rows,]
|
|
20
|
+
rows = [this.columns, ...rows,];
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
return stringify(rows, {
|
|
@@ -1321,8 +1322,7 @@ class Table {
|
|
|
1321
1322
|
}
|
|
1322
1323
|
return tableArray;
|
|
1323
1324
|
}
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1325
|
+
}
|
|
1326
1326
|
function table(p5, fn){
|
|
1327
1327
|
/**
|
|
1328
1328
|
* Table Options
|
|
@@ -1403,8 +1403,8 @@ function table(p5, fn){
|
|
|
1403
1403
|
*/
|
|
1404
1404
|
}
|
|
1405
1405
|
|
|
1406
|
-
export default table;
|
|
1407
|
-
|
|
1408
1406
|
if(typeof p5 !== 'undefined'){
|
|
1409
1407
|
table(p5, p5.prototype);
|
|
1410
1408
|
}
|
|
1409
|
+
|
|
1410
|
+
export { table as default };
|
|
@@ -349,8 +349,7 @@ class TableRow {
|
|
|
349
349
|
return this.arr[column].toString();
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
}
|
|
353
|
-
|
|
352
|
+
}
|
|
354
353
|
function tableRow(p5, fn){
|
|
355
354
|
/**
|
|
356
355
|
* A TableRow object represents a single row of data values,
|
|
@@ -368,8 +367,8 @@ function tableRow(p5, fn){
|
|
|
368
367
|
p5.TableRow = TableRow;
|
|
369
368
|
}
|
|
370
369
|
|
|
371
|
-
export default tableRow;
|
|
372
|
-
|
|
373
370
|
if(typeof p5 !== 'undefined'){
|
|
374
371
|
tableRow(p5, p5.prototype);
|
|
375
372
|
}
|
|
373
|
+
|
|
374
|
+
export { tableRow as default };
|
|
@@ -507,8 +507,6 @@ class XML {
|
|
|
507
507
|
addChild(node) {
|
|
508
508
|
if (node instanceof XML) {
|
|
509
509
|
this.DOM.appendChild(node.DOM);
|
|
510
|
-
} else {
|
|
511
|
-
// PEND
|
|
512
510
|
}
|
|
513
511
|
}
|
|
514
512
|
|
|
@@ -1290,9 +1288,8 @@ function xml(p5, fn){
|
|
|
1290
1288
|
p5.XML = XML;
|
|
1291
1289
|
}
|
|
1292
1290
|
|
|
1293
|
-
export default xml;
|
|
1294
|
-
export { XML }
|
|
1295
|
-
|
|
1296
1291
|
if(typeof p5 !== 'undefined'){
|
|
1297
1292
|
xml(p5, p5.prototype);
|
|
1298
1293
|
}
|
|
1294
|
+
|
|
1295
|
+
export { XML, xml as default };
|