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

Function valueToAngle

src/traces/indicator/plot.js:358–365  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

356 // circular gauge
357 var theta = Math.PI / 2;
358 function valueToAngle(v) {
359 var min = trace.gauge.axis.range[0];
360 var max = trace.gauge.axis.range[1];
361 var angle = (v - min) / (max - min) * Math.PI - theta;
362 if(angle < -theta) return -theta;
363 if(angle > theta) return theta;
364 return angle;
365 }
366
367 function arcPathGenerator(size) {
368 return d3.svg.arc()

Callers 2

drawArcFunction · 0.85
drawAngularGaugeFunction · 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…