MCPcopy Index your code
hub / github.com/plotly/plotly.js / updateMatchedAxRange

Function updateMatchedAxRange

src/plots/cartesian/dragbox.js:692–717  ·  view source on GitHub ↗
(axLetter, out)

Source from the content-addressed store, hash-verified

690 }
691
692 function updateMatchedAxRange(axLetter, out) {
693 var matchedAxes = matches.isSubplotConstrained ?
694 {x: yaxes, y: xaxes}[axLetter] :
695 matches[axLetter + 'axes'];
696
697 var constrainedAxes = matches.isSubplotConstrained ?
698 {x: xaxes, y: yaxes}[axLetter] :
699 [];
700
701 for(var i = 0; i < matchedAxes.length; i++) {
702 var ax = matchedAxes[i];
703 var axId = ax._id;
704 var axId2 = matches.xLinks[axId] || matches.yLinks[axId];
705 var ax2 = constrainedAxes[0] || xaHash[axId2] || yaHash[axId2];
706
707 if(ax2) {
708 if(out) {
709 // zoombox case - don't mutate 'range', just add keys in 'updates'
710 out[ax._name + '.range[0]'] = out[ax2._name + '.range[0]'];
711 out[ax._name + '.range[1]'] = out[ax2._name + '.range[1]'];
712 } else {
713 ax.range = ax2.range.slice();
714 }
715 }
716 }
717 }
718
719 // Draw ticks and annotations (and other components) when ranges change.
720 // Also records the ranges that have changed for use by update at the end.

Callers 3

computeZoomUpdatesFunction · 0.85
zoomWheelFunction · 0.85
plotDragFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…