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

Function shiftFraction

src/components/annotations/draw.js:285–299  ·  view source on GitHub ↗
(v, anchor)

Source from the content-addressed store, hash-verified

283 var outerHeight = Math.round(annHeight + 2 * borderfull);
284
285 function shiftFraction(v, anchor) {
286 if(anchor === 'auto') {
287 if(v < 1 / 3) anchor = 'left';
288 else if(v > 2 / 3) anchor = 'right';
289 else anchor = 'center';
290 }
291 return {
292 center: 0,
293 middle: 0,
294 left: 0.5,
295 bottom: -0.5,
296 right: -0.5,
297 top: 0.5
298 }[anchor];
299 }
300
301 var annotationIsOffscreen = false;
302 var letters = ['x', 'y'];

Callers 1

drawGraphicalElementsFunction · 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…