Skip to content

Commit

Permalink
move controls to bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslaneconkling committed Jan 18, 2021
1 parent 85a51f0 commit 01c5297
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/hierarchy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Stats from 'stats.js'
import * as Hierarchy from '../../src/layout/hierarchy'
import * as Force from '../../src/layout/force'
import * as Graph from '../../src/'
import * as Zoom from '../../src/controls/zoom'
import * as Zoom from '../../src/renderers/webgl/bindings/native/zoom'
import * as WebGL from '../../src/renderers/webgl'
import graphData from '../../data/tmp-data'

Expand Down
4 changes: 2 additions & 2 deletions examples/pixi-perf/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Stats from 'stats.js'
import * as Force from '../../src/layout/force'
import * as Graph from '../../src/'
import * as Zoom from '../../src/controls/zoom'
import * as Download from '../../src/controls/download'
import * as Zoom from '../../src/renderers/webgl/bindings/native/zoom'
import * as Download from '../../src/renderers/webgl/bindings/native/download'
import * as WebGL from '../../src/renderers/webgl'
import * as Png from '../../src/renderers/image'
import graphData from '../../data/tmp-data'
Expand Down
2 changes: 1 addition & 1 deletion examples/pixi-render-perf/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Stats from 'stats.js'
import * as Force from '../../src/layout/force'
import * as Zoom from '../../src/controls/zoom'
import * as Zoom from '../../src/renderers/webgl/bindings/native/zoom'
import * as Graph from '../../src'
import * as WebGL from '../../src/renderers/webgl'
import graphData from '../../data/tmp-data'
Expand Down
6 changes: 3 additions & 3 deletions examples/pixi/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Stats from 'stats.js'
import * as Force from '../../src/layout/force'
import * as Subgraph from '../../src/layout/subgraph'
import * as Zoom from '../../src/controls/zoom'
import * as Selection from '../../src/controls/selection'
import * as Download from '../../src/controls/download'
import * as Zoom from '../../src/renderers/webgl/bindings/native/zoom'
import * as Selection from '../../src/renderers/webgl/bindings/native/selection'
import * as Download from '../../src/renderers/webgl/bindings/native/download'
import * as Cluster from '../../src/layout/cluster'
import * as WebGL from '../../src/renderers/webgl'
import * as Png from '../../src/renderers/image'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ViewportDragDecelerateEvent, ViewportDragEvent, ViewportPointerEvent } from '../renderers/webgl'
import { ViewportDragDecelerateEvent, ViewportDragEvent, ViewportPointerEvent } from '../..'


const DEFAULT_TOP = '100px'
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/renderers/webgl/bindings/react/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { createElement, FunctionComponent } from 'react'
import { ButtonGroup } from './buttonGroup'


export { clampZoom } from '../../../../controls/zoom'


export type Props = {
onZoomIn?: () => void
onZoomOut?: () => void
}


export const clampZoom = (min: number, max: number, zoom: number) => Math.max(min, Math.min(max, zoom))


// TODO - memoize, disable on min/max zoom
export const Zoom: FunctionComponent<Props> = (props) => {

Expand Down

0 comments on commit 01c5297

Please sign in to comment.