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

Function _assert

test/jasmine/tests/hover_label_test.js:2200–2213  ·  view source on GitHub ↗
(msg, exp)

Source from the content-addressed store, hash-verified

2198
2199 it('hovermode:x common label should fit in the graph div width', function (done) {
2200 function _assert(msg, exp) {
2201 return function () {
2202 var label = d3Select('g.axistext');
2203 if (label.node()) {
2204 expect(label.text()).toBe(exp.txt, 'common label text| ' + msg);
2205 expect(Drawing.getTranslate(label).x).toBeWithin(exp.lx, 5, 'common label translate-x| ' + msg);
2206
2207 var startOfPath = label.select('path').attr('d').split('L')[0];
2208 expect(startOfPath).not.toBe('M0,0', 'offset start of label path| ' + msg);
2209 } else {
2210 fail('fail to generate common hover label');
2211 }
2212 };
2213 }
2214
2215 function _hoverLeft() {
2216 return _hover(gd, 30, 300);

Callers 1

Calls 1

negateIfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…