Marking.onChange (JavaScript API) method does not get triggered

I am trying to understand why the Marking.onChanged method does not get triggered. These are the steps that I go through after I add the code at the bottom to my page:

1. Open an analysis document on the WebPlayer

2. Mark some items on a scatter plot

3. Inspect the browser console => {
    document.marking.onChanged("Marking", "Wells", ["wellID"], 10, (marking) => {
        // that line below does not get triggered 
        console.log("Test key: " + marking.key);


(1) Answer