Skip to content

Commit 7de929b

Browse files
committed
fix imports
1 parent 9e286a5 commit 7de929b

File tree

11 files changed

+36
-15
lines changed

11 files changed

+36
-15
lines changed

frontend/src/components/data-table/chart-spec-model.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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: {

frontend/src/components/data-table/charts/__tests__/__snapshots__/spec-snapshot.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`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": {

frontend/src/components/data-table/charts/__tests__/spec-snapshot.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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";
44
import { describe, expect, it } from "vitest";
55
import {
66
augmentSpecWithData,

frontend/src/components/data-table/charts/__tests__/spec.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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";
44
import { describe, expect, it } from "vitest";
55
import {
66
getAggregate,

frontend/src/components/data-table/charts/chart-spec/spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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";
1313
import type { z } from "zod";
1414
import type { ResolvedTheme } from "@/theme/useTheme";
1515
import 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: [] },

frontend/src/components/data-table/charts/chart-spec/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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";
44
import type { DataType } from "@/core/kernel/messages";
55
import type { Mark } from "@/plugins/impl/vega/types";
66
import { logNever } from "@/utils/assertNever";

frontend/src/components/tracing/tracing-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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",

frontend/src/plugins/impl/data-explorer/functions/function.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Copyright 2024 Marimo. All rights reserved. */
22
/* eslint-disable @typescript-eslint/no-base-to-string */
33
import 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";
55
import type { FieldFunction, TimeUnitOp } from "./types";
66

77
// This code is adapted and simplified from https://github.com/vega/voyager

frontend/src/plugins/impl/data-explorer/queries/queries.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import type { SpecQuery } from "compassql/build/src/query/spec";
1111
import { getTopResultTreeItem, isResultTree } from "compassql/build/src/result";
1212
import type { Schema } from "compassql/build/src/schema";
1313
import { 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";
1616
import { type EncodingChannel, fromFieldQuery } from "../encoding";
1717
import { toSpecQuery } from "../spec";
1818
import type { ChartSpec } from "../state/types";

frontend/src/plugins/impl/vega/types.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export type { Field } from "vega-lite/types_unstable/channeldef.js";
1313
export type { SharedCompositeEncoding } from "vega-lite/types_unstable/compositemark/index.js";
1414
export type { DataFormat } from "vega-lite/types_unstable/data.js";
1515
export type { AnyMark, MarkDef } from "vega-lite/types_unstable/mark.js";
16-
export { Mark } from "vega-lite/types_unstable/mark.js";
1716
export type {
1817
SelectionParameter,
1918
SelectionType,
@@ -30,3 +29,23 @@ export type VegaLiteUnitSpec = TopLevelUnitSpec<Field>;
3029
export type GenericVegaSpec = GenericUnitSpec<any, any, any>;
3130
export type EncodingType = keyof Encoding<Field>;
3231
export 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;

0 commit comments

Comments
 (0)