You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for Holoviews with the Bokeh rendering engine has been added #13 . We can now choose what rendering engine to use for each chart. It is possible to compose dashboards that use both engines.
Technically many things have changed. All the charts generation logics now live in an external module: Dataswim, a data analytics library of my composition that is equipped to handle charts.
The generation logics for Altair is isolated in a specific module and freezed while waiting for Altair 2.
Chartflo is now only responsible for Django related stuff: mostly the dashboards view and the events-based charts generation. As a result both the code and api had been drastically simplified: ex:
fromchartflo.chartsimportchartfromdjango.contrib.auth.modelsimportUser# get the dataall_users=User.objects.filter(is_active=True)
staff=all_users.filter(is_staff=True).count()
superusers=all_users.filter(is_superuser=True).count()
users=all_users.filter(is_superuser=False, is_staff=False).count()
# declare the datadata= [users, staff, superusers]
index= ["Users", "Staff", "Superusers"]
columns= ["Number"]
chart.load_data("Groups", data, columns=columns, index=index)
# get the chartc=chart.draw("Groups", "Number", chart_type="bar")
# now in a jupyter notebook you can type:just 'c' to draw the chart# store the chart for later exportingchart.stack("registrations1", "User registrations 1", c)
# ... make other charts# then export to files in the folder templates/data/htmlchart.export("data/html")
Example of a generator that takes the user registration dates, aggregate them by one day and draw a line chart using Bokeh and points chart using Altair:
fromdataswimimportdsfromdjango.contrib.auth.modelsimportUserfromchartflo.chartsimportchartdefrun(events=None):
# 1. crunch dataq=User.objects.all()
# load data from a django queryds.load_django(q, dateindex="date_joined")
# keep only the relevant datads.keep("date_joined", "username")
# resample data by one day periodsds.rsum("1D")
# 2. draw charts# Note: ds.df is a pandas DataFrame instancec=chart.draw("date", "num", ds.df, "line")
chart.stack("registrations1", "User registrations 1", c)
chart.engine="altair"x= ("date", "date:T")
y= ("num", "num:Q")
# if no dataset is passed, it will use the previously declared onec2=chart.draw(x, y, chart_type="circle")
chart.stack("user_registrations", "User registrations", c2)
# Write the charts html to fileschart.export("data/html")
The Holoviews Bokeh rendering engine is now default. Altair 1 is getting old and is lagging behind: we are waiting for Altair 2. Furthermore Bokeh is more powerful and offers a very nice interactivity.
To resume we now have:
More power
More lazyness
I will update the doc and the examples soon and release.
[Edit]: comments in code
The text was updated successfully, but these errors were encountered:
Support for Holoviews with the Bokeh rendering engine has been added #13 . We can now choose what rendering engine to use for each chart. It is possible to compose dashboards that use both engines.
Technically many things have changed. All the charts generation logics now live in an external module: Dataswim, a data analytics library of my composition that is equipped to handle charts.
The generation logics for Altair is isolated in a specific module and freezed while waiting for Altair 2.
Chartflo is now only responsible for Django related stuff: mostly the dashboards view and the events-based charts generation. As a result both the code and api had been drastically simplified: ex:
Example of a generator that takes the user registration dates, aggregate them by one day and draw a line chart using Bokeh and points chart using Altair:
The Holoviews Bokeh rendering engine is now default. Altair 1 is getting old and is lagging behind: we are waiting for Altair 2. Furthermore Bokeh is more powerful and offers a very nice interactivity.
To resume we now have:
I will update the doc and the examples soon and release.
[Edit]: comments in code
The text was updated successfully, but these errors were encountered: