File tree Expand file tree Collapse file tree 11 files changed +36
-15
lines changed Expand file tree Collapse file tree 11 files changed +36
-15
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ export class ColumnChartSpecModel<T> {
151151 ...base ,
152152 // Two layers: one with the visible bars, and one with invisible bars
153153 // that provide a larger tooltip area.
154+ // @ts -expect-error 'layer' property not in TopLevelFacetedUnitSpec
154155 layer : [
155156 {
156157 mark : {
@@ -238,6 +239,7 @@ export class ColumnChartSpecModel<T> {
238239 ...base , // Assuming base contains shared configurations
239240 // Two layers: one with the visible bars, and one with invisible bars
240241 // that provide a larger tooltip area.
242+ // @ts -expect-error 'layer' property not in TopLevelFacetedUnitSpec
241243 layer : [
242244 {
243245 mark : {
Original file line number Diff line number Diff line change 22
33exports [` create vega spec > should create and augment a spec 1` ] = `
44{
5- " $schema" : " https://vega.github.io/schema/vega-lite/v5 .json" ,
5+ " $schema" : " https://vega.github.io/schema/vega-lite/v6 .json" ,
66 " background" : " white" ,
77 " config" : {
88 " axis" : {
Original file line number Diff line number Diff line change 11/* Copyright 2024 Marimo. All rights reserved. */
22
3- import type { TopLevelSpec } from "vega-lite/build/src/spec " ;
3+ import type { TopLevelSpec } from "vega-lite" ;
44import { describe , expect , it } from "vitest" ;
55import {
66 augmentSpecWithData ,
Original file line number Diff line number Diff line change 11/* Copyright 2024 Marimo. All rights reserved. */
22
3- import type { PositionDef } from "vega-lite/build/src/ channeldef" ;
3+ import type { PositionDef } from "vega-lite/types_unstable/ channeldef.js " ;
44import { describe , expect , it } from "vitest" ;
55import {
66 getAggregate ,
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import type {
66 Field ,
77 PolarDef ,
88 PositionDef ,
9- } from "vega-lite/build/src/ channeldef" ;
10- import type { Encoding } from "vega-lite/build/src/ encoding" ;
11- import type { Resolve } from "vega-lite/build/src/ resolve" ;
12- import type { FacetFieldDef } from "vega-lite/build/src/ spec/facet" ;
9+ } from "vega-lite/types_unstable/ channeldef.js " ;
10+ import type { Encoding } from "vega-lite/types_unstable/ encoding.js " ;
11+ import type { Resolve } from "vega-lite/types_unstable/ resolve.js " ;
12+ import type { FacetFieldDef } from "vega-lite/types_unstable/ spec/facet.js " ;
1313import type { z } from "zod" ;
1414import type { ResolvedTheme } from "@/theme/useTheme" ;
1515import type { TypedString } from "@/utils/typed" ;
@@ -284,7 +284,7 @@ function getBaseSpec(
284284 }
285285
286286 return {
287- $schema : "https://vega.github.io/schema/vega-lite/v5 .json" ,
287+ $schema : "https://vega.github.io/schema/vega-lite/v6 .json" ,
288288 background : theme === "dark" ? "dark" : "white" ,
289289 title : title ,
290290 data : { values : [ ] } ,
Original file line number Diff line number Diff line change 11/* Copyright 2024 Marimo. All rights reserved. */
22
3- import type { StandardType } from "vega-lite/build/src/ type" ;
3+ import type { StandardType } from "vega-lite/types_unstable/ type.js " ;
44import type { DataType } from "@/core/kernel/messages" ;
55import type { Mark } from "@/plugins/impl/vega/types" ;
66import { logNever } from "@/utils/assertNever" ;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export function createGanttBaseSpec(
3131 theme : ResolvedTheme ,
3232) : Readonly < TopLevelSpec > {
3333 return {
34- $schema : "https://vega.github.io/schema/vega-lite/v5 .json" ,
34+ $schema : "https://vega.github.io/schema/vega-lite/v6 .json" ,
3535 background : theme === "dark" ? "black" : undefined ,
3636 mark : {
3737 type : "bar" ,
Original file line number Diff line number Diff line change 11/* Copyright 2024 Marimo. All rights reserved. */
22/* eslint-disable @typescript-eslint/no-base-to-string */
33import type { FieldQuery } from "compassql/build/src/query/encoding" ;
4- import { isAggregateOp } from "vega-lite/build/src/ aggregate" ;
4+ import { isAggregateOp } from "vega-lite/types_unstable/ aggregate.js " ;
55import type { FieldFunction , TimeUnitOp } from "./types" ;
66
77// This code is adapted and simplified from https://github.com/vega/voyager
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import type { SpecQuery } from "compassql/build/src/query/spec";
1111import { getTopResultTreeItem , isResultTree } from "compassql/build/src/result" ;
1212import type { Schema } from "compassql/build/src/schema" ;
1313import { contains } from "vega-lite" ;
14- import { NONPOSITION_SCALE_CHANNELS } from "vega-lite/build/src/ channel" ;
15- import type { NamedData } from "vega-lite/build/src/ data" ;
14+ import { NONPOSITION_SCALE_CHANNELS } from "vega-lite/types_unstable/ channel.js " ;
15+ import type { NamedData } from "vega-lite/types_unstable/ data.js " ;
1616import { type EncodingChannel , fromFieldQuery } from "../encoding" ;
1717import { toSpecQuery } from "../spec" ;
1818import type { ChartSpec } from "../state/types" ;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ export type { Field } from "vega-lite/types_unstable/channeldef.js";
1313export type { SharedCompositeEncoding } from "vega-lite/types_unstable/compositemark/index.js" ;
1414export type { DataFormat } from "vega-lite/types_unstable/data.js" ;
1515export type { AnyMark , MarkDef } from "vega-lite/types_unstable/mark.js" ;
16- export { Mark } from "vega-lite/types_unstable/mark.js" ;
1716export type {
1817 SelectionParameter ,
1918 SelectionType ,
@@ -30,3 +29,23 @@ export type VegaLiteUnitSpec = TopLevelUnitSpec<Field>;
3029export type GenericVegaSpec = GenericUnitSpec < any , any , any > ;
3130export type EncodingType = keyof Encoding < Field > ;
3231export type Encodings = Encoding < Field > ;
32+
33+ // import type { Mark } from "vega-lite/types_unstable/mark.js";
34+ // Mark has issues with types so we manually define
35+ export const Mark = {
36+ arc : "arc" ,
37+ area : "area" ,
38+ bar : "bar" ,
39+ image : "image" ,
40+ line : "line" ,
41+ point : "point" ,
42+ rect : "rect" ,
43+ rule : "rule" ,
44+ text : "text" ,
45+ tick : "tick" ,
46+ trail : "trail" ,
47+ circle : "circle" ,
48+ square : "square" ,
49+ geoshape : "geoshape" ,
50+ } as const ;
51+ export type Mark = keyof typeof Mark ;
You can’t perform that action at this time.
0 commit comments