Skip to content

bug: plot type should also work implicitly #7

@ngfelixl

Description

@ngfelixl

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]);

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttypesTypeScript type improvements

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions