Make a plot visible in IE - python

I've been making plots in Bokeh, they work fine in Chrome, but I just get blank pages in IE. I thought this was because my company uses IE8 by default, but we've now been upgraded to IE11 and I see the same problem.
The IE debug console reports that the page targets document mode 7, so it may be an issue with the metadata in the page header.
Is there a way to make Bokeh output plots with the correct metadata for IE?

I ran into a similar issue with a Bokeh figure at work not showing in Internet Explorer, but the figure worked fine in other browsers.
For me the problem seemed to be that intranet sites were shown in Compatability View (I must admit I don't know what Compatability View means...). The fix was to choose the options icon in the upper right corner, then Compatibility View Settings and then remove the checkmark at Display intranet sites in Compatibility View. After close and reload the figure appeared.

We regularly test on IE before release, so I am not sure what the issue could be. You can definitely get just the plot components using various functions in bokeh.embed and template them into what whatever larger documents you like, but perhaps the default template needs updating or tweaking. I don't know what "document mode 7" is, but some of the other devs might be more familiar with IE and can help investigate. In any case I encourage you to make a proper issue not the GitHub issue tracker:
https://github.com/bokeh/bokeh/issues

Also had this issue with IE11.
I fixed it by removing webgl=True option from bokeh.plotting.figure() call.
cf. [http://docs.bokeh.org/en/0.11.1/docs/user_guide/webgl.html]

Related

Dash/Plotly layout rendering differently on another computer after the deploy

I just deployed a dashboard on Google Cloud and shared it with a friend to check if he could access it. I asked for a screen print to check if everything was ok.
To my surprise, the dashboard that appeared to him is very different from what appears to me. On his screen, the text fonts are all misconfigured and the size of the graphics are different, in addition to not being centered on the screen.
I didn't think this problem would happen, since the dash is online on the internet.
Can anyone tell me how I can standardize the view for any user?
I don't know if it helps but all the layout code (html+css+python) is in the same app.py file.
Obs
There is no Go.figures or Bootstrap in my code. It's just simples plotly charts made with plotly.express.

Selenium python firefox, disable images but show the placeholder

I have followed a few other SO threads on how to disable image loading in firefox. However the page looks very messed up after disabling images. Is there a way to show the image placeholders so the page look structure wise similar to the page with images.
No, this can't be done easily. As this answer explains, if you're not actually requesting the image from the server and getting a response, the browser can't be sure how big the placeholder should be. Thus it will assume a size of {0,0}.
As usual there are lots of alternatives and workarounds, but at that point you have to decide whether the benefit of not having to download images is really worth the effort of: rewriting the page to replace images with fixed-size <div>s, rewriting the image requests using a proxy server, adding aggressive caching, etc.

Gallery in Photologue can have only one Photo

after I put the photologue on the server, I have no issue with uploading photos.
the issue is when I am creating a Gallery from the admin site, I can choose only one photo to be attached to the Gallery. even if I selected many photos, one of them will be linked to the Gallery only.
The only way to add photos to a gallery is by adding them manually to photologue_gallery_photos table in the database :(
anyone kows how to solve it?
I had exactly the same problem. I suspected some problem with django-sortedm2m package. To associate photo to gallery, it was using SortedManyToMany() from sortedm2m package. For some reason, the admin widget associated with this package did not function well. (I tried Firefox, Chrome and safari browser).
I actually did not care for the order of photos getting uploaded to Gallery, so I simply replaced that function call with Django's ManyToManyField(). Also, I noticed that SortedManyToMany('Photo') was called with constant string Photo. Instead it should be called with SortedManyToMany(Photo) to identify Photo class. Although it did not resolve my problem entirely. So I used default ManyToMany field and it is showing all the photos from Gallery.
I guess your problem is solved by now, but just in case.. I had the same problem. Looking around in the logs, I found it was caused by me not having consolidated the static files from sortedm2m with the rest of my static files (hence the widget was not working properly).
Make sure sortedm2m is in INSTALLED_APPS in addition to photologue; merely duplicating any sortedm2m templates alone will not suffice.
Installation & configuration — django-photologue 3.6 documentation

xgoogle python library is not working any more?

I was using the xgoogle python library for one of my projects. It was working fine till recently. I am not getting the resultset that I used to get before. If anyone who has used this library written by Peter Krummins, faced a similar situation, can you please suggest a work around ?
The presence of BeautifulSoup.py hints that this library uses web scraping to get its result.
A common problem with this is that it will easily break when the design/layout of the page being scraped changes. And the problem you see seems to coincide with the new search results layout that Google introduced just recently.
Another problem is that it often is against the terms of service of the site being scraped. And according to point 5.3 of the Google Terms Of Service it actually is:
You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) [...]
A better idea would be to use the Custom Search API.
Peter Krumin's product xgoogle looks to be extremely useful both to me and I image many others.
https://github.com/pkrumins/xgoogle
For me the current version is 1.3 is not working.
I tried a new install from GitHub, ran the examples and nothing is returned.
Adding a debugger to the source code and tracing the data captured in a query to its disappearance the problem occurs in a routine called search.py subroutine "_extract_results" at a parser command
results = soup.findAll('li', {'class': 'g'})
The soup object has material in it but the "findAll" fails to return anything.
Looks like its searching for lists and if there are none it returns nothing.
I am unsure what html you would try to match to get a result.
If anyone knows how to make the is work I am very interested.
A little more googling and it appears xgoogle is no longer supported or works.
Part of the trouble is that Google changes the layout of its results pages every so often and so any scraping software that assumes some standard layout is in time doomed to failure.
There are however other search engines that are locally installed and thus provide a results layout that are less likely change with upgrades and will not change at all if you don't upgrade.
I am currently investigating Yacy. Easy to install and can be pointed at specific sites if you want.

Charts in django Web Applications

I want to Embed a chart in a Web Application developed using django.
I have come across Google charts API, ReportLab, PyChart, MatPlotLib and ChartDirector
I want to do it in the server side rather than send the AJAX request to Google chart APIs, as I also want to embed the chart into the PDF.
Which is the best option to use, and what are the relative merits and demerits of one over the other.
Another choice is CairoPlot.
We picked matplotlib over the others for some serious graphing inside one of our django apps, primarily because it was the only one that gave us exactly the kind of control we needed.
Performance generating PNG's was fine for us but... it was a highly specialized app with less than 10 logins a day.
Well, I'm involved in an open source project, Djime, that uses OpenFlashChart 2.
As you can see from our code, generating the JSON-data that OFC uses is a bit complex, but the output is very nice and user friendly, since you can add tooltips, etc. to the different elements.
Open Flash Chart 2
http://teethgrinder.co.uk/open-flash-chart-2/
python library http://btbytes.github.com/pyofc2/
kybi
One package I've wanted to try is graphite. It's a graphing server / platform built with Django. It's specialized for "numeric time-series data" though, like stock prices or bandwidth utilization. If that fits your need I would check it out. Here are some screenshots:
http://graphite.wikidot.com/screen-shots
I like client side charts because you can get full page plotting.
A good options seems to be Jquery Flot : http://code.google.com/p/flot/ which can load JSON data.
However, you won't get pdf support.
Perhaps you might want to have a look here: Django Plotting app.
The HowTo describes how to embed matplotlib plots into the admin interface and create a PDF view.
I have used FusionCharts Free with Django.
Its flash based, open source, multi-licensed and it's well documented. It's ActionScript 1, but AS version wasn't really a criteria for me, though it could be for others.

Categories

Resources