Skip to content

Commit bc32981

Browse files
committed
[wip] a few todos
- do the Lib.extend* methods do the right for typed arrays - what to do with 2d arrays? Should we start supporting ndarrays? - should we invent a JSON-seriliazable version of typed arrays?
1 parent bcf59d7 commit bc32981

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/lib/coerce.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ exports.valObjectMeta = {
3232
requiredOpts: [],
3333
otherOpts: ['dflt'],
3434
coerceFunction: function(v, propOut, dflt) {
35+
// TODO maybe `v: {type: 'float32', vals: [/* ... */]}` also
3536
if(isArrayOrTypedArray(v)) propOut.set(v);
3637
else if(dflt !== undefined) propOut.set(dflt);
3738
}

src/lib/extend.js

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) {
6565

6666
var input, key, src, copy, copyIsArray, clone, allPrimitives;
6767

68+
// TODO does this do the right thing for typed arrays?
69+
6870
if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) {
6971

7072
allPrimitives = primitivesLoopSplice(inputs[1], target);

src/traces/surface/defaults.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3232
var x = coerce('x');
3333
coerce('y');
3434

35+
// TODO
3536
traceOut._xlength = (Array.isArray(x) && Array.isArray(x[0])) ? z.length : z[0].length;
3637
traceOut._ylength = z.length;
3738

0 commit comments

Comments
 (0)