Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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
The npm package canvas-comment receives a total of 9 weekly downloads. As such, canvas-comment popularity was classified as not popular.
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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.