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
To empower third-party app building on top of FlexMeasures, we'll make it possible to load our figures through the FlexMeasures API.
This ticket is about the most important figure (power data). It establishes the new practice that the ui package also offers API endpoints, something which we will build out more powerful in the future (see below).
The new endpoint
Here is how the endpoint will look:
GET /charts/data/power
with a JSON body including details about which dataset to load:
The endpoint returns custom Javascript and HTML data (TODO: figure out how to send that safely through HTTP). Developers will then only need to include Bokeh CSS and JS in their HTML and the figure will show.
The new endpoint will use data.services.analytics.get_power_data and ui.views.analytics.make_power_figure.
It will be added to the API routes. I checked, and this is compatible with our plans to document all API endpoints with OpenAPI using the ApiSpec package (see #17).
Future work: more powerful chart API and more responsive figures
For the record, we have ongoing efforts for a more powerful charts API, like this:
GET /chart/<data_structure>/<chart_type>/<dataset_name>/<agg_demand_unit>
where developers can configure charts aspects of the charts. It will be based on Vega-Lite instead of Bokeh.
Data will then be loaded with a second endpoint, which allows for more interactive apps. See the charts-api branch.
The text was updated successfully, but these errors were encountered:
To empower third-party app building on top of FlexMeasures, we'll make it possible to load our figures through the FlexMeasures API.
This ticket is about the most important figure (power data). It establishes the new practice that the
ui
package also offers API endpoints, something which we will build out more powerful in the future (see below).The new endpoint
Here is how the endpoint will look:
GET /charts/data/power
with a JSON body including details about which dataset to load:
The endpoint returns custom Javascript and HTML data (TODO: figure out how to send that safely through HTTP). Developers will then only need to include Bokeh CSS and JS in their HTML and the figure will show.
The new endpoint will use
data.services.analytics.get_power_data
andui.views.analytics.make_power_figure
.It will be added to the API routes. I checked, and this is compatible with our plans to document all API endpoints with OpenAPI using the ApiSpec package (see #17).
Future work: more powerful chart API and more responsive figures
For the record, we have ongoing efforts for a more powerful charts API, like this:
GET /chart/<data_structure>/<chart_type>/<dataset_name>/<agg_demand_unit>
where developers can configure charts aspects of the charts. It will be based on Vega-Lite instead of Bokeh.
Data will then be loaded with a second endpoint, which allows for more interactive apps. See the
charts-api
branch.The text was updated successfully, but these errors were encountered: