Skip to content

Commit fa36b54

Browse files
author
José Renato Ramos González
authored
Update README.md
1 parent 7fe0bdc commit fa36b54

1 file changed

Lines changed: 58 additions & 48 deletions

File tree

README.md

Lines changed: 58 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,65 @@ query (or query template) as a table.
77

88
## Configuration
99

10-
These are the configuration keys that need to be set in the plugin
11-
configuration, via the Linkurious Configuration.
12-
13-
- `entityType` (**required**, `"edge"` or `"node"`): whether to display
14-
nodes or edges in the table (e.g. `"node"`).
15-
- `itemType` (**required**, string): name of the node-category or
16-
edge-type to display in the table (e.g. `"COMPANY"`).
17-
- `properties` (**optional**, array): property names to include in the
18-
table (e.g. `["name", "age", "date_of_birth"]`). Defaults to all
19-
properties of the configured `itemType`.
20-
- `basePath` (**optional**, string): URL path in which the plugin will
21-
be deployed (e.g. `"my-plugin"`). Defaults to plugin name.
22-
23-
Full configuration example:
24-
```json
25-
{
26-
"data-table": {
27-
"basePath": "table",
28-
"entityType": "node",
29-
"itemType": "Company",
30-
"properties": ["name", "address", "vat_number"]
31-
}
32-
}
33-
```
10+
This plugin supports the following configuration keys:
11+
12+
| Key | Type | Description | Example |
13+
| :-- | :-- | :-- | :-- |
14+
| `basePath` | string (**optional**) | A base path on which the plugin will be mounted. Defaults to `"data-plugin"`. | `"table"` |
15+
| `debugPort` | number (**optional**) | A debug port on which to attach a debugger for the plugin NodeJS process. | `9230` |
16+
| `entityType` | "edge" \| "node" (**required**) | Whether to display nodes or edges in the table. | `"node"` |
17+
| `itemType` | string (**optional**) | Name of the node category or edge type to display in the table. | `"Company"` |
18+
| `properties` | string\[] (**optional**) | Property names to include in the table. Defaults to all the properties of `itemType`. | `["name", "address", "vat_number"]` |
19+
20+
Full configuration example, via the [Linkurious Configuration](https://doc.linkurio.us/admin-manual/latest/configure/):
21+
<img width="1036" alt="Screenshot 2021-03-09 at 18 59 07" src="https://user-images.githubusercontent.com/11739632/110516230-9508c200-8109-11eb-9fae-1218010597f6.png">
3422

3523
## URL parameters
3624

37-
These are the URL parameters that this plugin accepts:
38-
39-
- `queryId` (**required**, integer): query to run (e.g. `queryId=26`).
40-
- `sourceKey` (**required**, string): Key of the data-source to run the
41-
query on (e.g. `sourceKey=b16e9ed5`).
42-
- `limit` (**optional**, integer): maximum number of results to display
43-
(e.g. `limit=1000`).
44-
- `param_number_PARAM NAME` (**optional**, number): *for query
45-
templates*, any numerical parameter of the template (e.g.
46-
`param_number_my%20number=123`).
47-
- `param_string_PARAM NAME` (**optional**, string): *for query
48-
templates*, any string parameter of the template (e.g.
49-
`param_string_my%20param=abc`).
50-
- `param_ids_PARAM NAME` (**optional**, comma-separated list): *for
51-
query templates*, any edgeset/nodeset parameter of the template (e.g.
52-
`param_ids_my%20id%20list=1,2,3`).
53-
54-
Full URL example (line breaks for readability):
55-
```
56-
https://linkurious.example.com/plugins/data-table
57-
?queryId=26
58-
&sourceKey=b16e9ed5
59-
&limit=1000
60-
&param_string_city=Paris
25+
This plugin supports the following URL parameters in the query string:
26+
27+
| Param | Type | Description | Example |
28+
| :-- | :-- | :-- | :-- |
29+
| `queryId` | integer (**required**) | ID of the query to run. | `queryId=87` |
30+
| `sourceKey` | string (**required**) | Key of the data-source to run the query on. | `sourceKey=b16e9ed5` |
31+
| `limit` | integer (**optional**) | Maximum number of results to display. | `limit=500` |
32+
| `param_number_{{Encoded field name}}` | number (**optional**) | *For query templates*, any numerical parameter of the template | `param_number_age=30` |
33+
| `param_string_{{Encoded field name}}` | string (**optional**) | *For query templates*, any string parameter of the template | `param_string_city=Paris` |
34+
| `param_ids_{{Encoded field name}}` | comma-separated list (**optional**) | *For query templates*, any edgeset/nodeset parameter of the template | `param_ids_target_ids=1,50,12` |
35+
36+
## Usage with standard queries
37+
38+
In order to display the result of a standard query in a table:
39+
40+
1. Create a standard READ query. For example: `MATCH (n) return n LIMIT 1000`.
41+
2. Note down the newly-created query ID, it will by the value of `queryId`. For example: `queryId=87`.
42+
3. Compose a valid data-table plugin URL and open it in a new tab.
43+
44+
You can either manually complete and open the following URL:
45+
```
46+
<your LKE base URL>/plugins/table?queryId=87&sourceKey=<a data-source key>
47+
```
48+
Or you can create the following [Custom Action](https://doc.linkurio.us/user-manual/latest/custom-actions/):
49+
```
50+
{{baseUrl}}plugins/table?queryId=87&sourceKey={{sourceKey}}
51+
```
52+
*When running a Custom Action, it will replace `{{baseUrl}}` and `{{sourceKey}}` for your LKE base URL and your current data-source key, respectively.*
53+
54+
## Usage with query templates
55+
56+
In order to display the result of a query template in a table:
57+
58+
1. Create a READ query template. For example: `MATCH (n) where n.city={{"City Name":string}} return n LIMIT 1000`.
59+
2. Note down the newly-created query ID, it will by the value of `queryId`. For example: `queryId=19`.
60+
2. Note down each field title, encode it, prepend it accordingly with a valid URL parameter and give it a value. For example: `param_string_City%20Name=Paris`.
61+
3. Compose a valid data-table plugin URL and open it in a new tab.
62+
63+
You can either manually complete and open the following URL:
64+
```
65+
<your LKE base URL>/plugins/table?queryId=19&sourceKey=<a data-source key>&param_string_City%20Name=Paris
66+
```
67+
Or you can create the following [Custom Action](https://doc.linkurio.us/user-manual/latest/custom-actions/):
68+
```
69+
{{baseUrl}}plugins/table?queryId=19&sourceKey={{sourceKey}}&param_string_City%20Name=Paris
6170
```
71+
*When running a Custom Action, it will replace `{{baseUrl}}` and `{{sourceKey}}` for your LKE base URL and your current data-source key, respectively.*

0 commit comments

Comments
 (0)