In order to support feature analytics, allow LZ.js to fire additional events, such as when a tooltip button is clicked, or a widget is used.
This introduces the new concept of "custom events", which just means that on and emit are no longer limited to predefined names.
Many widgets now emit new events, and have fine-grained control over what name to use for this event. This can be used to collect analytics on which features are most useful.
Summary of changes
When adding an event hook, LZ will no longer validate that the event is one of the known items built into LZ. If you have a typo, you won't see an event get fired at all.
Fortunately, the newly revised docs make it easier to discover the correct event names!
[x] Several new widget events have been added:
widget_display_options_choice
widget_download_png
widget_download_svg
widget_filter_field_action
widget_set_state_choice
[x] Some widgets are meant to be highly modular- eg the same plot can use 3 filter widgets or each panel can have its own display_options. Widgets will have a new custom_event_name property to provide control over how these events will be broadcast. For some scenarios, this makes it easier to collect analytics on a particular feature, without having to filter every possible use of that widget by name inside the listener that handles the event.
Ticket: Closes #236
Purpose
In order to support feature analytics, allow LZ.js to fire additional events, such as when a tooltip button is clicked, or a widget is used.
This introduces the new concept of "custom events", which just means that
on
andemit
are no longer limited to predefined names.Many widgets now emit new events, and have fine-grained control over what name to use for this event. This can be used to collect analytics on which features are most useful.
Summary of changes
custom_event_name
property to provide control over how these events will be broadcast. For some scenarios, this makes it easier to collect analytics on a particular feature, without having to filter every possible use of that widget by name inside the listener that handles the event.