MCPcopy Index your code
hub / github.com/plotly/plotly.py / buildSelectorObject

Method buildSelectorObject

js/src/widget.ts:1148–1173  ·  view source on GitHub ↗

* Build Selector data structure from data supplied by the * plotly_select event * @param data * @returns {null|Selector}

(data: any)

Source from the content-addressed store, hash-verified

1146 * @returns {null|Selector}
1147 */
1148 buildSelectorObject(data: any): null | Selector {
1149 var selectorObject: Selector;
1150
1151 if (data.hasOwnProperty("range")) {
1152 // Box selection
1153 selectorObject = {
1154 type: "box",
1155 selector_state: {
1156 xrange: data["range"]["x"],
1157 yrange: data["range"]["y"],
1158 },
1159 };
1160 } else if (data.hasOwnProperty("lassoPoints")) {
1161 // Lasso selection
1162 selectorObject = {
1163 type: "lasso",
1164 selector_state: {
1165 xs: data["lassoPoints"]["x"],
1166 ys: data["lassoPoints"]["y"],
1167 },
1168 };
1169 } else {
1170 selectorObject = null;
1171 }
1172 return selectorObject;
1173 }
1174
1175 /**
1176 * Handle ploty_restyle events emitted by the Plotly.js library

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected