Socket
Socket
Sign inDemoInstall

@antv/g-plugin-canvas-renderer

Package Overview
Dependencies
7
Maintainers
64
Versions
219
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @antv/g-plugin-canvas-renderer

A G plugin of renderer implementation with Canvas2D API


Version published
Weekly downloads
16K
increased by9.12%
Maintainers
64
Created
Weekly downloads
 

Readme

Source

@antv/g-plugin-canvas-renderer

使用 CanvasRenderingContext2D 绘制各类图形。

包含了两个插件:

  1. CanvasRendererPlugin 实现了以下 hook:

    1. beginFrame 保存上下文,如果开启了脏矩形渲染,创建脏矩形对应的 clip rect 并擦除
    2. renderFrame 绘制各个图形,如果开启了脏矩形渲染,仅在该区域内重绘
    3. endFrame 恢复上下文
  2. LoadImagePlugin 负责加载图片,实现了以下 hook:

    1. mounted Image 图形首次进入画布,异步加载包含的图片
    2. attributeChanged 如果 Image 图形的图片地址发生改变,重新加载图片

Keywords

FAQs

Last updated on 24 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc