MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / Painter

Function Painter

libs/echarts/echarts-en.simple.js:9499–9613  ·  view source on GitHub ↗
(root, storage, opts)

Source from the content-addressed store, hash-verified

9497 * @param {Object} opts
9498 */
9499var Painter = function (root, storage, opts) {
9500
9501 this.type = 'canvas';
9502
9503 // In node environment using node-canvas
9504 var singleCanvas = !root.nodeName // In node ?
9505 || root.nodeName.toUpperCase() === 'CANVAS';
9506
9507 this._opts = opts = extend({}, opts || {});
9508
9509 /**
9510 * @type {number}
9511 */
9512 this.dpr = opts.devicePixelRatio || devicePixelRatio;
9513 /**
9514 * @type {boolean}
9515 * @private
9516 */
9517 this._singleCanvas = singleCanvas;
9518 /**
9519 * 绘图容器
9520 * @type {HTMLElement}
9521 */
9522 this.root = root;
9523
9524 var rootStyle = root.style;
9525
9526 if (rootStyle) {
9527 rootStyle['-webkit-tap-highlight-color'] = 'transparent';
9528 rootStyle['-webkit-user-select'] =
9529 rootStyle['user-select'] =
9530 rootStyle['-webkit-touch-callout'] = 'none';
9531
9532 root.innerHTML = '';
9533 }
9534
9535 /**
9536 * @type {module:zrender/Storage}
9537 */
9538 this.storage = storage;
9539
9540 /**
9541 * @type {Array.<number>}
9542 * @private
9543 */
9544 var zlevelList = this._zlevelList = [];
9545
9546 /**
9547 * @type {Object.<string, module:zrender/Layer>}
9548 * @private
9549 */
9550 var layers = this._layers = {};
9551
9552 /**
9553 * @type {Object.<string, Object>}
9554 * @private
9555 */
9556 this._layerConfig = {};

Callers

nothing calls this directly

Calls 4

initContextMethod · 0.80
pushMethod · 0.80
extendFunction · 0.70
createRootFunction · 0.70

Tested by

no test coverage detected