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

Function measureText

src/traces/indicator/plot.js:854–865  ·  view source on GitHub ↗
(txt, font, textAnchor, gd)

Source from the content-addressed store, hash-verified

852}
853
854function measureText(txt, font, textAnchor, gd) {
855 var element = document.createElementNS('http://www.w3.org/2000/svg', 'text');
856 var sel = d3.select(element);
857 sel.text(txt)
858 .attr('x', 0)
859 .attr('y', 0)
860 .attr('text-anchor', textAnchor)
861 .attr('data-unformatted', txt)
862 .call(svgTextUtils.convertToTspans, gd)
863 .call(Drawing.font, font);
864 return Drawing.bBox(sel.node());
865}
866
867function cache(trace, name, initialValue, value, key, fn) {
868 var objName = '_cache' + name;

Callers 2

drawBignumberFunction · 0.85
drawDeltaFunction · 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…