nodeplotlib icon indicating copy to clipboard operation
nodeplotlib copied to clipboard

bug: plot type should also work implicitly

Open ngfelixl opened this issue 6 years ago • 0 comments

When using with typescript and include the type in the plotdata, tslint throws

const trace = {x: [1, 2], y: [1, 2], type: 'bar'};
plot([trace]); // type: string not compatible with type: 'scatter' | 'lines' | ...

Current workaround: Explicitly name the type of the plotdata.

import { plot, Plot } from 'nodeplotlib';
const trace: Plot = {x: [1, 2], y: [1, 2], type: 'bar'};
plot([trace]);

ngfelixl avatar Feb 17 '19 12:02 ngfelixl