Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.