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

Function dimensionDefaults

src/traces/parcoords/defaults.js:33–67  ·  view source on GitHub ↗
(dimensionIn, dimensionOut, parentOut, opts)

Source from the content-addressed store, hash-verified

31}
32
33function dimensionDefaults(dimensionIn, dimensionOut, parentOut, opts) {
34 function coerce(attr, dflt) {
35 return Lib.coerce(dimensionIn, dimensionOut, attributes.dimensions, attr, dflt);
36 }
37
38 var values = coerce('values');
39 var visible = coerce('visible');
40 if(!(values && values.length)) {
41 visible = dimensionOut.visible = false;
42 }
43
44 if(visible) {
45 coerce('label');
46 coerce('tickvals');
47 coerce('ticktext');
48 coerce('tickformat');
49 var range = coerce('range');
50
51 dimensionOut._ax = {
52 _id: 'y',
53 type: 'linear',
54 showexponent: 'all',
55 exponentformat: 'B',
56 range: range
57 };
58
59 Axes.setConvert(dimensionOut._ax, opts.layout);
60
61 coerce('multiselect');
62 var constraintRange = coerce('constraintrange');
63 if(constraintRange) {
64 dimensionOut.constraintrange = axisBrush.cleanRanges(constraintRange, dimensionOut);
65 }
66 }
67}
68
69module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
70 function coerce(attr, dflt) {

Callers

nothing calls this directly

Calls 1

coerceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…