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

Function zoomOut

test/jasmine/tests/axes_test.js:7942–7961  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7940 var testCount = 0;
7941
7942 var zoomOut = function() {
7943 promise = promise.then(function() {
7944 getZoomOutButton(gd).click();
7945 var xLabels = Axes.calcTicks(gd._fullLayout.xaxis);
7946 var formatter = getFormatter(Axes.getTickFormat(gd._fullLayout.xaxis));
7947 var expectedLabels = xLabels.map(function(d) {return formatter(new Date(d.x));});
7948 var actualLabels = xLabels.map(function(d) {return d.text;});
7949 expect(expectedLabels).toEqual(actualLabels);
7950 testCount++;
7951
7952 if(typeof gd._fullLayout.xaxis.dtick === 'number' ||
7953 typeof gd._fullLayout.xaxis.dtick === 'string' && parseInt(gd._fullLayout.xaxis.dtick.replace(/\D/g, '')) < 48) {
7954 zoomOut();
7955 } else {
7956 // make sure we tested as many levels as we thought we would
7957 expect(testCount).toBe(5);
7958 done();
7959 }
7960 });
7961 };
7962 zoomOut();
7963 });
7964

Callers 1

axes_test.jsFile · 0.85

Calls 4

getZoomOutButtonFunction · 0.85
doneFunction · 0.85
getFormatterFunction · 0.70
formatterFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…