(traceIn, traceOut, fullLayout, dfltColor)
| 22 | }; |
| 23 | |
| 24 | function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) { |
| 25 | var axesList = ['aaxis', 'baxis']; |
| 26 | |
| 27 | axesList.forEach(function(axName) { |
| 28 | var axLetter = axName.charAt(0); |
| 29 | var axIn = traceIn[axName] || {}; |
| 30 | var axOut = Template.newContainer(traceOut, axName); |
| 31 | |
| 32 | var defaultOptions = { |
| 33 | noAutotickangles: true, |
| 34 | noTicklabelshift: true, |
| 35 | noTicklabelstandoff: true, |
| 36 | noTicklabelstep: true, |
| 37 | tickfont: 'x', |
| 38 | id: axLetter + 'axis', |
| 39 | letter: axLetter, |
| 40 | font: traceOut.font, |
| 41 | name: axName, |
| 42 | data: traceIn[axLetter], |
| 43 | calendar: traceOut.calendar, |
| 44 | dfltColor: dfltColor, |
| 45 | bgColor: fullLayout.paper_bgcolor, |
| 46 | autotypenumbersDflt: fullLayout.autotypenumbers, |
| 47 | fullLayout: fullLayout |
| 48 | }; |
| 49 | |
| 50 | handleAxisDefaults(axIn, axOut, defaultOptions); |
| 51 | axOut._categories = axOut._categories || []; |
| 52 | |
| 53 | // so we don't have to repeat autotype unnecessarily, |
| 54 | // copy an autotype back to traceIn |
| 55 | if(!traceIn[axName] && axIn.type !== '-') { |
| 56 | traceIn[axName] = {type: axIn.type}; |
| 57 | } |
| 58 | }); |
| 59 | } |
no test coverage detected
searching dependent graphs…