Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
canvas-comment
Advanced tools
Canvas Comment
use npm
npm i canvas-comment
import CanvasComment from 'canvas-comment';
const cc = new CanvasComment({
container: '.container',
image: 'https://cdn-health.zhongan.com/hic/library/resource/613b041f23e187001cab3a3f/diaCLksvKr.png',
});
// When canvas loaded will trigger load event
cc.on('load', () => {
// You can set inital data. ex.
cc.setData([
{
type: 'rect',
label: '这里不合规',
coor: [
[128, 687],
[617, 722],
],
},
{
type: 'rect',
label: '率表有误',
coor: [
[381, 503],
[669, 531],
],
},
]);
});
属性 | 默认值 | 默认值 | 是否必填 | 说明 |
---|---|---|---|---|
container | - | - | 是 | canvas 容器 |
image | - | - | 是 | 要渲染的图片 |
setData(data: Shape[]) // 设置批注
update() // 更新视图
clean() // 清空批注
on(event: string, fn: Function) // 事件监听
createType: string // 设置当前批注类型
readonly: boolean // 设置只读状态
createLabelFillStyle: string // 设置当前批注文本的颜色
createRectStrokeStyle: string // 设置当前批注形状线条的颜色
activeShape: Shape // 获取/设置当前激活状态的批注
dataset: Shape[] // 获取当前批注内容
属性 | 类型 | 默认值 | 说明 |
---|---|---|---|
type | string | - | 批注类型 |
label | string | - | 批注文字 |
coor | Array<[number, number]> | - | 点位坐标信息 |
cc.on('load', () => {
// ...do something
});
FAQs
canvas-comment
We found that canvas-comment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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.