How to use the @antv/component.Annotation.Html function in @antv/component

To help you get started, we’ve selected a few @antv/component 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 / packages / g2 / __tests__ / unit / plot / controller / annotation-spec.js View on Github external
it('render', () => {
    controller.render(coord);
    expect(controller.annotations).to.have.lengthOf(7);
    expect(controller.get(0)).to.be.an.instanceOf(Annotation.Line);
    expect(controller.get(1)).to.be.an.instanceOf(Annotation.Image);
    expect(controller.get(2)).to.be.an.instanceOf(Annotation.Region);
    expect(controller.get(3)).to.be.an.instanceOf(Annotation.Text);
    expect(controller.get(4)).to.be.an.instanceOf(Annotation.Html);
    expect(controller.get(5)).to.be.an.instanceOf(Annotation.DataRegion);
    expect(controller.get(6)).to.be.an.instanceOf(Annotation.DataMarker);
    canvas.draw();
    expect(controller.frontgroundGroup.get('children')).to.have.lengthOf(3);
    expect(controller.backgroundGroup.get('children')).to.have.lengthOf(3);
    // html
    const dom = document.querySelector('.guide-annotation');
    expect(dom).to.be.an.instanceOf(HTMLElement);
  });