Skip to content

Commit

Permalink
chore(deps): upgrade packages
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Sep 3, 2019
1 parent 8938b29 commit ec6e42e
Show file tree
Hide file tree
Showing 4 changed files with 401 additions and 267 deletions.
3 changes: 2 additions & 1 deletion demo/examples/Focal.tsx
@@ -1,5 +1,6 @@
import React, { useEffect, useRef } from 'react'
import Panzoom from '../../src/panzoom'
import { PanzoomObject } from '../../src/types'
import Code from '../Code'
import Demo from '../Demo'

Expand All @@ -21,7 +22,7 @@ parent.addEventListener('wheel', function(event) {

export default function Focal() {
const elem = useRef<HTMLDivElement>(null)
const panzoomRef = useRef<Panzoom>(null)
const panzoomRef = useRef<PanzoomObject>(null)
let panzoom = panzoomRef.current
useEffect(() => {
panzoom = panzoomRef.current = Panzoom(elem.current)
Expand Down
3 changes: 2 additions & 1 deletion demo/examples/SVG.tsx
@@ -1,5 +1,6 @@
import React, { useEffect, useRef } from 'react'
import Panzoom from '../../src/panzoom'
import { PanzoomObject } from '../../src/types'
import Code from '../Code'
import Demo from '../Demo'

Expand All @@ -9,7 +10,7 @@ paths.forEach(Panzoom)`}</Code>
)

export default function SVG() {
const panzoomsRef = useRef<Panzoom[]>(null)
const panzoomsRef = useRef<PanzoomObject[]>(null)
let panzooms = panzoomsRef.current
useEffect(() => {
const paths: NodeListOf<SVGPathElement> = document.querySelectorAll('svg.panzoom path')
Expand Down
9 changes: 5 additions & 4 deletions demo/examples/Standard.tsx
@@ -1,5 +1,6 @@
import React, { useEffect, useRef } from 'react'
import Panzoom from '../../src/panzoom'
import { PanzoomObject } from '../../src/types'
import Code from '../Code'
import Demo from '../Demo'

Expand All @@ -19,7 +20,7 @@ rangeInput.addEventListener('input', (event) => {
export default function Buttons() {
const elem = useRef<HTMLDivElement>(null)
const range = useRef<HTMLInputElement>(null)
const panzoomRef = useRef<Panzoom>(null)
const panzoomRef = useRef<PanzoomObject>(null)
let panzoom = panzoomRef.current
useEffect(() => {
panzoom = panzoomRef.current = Panzoom(elem.current)
Expand All @@ -31,21 +32,21 @@ export default function Buttons() {
<button
onClick={() => {
panzoom.zoomIn()
range.current.value = panzoom.getScale()
range.current.value = panzoom.getScale() + ''
}}>
Zoom in
</button>
<button
onClick={() => {
panzoom.zoomOut()
range.current.value = panzoom.getScale()
range.current.value = panzoom.getScale() + ''
}}>
Zoom out
</button>
<button
onClick={() => {
panzoom.reset()
range.current.value = panzoom.getScale()
range.current.value = panzoom.getScale() + ''
}}>
Reset
</button>
Expand Down

0 comments on commit ec6e42e

Please sign in to comment.