Official Javascript wrapper for the Vulcan SDK.
At the moment, you have to go with manual installation yet. Just download vulcanSDK.js and include in your HTML, you are ready to go.
Yay, no Dependencies yet. True that it's an infantary stage, but still, Yay!
To use Vulcan SDK, you don't have to initialize SDK instance, but you do to register the extension points.
vulcanSDK.initialize({
extensionPoints: {
leftBar: [{
title: 'MY PLUGIN TITLE',
icon: iconSticky,
iconType: 'svg',
slug: 'my-plugin-title',
onClick: () => {
...
}
}]
}
});leftbar, bottomNavBar, topRightBar, chartTabBarTabItem, chartTabBarButtonItem, propertyEditor and imagePickerTab.
Supports svg and material-icon at the moment.
Example of material-icon iconType
vulcanSDK.initialize({
extensionPoints: {
leftBar: [{
title: 'MY PLUGIN TITLE',
icon: 'mdi-launch',
iconType: 'material-icon'
slug: 'my-plugin-title',
onClick: () => {
...
}
}]
}
});We have mainly three namespaces at the time of writing ui, viewport, and chart.
Sending command is straightforward, note that some methods may need additional options to be sent along.
vulcanSDK.chart.ui.openTreeView();
vulcanSDK.chart.objects.create(
{
type: "Rect",
width: "300",
height: "100",
text: "This is custom object created from Forge hosted plugin",
backgroundColor: '#aeaeae'
}
);Getters use callback to get the information back from vulcan.
vulcanSDK.chart.viewport.get(function(value) {});
vulcanSDK.chart.objects.get('OBJECT_ID', function(value) {});You can add listeners with addListener method.
vulcanSDK.addListener('SELECTION_UPDATED');samples folder contains rather straightforward samples with static HTML.
Example folder allows you to experiment the SDK in full mode. As a Vue application itself, to run the Example application
yarnornpm installyarn serveornpm serveto run the server on http://localhost:8087- To fully test it you should embed it, like what you can see in
samples/openDrawer.html. Please change the url to http://localhost:8087 in the example html file.
We will pick up just several methods worthy to mention here. To fully understand what SDK provides, we highly recommend you to check Example.
Arguments
| Argument | Type | Optional/Required | Default |
|---|---|---|---|
url |
string | Required | |
option |
object | Optional |
Example
vulcanSDK.chart.ui.openDrawer('https://www.vulcanapp.com', {
title: 'My Plugin',
width: 375,
height: 490
});Arguments / option
options is an object with projectId as a one attribute.
| Argument | Type | Opt/Required | Default |
|---|---|---|---|
projectId |
string | Required |
Arguments / option
options is an object with following attributes
| Argument | Type | Opt/Required | Default |
|---|---|---|---|
gridSize |
string | Required | |
gridColor |
string | Required | |
gridSnap |
boolean | Required |
gridSize to be one of large, medium, small, gridColor to be one of grey or black at the time of writing.
Arguments / option
options is an object with type as required field and you can specify the other attributes available to that type of object.
| Argument | Type | Opt/Required | Default |
|---|---|---|---|
type |
string | Required |
Example
vulcanSDK.chart.objects.create(
{
type: "Rect",
width: "300",
height: "100",
text: "This is custom object created from Forge hosted plugin",
backgroundColor: '#aeaeae'
}
);