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

Function getLabelContent

test/jasmine/assets/custom_assertions.js:64–81  ·  view source on GitHub ↗
(label)

Source from the content-addressed store, hash-verified

62};
63
64function getLabelContent(label) {
65 var lines = label.selectAll('tspan.line');
66 var content = [];
67
68 function fill(sel) {
69 if(sel.node()) {
70 var html = sel.html();
71 if(html) content.push(html);
72 }
73 }
74
75 if(lines.size()) {
76 lines.each(function() { fill(d3Select(this)); });
77 } else {
78 fill(label);
79 }
80 return content.join('\n');
81}
82
83function assertLabelContent(label, expectation, msg) {
84 if(!expectation) expectation = '';

Callers 2

assertLabelContentFunction · 0.85

Calls 1

fillFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…