- 
                Notifications
    You must be signed in to change notification settings 
- Fork 326
Open
Description
Expected Behavior (Mandatory)
The visualization should update with the nodes and relationships from the response.
Actual Behavior (Mandatory)
Nothing happens, but the same query when executed with updateWithCypher function updates the visualization and shows the right nodes and relationships.
How to Reproduce the Problem
By using this query -
MATCH (p) where ID(p) = ${nodeId}
      CALL apoc.path.subgraphAll(p, {
          minLevel: 0,
          maxLevel: 1
      })
      YIELD nodes, relationships
      RETURN nodes, relationshipsand capturing the result in a variable and passing it to updateWithFunction.
Simple Example
const config: NeovisConfig = {
  visConfig: {
    height: '100%',
    width: '100%',
    interaction: {
      hover: true,
      hoverConnectedEdges: true,
      selectConnectedEdges: false,
      multiselect: true,
      zoomView: true,
    },
    physics: {
      barnesHut: {
        gravitationalConstant: -50000,
        avoidOverlap: 0.4,
      },
    },
    nodes: {
      shape: 'circle',
      widthConstraint: 80,
    },
    edges: {
      hoverWidth: 2,
      selectionWidth: 0,
      smooth: {
        enabled: true,
        type: 'continuous',
        roundness: 0.15,
      },
      arrows: {
        to: {
          enabled: true,
          type: 'arrow',
          scaleFactor: 0.5,
        },
      },
    },
  },
  groupAsLabel: true,
  initialCypher: 'MATCH (n) RETURN n',
}
Node id can come from the clicked event mentioned below.
const result =  <result of this query - MATCH (p) where ID(p) = ${nodeId}
      CALL apoc.path.subgraphAll(p, {
          minLevel: 0,
          maxLevel: 1
      })
      YIELD nodes, relationships
      RETURN nodes, relationships
}>
vis.registerOnEvent(NeoVisEvents.ClickNodeEvent, e => {
  vis.updateWithFunction(() => result)
})Specifications (Mandatory)
Currently used versions
Versions
- OS:macOS
- Library: 2.1.0
- Neo4j: 5.9
Metadata
Metadata
Assignees
Labels
No labels