Skip to content

Commit 3981f51

Browse files
committed
fix: add missing export for Rdf and Json
They were used to create the GrapgBuilder but not exported directly
1 parent c81f2d8 commit 3981f51

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

packages/all/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export * from '@committed/components-graph-react'
55
import { Json } from '@committed/graph-json'
66
import { Rdf } from '@committed/graph-rdf'
77

8+
export { Json, Rdf }
9+
810
export const GraphBuilder = {
911
fromJsonGraph: Json.buildGraph,
1012
fromRdfGraph: Rdf.buildGraph,

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)