(textStyle, renderMode)
| 21947 | var TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1'; // TODO: more textStyle option |
| 21948 | |
| 21949 | function getTooltipTextStyle(textStyle, renderMode) { |
| 21950 | var nameFontColor = textStyle.color || '#6e7079'; |
| 21951 | var nameFontSize = textStyle.fontSize || 12; |
| 21952 | var nameFontWeight = textStyle.fontWeight || '400'; |
| 21953 | var valueFontColor = textStyle.color || '#464646'; |
| 21954 | var valueFontSize = textStyle.fontSize || 14; |
| 21955 | var valueFontWeight = textStyle.fontWeight || '900'; |
| 21956 | |
| 21957 | if (renderMode === 'html') { |
| 21958 | // `textStyle` is probably from user input, should be encoded to reduce security risk. |
| 21959 | return { |
| 21960 | // eslint-disable-next-line max-len |
| 21961 | nameStyle: "font-size:" + encodeHTML(nameFontSize + '') + "px;color:" + encodeHTML(nameFontColor) + ";font-weight:" + encodeHTML(nameFontWeight + ''), |
| 21962 | // eslint-disable-next-line max-len |
| 21963 | valueStyle: "font-size:" + encodeHTML(valueFontSize + '') + "px;color:" + encodeHTML(valueFontColor) + ";font-weight:" + encodeHTML(valueFontWeight + '') |
| 21964 | }; |
| 21965 | } else { |
| 21966 | return { |
| 21967 | nameStyle: { |
| 21968 | fontSize: nameFontSize, |
| 21969 | fill: nameFontColor, |
| 21970 | fontWeight: nameFontWeight |
| 21971 | }, |
| 21972 | valueStyle: { |
| 21973 | fontSize: valueFontSize, |
| 21974 | fill: valueFontColor, |
| 21975 | fontWeight: valueFontWeight |
| 21976 | } |
| 21977 | }; |
| 21978 | } |
| 21979 | } // See `TooltipMarkupLayoutIntent['innerGapLevel']`. |
| 21980 | // (value from UI design) |
| 21981 | |
| 21982 |
no test coverage detected
searching dependent graphs…