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

Function _calc

test/jasmine/tests/histogram2d_test.js:124–148  ·  view source on GitHub ↗
(opts, layout)

Source from the content-addressed store, hash-verified

122
123 describe('calc', function() {
124 function _calc(opts, layout) {
125 var base = { type: 'histogram2d' };
126 var trace = Lib.extendFlat({}, base, opts);
127 var gd = { data: [trace] };
128 if(layout) gd.layout = layout;
129
130 supplyAllDefaults(gd);
131 var fullTrace = gd._fullData[0];
132 var fullLayout = gd._fullLayout;
133
134 fullTrace._extremes = {};
135
136 // we used to call ax.setScale during supplyDefaults, and this had a
137 // fallback to provide _categories and _categoriesMap. Now neither of
138 // those is true... anyway the right way to do this though is
139 // ax.clearCalc.
140 fullLayout.xaxis.clearCalc();
141 fullLayout.yaxis.clearCalc();
142
143 var out = calc(gd, fullTrace);
144 out._xcategories = fullLayout.xaxis._categories;
145 out._ycategories = fullLayout.yaxis._categories;
146
147 return out;
148 }
149
150 // remove tzJan/tzJuly when we move to UTC
151 var oneDay = 24 * 3600000;

Callers 1

Calls 1

calcFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…