@gemx-dev/clarity-visualize 0.8.39 → 0.8.44
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 +1 -1
- package/src/interaction.ts +3 -0
- package/src/visualizer.ts +61 -57
- package/types/visualize.d.ts +1 -1
package/package.json
CHANGED
package/src/interaction.ts
CHANGED
|
@@ -115,6 +115,9 @@ export class InteractionHelper {
|
|
|
115
115
|
case "radio":
|
|
116
116
|
el.checked = data.value === "true";
|
|
117
117
|
break;
|
|
118
|
+
case "file":
|
|
119
|
+
// We cannot set value for files, only allowed to be an empty string when programatically set
|
|
120
|
+
break;
|
|
118
121
|
default:
|
|
119
122
|
el.value = data.value;
|
|
120
123
|
break;
|
package/src/visualizer.ts
CHANGED
|
@@ -171,68 +171,72 @@ export class Visualizer implements VisualizerType {
|
|
|
171
171
|
return this;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
public render =
|
|
174
|
+
public render = (events: DecodedData.DecodedEvent[]): void => {
|
|
175
175
|
if (this.state === null) { throw new Error(`Initialize visualization by calling "setup" prior to making this call.`); }
|
|
176
176
|
let time = 0;
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
break;
|
|
184
|
-
case Data.Event.Dimension:
|
|
185
|
-
if(entry.data[Dimension.InteractionNextPaint]){
|
|
177
|
+
for (const entry of events) {
|
|
178
|
+
try {
|
|
179
|
+
time = entry.time;
|
|
180
|
+
this.interaction.clearOldClickVisualizations(time);
|
|
181
|
+
switch (entry.event) {
|
|
182
|
+
case Data.Event.Metric:
|
|
186
183
|
this.data.metric(entry as DecodedData.MetricEvent);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
184
|
+
break;
|
|
185
|
+
case Data.Event.Dimension:
|
|
186
|
+
if(entry.data[Dimension.InteractionNextPaint]){
|
|
187
|
+
this.data.metric(entry as DecodedData.MetricEvent);
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
case Data.Event.Region:
|
|
191
|
+
this.data.region(entry as Layout.RegionEvent);
|
|
192
|
+
break;
|
|
193
|
+
case Data.Event.Mutation:
|
|
194
|
+
case Data.Event.Snapshot:
|
|
195
|
+
this.layout.markup(entry as Layout.DomEvent);
|
|
196
|
+
break;
|
|
197
|
+
case Data.Event.MouseDown:
|
|
198
|
+
case Data.Event.MouseUp:
|
|
199
|
+
case Data.Event.MouseMove:
|
|
200
|
+
case Data.Event.MouseWheel:
|
|
201
|
+
case Data.Event.Click:
|
|
202
|
+
case Data.Event.DoubleClick:
|
|
203
|
+
case Data.Event.TouchStart:
|
|
204
|
+
case Data.Event.TouchCancel:
|
|
205
|
+
case Data.Event.TouchEnd:
|
|
206
|
+
case Data.Event.TouchMove:
|
|
207
|
+
this.interaction.pointer(entry as Interaction.PointerEvent);
|
|
208
|
+
break;
|
|
209
|
+
case Data.Event.Visibility:
|
|
210
|
+
this.interaction.visibility(entry as Interaction.VisibilityEvent);
|
|
211
|
+
break;
|
|
212
|
+
case Data.Event.Input:
|
|
213
|
+
this.interaction.input(entry as Interaction.InputEvent);
|
|
214
|
+
break;
|
|
215
|
+
case Data.Event.Selection:
|
|
216
|
+
this.interaction.selection(entry as Interaction.SelectionEvent);
|
|
217
|
+
break;
|
|
218
|
+
case Data.Event.Resize:
|
|
219
|
+
this.interaction.resize(entry as Interaction.ResizeEvent);
|
|
220
|
+
break;
|
|
221
|
+
case Data.Event.Scroll:
|
|
222
|
+
this.interaction.scroll(entry as Interaction.ScrollEvent);
|
|
223
|
+
break;
|
|
224
|
+
case Data.Event.StyleSheetAdoption:
|
|
225
|
+
case Data.Event.StyleSheetUpdate:
|
|
226
|
+
this.layout.styleChange(entry as Layout.StyleSheetEvent);
|
|
227
|
+
break;
|
|
228
|
+
case Data.Event.Animation:
|
|
229
|
+
this.layout.animateChange(entry as Layout.AnimationEvent);
|
|
230
|
+
break;
|
|
231
|
+
case Data.Event.CustomElement:
|
|
232
|
+
this.layout.customElement(entry as Layout.CustomElementEvent);
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
catch (e) {
|
|
237
|
+
this._state.options.logerror?.(e);
|
|
233
238
|
}
|
|
234
239
|
}
|
|
235
|
-
|
|
236
240
|
if (events.length > 0) {
|
|
237
241
|
// Update pointer trail at the end of every frame
|
|
238
242
|
this.interaction.trail(time);
|
package/types/visualize.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class Visualizer {
|
|
|
25
25
|
clearmap: () => void;
|
|
26
26
|
scrollmap: (data?: ScrollMapInfo[], averageFold?: number, addMarkers?: boolean) => void;
|
|
27
27
|
merge: (decoded: Data.DecodedPayload[]) => MergedPayload;
|
|
28
|
-
render: (events: Data.DecodedEvent[]) =>
|
|
28
|
+
render: (events: Data.DecodedEvent[]) => void;
|
|
29
29
|
setup: (target: Window, options: Options) => Promise<Visualizer>;
|
|
30
30
|
time: () => number;
|
|
31
31
|
get: (hash: string) => HTMLElement;
|