|
3 | 3 | var Lib = require('../../lib'); |
4 | 4 | var contrast = require('../../components/color').contrast; |
5 | 5 | var layoutAttributes = require('./layout_attributes'); |
| 6 | +var getShowAttrDflt = require('./show_dflt'); |
6 | 7 | var handleArrayContainerDefaults = require('../array_container_defaults'); |
7 | 8 |
|
8 | 9 | module.exports = function handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options, config) { |
@@ -69,34 +70,6 @@ function handleOtherDefaults(containerIn, containerOut, coerce, axType, options) |
69 | 70 | } |
70 | 71 | } |
71 | 72 |
|
72 | | -/* |
73 | | - * Attributes 'showexponent', 'showtickprefix' and 'showticksuffix' |
74 | | - * share values. |
75 | | - * |
76 | | - * If only 1 attribute is set, |
77 | | - * the remaining attributes inherit that value. |
78 | | - * |
79 | | - * If 2 attributes are set to the same value, |
80 | | - * the remaining attribute inherits that value. |
81 | | - * |
82 | | - * If 2 attributes are set to different values, |
83 | | - * the remaining is set to its dflt value. |
84 | | - * |
85 | | - */ |
86 | | -function getShowAttrDflt(containerIn) { |
87 | | - var showAttrsAll = ['showexponent', 'showtickprefix', 'showticksuffix']; |
88 | | - var showAttrs = showAttrsAll.filter(function(a) { |
89 | | - return containerIn[a] !== undefined; |
90 | | - }); |
91 | | - var sameVal = function(a) { |
92 | | - return containerIn[a] === containerIn[showAttrs[0]]; |
93 | | - }; |
94 | | - |
95 | | - if(showAttrs.every(sameVal) || showAttrs.length === 1) { |
96 | | - return containerIn[showAttrs[0]]; |
97 | | - } |
98 | | -} |
99 | | - |
100 | 73 | function tickformatstopDefaults(valueIn, valueOut) { |
101 | 74 | function coerce(attr, dflt) { |
102 | 75 | return Lib.coerce(valueIn, valueOut, layoutAttributes.tickformatstops, attr, dflt); |
|
0 commit comments