The Elfsquad third party visualization package provides a simple way to implement third party visualization in your custom interface.
An example implementation can be found in the docs
directory. This
is also hosted at https://elfsquad.github.io/third-party-visualization/.
To install the package, run the following command:
npm install --save @elfsquad/third-party-visualization
or include the following script tag in your HTML file:
<script type="importmap>
{
"imports": {
"@elfsquad/third-party-visualization": "https://cdn.skypack.dev/@elfsquad/third-party-visualization@1.0.0"
}
}
</script>
This package exposes the VisualizationFrame
class. This class can be
used for creating & communicating with the iframe.
Example:
import { VisualizationFrame } from "@elfsquad/third-party-visualization";
const container = document.createElement("div");
document.body.appendChild(container);
const elfsquad = new VisualizationFrame({
container: container,
url: "https://elfsquad.github.io/third-party-visualization-test/"
});
Trigger an update in the third party visualization.
visualization.sendConfigurationUpdated(new Configuration());
Update a single requirement.
visualization.onUpdateRequirement(data => {
console.log('Requirement updated:', data);
});
Update multiple requirements at once.
visualization.onUpdateRequirements(data => {
console.log('Multiple requirements updated:', data);
});
Update the image value of a node.
visualization.onUpdateImageValue(data => {
console.log('Image value updated:', data);
});
We welcome contributions! Please feel free to fork the repository, make your changes, and submit a pull request.