@malloydata/render 0.0.119-dev240124170348 → 0.0.119-dev240124192531
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/README.md +19 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,3 +21,22 @@ Stories are written in the `src/stories` directory. To add more data and Malloy
|
|
|
21
21
|
### On Reloading Changes
|
|
22
22
|
|
|
23
23
|
When running `npm run storybook`, only changes in the malloy-render package will hot reload properly. Changes to dependencies like the core `malloy` package may require a browser reload to work properly.
|
|
24
|
+
|
|
25
|
+
## Using the Bundled Renderer
|
|
26
|
+
|
|
27
|
+
Any web browser with JSON results from a DB query execution and a PreparedResult object from the Malloy library should be able to use the bundled renderer to create an HTML Malloy Result. The renderer bundle is available from v0.0.118 onwards. Example usage:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
var script = document.createElement('script');
|
|
31
|
+
script.src =
|
|
32
|
+
'https://cdn.jsdelivr.net/npm/@malloydata/render@0.0.118/dist/bundle/bundled_renderer.min.js';
|
|
33
|
+
document.head.appendChild(script);
|
|
34
|
+
var resultElement = document.getElementById('result_div');
|
|
35
|
+
renderMalloyResults(result, total_rows, preparedResult).then(
|
|
36
|
+
function (malloyResElement) {
|
|
37
|
+
resultElement.appendChild(malloyResElement);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
To build the bundle from source, run `npm run bundle_renderer`. This will create the bundled js files in in `dist/bundle`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/render",
|
|
3
|
-
"version": "0.0.119-
|
|
3
|
+
"version": "0.0.119-dev240124192531",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@lit/context": "^1.1.0",
|
|
28
|
-
"@malloydata/malloy": "^0.0.119-
|
|
28
|
+
"@malloydata/malloy": "^0.0.119-dev240124192531",
|
|
29
29
|
"@types/luxon": "^2.4.0",
|
|
30
30
|
"lit": "^3.0.2",
|
|
31
31
|
"lodash": "^4.17.20",
|