plotly / dash-deck

Bringing deck.gl and pydeck into Dash
https://dash-gallery.plotly.host/dash-deck-explorer/
MIT License
90 stars 19 forks source link

Add disableContext property to DeckGL component #9

Closed karosc closed 3 years ago

karosc commented 3 years ago

About

Removes the right click context menu from deck.gl maps by default

## Description of changes Addition of new disableContext property bool. If set to true, event listener is added to stop right click context menu from showing up on deck.gl map

Pre-Merge checklist

Reference Issues

Closes #[issue number]

Other comments

xhluca commented 3 years ago

@karosc Thank you for opening this PR, but I'm not sure what's the issue. When I right click on the map I do not see a context menu different from what I usually have. I tested on both chrome and firefox. Could you share an example of what you have in mind (preferably, a GIF and working code)

xhluca commented 3 years ago

Nice, I have a working solution. But calling black to format at the end has changed a bunch of formatting in the existing code that I did not change myself. Do you have the black version number you are working with?

Unfortunately there's currently no linting for the source code; for now please don't lint it if possible (in order to limit the diff) and I'll add linting in a subsequent PR.

xhluca commented 3 years ago

@karosc I just cloned your branch and ran npm i/npm run build. I noticed there's some discrepancy in package-lock.json and dash_deck.min.map. Could you check if you correctly ran the commands described in CONTRIBUTING.md? Thanks!

karosc commented 3 years ago

disableContext=False

disableContext=False

disableContext=True

disableContext=True

karosc commented 3 years ago

@xhlulu I re-ran 'npm run build' and saw the changes in those files pop up in git.

I think I edited a docstring and forgot to rebuild before pushing. Apologies

xhluca commented 3 years ago

Thanks. Can you run npm i again as well to fix package-lock.json?

karosc commented 3 years ago

I did that before run build. Just did it again and got no changes.

xhluca commented 3 years ago

@alexcjohnson Happy to hear your feedback as well

karosc commented 3 years ago

Added a demo. Looks like this

disableContext Demo