🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

selectable-grid

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selectable-grid

selectable-grid

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

selectable-grid

Install

npm install --save selectable-grid

Usage example

import SelectableGrid from 'selectable-grid'

const init = () => {
  const img = document.querySelector('img')

  if (!img) {
    return
  }

  img.addEventListener('load', () => {
    new SelectableGrid({
      container: img,
      cellCount: 15,
    })
  })
}

init()

Properties

PropertyRequiredTypeDescription
containertrueHTMLImageElement | HTMLVideoElementimg or video node
cellCounttruenumbercount of the cell in the grid
mouseMovefalsefunction(area: {x: number, y: number, w: number, h: number}, selectArea: {x: number, y: number, w: number, h: number}, e: MouseEvent){}handler of mouse move on the grid
mouseDownfalse(point: {x: number, y:number}, e: MouseEvent) => voidhandler of mouse down on the grid
mouseUpfalse(area: {x: number, y: number, w: number, h: number}, selectArea: {x: number, y: number, w: number, h: number}, e: MouseEvent) => voidhandler of mouse up on the grid
cellsStylesfalse{fillStyle: string}color like as color for canvas
gridStylesfalse{strokeStyle: string}color like as color for canvas
areaStylesfalse{strokeStyle: string, fillStyle: string}color like as color for canvas
isAreafalsebooleanshow area on the grid
keepAreafalsebooleanshow area on the grid
isCellsfalsebooleanrender cells on the grid
isGridfalsebooleanrender grid on the grid
canvasClassNamefalsestringclass name of the canvas

Another packages

@selectable-grid/react

@selectable-grid/vue

Keywords

canvas

FAQs

Package last updated on 18 Jan 2023

Did you know?

Socket

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.

Install

Related posts