MCPcopy
hub / github.com/plotly/plotly.js / _assertLabelGroup

Function _assertLabelGroup

test/jasmine/tests/sankey_test.js:1538–1562  ·  view source on GitHub ↗
(g, content, style)

Source from the content-addressed store, hash-verified

1536}
1537
1538function _assertLabelGroup(g, content, style) {
1539 var lines = g.selectAll('.nums .line');
1540 var name = g.selectAll('.name');
1541 var tooltipBoundingBox = g.node().getBoundingClientRect();
1542 var nameBoundingBox = name.node().getBoundingClientRect();
1543
1544 expect(tooltipBoundingBox.top <= nameBoundingBox.top);
1545 expect(tooltipBoundingBox.bottom >= nameBoundingBox.bottom);
1546
1547 expect(lines.size()).toBe(content.length - 1);
1548
1549 lines.each(function(_, i) {
1550 expect(d3Select(this).text()).toBe(content[i]);
1551 });
1552
1553 expect(name.text()).toBe(content[content.length - 1]);
1554
1555 assertHoverLabelStyle(g, {
1556 bgcolor: style[0],
1557 bordercolor: style[1],
1558 fontSize: style[2],
1559 fontFamily: style[3],
1560 fontColor: style[4]
1561 });
1562}
1563
1564function assertNoLabel() {
1565 var g = d3SelectAll('.hovertext');

Callers 1

assertMultipleLabelsFunction · 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…