|
1 |
| -import * as v5 from "vega-embed-v5"; |
2 |
| -import * as v6 from "vega-embed-v6"; |
| 1 | +import { embed as vg2vl1 } from "vg2vl1"; |
| 2 | +import { embed as vg3vl1 } from "vg3vl1"; |
| 3 | +import { embed as vg4vl2 } from "vg4vl2"; |
| 4 | +import { embed as vg5vl3 } from "vg5vl3"; |
| 5 | +import { embed as vg5vl4 } from "vg5vl4"; |
3 | 6 |
|
4 |
| -type EmbedV5 = (el: HTMLElement | string, spec: v5.VisualizationSpec, opt?: v5.EmbedOptions) => Promise<v5.Result>; |
5 |
| -type EmbedV6 = (el: HTMLElement | string, spec: v6.VisualizationSpec, opt?: v6.EmbedOptions) => Promise<v6.Result>; |
6 |
| - |
7 |
| -interface VegaEmbeds { |
8 |
| - v3: EmbedV5; |
9 |
| - v4: EmbedV5; |
10 |
| - v5: EmbedV6; |
11 |
| -} |
12 |
| - |
13 |
| -export const vega: VegaEmbeds = { |
14 |
| - v3: (el, spec, opt) => import("vg3vl2").then((({embed}) => embed(el, spec, opt))), |
15 |
| - v4: (el, spec, opt) => import("vg4vl2").then((({embed}) => embed(el, spec, opt))), |
16 |
| - v5: (el, spec, opt) => import("vg5vl4").then((({embed}) => embed(el, spec, opt))), |
| 7 | +export const vega = { |
| 8 | + v2: vg2vl1, |
| 9 | + v3: vg3vl1, |
| 10 | + v4: vg4vl2, |
| 11 | + v5: vg5vl4, |
17 | 12 | };
|
18 | 13 |
|
19 |
| -interface VegaLiteEmbeds { |
20 |
| - v2: EmbedV5; |
21 |
| - v3: EmbedV5; |
22 |
| - v4: EmbedV6; |
23 |
| -} |
24 |
| - |
25 |
| -export const vegaLite: VegaLiteEmbeds = { |
26 |
| - v2: (el, spec, opt) => import("vg3vl2").then((({embed}) => embed(el, spec, opt))), |
27 |
| - v3: (el, spec, opt) => import("vg5vl3").then((({embed}) => embed(el, spec, opt))), |
28 |
| - v4: (el, spec, opt) => import("vg5vl4").then((({embed}) => embed(el, spec, opt))), |
| 14 | +export const vegaLite = { |
| 15 | + v1: vg3vl1, |
| 16 | + v2: vg4vl2, |
| 17 | + v3: vg5vl3, |
| 18 | + v4: vg5vl4, |
29 | 19 | };
|
0 commit comments