(
tooltipModel: Model<TooltipOption>,
enableTransition: boolean,
onlyFadeTransition: boolean,
enableDisplayTransition: boolean
)
| 180 | } |
| 181 | |
| 182 | function assembleCssText( |
| 183 | tooltipModel: Model<TooltipOption>, |
| 184 | enableTransition: boolean, |
| 185 | onlyFadeTransition: boolean, |
| 186 | enableDisplayTransition: boolean |
| 187 | ) { |
| 188 | const cssText: string[] = []; |
| 189 | const transitionDuration = tooltipModel.get('transitionDuration'); |
| 190 | const backgroundColor = tooltipModel.get('backgroundColor'); |
| 191 | const shadowBlur = tooltipModel.get('shadowBlur'); |
| 192 | const shadowColor = tooltipModel.get('shadowColor'); |
| 193 | const shadowOffsetX = tooltipModel.get('shadowOffsetX'); |
| 194 | const shadowOffsetY = tooltipModel.get('shadowOffsetY'); |
| 195 | const textStyleModel = tooltipModel.getModel('textStyle'); |
| 196 | const padding = getPaddingFromTooltipModel(tooltipModel, 'html'); |
| 197 | const boxShadow = `${shadowOffsetX}px ${shadowOffsetY}px ${shadowBlur}px ${shadowColor}`; |
| 198 | |
| 199 | cssText.push('box-shadow:' + boxShadow); |
| 200 | // Animation transition. Do not animate when transitionDuration <= 0. |
| 201 | enableTransition && transitionDuration > 0 |
| 202 | && cssText.push(assembleTransition(transitionDuration, onlyFadeTransition, enableDisplayTransition)); |
| 203 | |
| 204 | if (backgroundColor) { |
| 205 | cssText.push('background-color:' + backgroundColor); |
| 206 | } |
| 207 | |
| 208 | // Border style |
| 209 | each(['width', 'color', 'radius'] as const, function (name) { |
| 210 | const borderName = 'border-' + name; |
| 211 | const camelCase = toCamelCase(borderName) as 'borderWidth' | 'borderColor' | 'borderRadius'; |
| 212 | const val = tooltipModel.get(camelCase); |
| 213 | val != null |
| 214 | && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px')); |
| 215 | }); |
| 216 | |
| 217 | // Text style |
| 218 | cssText.push(assembleFont(textStyleModel)); |
| 219 | |
| 220 | // Padding |
| 221 | if (padding != null) { |
| 222 | cssText.push('padding:' + normalizeCssArray(padding).join('px ') + 'px'); |
| 223 | } |
| 224 | |
| 225 | return cssText.join(';') + ';'; |
| 226 | } |
| 227 | |
| 228 | // If not able to make, do not modify the input `out`. |
| 229 | function makeStyleCoord( |
no test coverage detected
searching dependent graphs…