You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{LTTB}from'downsample/methods/LTTB'constt=LTTB([[1,2]],1)// Is an arrayconsole.log(Array.isArray(t))// Is not typed as an arrayt.map(console.log)
The text was updated successfully, but these errors were encountered:
For what it's worth, I ran into this, too. Indexable type looks to return an array-like object, just without the correct methods on the type, so you can safely fix it by type-casting the response as an XYDataPoint array. E.g., XYDataPoint[]
Here's what I mean. Do this:
import { ASAP, XYDataPoint } from "downsample";
...
const downsampledData = ASAP([[0, 1], [1, 2], ...], 1000) as XYDataPoint[];
// now you can treat as an array
downsampledData.map(...)
The original (incorrect) type for Indexable is definitely missing properties of an array. Looks more like an object definition.
type Indexable<T> = {
length: number;
[index: number]: T;
};
The text was updated successfully, but these errors were encountered: