Skip to content

Add VisualizationSpec type to spec definition #589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

connormcmk
Copy link

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"'.

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"'.
```
@domoritz
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants