We are atlassian add-on contributor,
We are using D3 and NVD3 library in our dashboard gadgets in jira server,
When dashboard loads, all add-on resources bundled into single batch.js. our add-on is using D3 and dependent NVD3 library. When other add-on is loading it is overriding D3 object, so it generates below error and graph is not working.
batch.js?agile_globa…rue:formatted:29277 Uncaught TypeError: at.watchTransition is not a function
at SVGGElement.<anonymous> (batch.js?agile_globa…rue:formatted:29277)
at batch.js?agile_globa…ue:formatted:134532
at cF (batch.js?agile_globa…ue:formatted:134540)
at Array.dV.each (batch.js?agile_globa…ue:formatted:134531)
at Array.ad (batch.js?agile_globa…rue:formatted:29001)
Is there any way we can provide isolated scope/context for add-on web resources to work independently or Can we initialize D3 from amd module file ?
Below is the gadget definition code.
<dashboard-item key="....." configurable="true">
<definition>
<title key="...." />
<categories>
<category>JIRA</category>
</categories>
<author>
<name>......</name>
</author>
</definition>
<description
key="........." />
<context-provider
class="....." />
<amd-module>......</amd-module>
</dashboard-item>