Skip to content

Commit 9bddafe

Browse files
Merge pull request #59 from commitd/stuarthendren/peer
fix: add missing export for Rdf and Json
2 parents 9db3a62 + 3981f51 commit 9bddafe

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

packages/react/src/graph/renderer/CytoscapeRenderer.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,20 @@ function toSelector(prefix: 'node' | 'edge', id: string): string {
7474
}
7575

7676
export interface CyGraphRendererOptions extends GraphRendererOptions {
77-
renderOptions: Pick<
78-
React.ComponentProps<typeof CytoscapeComponent>,
79-
| 'zoom'
80-
| 'minZoom'
81-
| 'maxZoom'
82-
| 'pan'
83-
| 'zoomingEnabled'
84-
| 'userZoomingEnabled'
85-
| 'boxSelectionEnabled'
86-
| 'autoungrabify'
87-
| 'autounselectify'
88-
| 'wheelSensitivity'
77+
renderOptions?: Partial<
78+
Pick<
79+
React.ComponentProps<typeof CytoscapeComponent>,
80+
| 'zoom'
81+
| 'minZoom'
82+
| 'maxZoom'
83+
| 'pan'
84+
| 'zoomingEnabled'
85+
| 'userZoomingEnabled'
86+
| 'boxSelectionEnabled'
87+
| 'autoungrabify'
88+
| 'autounselectify'
89+
| 'wheelSensitivity'
90+
>
8991
>
9092
}
9193

@@ -307,7 +309,7 @@ const Renderer: GraphRenderer<CyGraphRendererOptions>['render'] = ({
307309
if (cytoscape == null) {
308310
return
309311
}
310-
const zoomAmount = 1 + (options.renderOptions.wheelSensitivity ?? 1)
312+
const zoomAmount = 1 + (options.renderOptions?.wheelSensitivity ?? 1)
311313
const position = { x: cytoscape.width() / 2, y: cytoscape.height() / 2 }
312314
commands.forEach((c) => {
313315
switch (c.type) {

0 commit comments

Comments
 (0)