Interactions & Events

User interactions and events

🚧

Subject to breaking changes

The technical documentation for this feature is in Alpha Preview.

Overview

What do you mean user events? Why does this matter?
Any time a user does something, such as creating an instance, deleting an instance, changing labels etc. we think of as an "event". The main point is that we do so at semantically meaningful level for training data.

For example, a create_instance event is more meaningful than a regular "mouse_click" if I want to do something (such as running a model) after the user creates the instance.

Using a watcher (Alpha Preview Release)

Create a watcher using the following syntax. Everything inside the function can be changed. The function must have a create_instance key and use data as the value received. Click "Watch" button to start. Then draw an instance.

// Click Watch Then draw an instance and look at dev tools
create_instance: function (data){
  let instance = {...data[0]}
  console.log(instance)
 }
701

📘

Upcoming change

In the next release we plan to integrate this more smoothly and not require the button press in this way.

Watcher pattern by any other name

The high level idea is based around the watcher pattern.. For VueJS fans see reactivity in depth - think of this as simply setting a key in the watch: {} section.
For react fans this is somewhat similar to a useEffect. In classic terms this is called a callback.