d3-inetsoft
This module provides integration with InetSoft dashboards. It will only work when the enclosing HTML page is embedded in a dashboard. For example, to load data from a dashboard table named D3DataTable
:
function loadData(table) {
console.log("Table loaded: ", table);
}
d3.inetsoft("D3DataTable", loadData);
The handler function receives a TableData
object. This will be called when the dashboard is first loaded and whenever the data has changed, for example when a selection is modified.
By default, it is assumed that the InetSoft dashboard is served from the same domain as the D3 chart HTML page. If this is not the case, there is an optional third argument to d3.inetsoft()
for the origin of the InetSoft dashboard. For example, if the dashboard is served from inetsoft.example.com
, you would use:
d3.inetsoft("D3DataTable", loadData, "https://inetsoft.example.com");
Installing
If you use npm, npm install @inetsoft/d3-inetsoft
. You can also download the latest release on GitHub. For use in a browser, you can load d3-inetsoft's UMD bundle from an npm based CDN such as jsDelivr; a d3
global is exported:
<script src="https://cdn.jsdelivr.net/npm/@inetsoft/d3-inetsoft@1.0.6"></script>
<script>
d3.inetsoft("D3DataTable", loadData)
</script>
Version Compatibility
The following table lists the compatability between versions of this plugin and the versions of the InetSoft software.
Plugin Version | InetSoft Version |
---|---|
1.0.x | 2021 |
Note that InetSoft versions prior to 2021 do not support this plugin.
API Reference
# d3.inetsoft(assemblyName, callback[, origin][, normalize]) · Source
Connects to the enclosing dashboard and loads data from the specified assembly. If origin is specified, only message events with that origin are accepted. Otherwise, only message events with the same origin as the HTML page are accepted. If the optional normalize argument is true
, the table data will be normalized to be the same as that returned by d3.csv()
. When new data is received callback is invoked with a TableData
object as the argument.