UNKNOWN
Project description
P3
===
P3 contains some core features of @mbostock's awesome [d3] in python
Why
---
I have grown used to creating html views in the browser using d3. When I came to do some server side work in python I wanted to manipulate a tree of nodes with d3, not concatenate strings with a templating language.
Basic Usage
-----------
### Creating a simple document
```python
p3 = P3()
p3.select('body')\
.create('div').classed('foo', True)\
.create('p').text('hi')
```
### Binding to some data
```python
p3 = P3()
sel = p3.select('body').create('div').create('ul')
sel = sel.selectAll('li').data(["foo", "bar"])
sel.enter().create('li')
sel.text(lambda n, d, i: d)
```
[d3]: http://d3js.org/
===
P3 contains some core features of @mbostock's awesome [d3] in python
Why
---
I have grown used to creating html views in the browser using d3. When I came to do some server side work in python I wanted to manipulate a tree of nodes with d3, not concatenate strings with a templating language.
Basic Usage
-----------
### Creating a simple document
```python
p3 = P3()
p3.select('body')\
.create('div').classed('foo', True)\
.create('p').text('hi')
```
### Binding to some data
```python
p3 = P3()
sel = p3.select('body').create('div').create('ul')
sel = sel.selectAll('li').data(["foo", "bar"])
sel.enter().create('li')
sel.text(lambda n, d, i: d)
```
[d3]: http://d3js.org/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
p3-0.1.0-dev.tar.gz
(2.5 kB
view hashes)