mikedewar/d3py — Issue #23: Server shuts down directly after fig.show()
Author: arthurgerigk
Created: 2012-02-15 10:05:04+00:00
State: open

python test.py
you can find your chart at http://localhost:8000/basic_example/basic_example.html
Shutting down httpd
Cleaning temp files

The browser window opens but the server is already shut down.

Source code:
import d3py
import pandas
import numpy as np
# some test data
T = 100
# this is a data frame with three columns (we only use 2)
df = pandas.DataFrame({
"time" : range(T),
"pressure": np.random.rand(T),
"temp" : np.random.rand(T)
})
## build up a figure, ggplot2 style
# instantiate the figure object
fig = d3py.Figure(df, name="basic_example", width=300, height=300)
# add some red points
fig += d3py.geoms.Point(x="pressure", y="temp", fill="red")
# writes 3 files, starts up a server, then draws some beautiful points in Chrome
fig.show()