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

Function assertTextIsInsidePath

test/jasmine/tests/funnel_test.js:594–602  ·  view source on GitHub ↗
(textNode, pathNode, errorMargin=0)

Source from the content-addressed store, hash-verified

592 }
593
594 function assertTextIsInsidePath(textNode, pathNode, errorMargin=0) {
595 var textBB = textNode.getBoundingClientRect();
596 var pathBB = pathNode.getBoundingClientRect();
597
598 expect(pathBB.left - errorMargin).not.toBeGreaterThan(textBB.left);
599 expect(textBB.right - errorMargin).not.toBeGreaterThan(pathBB.right);
600 expect(pathBB.top - errorMargin).not.toBeGreaterThan(textBB.top);
601 expect(textBB.bottom - errorMargin).not.toBeGreaterThan(pathBB.bottom);
602 }
603
604 function assertTextIsAbovePath(textNode, pathNode) {
605 var textBB = textNode.getBoundingClientRect();

Callers 1

funnel_test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…