* Build and send a points callback message to the Python side * * @param {Object} data * data object as provided by the plotly_click, plotly_hover, * plotly_unhover, or plotly_selected events * @param {String} event_type * Name of the triggering event. One of 'plotly_click',
(data: any, event_type: string)
| 1315 | * @private |
| 1316 | */ |
| 1317 | _send_points_callback_message(data: any, event_type: string) { |
| 1318 | if (data === null || data === undefined) { |
| 1319 | // No data to report to the Python side |
| 1320 | return; |
| 1321 | } |
| 1322 | |
| 1323 | /** @type {Js2PyPointsCallbackMsg} */ |
| 1324 | var pointsMsg: Js2PyPointsCallbackMsg = { |
| 1325 | event_type: event_type, |
| 1326 | points: this.buildPointsObject(data), |
| 1327 | device_state: this.buildInputDeviceStateObject(data), |
| 1328 | selector: this.buildSelectorObject(data), |
| 1329 | }; |
| 1330 | |
| 1331 | if (pointsMsg["points"] !== null && pointsMsg["points"] !== undefined) { |
| 1332 | this.model.set("_js2py_pointsCallback", pointsMsg); |
| 1333 | this.touch(); |
| 1334 | } |
| 1335 | } |
| 1336 | |
| 1337 | /** |
| 1338 | * Stub for future handling of plotly_doubleclick |
no test coverage detected