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

Function assertTitle

test/jasmine/tests/polar_test.js:454–468  ·  view source on GitHub ↗
(content, didBBoxChanged)

Source from the content-addressed store, hash-verified

452 var lastBBox;
453
454 function assertTitle(content, didBBoxChanged) {
455 var radialAxisTitle = d3Select('g.g-polartitle');
456 var txt = radialAxisTitle.select('text');
457 var bb = radialAxisTitle.node().getBBox();
458 var newBBox = [bb.x, bb.y, bb.width, bb.height];
459
460 if(content === '') {
461 expect(txt.size()).toBe(0, 'cleared <text>');
462 } else {
463 expect(txt.text()).toBe(content, 'radial axis title');
464 }
465
466 negateIf(didBBoxChanged, expect(newBBox)).toEqual(lastBBox, 'did bbox change');
467 lastBBox = newBBox;
468 }
469
470 Plotly.newPlot(gd, [{
471 type: 'scatterpolar',

Callers 1

polar_test.jsFile · 0.85

Calls 1

negateIfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…