Detroit

Latest version: v1.2.2

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.2.2

- Improvement of inline functions syntax :
python
from detroit import Data, Script, d3

data = {"curves": {"values": [{"x": 1, "y": 2}], "color": "blue"}}
data = Data(data)
d = data.datum

vmax = 1
width = 100
script = Script()
x = script(
"x",
d3.scaleLinear()
.domain([-vmax, vmax])
.range([0, width]),
)

y = script(
"y",
d3.scaleLinear()
.domain([-vmax, vmax])
.range([0, width]),
)

print(d.curves.values)
print(d > x(data.curves.values.x))

d = d.curves.values
print(d3.line().x(d > x(d.x)).y(d > y(d.y))(d))

Outputs :

d.values
d => x(d.x)
d3.line().x(d => x(d.x)).y(d => y(d.y))(d.values)


- Add `autoreload` option to avoid pressing the "refresh button" in your browser
python
render(data, script, autoreload=True)

1.2.1

- Add documentation from d3js API and Plot API directly in the code by using [`api_maker`](https://github.com/bourbonut/detroit/tree/main/api_maker) (check out [`d3.__init__.py`](https://github.com/bourbonut/detroit/blob/main/detroit/d3/__init__.py) to see the code)
- `d3.interpolateTurbo(no_args=True)` becomes `d3.interpolateTurbo` (no need to add `no_args`)
- Fix small errors in documentation

1.1.0

- Added `websocket_render` and `websocket_save` functions which allows to update dynamically a visualization. Check out the documentation for more information.
- Improvement of the usage of `var` class

1.0.3

Mainly faster `detroit` import

1.0.2

Small fix

- Added `MANIFEST.in` to include `templates` and `static` files

1.0.1

Features

- Write as close as possible d3 and Plot code
- Render one or multiple plots in your browser or in your jupyter notebook
- Customize style as you want
- Save them into `.svg`, `.png` or `.pdf`

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.