Skip to content
Snippets Groups Projects
Commit 2680fdad authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'plugin-docs' into 'main'

typos fixed

See merge request !298
parents cc768bbb 75c4dd0f
No related branches found
No related tags found
2 merge requests!298typos fixed,!293Resolve "Allow plugin to add entries to context menu"
Pipeline #97554 passed
...@@ -19,7 +19,7 @@ Below is a description of the methods, as well as the types they return. A descr ...@@ -19,7 +19,7 @@ Below is a description of the methods, as well as the types they return. A descr
- gets list of added markers - gets list of added markers
- returns array of `Marker` - returns array of `Marker`
- `getShownElements` - `getShownElements`
- gets list of all currently shown content/chemicals/drugs bioentities + markers - gets list of all currently shown content/chemicals/drugs BioEntities + markers
- returns object of - returns object of
``` ```
{ {
...@@ -68,12 +68,12 @@ Below is a description of the methods, as well as the types they return. A descr ...@@ -68,12 +68,12 @@ Below is a description of the methods, as well as the types they return. A descr
- **opacity** - should be a float between `0` and `1` (example: `0.54`) - **opacity** - should be a float between `0` and `1` (example: `0.54`)
- **x** - x coord on the map [surface/pin marker only] - **x** - x coord on the map [surface/pin marker only]
- **y** - y coord on the map [surface/pin marker only] - **y** - y coord on the map [surface/pin marker only]
- **width** - width of surface [surface marker only] - **width** - width of surface
- **height** - width of height [surface marker only] - **height** - height of surface
- **number** - number presented on the pin [pin marker only] - **number** - number presented on the pin
- **modelId** - if marker should be visible only on single map, modelId should be provided - **modelId** - if marker should be visible only on single map, modelId should be provided
- **start** - start point of the line [line marker only] - **start** - start point of the line
- **end** - end point of the line [line marker only] - **end** - end point of the line
- adds one marker to markers list - adds one marker to markers list
- returns created `Marker` - returns created `Marker`
- examples: - examples:
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
## Zoom errors ## Zoom errors
- **Provided zoom value exeeds max zoom of ...**: This error occurs when `zoom` param of `setZoom` exeeds max zoom value of the selected map - **Provided zoom value exceeds max zoom of ...**: This error occurs when `zoom` param of `setZoom` exceeds max zoom value of the selected map
- **Provided zoom value exceeds min zoom of ...**: This error occurs when `zoom` param of `setZoom` exceeds min zoom value of the selected map - **Provided zoom value exceeds min zoom of ...**: This error occurs when `zoom` param of `setZoom` exceeds min zoom value of the selected map
......
...@@ -69,7 +69,7 @@ To listen for specific events, plugins can use the `addListener` method in `even ...@@ -69,7 +69,7 @@ To listen for specific events, plugins can use the `addListener` method in `even
- onSearch - triggered after completing a search; the elements returned by the search are passed as arguments. Three separate events 'onSearch' are triggered, each with a different searched category type. Category types include: bioEntity, drugs, chemicals, reaction. Example argument: - onSearch - triggered after completing a search; the elements returned by the search are passed as arguments. Three separate events 'onSearch' are triggered, each with a different searched category type. Category types include: bioEntity, drugs, chemicals, reaction. Example argument:
```javascript ```
{ {
type: 'drugs', type: 'drugs',
searchValues: ['PRKN'], searchValues: ['PRKN'],
...@@ -171,7 +171,7 @@ To listen for specific events, plugins can use the `addListener` method in `even ...@@ -171,7 +171,7 @@ To listen for specific events, plugins can use the `addListener` method in `even
- onZoomChanged - triggered after changing the zoom level on the map; the zoom level and the map ID are passed as argument. Example argument: - onZoomChanged - triggered after changing the zoom level on the map; the zoom level and the map ID are passed as argument. Example argument:
```javascript ```json
{ {
"modelId": 52, "modelId": 52,
"zoom": 9.033753064925367 "zoom": 9.033753064925367
...@@ -180,7 +180,7 @@ To listen for specific events, plugins can use the `addListener` method in `even ...@@ -180,7 +180,7 @@ To listen for specific events, plugins can use the `addListener` method in `even
- onCenterChanged - triggered after the coordinates of the map center change; the coordinates of the center and map ID are passed as argument. Example argument: - onCenterChanged - triggered after the coordinates of the map center change; the coordinates of the center and map ID are passed as argument. Example argument:
```javascript ```json
{ {
"modelId": 52, "modelId": 52,
"x": 8557, "x": 8557,
...@@ -190,7 +190,7 @@ To listen for specific events, plugins can use the `addListener` method in `even ...@@ -190,7 +190,7 @@ To listen for specific events, plugins can use the `addListener` method in `even
- onBioEntityClick - triggered when someone clicks on a pin; the element to which the pin is attached is passed as an argument. Example argument: - onBioEntityClick - triggered when someone clicks on a pin; the element to which the pin is attached is passed as an argument. Example argument:
```javascript ```json
{ {
"id": 40072, "id": 40072,
"modelId": 52, "modelId": 52,
...@@ -200,29 +200,33 @@ To listen for specific events, plugins can use the `addListener` method in `even ...@@ -200,29 +200,33 @@ To listen for specific events, plugins can use the `addListener` method in `even
- onPinIconClick - triggered when someone clicks on a pin icon; the element to which the pin is attached is passed as an argument. Example argument: - onPinIconClick - triggered when someone clicks on a pin icon; the element to which the pin is attached is passed as an argument. Example argument:
```javascript ```json
{ {
"id": 40072, "id": 40072
} }
``` ```
```javascript Marker pin:
```json
{ {
"id": "b0a478ad-7e7a-47f5-8130-e96cbeaa0cfe", // marker pin "id": "b0a478ad-7e7a-47f5-8130-e96cbeaa0cfe"
} }
``` ```
- onSurfaceClick - triggered when someone clicks on a overlay surface; the element to which the pin is attached is passed as an argument. Example argument: - onSurfaceClick - triggered when someone clicks on an overlay surface; the element to which the pin is attached is passed as an argument. Example argument:
```javascript ```json
{ {
"id": 18, "id": 18
} }
``` ```
```javascript Surface marker overlay:
```json
{ {
"id": "a3a5305f-acfa-47ff-bf77-a26d017c6eb3", // surface marker overlay "id": "a3a5305f-acfa-47ff-bf77-a26d017c6eb3"
} }
``` ```
......
### Map positon ### Map position
With use of the methods below plugins can access and modify user position data. With use of the methods below plugins can access and modify user position data.
...@@ -33,7 +33,7 @@ window.minerva.map.setZoom(-14); ...@@ -33,7 +33,7 @@ window.minerva.map.setZoom(-14);
#### Get center #### Get center
User position is defined as center coordinate. It's value is defined as x/y/z points of current viewport center translated to map position. Plugins can access center value and modify it. User position is defined as center coordinate. Its value is defined as x/y/z points of current viewport center translated to map position. Plugins can access center value and modify it.
To get current position value, plugins can use the `window.minerva.map.getCenter()` method which returns current position value as an object containing `x`, `y` and `z` fields. All of them are non-negative numbers but `z` is an optional field and it defines current zoom value. If argument is invalid, `getCenter` method throws an error. To get current position value, plugins can use the `window.minerva.map.getCenter()` method which returns current position value as an object containing `x`, `y` and `z` fields. All of them are non-negative numbers but `z` is an optional field and it defines current zoom value. If argument is invalid, `getCenter` method throws an error.
......
...@@ -28,17 +28,17 @@ window.minerva.plugins.registerPlugin({ ...@@ -28,17 +28,17 @@ window.minerva.plugins.registerPlugin({
The `window.minerva.plugins.registerPlugin` method returns object with `element` property which is a DOM element, allowing your plugin to append its HTML content to the DOM. Use this element to create and modify the HTML structure of your plugin. The `window.minerva.plugins.registerPlugin` method returns object with `element` property which is a DOM element, allowing your plugin to append its HTML content to the DOM. Use this element to create and modify the HTML structure of your plugin.
``` ```javascript
// Plugin registration // Plugin registration
const { element } = window.minerva.plugins.registerPlugin({ const { element } = window.minerva.plugins.registerPlugin({
pluginName: "Your Plugin Name", pluginName: 'Your Plugin Name',
pluginVersion: "1.0.0", pluginVersion: '1.0.0',
pluginUrl: "your-plugin-url", pluginUrl: 'your-plugin-url',
}); });
// Modify plugin's HTML structure // Modify plugin's HTML structure
const yourContent = document.createElement('div'); const yourContent = document.createElement('div');
yourContent.textContent = "Your Plugin Content"; yourContent.textContent = 'Your Plugin Content';
element.appendChild(yourContent); element.appendChild(yourContent);
``` ```
......
// const root = 'https://minerva-dev.lcsb.uni.lu'; // const root = 'https://minerva-dev.lcsb.uni.lu';
// const root = 'https://scimap.lcsb.uni.lu';
const root = 'https://lux1.atcomp.pl'; const root = 'https://lux1.atcomp.pl';
window.config = { window.config = {
BASE_API_URL: `${root}/minerva/api`, BASE_API_URL: `${root}/minerva/api`,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment