Forum Discussion
Adding threejs to a custom visual
- 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
Yup - you can place a file somewhere like that - it's not just read rights though; make sure there are no cross-domain restrictions or firewalling applied at the server level for those endpoints. I can't speak for AWS but for some Azure assets I need to explicitly enable this so that cross-domain calls from iframes with no origin are possible (otherwise you'll get the same problem).
I haven't seen the 3D viewer you mention, but I'm sure that they will mandate a similar approach for users, or will allow uploads via the file dialog (or a combination of the two). It could be worth seeing how they do it or reach out to the developers to see if they have any lessons that they can provide you to help narrow your focus on the things that can work. There are a lot of things that are simple to do in a regular web application that become difficult via custom visuals due to the constraints impose by the main window.
Good luck,
Daniel
dm-p will try...
this is one the viewers I am talking about.
Tracer For Revit | 3D Building Information Models for Power BI (provingground.io)
- cesarecaoduro4 years agoRegular Visitor
dm-p just on the same topic, do you think would be a feasable option to run a tiny local webserver that serves those file and manages the upload?
This way I can create an aspnet core webapi and package that in a selfcontained server that gets installed on the user machine.
- dm-p4 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.
- HectorElMago2 years agoNew Member
Were you able to make a 3D visualization? Do you have material or something like that?