Skip to content

Commit cb02d55

Browse files
committed
llm friendly docs: add value context ref
1 parent fb1f231 commit cb02d55

File tree

3 files changed

+66
-6
lines changed

3 files changed

+66
-6
lines changed

dashjoin-docs/docs/appendix-widgets.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@ Used to visualize the result of any jsonata expression. Here, we display the val
44
```json
55
{
66
"widget" : "display",
7-
"print" : "variable.x"
7+
"display" : "variable.x"
8+
}
9+
```
10+
## display widget current database record
11+
Used to visualize the result of any jsonata expression. Here, we display the current record on an instance page
12+
```json
13+
{
14+
"widget" : "display",
15+
"display" : "value"
816
}
917
```
1018
## display widget showing object
1119
Used to visualize the result of any jsonata expression. Here, we display the current time as a key-value list
1220
```json
1321
{
1422
"widget" : "display",
15-
"print" : "{'time': $now()}"
23+
"display" : "{'time': $now()}"
1624
}
1725
```
1826
## display widget showing link
@@ -431,6 +439,24 @@ displays a chart based on a query or expression. the first column is used as lab
431439
"widget" : "chart"
432440
}
433441
```
442+
## chart widget
443+
chart with style options (see ChartJS)
444+
```json
445+
{
446+
"widget" : "chart",
447+
"query" : "orders-over-time",
448+
"database" : "northwind",
449+
"chart" : "bar",
450+
"style" : {
451+
"elements.bar.backgroundColor" : "green",
452+
"plugins.title.text" : "Orders in February",
453+
"plugins.title.display" : "true",
454+
"scales.x.type" : "time",
455+
"scales.x.min" : "1998-02-01",
456+
"scales.x.max" : "1998-02-28"
457+
}
458+
}
459+
```
434460
## datagrid widget
435461
Displays the result of a JSONata expression as an editable table. We have callbacks ondelete (context 'id' contains the primary key of the row to be deleted), onchange (updatedRow contains the new value of the row), and oncreate (no context is given - in this example, the code computes a new unique primary key by running select max(id) from table)
436462
```json

dashjoin-docs/llms/widget.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@
55
"description": "Used to visualize the result of any jsonata expression. Here, we display the value of the session variable x",
66
"code": {
77
"widget": "display",
8-
"print": "variable.x"
8+
"display": "variable.x"
9+
}
10+
},
11+
{
12+
"title": "display widget current database record",
13+
"description": "Used to visualize the result of any jsonata expression. Here, we display the current record on an instance page",
14+
"code": {
15+
"widget": "display",
16+
"display": "value"
917
}
1018
},
1119
{
1220
"title": "display widget showing object",
1321
"description": "Used to visualize the result of any jsonata expression. Here, we display the current time as a key-value list",
1422
"code": {
1523
"widget": "display",
16-
"print": "{'time': $now()}"
24+
"display": "{'time': $now()}"
1725
}
1826
},
1927
{

llms.txt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we di
77
LANGUAGE: json
88
CODE: {
99
"widget" : "display",
10-
"print" : "variable.x"
10+
"display" : "variable.x"
11+
}
12+
13+
TITLE: display widget current database record
14+
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display the current record on an instance page
15+
LANGUAGE: json
16+
CODE: {
17+
"widget" : "display",
18+
"display" : "value"
1119
}
1220

1321
TITLE: display widget showing object
1422
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display the current time as a key-value list
1523
LANGUAGE: json
1624
CODE: {
1725
"widget" : "display",
18-
"print" : "{'time': $now()}"
26+
"display" : "{'time': $now()}"
1927
}
2028

2129
TITLE: display widget showing link
@@ -416,6 +424,24 @@ CODE: {
416424
"widget" : "chart"
417425
}
418426

427+
TITLE: chart widget
428+
DESCRIPTION: chart with style options (see ChartJS)
429+
LANGUAGE: json
430+
CODE: {
431+
"widget" : "chart",
432+
"query" : "orders-over-time",
433+
"database" : "northwind",
434+
"chart" : "bar",
435+
"style" : {
436+
"elements.bar.backgroundColor" : "green",
437+
"plugins.title.text" : "Orders in February",
438+
"plugins.title.display" : "true",
439+
"scales.x.type" : "time",
440+
"scales.x.min" : "1998-02-01",
441+
"scales.x.max" : "1998-02-28"
442+
}
443+
}
444+
419445
TITLE: datagrid widget
420446
DESCRIPTION: Displays the result of a JSONata expression as an editable table. We have callbacks ondelete (context 'id' contains the primary key of the row to be deleted), onchange (updatedRow contains the new value of the row), and oncreate (no context is given - in this example, the code computes a new unique primary key by running select max(id) from table)
421447
LANGUAGE: json

0 commit comments

Comments
 (0)