react-vega icon indicating copy to clipboard operation
react-vega copied to clipboard

Add `VisualizationSpec` type to spec definition

Open connormcmk opened this issue 3 years ago • 1 comments

Otherwise, user gets error:

Type '{ width: number; height: number; mark: { type: string; }; encoding: { x: { field: string; type: string; }; y: { field: string; type: string; }; }; data: { name: string; }; }' is not assignable to type 'VisualizationSpec'.
  Type '{ width: number; height: number; mark: { type: 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: { type: string; }; encoding: { x: { field: string; type: string; }; y: { field: string; type: string; }; }; data: { name: string; }; }' is not assignable to type 'GenericUnitSpec<FacetedCompositeEncoding<Field>, AnyMark, TopLevelParameter>'.
      Types of property 'mark' are incompatible.
        Type '{ type: string; }' is not assignable to type 'AnyMark'.
          Type '{ type: string; }' is not assignable to type 'MarkDef<"bar" | "area" | "circle" | "image" | "line" | "rect" | "text" | "arc" | "point" | "rule" | "tick" | "trail" | "square" | "geoshape", ExprRef | SignalRef>'.
            Types of property 'type' are incompatible.
              Type 'string' is not assignable to type '"bar" | "area" | "circle" | "image" | "line" | "rect" | "text" | "arc" | "point" | "rule" | "tick" | "trail" | "square" | "geoshape"'.

connormcmk avatar Feb 15 '23 19:02 connormcmk

I think we need to add it to the import in the example code as well.

domoritz avatar Jun 14 '25 00:06 domoritz