widget_graph_interface

A graph gadget allows to display various types of graph (lines, bars, 3D, etc)

render
render a graph
configuration_dict
Generic graph gadget. The purpose of this gadget is to provide an unique API for various charting libraries Options supported are : { "$schema": "http://json-schema.org/draft-04/schema#", "description": "Parameters to generate a graph", "properties": { "layout": { "description": "definition of layout", "properties": { "title": { "description": "The title of the graph", "type": "string" }, "axis_dict": { "properties": { ".*": { "description": "layout definition of one axis", "properties": { "title": { "description": "label to display on axis n", "type": "string" }, "scale_type": { "description": "type of axis", "enum": [ "linear", "logarithmic" ], "default": "linear", "type": "string" }, }, "value_type": { "description": "value type for data on this axis", "enum": [ "number", "date", "string" ], "default": "number", "type": "string" }, }, "position": { "description": "where to place the axis, only y axis for now", "enum": [ "left", "right" ], "type": "string" } }, "type": "object", "additionalProperties": false } }, "type": "object" } }, "type": "object", "additionalProperties": false }, "data": { "description": "the list of data sets", "items": { "properties": { "value_dict": { "[0-9]*": { "description": "values for the axis number n", "type": "array" }, "type": "object" }, "type": { "description": "type of trace that should be displayed", "enum": [ "pie", "bar", "scatter", "marker", "surface", "line" ], "default": "scatter", "type": "string" }, "title": { "description": "label for this data set", "type": "string" }, "axis_mapping_id_dict": { "[0-9]*": { "description": "mapping id for the axis number n, this is optional and allows to have several scales per axis, several data set might use same name if they should be grouped on the same scale", "type": "string" }, "type": "object" } }, "additionalProperties": false, "type": "object" }, "type": "array" } }, "additionalProperties": false } Options were inspired by https://plot.ly/javascript/ which supports various types of charts. For axis, typically, on a scatter: - axis 0 would be mapped to x - axis 1 would be mapped to y For a 3D surface, we would have : - axis 0 would be mapped to x - axis 1 would be mapped to y - axis 2 would be mapped to z Example of options: {data: [{ value_dict: {"0": [0, 1, 2], "1": [0, 1, 4] }, type: "scatter", label_list: ["First Point", "Second Point", "Third Point"], axis_mapping_id_dict: {"1": "1_1"}, title: "first data set" }, { value_dict: {"0": [0, 1, 3],, "1": [0, 10, 40] }, type: "scatter", title: "second data set", axis_mapping_id_dict: {"1": "1_2"} } ], layout: {axis_dict : {"0": {"title": "x axis label", "scale_type": "linear", "value_type": "number"}, "1_1": {"title": "y axis label for first data set", "scale_type": "log", "side" : "left"}, "1_2": {"title": "y axis label for second data set", "position": "right"} }, title: "Title for my global graph"} });
updateConfiguration
update Configuration of graph (implies redrawing)
configuration_dict
same format as the configuration_dict passed to render