Detroit

Latest version: v2.2.0

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

Scan your dependencies

Page 1 of 2

2.2.0

- Add symbols to access all predefined symbols (see [documentation](https://detroit.readthedocs.io/en/latest/api/shape/symbols.html)).
- Add scale chromatic to access all predefined interpolation colorschemes (see [documentation](https://detroit.readthedocs.io/en/latest/api/scale_chromatic/index.html)).
- Add area (see [documentation](https://detroit.readthedocs.io/en/latest/api/shape/areas.html))
- Add arcs and pies (see [arcs documentation](https://detroit.readthedocs.io/en/latest/api/shape/arcs.html) and [pies documentation](https://detroit.readthedocs.io/en/latest/api/shape/pies.html))
- Add more examples in documentation
- Add `Selection.filter`
- Fix some issues from `path.py`

2.1.0

- Add `scale_chromatic` (see the [documentation](https://detroit.readthedocs.io/en/latest/api/scale_chromatic/index.html) for more information)
- Add more examples in `examples` folder

**Full Changelog**: https://github.com/bourbonut/detroit/compare/v2.0.0...v2.1.0

2.0.0

New implementation of `detroit`

I reimplement most of fundamental features of `d3js` in Python instead of generating javascript code.
Then there is a new documentation.

Currently there are 1052 tests passed with 3 skipped tests.

Coverage

| Package Name | Yes / No | Tests OK | Notes |
|-----------------|----------|----------|-------------------------------|
| array | Yes | Yes | Not all functions supported |
| axis | Yes | Yes | |
| brush | No | - | |
| chord | No | - | |
| color | Yes | Yes | |
| contour | No | - | |
| delaunay | No | - | |
| dispatch | No | - | |
| drag | No | - | |
| dsv | No | - | use `import pandas / polars` |
| ease | No | - | |
| fetch | No | - | use `import requests` |
| force | No | - | |
| format | Yes | Yes | |
| geo | No | - | |
| hierarchy | No | - | |
| interpolate | Yes | Yes | interpolate CSS not supported |
| path | Yes | Yes | |
| polygone | No | - | |
| quadtree | No | - | |
| random | No | - | Use `import random` |
| scale | Yes | Yes | Mostly `test_linear` |
| scale-chromatic | No | No | TODO: tests |
| selection | Yes | No | TODO: tests |
| shape | Yes | Yes | Missing most of shapes |
| time | Yes | Yes | |
| time-format | Yes | Yes | |
| timer | No | - | |
| transition | No | - | |
| zoom | No | - | |

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

Page 1 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.