vega/react-vega

Type errors in demo code

jazweatherhead opened this issue · 0 comments

I'm getting weird type errors trying to run the demo code, third example. The issue seems similar to #141.

Error:

  Type '{ width: number; height: number; mark: string; encoding: { x: { field: string; type: string; }; y: { field: string; type: string; }; }; data: { name: string; }; }' is not assignable to type 'TopLevelUnitSpec<Field>'.
    Type '{ width: number; height: number; mark: string; encoding: { x: { field: string; type: string; }; y: { field: string; type: string; }; }; data: { name: string; }; }' is not assignable to type 'GenericUnitSpec<FacetedCompositeEncoding<Field>, AnyMark>'.
      Types of property 'mark' are incompatible.
        Type 'string' is not assignable to type 'AnyMark'.

I'm using:

    "react": "^17.0.2",
    "react-vega": "^7.4.4",
    "vega": "^5.21.0",
    "vega-lite": "^5.1.1",

Thanks.