Open jjwallace opened 4 years ago
Does pinch work? Likely something is capturing the pointerdown event before it reaches the canvas element.
Ahh, that makes sense. Pinch also doesn't work also, it just defaults to zooming in the entire dom. I added a listener on the background container to see if mouse events get to the background and no console log is displayed. So yes something must be layered over it, gotta step through and see what it might be. I thought this might be a common problem with angular and pixi battling over something.
Ok, let me know if you continue to have this problem or how you resolved it so that others can benefit.
Still unable to get drag working with d3, angular integration. Do you know any working examples/boilerplate with angular or d3?
I haven't seen any. If you mock up something in jsfiddle or the like, I can try to debug it.
I built a simple angular pixiJS viewport - Boilerplate.
Drag viewport still not function.
Here is the source: https://github.com/jjwallace/angular-pixi/blob/master/src/app/pixiApp/d3/generateSimulationData.js
If you wanna test it: npm install npm start
You will notice you cannot drag around in the viewport.
Solution Found
The error was occurring with a custom built Render and Render Store.
Upon resize of the browser window the render would recalculate the canvas size and child element sizes.
The event listener for the resize was somehow overriding the drag listener.
I will post more about this when I take a look a the custom renderer.
//interaction: BrainStore.renderer.interaction, //Custom Renderer interaction: BrainStore.app.renderer.plugins.interaction, //Pixi5
@jjwallace Seem I have a similar issue with angular. Can you maybe post an example what you did exactly? Thanks
For some reason items (sprites) inside the viewport are draggable; however, The viewport itself doesn't drag around. A snapZoom attached to key presses allows for navigation but it seems the viewport itself cannot be dragged.
I have seen some z-index solutions here but non of those apply to my scenario.
Has this occurred for anyone else.
The project is Angular, Webpack, Pixi, D3
I will post my solution here when I find something.