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

Function prerenderTitles

src/traces/pie/plot.js:649–677  ·  view source on GitHub ↗
(cdModule, gd)

Source from the content-addressed store, hash-verified

647}
648
649function prerenderTitles(cdModule, gd) {
650 var cd0, trace;
651
652 // Determine the width and height of the title for each pie.
653 for (var i = 0; i < cdModule.length; i++) {
654 cd0 = cdModule[i][0];
655 trace = cd0.trace;
656
657 if (trace.title.text) {
658 var txt = trace.title.text;
659 if (trace._meta) {
660 txt = Lib.templateString(txt, trace._meta);
661 }
662
663 var dummyTitle = Drawing.tester
664 .append('text')
665 .attr('data-notex', 1)
666 .text(txt)
667 .call(Drawing.font, trace.title.font)
668 .call(svgTextUtils.convertToTspans, gd);
669 var bBox = Drawing.bBox(dummyTitle.node(), true);
670 cd0.titleBox = {
671 width: bBox.width,
672 height: bBox.height
673 };
674 dummyTitle.remove();
675 }
676 }
677}
678
679function transformInsideText(textBB, pt, cd0) {
680 var r = cd0.r || pt.rpx1;

Callers 2

plot.jsFile · 0.85
plotFunction · 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…