Generating matplotlib graph which is refreshed real-time on web browser using mpld3 - matplotlib

I have realized the dynamic graph drawing with matplotlib, and it can refresh graph real-time. Now, I want to generate matplot figure on Web Browers using mpld3. It can export to webpage, but can only run one time and graph won't be refreshed continuously. Wondering what this may be caused by? My script frame is as follow:
import mpld3[enter image description here][1]
from mpld3._server import serve
.
.
.
html1=mpld3.fig_to_html(fig1)
html2=mpld3.fig_to_html(fig2)
serve(html1+html2)
plt.pause(0.5)
enter image description here

There is no way to do that.
However, you can still export your figure as a html file – as you already do with the mpld3.fig_to_html() command – but always in the same html file, and run a auto-reload soft in the web browser on this page (see for example this plugin for Firefox: https://addons.mozilla.org/en-US/firefox/addon/tab-auto-reload/).
But for mpld3 figures, the loading time can be quite large depending on the amount of data you are showing. This solution is definitely not appropriate for real-time applications!

Related

TinyMCE 5 - large images pasted via Safari do not render correctly

We are running TinyMCE version 5.4.1 with various options including:
paste_data_images: true
powerpaste_allow_local_image: true
When we drag & drop (or paste) in smaller images (400px X 400px) everything seems to work fine. The Base64 encoding is saved to the database and the image is rendered from all browsers, Chrome, Firefox and Safari.
However, when we paste in a larger image (1920px x 1081px) the image is only saved and rendered correctly in Chrome and Firefox. In Safari the Base64 encoding is saved with all lowercase characters. Therefore it doesn't render when attempting to view it. Has anyone else experienced this?
I have searched here as well as on the TinyMCE website but don't see anything mentioning this behavior. We will eventually attempt to move away from this Base64 implementation as it's no longer recommended but it's what we have for the time being so I'm just trying to address this issue.
When the page loads, its' elements can do so in parallel. But when the browser sees the base64 image, it blocks the page from loading until this image is rendered. Thus, inserting large images into the page as base64 is certainly not a good practice - it may slow down page loads and worsen the UX.
To fix this problem and maybe several other issues, utilizing the automatic_uploads option is highly recommended. It will upload pasted images on the server instead of converting them to base64. Here is the example of the PHP upload handler that will upload images and give their URLs back to TinyMCE.
Concerning the issue with Safari, some minimal reproducible example would be very useful.
I should also mention that PowerPaste is a premium feature that will not work with TinyMCE opensource. If you are using the paid version of TinyMCE, you can create a support ticket.

Upload same image in different sizes - Dropzonejs

There is any possibility to upload a file with different sizes in DropzoneJs?
I'm using vue-dropzone which is made with dropzonejs and i have to upload the same file with different sizing for srcset.
Example:
I want to upload the file test.png which is 1000x500 px. There is any possibility to upload it at the same time in original resolution and also in 500x250px?
Image resizing in the browser has been a seat-of-the pants experience for a long time. Web assemblies are the way of the future for processing-intensive tasks in web apps. I came across this project the other day. It looks fantastic and I really can't wait to strip out our home-baked image resizing with canvas and replace it with this.
The usual reason for doing this is to avoid large uploads. It's a little bit weird to want to resize in the browser then upload the original. You might be better resizing on the server. You'll save bandwidth and the server libraries will be more mature than what's available on the client.
Along with the original image object you can add one more your custom resized image to the array of images by using resize config of dropzone. You can do the above on drop event or adddedFile event of dropzone.

Extract graph image using PhantomJs

I use jqplot to create a complex data graph for a clinical web application using IE7. Now, I need to create a PDF and the graph is part of the PDF.
Since it is IE7, I can't export jqplot graph as an image.
My plan is:
From the web app, user clicks on a button to send the graph data (JSON) to a web service on a remote server.
On the remote server, I will have a HTML page to be built dynamically by PhantomJS using the JSON data passed to the web service.
When the page load is complete, I will "rasterize ??" the page to get the graph image.
I will use this image in building my PDF using package like jsPDF.
Return the PDF URI back to the web app.
Does this make any sense at all? I struggle on how to integrate all the moving parts together. Any suggestions?

How to integrate jQuery Lazy Load into Meta Slider WordPress plugin?

Unfortunately for me, Meta Slider WP plugin does not support lazy load, but it's perfect for what I need -- well almost. Here's why:
I have a ton of images (per slider) that will be displayed in multiple sliders using this WP Meta Slider plugin. All sliders will use the Flex Slider option, not the other options they have available. And, as you can imagine, the page load time is awful.
I looked up lazy load and came across this site:
http://www.appelsiini.net/projects/lazyload
It seems to be the perfect solution for what I need, but where do I need to input the snippet of coding in Meta Slider files to get this plugin to stop loading all the images at one time? What's happening is when a visitor comes to the site, this plugin loads every single image you have uploaded to it at that first-time page load which is causing the page to load awfully slow.
Additional info:
The images are pngs, 120x220 and under 50kb. I have found that converting them into jpgs instead of gifs compresses the file size to be between 12kb and 15kb, but anything lower, the images begin to lose color quality and the image color quality is extremely important.
END OF ADDITIONAL INFO
Anyway, my image database is growing and I need the images to only load upon the visitor scrolling up or down to reduce the page load time as much as possible so visitors will not be turned off and leave the site.
Thanks!
Oh, here's the plugin, I'm using:
wordpress.org/plugins/ml-slider/

Render a Graph (Chart) "silent" in VB.net

I have a program that checks in a file every X minutes and render a graph (sorry, a chart) by the data in this file.
Is there a way to build this program to run in the background, and instead of showing the graph, it export this graph as an image to a specified folder? That is, i wanna render the graph without displaying it.
Any suggestions?
I did'nt find the soultion on google, but i found it scrolling down the suggestion list for my chart. The function is called .SaveFile(), where i type the address. Too simple