title: Example of Asynchronous page processing in Flask
body: <p>I am dealing with an application which is using a lot of graphics (the library <a href="http://raphaeljs.com/reference.html" rel="nofollow">Raphael</a> and <a href="http://graphdracula.net/" rel="nofollow">graphdracula</a>). Basically, the application is drawing different graphs. Let's say that we have 3 pages which are drawing graphs:</p>
  
  <ol>
  <li>graph1</li>
  <li>graph2</li>
  <li>graph3</li>
  </ol>
  
  <p>Let's say we have the following URL: </p>
  
  <pre><code>www.someurl.com/graph1
  </code></pre>
  
  <p>Now, this URL is going to load the page and the drawing algorithm for <em>graph1</em>. The way my application works now is: if I want to change the layout (say, to graph2), I will have to reload a whole page:</p>
  
  <pre><code>www.someurl.com/graph2
  </code></pre>
  
  <p>What I want to do is: to make this as a Single Page Application (SPA). When we load the application, I want all the graphs to be loaded, but only one to be visible (I guess this is the way to do it). When I click a button, just to load the stuff I need, not the whole page. Something like, when we open the application's page about graphs, to be:</p>
  
  <pre><code>www.someurl.com/graph#1 -&gt; for the first graph
  www.someurl.com/graph#2 -&gt; for the second graph
  www.someurl.com/graph#3 -&gt; for the third graph
  </code></pre>
  
  <p>I want to this asynchronous. I tried to find something for Flask, but without sucess. Can someone please point me into the right direction how should I do this?</p>
  
  <p>Thanks in advance! </p>