Forum Discussion
Include vis.js in custom visual causes error
- 8 years ago
Please follow these steps to make vis.js working:
- Create a new JS file in src folder
- Put the folllowing code in the new JS file
var vis = window.vis || window.window.vis;
Include the new file into externalJs property of pbiviz.json right after node_modules/vis/dist/vis.js.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Hello Ignat,
either the d3 v4 approach does not work with vis.js or I don’t understand it.
I added a separate file: initVendorLibraries.js (included it in pbiviz after the vis library) with the code:
var vis = window.vis;
but it did not work. The object is still undefined.
According to https://github.com/almende/vis/blob/master/package.json vis contains other libraries (which are also visible under node_modules in my project):
"emitter-component": "^1.1.1",
"moment": "^2.18.1",
"propagating-hammerjs": "^1.4.6",
"hammerjs": "^2.0.8",
"keycharm": "^0.2.0"
do I have to use the approach on the other libraries as well?
Is there a Power BI visual that included already vis.js successfully? If yes, do you have a link?
Kind regards
- v-chuncz-msft8 years agoCommunity Support
- v-viig8 years agoCommunity Champion
Please follow these steps to make vis.js working:
- Create a new JS file in src folder
- Put the folllowing code in the new JS file
var vis = window.vis || window.window.vis;
Include the new file into externalJs property of pbiviz.json right after node_modules/vis/dist/vis.js.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals