ratt-ru / ragavi

Radio Astronomy Gain and Visibility Inspector
MIT License
3 stars 1 forks source link

problem rendering bokeh plots with WebKit #89

Open o-smirnov opened 12 months ago

o-smirnov commented 12 months ago

Hi @Mulan-94 -- I'm trying to use wkhtmltopng to render thumbnails of ragavi plots in radiopadre. You can simply apt install it. It seems a much easier option than the clunky fragile stuff I was using before (phantomjs and puppeteer, argh). But the problem is, I get a blank image on the output.

I get some curious warnings when I enable JS debugging with the tool. Not sure if they're related to the problem:

$ wkhtmltoimage --width 1920 --height 1020 --javascript-delay 500 --enable-javascript --debug-javascript mgps-1543664600-hii-bubbles-1543664600_sdp_l0-1kgb_primary.B1.html img.png
Loading page (1/2)
Warning: https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js:164 SyntaxError: Unexpected keyword 'function'
Warning: https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js:46 SyntaxError: Unexpected keyword 'super'
Warning: https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js:121 SyntaxError: Unexpected token '*'
Warning: file:///home/oms/tmp/mgps-1543664600-hii-bubbles-1543664600_sdp_l0-1kgb_primary.B1.html:23 ReferenceError: Can't find variable: Bokeh
Warning: file:///home/oms/tmp/mgps-1543664600-hii-bubbles-1543664600_sdp_l0-1kgb_primary.B1.html:51 ReferenceError: Can't find variable: Bokeh
Rendering (2/2)                                                    
Done                                                               

Could you please have a small dig to see if this can be worked around?

Mulan-94 commented 12 months ago

ok , looking into it

Mulan-94 commented 12 months ago

@o-smirnov , seems like an issue with wkhtmltopdf. I have tried validating the syntax with node and everything seems fine. Tried this on a couple of other websites even and it seems to give a blank space either way. Perhaps the JS version in use for this tool is ... different (e.g. see this stack overflow issue). I think it would require a bit more time to look into.

o-smirnov commented 12 months ago

All right, let's leave it for now then. Thanks!