Skip to content

Instantly share code, notes, and snippets.

@ikwattro
Last active November 12, 2019 16:55
Show Gist options
  • Save ikwattro/93ff5fd14361da3b1947e96d206172f7 to your computer and use it in GitHub Desktop.
Save ikwattro/93ff5fd14361da3b1947e96d206172f7 to your computer and use it in GitHub Desktop.
CREATE (n:HumeAction)
SET n.id = 'hume_action_chart'
SET n.data = '{
  "label": "Show Demand",
  "returnType": "CHART",
  "scope": "LOCAL",
  "id": "hume_action_chart",
  "action": {
    "statement": "MATCH (n:Product) WHERE id(n) = $id 
MATCH (n)<-[:FOR_PRODUCT]-(order) 
WITH n, order ORDER BY order.date ASC 
RETURN collect({time: order.date, qty: order.demand}) AS values, 
\'bar\' as chartType, 
{x: {field: \'time\', type: \'nominal\'}, y: {field: \'qty\', type: \'quantitative\'}} AS options",
    "parameters": {
      "id": {
        "type":"node",
        "resolution":"single"
      }
    }
  }
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment