Functions and data
The observations fade in one year at a time. Each dot pairs the daily low and high from one of Seattle’s 1,461 weather observations between 2012 and 2015. NOAA data via Vega Datasets
read<List<WeatherDay>> accepts a project-relative path or an HTTP(S) URL.
Ebi uses the URL’s path extension to select the data format. A bounded
in-memory cache reuses downloads across hot reloads. Restarting the session
fetches them again.
In a browser, the server must allow cross-origin fetches when it’s on a
different origin.
| Use | To draw |
|---|---|
Axes, NumberPlane, PolarPlane, ComplexPlane | Cartesian axes, a rectangular grid, polar guides, or a complex plane. Call frame() to show it. |
NumberLine, UnitInterval | A single labeled horizontal axis. |
ax.plot(f), ax.plot_parametric_curve(f), ax.plot_polar_graph(f) | A function, a function returning [x, y], or a radius as a function of angle in radians. |
ax.plot_implicit_curve(f) | A level set such as x*x + y*y - 1 = 0, with level=0 by default. |
ax.plot_line_graph(points), ax.scatter(points), ax.bar(points), BarChart(values) | A line, markers, or bars. Each coordinate pair is [x, y]. |
ax.get_area(f), ax.get_riemann_rectangles(f) | Area to the axis or to bounded_function. |
ax.plot_derivative_graph(f), ax.plot_antiderivative_graph(f), ax.get_secant_slope_group(f, x=1) | A derivative, an integral from the lower range endpoint, or a secant with rise and run. |
ax.get_lines_to_point(point), ax.get_graph_label(f, text="f", x=1), ax.get_axis_labels() | Guides and annotations. |
ax.get_vector(point), ax.vector_field(f), ax.streamlines(f) | An arrow from the origin, arrows sampled from a vector field, or trajectories through that field. |
Use ax.c2p([x, y]) to position an Ebi element from data. Use
ax.p2c([x, y]) for the inverse. For a logarithmic axis, set
x_log_base or y_log_base and use positive range endpoints. On a complex
plane, pass [real, imaginary].
Set edge_axes=true on Plot to place the rulers and tick labels along the
left and bottom edges. The grid draws behind the series.
Pass a signal to points on ax.plot_line_graph or ax.scatter to move the data. For a function plot, pass a second Number into the callback with parameter= as in the wave example. Sampled curves and contours keep the points computed at construction. You can animate the position, rotation, scale, or opacity of the resulting element.