Skip to content

Feature: Optionally pass query results to binding functions #11

@yGuy

Description

@yGuy

Sometimes, you make a query and the query contains additional data, like simple scalars (sums, averages, or anything you calculated on the database) and you want to use that information to drive the visualization.

A possible approach would be to allow an optional second argument to the binding functions that receives the result of the cypher query so you could do something along the lines of the following:

def heat_mapping(element, results):
      amount = element['properties']['some_amount']
      normalized_value = (amount - results['min_amount']) / (results['max_amount'] - results['min_amount'])
      return normalized_value

...

g.show_cypher(
"""
MATCH (n:SomeLabel)
RETURN n, MIN(n.some_amount) AS min_amount, MAX(n.some_amount) AS max_amount
"""  
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions