Skip to content

Commit 29d530e

Browse files
committed
include vega in test coverage again and add typing for useSinalListeners
1 parent 5810bc3 commit 29d530e

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

chartlets.js/packages/lib/src/plugins/vega/VegaChart.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe("VegaChart", () => {
5050
});
5151

5252
const chart: TopLevelSpec = {
53-
$schema: "https://vega.github.io/schema/vega-lite/v5.20.1.json",
53+
$schema: "https://vega.github.io/schema/vega-lite/v6.json",
5454
config: { view: { continuousWidth: 300, continuousHeight: 300 } },
5555
data: { name: "data-0" },
5656
mark: { type: "bar" },

chartlets.js/packages/lib/src/plugins/vega/hooks/useSignalListeners.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ type SelectionParameter = {
2525
select: "point" | "interval" | { type: "point" | "interval"; on: string };
2626
};
2727

28+
type UseSignalListenersReturn = {
29+
onEmbed: (result: VegaEmbedResult) => void;
30+
signalListenerMap: Record<string, SignalHandler>;
31+
};
32+
2833
const isSelectionParameter = (param: unknown): param is SelectionParameter =>
2934
isObject(param) &&
3035
(param.select === "point" ||
@@ -38,7 +43,7 @@ export function useSignalListeners(
3843
type: string,
3944
id: string | undefined,
4045
onChange: ComponentChangeHandler,
41-
) /*: Record<string, SignalHandler>*/ {
46+
): UseSignalListenersReturn {
4247
/*
4348
* Here, we create map of signals which will be then used to create the
4449
* map of signal-listeners because not all params are event-listeners, and we

chartlets.js/packages/lib/vite.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,5 @@ export default defineConfig({
7878
return false;
7979
}
8080
},
81-
exclude: ["**/vega/index.test.ts", "**/vega/VegaChart.test.tsx"],
8281
},
8382
});

0 commit comments

Comments
 (0)