@luzmo/embed 6.0.0-beta.3 → 6.0.0-beta.4

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 CHANGED
@@ -5,13 +5,11 @@ A modern [Web Component](https://developer.mozilla.org/en-US/docs/Web/Web_Compon
5
5
  ## Table of contents
6
6
 
7
7
  1. [Installation instructions](#installation-instructions)
8
- 2. [Usage](#usage)
9
- 3. [Events](#events)
10
- 4. [Public Methods](#public-methods)
11
- 5. [Examples](#examples)
12
- 6. [Changelog](#changelog)
13
- 7. [Migration](#migration)
14
- 8. [Quick links](#quick-links)
8
+ 2. [Luzmo Embed Viz Item](#luzmo-embed-viz-item)
9
+ 3. [Luzmo Embed Dashboard](#luzmo-embed-dashboard)
10
+ 4. [Changelog](#changelog)
11
+ 5. [Migration](#migration)
12
+ 6. [Quick links](#quick-links)
15
13
 
16
14
  ## Installation instructions
17
15
 
@@ -43,7 +41,113 @@ OR
43
41
  <script type="module" src="./node_modules/@luzmo/embed/index.js"></script>
44
42
  ```
45
43
 
46
- ## Usage
44
+ ## Luzmo Embed Viz Item
45
+
46
+ ### Usage luzmo-embed-viz-item
47
+
48
+ Use the viz-item components as if they were native HTML tags.
49
+
50
+ **In your HTML template.**
51
+ ```html
52
+ <luzmo-embed-viz-item type="bar-chart" slots="slotsArray[]" options="optionsObject"></luzmo-embed-viz-item>
53
+
54
+ OR
55
+
56
+ <luzmo-embed-viz-item type="bar-chart" dashboardId="dashboardId" itemId="itemId" options="optionsObject"></luzmo-embed-viz-item>
57
+
58
+ ```
59
+ <br/>
60
+
61
+ ### Properties: luzmo-embed-viz-item
62
+
63
+ Below a list of available properties on the viz item web component
64
+
65
+ | Property | Type | Description |
66
+ |----------------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
67
+ | `type` | string | The type of viz item to embed. |
68
+ | `options` | object | The options object to be passed on to viz item |
69
+ | `slots` | array | The slots array to specify which columns to use to fetch data. depends on the type of chart. |
70
+ | `contextId` | string | contextId is a unique id that can be assigned to viz item which will be used in filtering with `canFilter`. |
71
+ | `authKey` | string | Authorization key generated via Luzmo API |
72
+ | `authToken` | string | Authorization token generated via Luzmo API |
73
+ | `canFilter` | string \| array | `canFilter` can be either set to `all` or an array of `contextId`'s. |
74
+ | `filters` | object | `filters` object is used to set initial filters. |
75
+ | `appServer` | string | Tenancy of luzmo.com to connect to (Default: 'https://app.luzmo.com/' for US set appServer to 'https://app.us.luzmo.com/') |
76
+ | `apiHost` | string | API server to connect to (Default: 'https://api.luzmo.com/' , for US set apiHost to 'https://api.us.luzmo.com/') |
77
+
78
+ <br/>
79
+
80
+ ### Events luzmo-embed-viz-item
81
+
82
+ | Name | Description |
83
+ |----------------|----------------------------------------|
84
+ | changedFilters | Emitted when filters are changed |
85
+ | customEvent | Emitted when a custom event is fired |
86
+ | exported | Emitted when export completes or fails |
87
+ | rendered | Emitted when the item is rendered |
88
+ | load | Emitted when dashboard is loaded |
89
+
90
+ <br/>
91
+
92
+ ### Public methods luzmo-embed-viz-item
93
+
94
+ ```typescript
95
+ getData(): any
96
+ // Return an array of the data of the viz item that's embedded.
97
+
98
+ getFilters(): FilterGroup[];
99
+ // Return an array of active filters on the viz item.
100
+
101
+ refreshData(): void
102
+ // Refresh the data of the viz item.
103
+
104
+ setAuthorization(key: string, token: string): void
105
+ // Changes the authorization of the viz item. To fetch data based on new authorization parameters, refreshData() needs to be called.
106
+
107
+ export(): void
108
+ // Export the viz item as png.
109
+ ```
110
+ <br/>
111
+
112
+ ### Examples luzmo-embed-viz-item
113
+
114
+ A Bar chart with display hidden.
115
+
116
+ ```html
117
+ <luzmo-embed-viz-item id="vizItem" type="bar-chart" options='{ "display": { "title": false } }'></luzmo-embed-viz-item>
118
+ ```
119
+ Add an event listener to the viz item.
120
+
121
+ ```typescript
122
+ // get the component, here we query the component that has an id 'dashboard'
123
+ const vizItemComponent = document.getElementById('vizItem');
124
+ vizItemComponent.addEventListener('rendered', (event) => {
125
+ // do something after all items are rendered
126
+ console.log(event);
127
+ });
128
+ ```
129
+
130
+ Get data from the viz item
131
+
132
+ ```typescript
133
+ const data = vizItemComponent.getData()
134
+ ```
135
+
136
+ Get Active filters in the viz item
137
+
138
+ ```typescript
139
+ const filters = vizItemComponent.getFilters();
140
+ ```
141
+
142
+ Export the viz item
143
+
144
+ ```typescript
145
+ vizItemComponent.export();
146
+ ```
147
+
148
+ ## Luzmo Embed Dashboard
149
+
150
+ ### Usage luzmo-embed-dashboard
47
151
 
48
152
  Use the dashboard components as if they were native HTML tags. Use the id of the dashboard you wish to embed.
49
153
  **In your HTML template.**
@@ -57,7 +161,7 @@ OR
57
161
  <luzmo-embed-dashboard dashboardId="55cfb99c-d602-492b-b192-6c15277fdb9a" itemId="59fe5bd7-5070-42f5-98f4-da7f931e316c"> </luzmo-embed-dashboard>
58
162
  ```
59
163
 
60
- **Properties:**
164
+ ### Properties: luzmo-embed-dashboard
61
165
 
62
166
  Below a list of available properties on the dashboard web component
63
167
 
@@ -83,9 +187,9 @@ Below a list of available properties on the dashboard web component
83
187
  | `mainColor` | string | Optional override of the main color used in the whitelabeling of the embedded dashboard editor. If not provided, the main color of the whitelabeling colors set on the organization will be used. Should be specified as a string of rgb values (i.e. "rgb(50,50,50)"). |
84
188
  | `accentColor` | string | Optional override of the accent color used in the whitelabeling of the embedded dashboard editor. If not provided, the accent color of the whitelabeling colors set on the organization will be used. Should be specified as a string of rgb values (i.e. "rgb(50,50,50)"). |
85
189
 
86
- <br/><br/>
190
+ <br/>
87
191
 
88
- ## Events
192
+ ### Events luzmo-embed-dashboard
89
193
 
90
194
  | Name | Description | Event Arguments |
91
195
  | -------------- | -------------------------------------- | --------------------- |
@@ -97,7 +201,7 @@ Below a list of available properties on the dashboard web component
97
201
 
98
202
  <br/>
99
203
 
100
- ## Public methods
204
+ ### Public methods luzmo-embed-dashboard
101
205
 
102
206
  ```typescript
103
207
  getDashboards(): Promise<LuzmoDashboard[]>
@@ -130,7 +234,7 @@ setEditMode(editMode: DashboardEditMode): Promise<SetEditMode>
130
234
 
131
235
  <br/>
132
236
 
133
- ## Examples
237
+ ### Examples luzmo-embed-dashboard
134
238
 
135
239
  A dashboard with a gray loader background
136
240
 
@@ -206,7 +310,7 @@ dashboardComponent.getAccessibleDashboards().then((dashboards) => {
206
310
  ### Migrating from cumul.io to luzmo.
207
311
 
208
312
  * Change `import '@cumul.io/cumulio-dashboard` to `import @luzmo/embed`.
209
- * Replace all references of `cumulio-dashboard` to `luzmo-dashboard`
313
+ * Replace all references of `cumulio-dashboard` to `luzmo-embed-dashboard`
210
314
 
211
315
  ## Quick links
212
316
 
package/index.cjs CHANGED
@@ -57,7 +57,7 @@ var import_style_map = require("lit/directives/style-map.js");
57
57
  var import_shared_embed = require("@luzmo/shared-embed");
58
58
 
59
59
  // libs/embed-libs/embed/package.json
60
- var version = "6.0.0-beta.3";
60
+ var version = "6.0.0-beta.4";
61
61
 
62
62
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
63
63
  var LuzmoService = class {
package/index.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  } from "@luzmo/shared-embed";
38
38
 
39
39
  // libs/embed-libs/embed/package.json
40
- var version = "6.0.0-beta.3";
40
+ var version = "6.0.0-beta.4";
41
41
 
42
42
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
43
43
  var LuzmoService = class {
@@ -6049,7 +6049,7 @@ var o5 = e6(class extends i4 {
6049
6049
  });
6050
6050
 
6051
6051
  // libs/embed-libs/embed/package.json
6052
- var version = "6.0.0-beta.3";
6052
+ var version = "6.0.0-beta.4";
6053
6053
 
6054
6054
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
6055
6055
  var LuzmoService = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luzmo/embed",
3
- "version": "6.0.0-beta.3",
3
+ "version": "6.0.0-beta.4",
4
4
  "dependencies": {
5
5
  "lit": "3.1.2",
6
6
  "@luzmo/shared-embed": "5.0.9-beta.2",