Skip to content

Releases: bourbonut/detroit

v1.2.2

23 Jun 15:05
Compare
Choose a tag to compare
  • Improvement of inline functions syntax :
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
render(data, script, autoreload=True)

v1.2.1

31 May 14:19
Compare
Choose a tag to compare
  • Add documentation from d3js API and Plot API directly in the code by using api_maker (check out 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

v1.1.0

13 Mar 18:21
Compare
Choose a tag to compare
  • 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

v1.0.3

04 Feb 13:07
Compare
Choose a tag to compare

Mainly faster detroit import

v1.0.2

06 Jan 13:57
Compare
Choose a tag to compare

Small fix

  • Added MANIFEST.in to include templates and static files

v1.0.1

24 Dec 18:20
Compare
Choose a tag to compare

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