feat(plugins): data overlays (MIN-222)
Overlays
Get list of available data overlays
To get list of available data overlays, plugins can use the getDataOverlays
method defined in window.minerva.overlays.data
. This method returns array with all overlays.
Example of getDataOverlays usage:
window.minerva.overlays.data.getDataOverlays();
Get list of visible data overlays
To get list of visible data overlays, plugins can use the getVisibleDataOverlays
method defined in window.minerva.overlays.data
. This method returns array with all visible data overlays.
Example of getVisibleDataOverlays usage:
window.minerva.overlays.data.getVisibleDataOverlays();
Show an overlay
To show an overlay, plugins can use the showDataOverlay
method defined in window.minerva.overlays
. This method takes one argument: the ID of the overlay that the plugin wants to show.
Example of showDataOverlay usage:
window.minerva.overlays.showDataOverlay(109);
Hide an overlay
To hide an overlay, plugins can use the hideDataOverlay
method defined in window.minerva.overlays
. This method takes one argument: the ID of the overlay that the plugin wants to hide.
Example of showDataOverlay usage:
window.minerva.overlays.hideDataOverlay(109);
Add an overlay
To add an overlay, plugins can use the addDataOverlay
method defined in window.minerva.overlays
. This method takes one argument: the object with the following properties:
-
name (string): The name of the overlay.
-
description (optional string): A description of the overlay.
-
filename (optional string): The filename of the overlay data.
-
fileContent (string or text File): The content of the overlay data.
-
type (optional string): The type of overlay data.
Example of addDataOverlay usage:
window.minerva.overlays.addDataOverlay({
name: 'Plugin Test',
fileContent: 'plugin test content',
});
Remove an overlay
To remove an overlay, plugins can use the removeDataOverlay
method defined in window.minerva.overlays
. This method takes one argument: the ID of the overlay that the plugin wants to remove.
Example of removeDataOverlay usage:
window.minerva.overlays.removeDataOverlay(129);
Get Api Urls:
To get Api urls associated with the project, plugins can use the getApiUrls
method defined in window.minerva.project.data
object.
Example usage of getApiUrls method:
window.minerva.project.data.getApiUrls();