Skip to content

Commit

Permalink
document graph and chat widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
aeberhart committed Mar 19, 2024
1 parent fa82232 commit 1505990
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions dashjoin-docs/docs/developer-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ The key specifies the action button's label, the value contains the expression t
* expression: allows configuring the widget data via JSONata which must evaluate to an array of objects. Note that the table is able to display links, images, and lists thereof. Please refer to the display widget for information on how the JSON data must be structured. If omitted, the widget uses $query(database, query, arguments)
* properties: a set of key value pairs. For every key, an action button with the key used as its label is displayed. When the button is pressed, the JSONata expression specified in the value is run

#### aichat

Chatbot widget for interacting with large language models.

* url: LLM Service URL or function name
* name: Chatbot name
* tagline: Chatbot tagline
* logo: Logo URL
* system_prompt: AI system prompt

#### chart

Chart for visualizing query results.
Expand Down Expand Up @@ -205,6 +215,45 @@ Allows editing related records of a database record:
* prop: foreign key column on the related table
* columns: columns to display in the editRelated table display

#### graph

Displays data as a directed graph

* nodes: expression to generate nodes, this can either be the result of an OpenCypher query or a list of nodes
* _3d: if true, displays the graph in 3D, 2D otherwise

To add a single starting node, you can simply use the following expression for "nodes":

```text
{
"database": "northwind",
"table": "EMPLOYEES",
"pk": [1]
}
```

To add all employees, you can select all employee IDs and convert them into resource objects as shown above:

```text
$all("northwind", "EMPLOYEES").EMPLOYEE_ID.{
"database": "northwind",
"table": "EMPLOYEES",
"pk": [$]
}
```

Alternatively, you can use an OpenCypher query:

```text
$adHocQueryGraph("*", "MATCH (e:EMPLOYEES) return e").e
```

The previous examples only added nodes to the canvas. You can use OpenCypher to pre-select a path:

```text
$adHocQueryGraph("*", "MATCH path=(e:EMPLOYEES) -[REPORTS_TO]-> (x) return path").path
```

#### [html](https://demo.my.dashjoin.com/#/page/html)

Displays custom HTML
Expand Down

0 comments on commit 1505990

Please sign in to comment.