kgabryje opened a new pull request #13181:
URL: https://github.com/apache/superset/pull/13181


   ### SUMMARY
   Due to Mapbox controls being loaded from different origin, it was impossible 
to convert Mapbox canvas to base64 encoded image due to CORS policy of 
`HTMLCanvasElement.toDataURL` method 
(https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#exceptions).
 This PR fixes it by filtering out div that contains control elements (such as 
Mapbox logo).
   This PR needs 
https://github.com/apache-superset/superset-ui-plugins-deckgl/pull/25 and 
https://github.com/apache-superset/superset-ui/pull/965 to be merged and 
respective packages to be bumped to work properly. Mapbox and DeckGL components 
need to have `preserveDrawingBuffer` prop set to true - otherwise only a gray 
background is getting captured. This change may affect performance of MapBox 
and DeckGL charts - I'd appreciate some stress tests and verifying if 
performance is acceptable when compared to current version
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: see https://github.com/apache/superset/issues/12745
   After:
   ![country-of-citizenship-2021-02-17T17-01-42 
411Z](https://user-images.githubusercontent.com/15073128/108241334-ff9e9180-714b-11eb-9bf4-ef82cbd199fe.jpg)
   ![country-of-citizenship-2021-02-17T17-02-26 
826Z](https://user-images.githubusercontent.com/15073128/108241340-03321880-714c-11eb-9664-d77a1e7deb2c.jpg)
   
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: fixes 
https://github.com/apache/superset/issues/12745
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   CC: @villebro @junlincc @altef 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to