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

Function getFontValue

src/traces/bar/style.js:146–179  ·  view source on GitHub ↗
(attributeDefinition, attributeValue, index, defaultValue)

Source from the content-addressed store, hash-verified

144}
145
146function getFontValue(attributeDefinition, attributeValue, index, defaultValue) {
147 attributeValue = attributeValue || {};
148
149 var familyValue = helpers.getValue(attributeValue.family, index);
150 var sizeValue = helpers.getValue(attributeValue.size, index);
151 var colorValue = helpers.getValue(attributeValue.color, index);
152 var weightValue = helpers.getValue(attributeValue.weight, index);
153 var styleValue = helpers.getValue(attributeValue.style, index);
154 var variantValue = helpers.getValue(attributeValue.variant, index);
155 var textcaseValue = helpers.getValue(attributeValue.textcase, index);
156 var linepositionValue = helpers.getValue(attributeValue.lineposition, index);
157 var shadowValue = helpers.getValue(attributeValue.shadow, index);
158
159 return {
160 family: helpers.coerceString(
161 attributeDefinition.family, familyValue, defaultValue.family),
162 size: helpers.coerceNumber(
163 attributeDefinition.size, sizeValue, defaultValue.size),
164 color: helpers.coerceColor(
165 attributeDefinition.color, colorValue, defaultValue.color),
166 weight: helpers.coerceString(
167 attributeDefinition.weight, weightValue, defaultValue.weight),
168 style: helpers.coerceString(
169 attributeDefinition.style, styleValue, defaultValue.style),
170 variant: helpers.coerceString(
171 attributeDefinition.variant, variantValue, defaultValue.variant),
172 textcase: helpers.coerceString(
173 attributeDefinition.variant, textcaseValue, defaultValue.textcase),
174 lineposition: helpers.coerceString(
175 attributeDefinition.variant, linepositionValue, defaultValue.lineposition),
176 shadow: helpers.coerceString(
177 attributeDefinition.variant, shadowValue, defaultValue.shadow),
178 };
179}
180
181function getBarColor(cd, trace) {
182 if(trace.type === 'waterfall') {

Callers 3

getTextFontFunction · 0.85
getInsideTextFontFunction · 0.85
getOutsideTextFontFunction · 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…