MCPcopy Index your code
hub / github.com/plotly/plotly.js / get_glyphData

Function get_glyphData

stackgl_modules/index.js:19906–19960  ·  view source on GitHub ↗
(glyphs, index, font, pixelRatio)

Source from the content-addressed store, hash-verified

19904}
19905
19906function get_glyphData(glyphs, index, font, pixelRatio) {
19907 var str
19908
19909 // use the data if presented in an array
19910 if(isArrayOrTypedArray(glyphs)) {
19911 if(index < glyphs.length) {
19912 str = glyphs[index]
19913 } else {
19914 str = undefined
19915 }
19916 } else {
19917 str = glyphs
19918 }
19919
19920 str = getSimpleString(str) // this would handle undefined cases
19921
19922 var visible = true
19923 if(isAllBlank(str)) {
19924 str = '▼' // Note: this special character may have minimum number of surfaces
19925 visible = false
19926 }
19927
19928 if(!font) font = {}
19929
19930 var family = font.family
19931 if(isArrayOrTypedArray(family)) family = family[index]
19932 if(!family) family = "normal"
19933
19934 var weight = font.weight
19935 if(isArrayOrTypedArray(weight)) weight = weight[index]
19936 if(!weight) weight = "normal"
19937
19938 var style = font.style
19939 if(isArrayOrTypedArray(style)) style = style[index]
19940 if(!style) style = "normal"
19941
19942 var variant = font.variant
19943 if(isArrayOrTypedArray(variant)) variant = variant[index]
19944 if(!variant) variant = "normal"
19945
19946 var glyph = getGlyph(str, {
19947 family: family,
19948 weight: weight,
19949 style: style,
19950 variant: variant,
19951 }, pixelRatio)
19952
19953
19954 var glyph = getGlyph(str, font, pixelRatio)
19955
19956 return { mesh:glyph[0],
19957 lines:glyph[1],
19958 bounds:glyph[2],
19959 visible:visible };
19960}
19961
19962
19963

Callers 1

index.jsFile · 0.85

Calls 2

getGlyphFunction · 0.85
isArrayOrTypedArrayFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…