@eox/chart 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,27 +1,40 @@
1
1
  {
2
2
  "name": "@eox/chart",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
- "vite": "^5.0.2"
6
+ "vite": "^6.0.3"
7
7
  },
8
8
  "engines": {
9
9
  "npm": ">=8.0.0",
10
10
  "node": ">=18.0.0"
11
11
  },
12
12
  "files": [
13
+ "types",
13
14
  "dist",
14
15
  "src"
15
16
  ],
16
17
  "main": "./src/main.js",
18
+ "types": "./types/main.d.ts",
19
+ "typesVersions": {
20
+ "*": {
21
+ ".": [
22
+ "./types/main.d.ts"
23
+ ],
24
+ "src/*": [
25
+ "./types/*"
26
+ ]
27
+ }
28
+ },
17
29
  "scripts": {
30
+ "prepack": "tsc --project tsconfig.build.json || true",
18
31
  "build": "vite build",
19
32
  "watch": "vite build --watch"
20
33
  },
21
34
  "dependencies": {
22
- "@eox/elements-utils": "^0.0.1",
35
+ "@eox/elements-utils": "^0.1.5",
23
36
  "deepmerge-ts": "^7.1.3",
24
- "lit": "^3.0.2",
37
+ "lit": "^3.2.0",
25
38
  "vega": "^5.30.0",
26
39
  "vega-embed": "^6.26.0",
27
40
  "vega-lite": "^5.21.0"
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @type {import("vega-embed").VisualizationSpec}
3
+ */
4
+ export const DEFAULT_SPEC: import("vega-embed").VisualizationSpec;
5
+ //# sourceMappingURL=default-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-spec.d.ts","sourceRoot":"","sources":["../../src/enums/default-spec.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,2BAFU,OAAO,YAAY,EAAE,iBAAiB,CAS9C"}
@@ -0,0 +1,3 @@
1
+ export { DEFAULT_SPEC } from "./default-spec";
2
+ export { TEST_SELECTORS, TEST_VALUES } from "./test";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ export namespace TEST_SELECTORS {
2
+ let chart: string;
3
+ let vegaContainer: string;
4
+ let vegaCanvas: string;
5
+ }
6
+ export namespace TEST_VALUES {
7
+ let chartHeight: number;
8
+ namespace chartSpec {
9
+ let $schema: string;
10
+ let description: string;
11
+ namespace data {
12
+ let values: {
13
+ a: string;
14
+ b: number;
15
+ }[];
16
+ }
17
+ namespace mark {
18
+ let type: string;
19
+ let tooltip: boolean;
20
+ let fill: string;
21
+ }
22
+ namespace encoding {
23
+ namespace x {
24
+ export let field: string;
25
+ let type_1: string;
26
+ export { type_1 as type };
27
+ }
28
+ namespace y {
29
+ let field_1: string;
30
+ export { field_1 as field };
31
+ let type_2: string;
32
+ export { type_2 as type };
33
+ }
34
+ }
35
+ }
36
+ }
37
+ //# sourceMappingURL=test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/enums/test.js"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Chart component based on [Vega-Lite](https://vega.github.io/vega-lite/)/[Vega-Embed](https://github.com/vega/vega-embed).
3
+ * Pass a valid Vega spec as `spec` property in order to render a chart.
4
+ *
5
+ * The `eox-chart` provides some default `spec` settings (merged with the provided `spec` property) and helper functionalities on top of Vega-Lite.
6
+ *
7
+ * @element eox-chart
8
+ */
9
+ export class EOxChart extends LitElement {
10
+ static properties: {
11
+ dataValues: {
12
+ attribute: boolean;
13
+ type: ObjectConstructor;
14
+ };
15
+ spec: {
16
+ attribute: boolean;
17
+ type: ObjectConstructor;
18
+ };
19
+ noShadow: {
20
+ attribute: string;
21
+ type: BooleanConstructor;
22
+ };
23
+ unstyled: {
24
+ type: BooleanConstructor;
25
+ };
26
+ };
27
+ /**
28
+ * [Vega-Lite spec](https://vega.github.io/vega-lite/docs/spec.html)
29
+ *
30
+ * @type {import("vega-embed").VisualizationSpec}
31
+ */
32
+ spec: import("vega-embed").VisualizationSpec;
33
+ /**
34
+ * Data values passed on runtime. Requires a [named data source](https://vega.github.io/vega-lite/docs/data.html#named) in the provided `spec`
35
+ *
36
+ * @type {{[dataSourceName: string]: import("vega-lite/build/src/data").InlineData}}
37
+ */
38
+ dataValues: {
39
+ [dataSourceName: string]: import("vega-lite/build/src/data").InlineData;
40
+ };
41
+ /**
42
+ * Renders the element without a shadow root
43
+ *
44
+ * @type {Boolean}
45
+ */
46
+ noShadow: boolean;
47
+ /**
48
+ * Render the element without additional styles
49
+ *
50
+ * @type {Boolean}
51
+ */
52
+ unstyled: boolean;
53
+ /**
54
+ * Lifecycle method called when the element is updated
55
+ *
56
+ * @param {import("lit").PropertyValues} changedProperties
57
+ */
58
+ updated(changedProperties: import("lit").PropertyValues): Promise<void>;
59
+ /**
60
+ * Renders the component's HTML and CSS
61
+ */
62
+ render(): import("lit-html").TemplateResult<1>;
63
+ }
64
+ import { LitElement } from "lit";
65
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH;IACE;;;;;;;;;;;;;;;;MAKE;IAKA;;;;OAIG;IACH,MAFU,OAAO,YAAY,EAAE,iBAAiB,CAE3B;IAErB;;;;OAIG;IACH,YAFU;QAAC,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,0BAA0B,EAAE,UAAU,CAAA;KAAC,CAExD;IAE3B;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAGvB;;;;OAIG;IACH,2BAFW,OAAO,KAAK,EAAE,cAAc,iBAMtC;IASD;;OAEG;IACH,+CASC;CACF;2BArFgC,KAAK"}
@@ -0,0 +1,2 @@
1
+ export { default as renderChartMethod } from "./render-chart";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/methods/render/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ export default renderChartMethod;
2
+ /**
3
+ * Render the Vega-Lite chart using vega-embed with a spec and (optionally) dataValues
4
+ *
5
+ * @param {import("../../main").EOxChart} EOxChart The eox-chart instance
6
+ * @param {import("vega-embed").VisualizationSpec} spec
7
+ * @param {Object=} dataValues
8
+ *
9
+ */
10
+ declare function renderChartMethod(EOxChart: import("../../main").EOxChart, spec: import("vega-embed").VisualizationSpec, dataValues?: any | undefined): void;
11
+ //# sourceMappingURL=render-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-chart.d.ts","sourceRoot":"","sources":["../../../src/methods/render/render-chart.js"],"names":[],"mappings":";AAIA;;;;;;;GAOG;AACH,6CALW,OAAO,YAAY,EAAE,QAAQ,QAC7B,OAAO,YAAY,EAAE,iBAAiB,sCAiBhD"}
@@ -0,0 +1,2 @@
1
+ export const style: "\n :root, :host, eox-chart {\n display: block;\n }\n #vis {\n width: 100%;\n height: 100%;\n }\n";
2
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.js"],"names":[],"mappings":"AAAA,oIAQE"}
@@ -0,0 +1,2 @@
1
+ export const styleEOX: "\n eox-chart {\n font-family: Roboto, sans-serif;\n }\n";
2
+ //# sourceMappingURL=style.eox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.eox.d.ts","sourceRoot":"","sources":["../src/style.eox.js"],"names":[],"mappings":"AAAA,sFAIE"}