GRID
This widget displays a 2D grid (usually for a graph) using the provided parameter information (positions count, default value etc.). It is typically used as a background for one or several CURVE_GRAPH objects.
Attributes brief detailed show all inherited
Since this element references the metadata for two parameters (one for each axis), all attributes are prefixed by 'x_' and 'y_', for each axis.
Examples
A simple demo to see colors and width of lines in the GRID.

- <!-- demo curve (you can instead use any PARAM's .info for GRID) -->
- <FORMULA_CURVE id="demo_curve" x_min="-5" x_max="5" x_default="0" y_default="0" y_max="10" y_min="-10" formula="x" />
- <!-- widget with black bg containing GRID and RULER -->
- <WIDGET layout_type="layer_stack" width="400" height="200" background_color="#000000">
- <!-- the grid -->
- <GRID width="100%" height="100%"
- x_positions_count="7" y_positions_count="5"
- x_subdiv_count="3" y_subdiv_count="1"
- subdiv_line_width="1" origin_line_width="10" line_width="5"
- subdiv_color="#AA0000" origin_color="#00AA00" color="#0000AA"
- x_param_info_id="demo_curve.x_info" y_param_info_id="demo_curve.y_info"
- />
- <!-- the ruler -->
- <RULER orientation="horizontal" width="100%" value_suffix="false" param_info_id="demo_curve.x_info" color="#FFFFFF" value_format=".2" content="{value}" positions_count="7" font_escapement="45" text_h_align="center" v_offset="0" v_align="bottom" h_offset="0" />
- </WIDGET>
Changing on the fly
Another example where you can see how to dynamically change GRID "zoom", in sync with RULER and CURVE_GRAPH zoom.

- <!-- create a formula curve -->
- <FORMULA_CURVE id="formula_curve_1" x_default="0" x_max="7" x_min="-7" y_default="0" y_max="1" y_min="-1" formula="sin(x)" />
- <!-- display the curve and the grid -->
- <ROW width="500" height="250" spacing="10">
- <!-- Y-Ruler -->
- <RULER id="ruler_y" orientation="vertical" width="35" height="240" param_info_id="formula_curve_1.y_info" color="#AAAAAA" value_format=".1" content="{value}" positions_count="5" v_offset="-20" h_offset="0" v_margin="20" />
- <COLUMN width="450" height="200" spacing="10">
- <LAYER_STACK width="100%" height="100%">
- <!-- Grid -->
- <GRID id="grid_1" width="100%" height="100%" x_positions_count="15" y_positions_count="3" x_subdiv_count="1" y_subdiv_count="1" color="#555555" subdiv_color="#CCCCCC" origin_color="#00AA00" line_width="0.75" origin_line_width="2" x_param_info_id="formula_curve_1.x_info" y_param_info_id="formula_curve_1.y_info" x_offset="0.5" opacity="0.5" />
- <!-- Curve graph -->
- <CURVE_GRAPH id="curve_graph_1" curve_id="formula_curve_1" width="100%" height="100%" anti_alias="true" color="#0066FF" line_width="3" sample_rate="1" x_offset="0.5" />
- </LAYER_STACK>
- <!-- X-Ruler -->
- <RULER id="ruler_x" orientation="horizontal" width="490" value_suffix="false" param_info_id="formula_curve_1.x_info" color="#AAAAAA" value_format=".0" content="{value}" positions_count="15" font_escapement="90" text_h_align="right" v_offset="0" h_offset="-9" v_align="center" offset="0.5" h_margin="20" />
- </COLUMN>
- </ROW>
- <!-- link grid .x_zoom to ruler and curve -->
- <PARAM_MULTI_LINK from="grid_1.x_zoom" to="ruler_x.zoom;curve_graph_1.x_zoom" />
- <!-- control to change grid .x_zoom-->
- <PARAM_TEXT_CONTROL param_id="grid_1.x_zoom" content="x_zoom: {value}" />
Grid can be also used with a single coordinate

- <PARAM id="freqs" min="0" max="10" default="5" />
- <GRID width="300" height="30"
- x_param_info_id="freqs.info" x_positions_count="11" x_subdiv_count="1" subdiv_color="#CCCCCC" origin_line_width="2" subdiv_line_width="0.5" origin_color="#DD0000" />
- <RULER orientation="horizontal" width="340" height="30" h_margin="20" param_info_id="freqs.info" color="#AAAAAA" value_format=".1" content="{value}" positions_count="11" font_escapement="90" text_h_align="right" v_offset="0" h_offset="-10" v_align="center" font_size="12" />
Related elements
Also see RULER, FORMULA_CURVE, CURVE_FROM_PARAM_OVER_TIME, CURVE_GRAPH.
Comments
Please, authorize to view and post comments.