MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / createDom

Function createDom

libs/echarts/echarts.simple.js:7264–7284  ·  view source on GitHub ↗

* 创建dom * * @inner * @param {string} id dom id 待用 * @param {Painter} painter painter instance * @param {number} number

(id, painter, dpr)

Source from the content-addressed store, hash-verified

7262 * @param {number} number
7263 */
7264function createDom(id, painter, dpr) {
7265 var newDom = createCanvas();
7266 var width = painter.getWidth();
7267 var height = painter.getHeight();
7268
7269 var newDomStyle = newDom.style;
7270 if (newDomStyle) { // In node or some other non-browser environment
7271 newDomStyle.position = 'absolute';
7272 newDomStyle.left = 0;
7273 newDomStyle.top = 0;
7274 newDomStyle.width = width + 'px';
7275 newDomStyle.height = height + 'px';
7276
7277 newDom.setAttribute('data-zr-dom-id', id);
7278 }
7279
7280 newDom.width = width * dpr;
7281 newDom.height = height * dpr;
7282
7283 return newDom;
7284}
7285
7286/**
7287 * @alias module:zrender/Layer

Callers 2

LayerFunction · 0.70
echarts.simple.jsFile · 0.70

Calls 3

createCanvasFunction · 0.70
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected