(dimensionIn, dimensionOut, parentOut, opts)
| 31 | } |
| 32 | |
| 33 | function 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 | |
| 69 | module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { |
| 70 | function coerce(attr, dflt) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…