Forum Discussion
cesarecaoduro
4 years agoRegular Visitor
Adding threejs to a custom visual
I am tring to add threejs to a custom visual but I keep receiveng always the same error. I have initialized a simple custom visual using pbiviz and then just installed threejs via npm. {
"...
- 4 years ago
Hi cesarecaoduro,
Power BI visuals are not set up for async operations by default. Looks like threejs might require this, so this can be mitigated by adding regenerator-runtime to your project.
From the command line in your project's root folder (assuming you're using npm for package management), run the following:
npm i regenerator-runtimeAt the top of your visual.ts, add an import, similar to the following:
import 'core-js/stable'; import 'regenerator-runtime/runtime'; /* <---- add this line */ import '../style/visual.less';Re-run pbiviz start and this particular error should go away when you re-initialise your visual.
Regards,
Daniel
dm-p
4 years agoSuper User
I've never had a case come up where I've needed to try something like that. I imagine it might, but I honestly don't know.
HectorElMago
2 years agoNew Member
Were you able to make a 3D visualization? Do you have material or something like that?