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

Function checkBarsMatch

test/jasmine/tests/bar_test.js:1920–1931  ·  view source on GitHub ↗
(dims, msg)

Source from the content-addressed store, hash-verified

1918
1919 it('can change orientation and correctly sets axis types', function(done) {
1920 function checkBarsMatch(dims, msg) {
1921 var bars = d3SelectAll('.bars .point');
1922 var bbox1 = bars.node().getBoundingClientRect();
1923 bars.each(function(d, i) {
1924 if(!i) return;
1925 var bbox = this.getBoundingClientRect();
1926 ['left', 'right', 'top', 'bottom', 'width', 'height'].forEach(function(dim) {
1927 negateIf(dims.indexOf(dim) === -1, expect(bbox[dim]))
1928 .toBeWithin(bbox1[dim], 0.1, msg + ' (' + i + '): ' + dim);
1929 });
1930 });
1931 }
1932
1933 Plotly.newPlot(gd, [{
1934 x: ['a', 'b', 'c'],

Callers 1

bar_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…