MCPcopy Create free account
hub / github.com/plotly/plotly.js / fixExtremes

Function fixExtremes

src/traces/parcoords/parcoords.js:44–67  ·  view source on GitHub ↗
(lo, hi)

Source from the content-addressed store, hash-verified

42}
43
44function fixExtremes(lo, hi) {
45 if(isNaN(lo) || !isFinite(lo)) {
46 lo = 0;
47 }
48
49 if(isNaN(hi) || !isFinite(hi)) {
50 hi = 0;
51 }
52
53 // avoid a degenerate (zero-width) domain
54 if(lo === hi) {
55 if(lo === 0) {
56 // no use to multiplying zero, so add/subtract in this case
57 lo -= 1;
58 hi += 1;
59 } else {
60 // this keeps the range in the order of magnitude of the data
61 lo *= 0.9;
62 hi *= 1.1;
63 }
64 }
65
66 return [lo, hi];
67}
68
69function toText(formatter, texts) {
70 if(texts) {

Callers 3

findExtremesFunction · 0.85
dimensionExtentFunction · 0.85
calcAllTicksFunction · 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…