Socket
Socket
Sign inDemoInstall

@verygoodgraphics/vgg-react

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@verygoodgraphics/vgg-react

## Usage


Version published
Weekly downloads
1
decreased by-98.36%
Maintainers
0
Weekly downloads
 
Created
Source

VGG React

Usage

<VGGRender />

import { VGGRender } from "@verygoodgraphics/vgg-react"

return (
  <VGGRender
    src="https://s3.vgg.cool/test/vgg.daruma"
    canvasStyle={{
      width: "50vw",
      height: "100vh",
    }}
    onLoad={async (_, instance) => {
      instance.$("2:94").on(EventType.Click, async () => {
        window.alert("Hello, VGG!")
      })
    }}
  />
)

useVGG()

import { useVGG } from "@verygoodgraphics/vgg-react"

const { canvasRef, vgg, isLoading } = useVGG({
  src: "https://s3.vgg.cool/test/vgg.daruma",
})

useEffect(() => {
  if (isLoading || !vgg.current) return
  vgg.current?.$("2:94").on(EventType.Click, async () => {
    window.alert("Hello, VGG!")
  })
}, [isLoading])

return (
  <canvas
    ref={canvasRef}
    style={{
      width: "50vw",
      height: "100vh",
    }}
  />
)

API

Options for useVGG()

OptionTypeRequiredDefault
srcstring--
runtimestring-https://s5.vgg.cool/runtime/latest
editModeboolean-false
verboseboolean-false
onLoadEventCallback--
onLoadErrorEventCallback--
onStateChangeEventCallback--

Props for <VGGRender />

OptionTypeRequiredDefault
srcstring--
runtimestring-https://s5.vgg.cool/runtime/latest
canvasStyleReact.CSSProperties--
editModeboolean-false
verboseboolean-false
onLoad(event: VGGEvent, instance: VGG<T>) => Promise<void>--
onLoadError(event: VGGEvent) => Promise<void>--
onStateChange(event: VGGEvent, instance: VGG<T>) => Promise<void>--

FAQs

Package last updated on 01 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc