Skip to content

example from readme doesn't work with typescript #52

@lebed2045

Description

@lebed2045
import { plot, Plot } from 'nodeplotlib';
const data: Plot[] = [{x: [1, 3, 4, 5], y: [3, 12, 1, 4], type: 'line'}];
plot(data);

return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
src/sudao.ts:12:59 - error TS2322: Type '"line"' is not assignable to type 'PlotType'.

12 const data: Plot[] = [{x: [1, 3, 4, 5], y: [3, 12, 1, 4], type: 'line'}];
~~~~

node_modules/@types/plotly.js/index.d.ts:1102:5
1102 type: PlotType;
~~~~
The expected type comes from property 'type' which is declared here on type 'Partial'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions