Skip to content

Commit f1e5762

Browse files
author
Renato Ramos G
authored
post review
1 parent fa36b54 commit f1e5762

1 file changed

Lines changed: 25 additions & 24 deletions

File tree

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,30 @@ query (or query template) as a table.
77

88
## Configuration
99

10-
This plugin supports the following configuration keys:
10+
You can configure a plugin via the [Linkurious Configuration](https://doc.linkurio.us/admin-manual/latest/configure/).
11+
12+
Configuration keys supported by all the plugins:
13+
| Key | Type | Description | Example |
14+
| :-- | :-- | :-- | :-- |
15+
| `basePath` | string (**optional**) | A base path on which the plugin will be mounted. Defaults to [the manifest name](https://github.com/Linkurious/lke-plugin-data-table/blob/master/manifest.json#L2). | `"table"` |
16+
| `debugPort` | number (**optional**) | A debug port on which to attach a debugger for the plugin NodeJS process. If not specfified, the plugin won't be started in debug mode. | `9230` |
17+
18+
Configuration keys supported only by the data-table plugin:
1119

1220
| Key | Type | Description | Example |
1321
| :-- | :-- | :-- | :-- |
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` |
1622
| `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"` |
23+
| `itemType` | string (**required**) | Name of the node category or edge type to display in the table. | `"Company"` |
1824
| `properties` | string\[] (**optional**) | Property names to include in the table. Defaults to all the properties of `itemType`. | `["name", "address", "vat_number"]` |
1925

20-
Full configuration example, via the [Linkurious Configuration](https://doc.linkurio.us/admin-manual/latest/configure/):
26+
Configuration example for 1 data-table instance accesible via `/plugins/table`:
2127
<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">
2228

29+
Configuration example for 2 data-table instances accesible via `/plugins/table` and `/plugins/edgeTable`:
30+
<img width="1031" alt="Screenshot 2021-03-10 at 15 16 40" src="https://user-images.githubusercontent.com/11739632/110642781-a4444a00-81b3-11eb-9864-919916648db9.png">
31+
32+
*You can run multiple data-table instances by passing an array with unique `basePath` per config.*
33+
2334
## URL parameters
2435

2536
This plugin supports the following URL parameters in the query string:
@@ -33,39 +44,29 @@ This plugin supports the following URL parameters in the query string:
3344
| `param_string_{{Encoded field name}}` | string (**optional**) | *For query templates*, any string parameter of the template | `param_string_city=Paris` |
3445
| `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` |
3546

36-
## Usage with standard queries
47+
### Usage with standard queries
3748

3849
In order to display the result of a standard query in a table:
3950

4051
1. Create a standard READ query. For example: `MATCH (n) return n LIMIT 1000`.
4152
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/):
53+
3. Compose a valid data-table plugin URL and open it in a new tab. For example:
4954
```
5055
{{baseUrl}}plugins/table?queryId=87&sourceKey={{sourceKey}}
5156
```
52-
*When running a Custom Action, it will replace `{{baseUrl}}` and `{{sourceKey}}` for your LKE base URL and your current data-source key, respectively.*
57+
You can save this URL as a [Custom Action](https://doc.linkurio.us/user-manual/latest/custom-actions/), and when triggered, the `{{baseUrl}}` and `{{sourceKey}}` will be replaced with your LKE base URL and your current data-source key, respectively, and the final URL will be opened in a new tab. You can always do it manually, if you want.
5358

54-
## Usage with query templates
59+
### Usage with query templates
5560

5661
In order to display the result of a query template in a table:
5762

5863
1. Create a READ query template. For example: `MATCH (n) where n.city={{"City Name":string}} return n LIMIT 1000`.
5964
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/):
65+
2. Note down each field title, [URL encode it](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent), prepend it with a valid URL parameter and give it a value. For example: `param_string_City%20Name=Paris`.
66+
3. Compose a valid data-table plugin URL and open it in a new tab. For example:
6867
```
6968
{{baseUrl}}plugins/table?queryId=19&sourceKey={{sourceKey}}&param_string_City%20Name=Paris
7069
```
71-
*When running a Custom Action, it will replace `{{baseUrl}}` and `{{sourceKey}}` for your LKE base URL and your current data-source key, respectively.*
70+
You can save this URL as a [Custom Action](https://doc.linkurio.us/user-manual/latest/custom-actions/), and when triggered, the `{{baseUrl}}` and `{{sourceKey}}` will be replaced with your LKE base URL and your current data-source key, respectively, and the final URL will be opened in a new tab. You can always do it manually if you want.
71+
72+
*Note that when prepending `param_string_` to the template field name `"City Name"`, we had to [encode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the name into `City%20Name` in order to be URL compliant.*

0 commit comments

Comments
 (0)