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

Function findNearestOnAxis

src/traces/isosurface/convert.js:10–25  ·  view source on GitHub ↗
(w, arr)

Source from the content-addressed store, hash-verified

8var zip3 = require('../../plots/gl3d/zip3');
9
10var findNearestOnAxis = function(w, arr) {
11 for(var q = arr.length - 1; q > 0; q--) {
12 var min = Math.min(arr[q], arr[q - 1]);
13 var max = Math.max(arr[q], arr[q - 1]);
14 if(max > min && min < w && w <= max) {
15 return {
16 id: q,
17 distRatio: (max - w) / (max - min)
18 };
19 }
20 }
21 return {
22 id: 0,
23 distRatio: 0
24 };
25};
26
27function IsosurfaceTrace(scene, mesh, uid) {
28 this.scene = scene;

Callers 3

convert.jsFile · 0.85
convert.jsFile · 0.85
drawAllFunction · 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…