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

Function getInsideTextFont

src/traces/bar/style.js:116–138  ·  view source on GitHub ↗
(trace, index, layoutFont, barColor)

Source from the content-addressed store, hash-verified

114}
115
116function getInsideTextFont(trace, index, layoutFont, barColor) {
117 var defaultFont = getTextFont(trace, index, layoutFont);
118
119 var wouldFallBackToLayoutFont =
120 (trace._input.textfont === undefined || trace._input.textfont.color === undefined) ||
121 (Array.isArray(trace.textfont.color) && trace.textfont.color[index] === undefined);
122 if(wouldFallBackToLayoutFont) {
123 defaultFont = {
124 color: Color.contrast(barColor),
125 family: defaultFont.family,
126 size: defaultFont.size,
127 weight: defaultFont.weight,
128 style: defaultFont.style,
129 variant: defaultFont.variant,
130 textcase: defaultFont.textcase,
131 lineposition: defaultFont.lineposition,
132 shadow: defaultFont.shadow,
133 };
134 }
135
136 return getFontValue(
137 attributeInsideTextFont, trace.insidetextfont, index, defaultFont);
138}
139
140function getOutsideTextFont(trace, index, layoutFont) {
141 var defaultFont = getTextFont(trace, index, layoutFont);

Callers 1

determineFontFunction · 0.85

Calls 2

getFontValueFunction · 0.85
getTextFontFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…