@malloydata/render 0.0.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.
Files changed (66) hide show
  1. package/README.md +7 -0
  2. package/dist/data_styles.d.ts +181 -0
  3. package/dist/data_styles.js +15 -0
  4. package/dist/drill.d.ts +10 -0
  5. package/dist/drill.js +103 -0
  6. package/dist/html/bar_chart.d.ts +7 -0
  7. package/dist/html/bar_chart.js +48 -0
  8. package/dist/html/boolean.d.ts +5 -0
  9. package/dist/html/boolean.js +26 -0
  10. package/dist/html/bytes.d.ts +5 -0
  11. package/dist/html/bytes.js +26 -0
  12. package/dist/html/cartesian_chart.d.ts +7 -0
  13. package/dist/html/cartesian_chart.js +88 -0
  14. package/dist/html/chart.d.ts +21 -0
  15. package/dist/html/chart.js +105 -0
  16. package/dist/html/container.d.ts +21 -0
  17. package/dist/html/container.js +43 -0
  18. package/dist/html/currency.d.ts +5 -0
  19. package/dist/html/currency.js +32 -0
  20. package/dist/html/dashboard.d.ts +7 -0
  21. package/dist/html/dashboard.js +224 -0
  22. package/dist/html/date.d.ts +7 -0
  23. package/dist/html/date.js +38 -0
  24. package/dist/html/html_view.d.ts +23 -0
  25. package/dist/html/html_view.js +217 -0
  26. package/dist/html/image.d.ts +7 -0
  27. package/dist/html/image.js +34 -0
  28. package/dist/html/index.d.ts +1 -0
  29. package/dist/html/index.js +18 -0
  30. package/dist/html/json.d.ts +7 -0
  31. package/dist/html/json.js +31 -0
  32. package/dist/html/line_chart.d.ts +7 -0
  33. package/dist/html/line_chart.js +51 -0
  34. package/dist/html/link.d.ts +7 -0
  35. package/dist/html/link.js +35 -0
  36. package/dist/html/list.d.ts +9 -0
  37. package/dist/html/list.js +63 -0
  38. package/dist/html/list_detail.d.ts +5 -0
  39. package/dist/html/list_detail.js +23 -0
  40. package/dist/html/number.d.ts +6 -0
  41. package/dist/html/number.js +30 -0
  42. package/dist/html/percent.d.ts +5 -0
  43. package/dist/html/percent.js +26 -0
  44. package/dist/html/point_map.d.ts +8 -0
  45. package/dist/html/point_map.js +147 -0
  46. package/dist/html/scatter_chart.d.ts +7 -0
  47. package/dist/html/scatter_chart.js +51 -0
  48. package/dist/html/segment_map.d.ts +8 -0
  49. package/dist/html/segment_map.js +128 -0
  50. package/dist/html/shape_map.d.ts +10 -0
  51. package/dist/html/shape_map.js +171 -0
  52. package/dist/html/state_codes.d.ts +3 -0
  53. package/dist/html/state_codes.js +127 -0
  54. package/dist/html/table.d.ts +7 -0
  55. package/dist/html/table.js +111 -0
  56. package/dist/html/text.d.ts +8 -0
  57. package/dist/html/text.js +35 -0
  58. package/dist/html/utils.d.ts +18 -0
  59. package/dist/html/utils.js +175 -0
  60. package/dist/html/vega_spec.d.ts +18 -0
  61. package/dist/html/vega_spec.js +499 -0
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.js +19 -0
  64. package/dist/renderer.d.ts +21 -0
  65. package/dist/renderer.js +23 -0
  66. package/package.json +17 -0
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * This program is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU General Public License
7
+ * version 2 as published by the Free Software Foundation.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.JSONView = exports.HTMLView = void 0;
16
+ var html_view_1 = require("./html/html_view");
17
+ Object.defineProperty(exports, "HTMLView", { enumerable: true, get: function () { return html_view_1.HTMLView; } });
18
+ Object.defineProperty(exports, "JSONView", { enumerable: true, get: function () { return html_view_1.JSONView; } });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,21 @@
1
+ import { DataColumn } from "@malloydata/malloy";
2
+ import { DrillFunction } from "./drill";
3
+ export declare type ChildRenderers = {
4
+ [fieldName: string]: Renderer;
5
+ };
6
+ export interface Renderer {
7
+ render(value: DataColumn): Promise<HTMLElement>;
8
+ }
9
+ export declare abstract class RenderTree implements Renderer {
10
+ protected readonly document: Document;
11
+ protected readonly options: {
12
+ isDrillingEnabled?: boolean;
13
+ onDrill?: DrillFunction;
14
+ };
15
+ constructor(document: Document, options: {
16
+ isDrillingEnabled?: boolean;
17
+ onDrill?: DrillFunction;
18
+ });
19
+ protected abstract get childRenderers(): ChildRenderers;
20
+ abstract render(value: DataColumn): Promise<HTMLElement>;
21
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * This program is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU General Public License
7
+ * version 2 as published by the Free Software Foundation.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.RenderTree = void 0;
16
+ class RenderTree {
17
+ constructor(document, options) {
18
+ this.document = document;
19
+ this.options = options;
20
+ }
21
+ }
22
+ exports.RenderTree = RenderTree;
23
+ //# sourceMappingURL=renderer.js.map
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@malloydata/render",
3
+ "version": "0.0.1",
4
+ "license": "GPL-2.0",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "lint": "eslint '**/*.ts{,x}'",
9
+ "lint-fix": "eslint '**/*.ts{,x}' --fix",
10
+ "test": "jest --config=../../jest.config.js",
11
+ "build": "tsc --build"
12
+ },
13
+ "dependencies": {
14
+ "@malloydata/malloy": "^0.0.1",
15
+ "us-atlas": "^3.0.0"
16
+ }
17
+ }