MCPcopy Index your code
hub / github.com/leeoniya/uPlot / _commit

Function _commit

src/uPlot.js:2166–2304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2164 self.batch = batch;
2165
2166 function _commit() {
2167 // log("_commit()", arguments);
2168
2169 if (shouldSetScales) {
2170 setScales();
2171 shouldSetScales = false;
2172 }
2173
2174 if (shouldConvergeSize) {
2175 convergeSize();
2176 shouldConvergeSize = false;
2177 }
2178
2179 if (shouldSetSize) {
2180 setStylePx(under, LEFT, plotLftCss);
2181 setStylePx(under, TOP, plotTopCss);
2182 setStylePx(under, WIDTH, plotWidCss);
2183 setStylePx(under, HEIGHT, plotHgtCss);
2184
2185 setStylePx(over, LEFT, plotLftCss);
2186 setStylePx(over, TOP, plotTopCss);
2187 setStylePx(over, WIDTH, plotWidCss);
2188 setStylePx(over, HEIGHT, plotHgtCss);
2189
2190 setStylePx(wrap, WIDTH, fullWidCss);
2191 setStylePx(wrap, HEIGHT, fullHgtCss);
2192
2193 // NOTE: mutating this during print preview in Chrome forces transparent
2194 // canvas pixels to white, even when followed up with clearRect() below
2195 can.width = round(fullWidCss * pxRatio);
2196 can.height = round(fullHgtCss * pxRatio);
2197
2198 axes.forEach(({ _el, _show, _size, _pos, side }) => {
2199 if (_el != null) {
2200 if (_show) {
2201 let posOffset = (side === 3 || side === 0 ? _size : 0);
2202 let isVt = side % 2 == 1;
2203
2204 setStylePx(_el, isVt ? "left" : "top", _pos - posOffset);
2205 setStylePx(_el, isVt ? "width" : "height", _size);
2206 setStylePx(_el, isVt ? "top" : "left", isVt ? plotTopCss : plotLftCss);
2207 setStylePx(_el, isVt ? "height" : "width", isVt ? plotHgtCss : plotWidCss);
2208
2209 remClass(_el, OFF);
2210 }
2211 else
2212 addClass(_el, OFF);
2213 }
2214 });
2215
2216 // invalidate ctx style cache
2217 ctxStroke = ctxFill = ctxWidth = ctxJoin = ctxCap = ctxFont = ctxAlign = ctxBaseline = ctxDash = null;
2218 ctxAlpha = 1;
2219
2220 syncRect(true);
2221
2222 if (
2223 plotLftCss != _plotLftCss ||

Callers 1

batchFunction · 0.85

Calls 12

setStylePxFunction · 0.90
remClassFunction · 0.90
addClassFunction · 0.90
elTransFunction · 0.90
setScalesFunction · 0.85
convergeSizeFunction · 0.85
syncRectFunction · 0.85
resetYSeriesFunction · 0.85
fireFunction · 0.85
setSelectFunction · 0.85
updateCursorFunction · 0.85
setLegendFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…