Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@antv/g-mobile
Advanced tools
定义了基于 Canvas2D 的上下文,内置以下插件:
ContextRegisterPlugin
提供小程序环境下的上下文服务import { Canvas } from '@antv/g';
import { Renderer } from '@antv/g-mobile';
// 创建渲染器
const renderer = new Renderer();
// 创建画布
const canvas = new Canvas({
canvas: {
getContext: () => {
// 模拟 DOM API,返回小程序 context,它应当和 Canvas2DRenderingContext 一致
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/getContext
return context;
},
getBoundingClientRect: () => {
// 模拟 DOM API,返回小程序 context 相对于视口的位置
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
return rect;
},
},
renderer,
//(可选)传入原本 DOM 环境下需要通过 window 获取的属性和方法,例如 dpr、rAF 等
// @see https://g-next.antv.vision/zh/docs/api/canvas#devicepixelratio
devicePixelRatio: 2,
requestAnimationFrame,
cancelAnimationFrame,
});
// 正常创建图形并添加到画布
FAQs
A renderer implemented with Canvas2D API in mobile environment
The npm package @antv/g-mobile receives a total of 20 weekly downloads. As such, @antv/g-mobile popularity was classified as not popular.
We found that @antv/g-mobile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 58 open source maintainers collaborating on the project.
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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.