How to use the @antv/g.DomUtil.createDom function in @antv/g

To help you get started, we’ve selected a few @antv/g examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / G2 / src / component / guide / html.js View on Github external
render(coord, group) {
    const self = this;
    const position = self.parsePoint(coord, self.position);

    const parentNode = group.get('canvas').get('el').parentNode;
    const wrapperNode = DomUtil.createDom('<div class="g-guide"></div>');
    parentNode.appendChild(wrapperNode);

    let html = self.html;
    if (Util.isFunction(html)) {
      html = html(self.xScales, self.yScales);
    }
    const htmlNode = DomUtil.createDom(html);
    wrapperNode.appendChild(htmlNode);
    self._setDomPosition(wrapperNode, htmlNode, position);
    self.el = wrapperNode;
  }
github antvis / G2 / src / component / guide / html.js View on Github external
render(coord, group) {
    const self = this;
    const position = self.parsePoint(coord, self.position);

    const parentNode = group.get('canvas').get('el').parentNode;
    const wrapperNode = DomUtil.createDom('<div class="g-guide"></div>');
    parentNode.appendChild(wrapperNode);

    let html = self.html;
    if (Util.isFunction(html)) {
      html = html(self.xScales, self.yScales);
    }
    const htmlNode = DomUtil.createDom(html);
    wrapperNode.appendChild(htmlNode);
    self._setDomPosition(wrapperNode, htmlNode, position);
    self.el = wrapperNode;
  }