GwyGraphArea — Layout for drawing graph curves
GtkWidget * | gwy_graph_area_new () |
GtkWidget * | gwy_graph_area_get_label () |
void | gwy_graph_area_set_model () |
GwyGraphModel * | gwy_graph_area_get_model () |
void | gwy_graph_area_get_cursor () |
void | gwy_graph_area_set_x_range () |
void | gwy_graph_area_set_y_range () |
void | gwy_graph_area_set_x_grid_data () |
void | gwy_graph_area_set_y_grid_data () |
const gdouble * | gwy_graph_area_get_x_grid_data () |
const gdouble * | gwy_graph_area_get_y_grid_data () |
GwySelection * | gwy_graph_area_get_selection () |
void | gwy_graph_area_set_status () |
GwyGraphStatusType | gwy_graph_area_get_status () |
void | gwy_graph_area_draw_on_drawable () |
GString * | gwy_graph_area_export_vector () |
void | gwy_graph_area_enable_user_input () |
void | gwy_graph_area_set_selection_editable () |
void | gwy_graph_area_edit_curve () |
GwyGraphStatusType | status | Read / Write |
void | edit-curve | Action |
struct | GwyGraphArea |
struct | GwyGraphAreaClass |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkContainer ╰── GtkLayout ╰── GwyGraphArea
GwyGraphArea implements AtkImplementorIface and GtkBuildable.
#include <libgwydgets/gwydgets.h>
GwyGraphArea is the central part of GwyGraph widget. It plots a set of data curves with the given plot properties.
It is recommended to use it within GwyGraph, however, it can also be used separately.
GtkWidget *
gwy_graph_area_new (void
);
Creates a new graph area widget.
Newly created graph area as GtkWidget.
GtkWidget *
gwy_graph_area_get_label (GwyGraphArea *area
);
Gets the label inside a graph area.
area |
A graph area. |
The graph label widget within the graph area.
void gwy_graph_area_set_model (GwyGraphArea *area
,GwyGraphModel *gmodel
);
Sets the graph model of a graph area.
area |
A graph area. |
|
gmodel |
New graph model. |
GwyGraphModel *
gwy_graph_area_get_model (GwyGraphArea *area
);
Gets the model of a graph area.
area |
A graph area. |
The graph model this graph area widget displays.
void gwy_graph_area_get_cursor (GwyGraphArea *area
,gdouble *x_cursor
,gdouble *y_cursor
);
Gets mouse cursor related values within a graph area.
area |
A graph area. |
|
x_cursor |
Location to store the x value corresponding to cursor position. |
|
y_cursor |
Location to store the y value corresponding to cursor position. |
void gwy_graph_area_set_x_range (GwyGraphArea *area
,gdouble x_min
,gdouble x_max
);
Sets the horizontal range a graph area displays.
area |
A graph area. |
|
x_min |
The minimum x value, in real coodrinates. |
|
x_max |
The maximum x value, in real coodrinates. |
void gwy_graph_area_set_y_range (GwyGraphArea *area
,gdouble y_min
,gdouble y_max
);
Sets the vertical range a graph area displays.
area |
A graph area. |
|
y_min |
The minimum y value, in real coodrinates. |
|
y_max |
The maximum y value, in real coodrinates. |
void gwy_graph_area_set_x_grid_data (GwyGraphArea *area
,guint ndata
,const gdouble *grid_data
);
Sets the grid data on the x-axis of a graph area
area |
A graph area. |
|
ndata |
The number of points in |
|
grid_data |
Array of grid line positions on the x-axis (in real values, not pixels). |
void gwy_graph_area_set_y_grid_data (GwyGraphArea *area
,guint ndata
,const gdouble *grid_data
);
Sets the grid data on the y-axis of a graph area
area |
A graph area. |
|
ndata |
The number of points in |
|
grid_data |
Array of grid line positions on the y-axis (in real values, not pixels). |
const gdouble * gwy_graph_area_get_x_grid_data (GwyGraphArea *area
,guint *ndata
);
Gets the grid data on the x-axis of a graph area.
area |
A graph area. |
|
ndata |
Location to store the number of returned positions. |
Array of grid line positions (in real values, not pixels) owned by the graph area.
const gdouble * gwy_graph_area_get_y_grid_data (GwyGraphArea *area
,guint *ndata
);
Gets the grid data on the y-axis of a graph area.
area |
A graph area. |
|
ndata |
Location to store the number of returned positions. |
Array of grid line positions (in real values, not pixels) owned by the graph area.
GwySelection * gwy_graph_area_get_selection (GwyGraphArea *area
,GwyGraphStatusType status_type
);
Gets the selection object corresponding to a status of a graph area.
A selection object exists even for inactive status types (selection modes), therefore also selections for other modes than the currently active one can be requested.
area |
A graph area. |
|
status_type |
Graph status. Value |
The requested selection. It is NULL
only if status_type
is
GWY_GRAPH_STATUS_PLAIN
and the current selection mode is
GWY_GRAPH_STATUS_PLAIN
.
void gwy_graph_area_set_status (GwyGraphArea *area
,GwyGraphStatusType status_type
);
Sets the status of a graph area.
When the area is inside a GwyGraph, use gwy_graph_set_status()
instead
(also see this function for details).
area |
A graph area. |
|
status_type |
New graph area status. |
GwyGraphStatusType
gwy_graph_area_get_status (GwyGraphArea *area
);
Gets the status of a grap area.
See gwy_graph_area_set_status()
.
area |
A graph area. |
The current graph area status.
void gwy_graph_area_draw_on_drawable (GwyGraphArea *area
,GdkDrawable *drawable
,GdkGC *gc
,gint x
,gint y
,gint width
,gint height
);
Draws a graph area to a Gdk drawable.
area |
A graph area. |
|
drawable |
a GdkDrawable (destination for graphics operations) |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
x |
X position in |
|
y |
Y position in |
|
width |
width of the graph area on the drawable |
|
height |
height of the graph area on the drawable |
GString * gwy_graph_area_export_vector (GwyGraphArea *area
,gint x
,gint y
,gint width
,gint height
);
Creates PostScript representation of a graph area.
area |
A graph area. |
|
x |
Bounding box origin X-coordinate. |
|
y |
Bounding box origin Y-coordinate. |
|
width |
Bounding box width. |
|
height |
Bounding box height. |
A fragment of PostScript code representing the the graph area as a newly allocated GString.
void gwy_graph_area_enable_user_input (GwyGraphArea *area
,gboolean enable
);
Enables/disables auxiliary graph area dialogs (invoked by clicking the mouse).
Note, however, that this setting does not control editability of selections.
Use gwy_graph_area_set_selection_editable()
for that.
area |
A graph area. |
|
enable |
|
void gwy_graph_area_set_selection_editable (GwyGraphArea *area
,gboolean setting
);
Enables/disables selection editing using mouse.
When selection editing is disabled the graph area status type determines the selection type that can be drawn on the area. However, the user cannot modify it.
area |
A graph area. |
|
setting |
|
Since: 2.45
void gwy_graph_area_edit_curve (GwyGraphArea *area
,gint id
);
Invokes the curve property dialog for a curve.
If the dialog is already displayed, it is switched to the requested curve.
area |
A graph area. |
|
id |
The index of the curve to edit properties of. |
Since: 2.5
struct GwyGraphArea;
struct GwyGraphAreaClass { GtkLayoutClass parent_class; void (*edit_curve)(GwyGraphArea *area, gint id); void (*reserved2)(void); };
“status”
property“status” GwyGraphStatusType
The type of reaction to mouse events (zoom, selections).
Owner: GwyGraphArea
Flags: Read / Write
Default value: GWY_GRAPH_STATUS_PLAIN
“edit-curve”
signalvoid user_function (GwyGraphArea *gwygraphcurvemodel, int arg1, gpointer user_data)
The ::data-changed signal is emitted when a curve properties are to be edited.
gwygraphcurvemodel |
The GwyGraphArea which received the signal. |
|
arg1 |
The index of the curve to edit. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
Since: 2.5