You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-24Lines changed: 25 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,30 @@ query (or query template) as a table.
7
7
8
8
## Configuration
9
9
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:
11
19
12
20
| Key | Type | Description | Example |
13
21
| :-- | :-- | :-- | :-- |
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
22
|`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"`|
18
24
|`properties`| string\[] (**optional**) | Property names to include in the table. Defaults to all the properties of `itemType`. |`["name", "address", "vat_number"]`|
19
25
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`:
21
27
<imgwidth="1036"alt="Screenshot 2021-03-09 at 18 59 07"src="https://user-images.githubusercontent.com/11739632/110516230-9508c200-8109-11eb-9fae-1218010597f6.png">
22
28
29
+
Configuration example for 2 data-table instances accesible via `/plugins/table` and `/plugins/edgeTable`:
30
+
<imgwidth="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
+
23
34
## URL parameters
24
35
25
36
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:
33
44
|`param_string_{{Encoded field name}}`| string (**optional**) |*For query templates*, any string parameter of the template |`param_string_city=Paris`|
34
45
|`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
46
36
-
## Usage with standard queries
47
+
###Usage with standard queries
37
48
38
49
In order to display the result of a standard query in a table:
39
50
40
51
1. Create a standard READ query. For example: `MATCH (n) return n LIMIT 1000`.
41
52
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:
*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.
53
58
54
-
## Usage with query templates
59
+
###Usage with query templates
55
60
56
61
In order to display the result of a query template in a table:
57
62
58
63
1. Create a READ query template. For example: `MATCH (n) where n.city={{"City Name":string}} return n LIMIT 1000`.
59
64
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>¶m_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:
*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