'Add a popup ( html figure mpld) to a map (folium) and build app (PyQt4)

I'm trying to build a little app that loads a map in an QWebView. It functions well until I want to add a popup to my map, in form of a MPLD figure.

Here is my code:

#!/usr/bin/env python

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

import matplotlib.pyplot as plt
import mpld3
from mpld3 import fig_to_html, plugins

import folium

fig, axes = plt.subplots()
x = [3,54,6,9,99]
axes.plot(x)
kodHTML = mpld3.fig_to_html(fig,template_type="simple")

m = folium.Map([43,-100], zoom_start=4)
iframe = folium.element.IFrame(html=kodHTML, width=660, height=500)
popup = folium.Popup(iframe, max_width=2650)
folium.Marker([30,-100], popup=popup).add_to(m)
m.save("./test.html")


app = QApplication(sys.argv)
strona = QWebView() 
strona.load(QUrl("./test.html")) 
strona.show() 

sys.exit(app.exec_())

When I run my script I cannot see any popup. How can I make it visible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source