I'm currently using Open Flash Chart 2 on my django website, but I find it insufficiently customizable. (It's great when you want the usual barcharts, piecharts, but what about homemade shapes...). Although it's open source, I don't feel like diving in the Flex code.
I'm thinking a lot about matplotlib but the documentation is rather poor on web application developpment.
Does anybody uses matplotlib in his web app?
I would appreciate links on those web sites to figure out what can be achieved.
Thanks
If you're looking for flash-like interactivity in a web application, matplotlib probably isn't what you're looking for. It's fine for rendering a static image to serve out in a web app, though. (and is amazingly flexible)
However, there's been a lot of recent development on making matplotlib more oriented toward web interactivity. Take a look at the new HTML5/Canvas backend. http://code.google.com/p/mplh5canvas/ It's not quite finished yet, but it's worth playing around with, anyway.
You can use MPLD3 to export your existing matplotlib stuff to browser.
Matplotlib itself is very powerful, albeit, I agree the documentation is not very extensive.
I've learned it just by trying stuff out and finding examples on the net.
'matplotlib example X' where X is somewhat about what you are trying to plot find suprising amount of code on the net.
I have never used matplotlib, but how about using Google's Chart API http://code.google.com/intl/pl-PL/apis/chart/ for charts?
Resurrecting an old question with the current state of affairs. As of Fall 2013, there's now an example of embedding matplotlib's WebAgg backend in a Tornado-based webserver: https://github.com/matplotlib/matplotlib/blob/master/examples/user_interfaces/embedding_webagg.py
This makes use of websockets to send the figure updates to the browser, which allows for really nice interactive plots that get rendered client-side. This means that no images are being generated on the server!
This tool is nice, but it would awesome if it worked with matplotlib.
http://www.highcharts.com/
Related
Im starting a new project for personal porpuse!
Im working personally in finance, I decided to create personal chart viewing software to suit my needs. I thought I'd create a good part of the backend in Python as it is a language I know quite well. Use Javascript for the graphic side, and use a webview in a windows form to make everything available as if it were software.
As for the graphics I thought of using: Lightweight Library for JS, I find that today it is the most avant-garde library compared to the classic plotly, matplotlib.
Use pywebview as a bridge between Python and JS and to redirect everything in a windows form.
However I find it a bit difficult to use this library (pywebview), there is a poor documentation around and not very clear to me (my level of JS is really basic). However, I believe it is one of the most convenient solutions.
I would have thought of using pyscript, but it still seems early to use this library in production.
Questions:
Do you think such a job is feasible?
Do you know other libraries/better solutions to do such jobs?
What kind of approach would you use if you were to do such work?
What I am trying to achieve is to write most of the functions in python and use only JS to make calls through buttons or to get data from various inputs.
Wandering around the web I found a work already partially created by this guy (if you are reading, Thanks Filipe you have been very helpful! here you can see his project hosted on Github) but unfortunately it is difficult for me to get my hands on a code not produced by me.
I'm currently developing a Django app that allows students to programmatically develop SVG graphics. They can code Python in their browser with ACE editor. The code is executed on the server, stored in a database and the generated SVG (custom library) returned and displayed. An example code that displays a filled ellipse looks like so:
graph.draw(Circle(cx=0, cy=0, r=20, fill="lime").scale(2, 1)
Now I'm wondering, how I could extend this app to do some 3D. I stumbled over X3Dom, which seems promising and not too hard to generate and I could write another lightweight pythonic library for this. But, it doesn't seem to do CSG (constructive solid geometry) which is major drawback.
Any hints in what direction I should investigate for some 3D web technology that allows easy 3D scene generation with server-side python and that implements CSG?
NB: OpenJSCad is simalar to what I'd like to achieve, except that my solution allows for classroom collaboration and it must expose Python to students as the programming language. The aim is to spice up the teaching of Python programming with graphics.
I believe I used three.js to do CSG a while back. There used to be an example online. You are right that X3D does not do CSG. I was doing cross sections of the earth and found a way with X3D. You might be able to use VPython or brython in the browser if your worried about Python not running in the browser. I’ve only brython for a short time testing another person’s project and vpython not at all.
If you’re doing something like inverseCSG or CSGNet, is your class available online?
In other words, maybe try to find a Python library that does CSG instead searching for a rendering engine in JS. Don’t view the browser as limited to JS.
I only found three.js when I was looking.
Maybe search for a solution which is not a solid solution.
try checking out the library "trimesh" for python which relays mainly on watertight stl files, but allows you to do some boolean operations for CSG. You can substract one file from the other, extended and find the intersection. Plus, it has some primitive functions directly like cylinders and spheres.
I've been working with data visualization using Python. To do such think, I've been using Matplotlib to get the visualizations. However, now I have some demand to provide more interactive visualization, besides a complete GUI.
I'm wondering how could I do such thing without losing all work done so far in Python, i.e., if there is some tool for Python to do such thing or if I have to go to D3 or something like it.
Here there is an example of what I have to achieve. I'm not building an web app, I just need to provide a good GUI and data interaction.
Thank you in advance.
As well as targeting a web app using frameworks as suggested by mwaskom, you could try data visualization / plotting libraries that offer more interactivity than matplotlib, such as
PyQtGraph
Pyqwt
Glumpy
Vispy (new project)
Galry
I've used PyQtGraph myself in several small projects.
You could check out the mpld3 project, which aims to provide a translation between matplotlib graphics and d3. It's pretty new and rapidly developing, but it's worth at least keeping an eye on.
For a different approach, there's the vincent library, which has its own API but similarly produces d3 (by way of Vega) for making graphics that target the web in Python.
Question: is it possible to recreate such functionality with python? http://itools.subhashbose.com/grapher/index.php
Backstory: We want to create a hybrid online teaching/computational resource for undergraduate students of our institute, running on a local server. I have worked only in matlab, and have fair bit experience in c++. so wanted to choose appropriate language (preferably open source, but not strictly) which can facilitate above functionality with mathematica cdf like properties. I wanted to learn python form long time so wanted to know if it can do the job. Dont want to use javascript (which i suppose is used in this page).
For fetching data from html have a look at this site: http://docs.python.org/2/howto/urllib2.html.
If you want to built your own site, there are small web frameworks like flask and bottle. If you are interested in a more comprehensive web framework, check out Django: http://www.djangoproject.com/.
Matplotlib could be used to generate the plot e.g. in jpg or svg. The latter might give you the option to have the image respond to e.g. hovering over specific parts of the plot like in your example page.
Maybe also have a look at https://pypi.python.org/pypi/django-chart-tools. From their webpage:
django-chart-tools is a simple app for creating charts in django templates using Google Chart API.
I have a live feed of data that represents network traffic for a remote machine. I would like to take this data and visualize it in a live plot in my webapp that is using Django, What is the easiest and fast way to achieve this.
What I tried so far: Generating scatter plots using matplotlib and updating the .png image on the webapp
Use RRDTool:
RRDtool is the OpenSource industry standard, high performance data logging and graphing system for time series data. RRDtool can be easily integrated in shell scripts, perl, python, ruby, lua or tcl applications.
Some examples including web-based system monitoring applications of RRDTool:
http://oss.oetiker.ch/rrdtool/gallery/index.en.html
http://snm.sourceforge.net/
http://munin-monitoring.org/
A good option (I know from first hand experience) is using the Ajax update method with the Flot js library to plot live updating graphs. +1 for simplicity, extensible options, plugins and for the MIT license.
Look at an example here http://people.iola.dk/olau/flot/examples/ajax.html
Cheers!
In the past when I've had to plot data in a browser, I've used jqPlot. You could set javascript up to periodically poll a url on your django app that returns JSON encoded data to plot.