
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
@hasma/react-drawing-board
Advanced tools
Browser drawing board created with canvas and React.
A browser-ready efficient drawing board.
React Drawing board uses a CMD so you can use it in NPM as well. npm install
this package and
const DrawingBoard = require('react-drawing-board');
<DrawingBoard />
const Demo: React.FC = () => {
const [operations, setOperations] = useState<Operation[]>([]);
return (
<DrawingBoard
userId="user1" // identify for different players.
operations={operations}
onChange={(newOperation, afterOperation) => {
console.log(`TODO: send ${newOperation}`);
setOperations(afterOperation);
}}
/>
)
}
Props | Description | Type | Default |
---|---|---|---|
userId(optional) | identify for operation source | string | uuid.v4() |
locale(optional) | 'en-US', 'zh-CN', 'tr-TR' | string | navigator.language |
operations(optional) | operations on drawing board | Operation[] | undefined |
onChange(optional) | called when user draw some operations | (newOperaton: Operation, operationsAfter: Operation[]) => void | undefined |
onSave(image) | called when user click save button for saving current view | (image: { canvas: HTMLCanvasElement, dataUrl: string }) => void | undefined |
style(optional) | element style | CSSProperties | undefined |
className(optional) | element classname | string | undefined |
toolbarPlacement(optional) | the position of toolbar | 'top' or 'left' or 'right' | 'top' |
viewMatrix(optional) | control the current perspective | undefined | |
onViewMatrixChange(optional) | (viewMatrix: ViewMatrix) => void | undefined |
FAQs
Browser drawing board created with canvas and React.
We found that @hasma/react-drawing-board 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.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.