kgabryje opened a new issue, #24948:
URL: https://github.com/apache/superset/issues/24948

   ### Motivation
   
   Currently, Superset uses Selenium for rendering charts in reports and in 
thumbnails. However, this approach has proven to be problematic when dealing 
with [deck.gl](http://deck.gl/) charts. The current Selenium-based approach 
fails to handle these charts properly, resulting in blank visualizations in the 
reports. To address this issue and provide a more reliable solution for 
rendering [deck.gl](http://deck.gl/) charts, we propose integrating 
[Playwright](https://github.com/microsoft/playwright) as an alternative to 
Selenium.
   
   ### Proposed Change
   
   The proposed change involves introducing Playwright for rendering charts in 
Superset reports. Playwright is an open-source library for automating web 
browsers, similar to Selenium but with better support for modern browser 
features and improved performance. By using Playwright, we aim to provide a 
more stable and accurate chart rendering experience in Superset reports, 
especially for [deck.gl](http://deck.gl/) charts.
   
   We wrote a POC that proved that the underlying problem, which is inability 
to render WebGL images (which deck.gl charts are based on), does not occur when 
running reports with Playwright. The screenshots below present the contents of 
email reports of dashboard containing deck.gl charts when using Selenium 
(before) and Playwright (after).
   
   Before (Selenium):
   
   <img width="918" alt="image" 
src="https://github.com/apache/superset/assets/15073128/21dfcaed-ef1f-4462-9d67-2b28c7cc8618";>
   
   After (Playwright):
   
   
![image](https://github.com/apache/superset/assets/15073128/3917d759-1344-467f-ba32-cc8e639a4496)
   
   Since configuring Playwright requires installing additional dependencies, in 
order to prevent breaking changes in existing deployments we propose to put the 
new flow behind a feature flag `PLAYWRIGHT_REPORTS_AND_THUMBNAILS` while 
supporting Selenium at the same time. Users who do not enable the new feature 
flag will be unaffected by the proposed changes.
   
   ### New or Changed Public Interfaces
   
   There will be no changes to existing public interfaces in Superset as part 
of this feature addition.
   
   ### New dependencies
   
   The proposed feature will require the addition of the Playwright library as 
a new Python dependency. Playwright is actively maintained, with Apache 2.0 
license.
   
   ### Migration Plan and Compatibility
   
   The migration to Playwright as the alternative to Selenium will not require 
any database migrations or updates to stored URLs. Existing reports using 
[deck.gl](http://deck.gl/) charts should continue to work as expected.
   
   In order to avoid introducing a potential breaking change in existing 
deployments, Playwright will only be used if 
`PLAYWRIGHT_REPORTS_AND_THUMBNAILS` is enabled. Otherwise, the reports will be 
run by Selenium.
   
   ### Rejected Alternatives
   
   1. Continue using Selenium with geckodriver (Firefox): This approach was 
rejected due to the limitations of geckodriver, which can't render WebGL 
visualizations in headless mode.
   2. Continue using Selenium, change the driver to Chrome: This approach was 
rejected due to problems with taking fullpage screenshots.
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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