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

Method do_animate

js/src/widget.ts:1483–1519  ·  view source on GitHub ↗

* Handle Plotly.animate request

()

Source from the content-addressed store, hash-verified

1481 * Handle Plotly.animate request
1482 */
1483 do_animate() {
1484 /** @type {Py2JsAnimateMsg} */
1485 var msgData: Py2JsAnimateMsg = this.model.get("_py2js_animate");
1486
1487 if (msgData !== null) {
1488 // Unpack params
1489 // var animationData = msgData[0];
1490 var animationOpts = msgData.animation_opts;
1491
1492 var styles = msgData.style_data;
1493 var layout = msgData.layout_data;
1494 var traceIndexes = (this.model as FigureModel)._normalize_trace_indexes(
1495 msgData.style_traces
1496 );
1497
1498 var animationData: any = {
1499 data: styles,
1500 layout: layout,
1501 traces: traceIndexes,
1502 };
1503
1504 animationData["_doNotReportToPy"] = true;
1505 var that = this;
1506
1507 // @ts-ignore
1508 Plotly.animate(this.el, animationData, animationOpts).then(function () {
1509 // ### Send trace deltas ###
1510 // We create an array of deltas corresponding to the
1511 // animated traces.
1512 that._sendTraceDeltas(msgData.trace_edit_id);
1513
1514 // ### Send layout delta ###
1515 var layout_edit_id = msgData.layout_edit_id;
1516 that._sendLayoutDelta(layout_edit_id);
1517 });
1518 }
1519 }
1520
1521 /**
1522 * Construct layout delta object and send layoutDelta message to the

Callers 1

perform_renderMethod · 0.95

Calls 4

getMethod · 0.45
_sendTraceDeltasMethod · 0.45
_sendLayoutDeltaMethod · 0.45

Tested by

no test coverage detected