ASCII terminal plotting backend - Legend Management
This module handles ASCII-specific legend rendering, positioning,
and management including specialized autopct support.
Author: fortplot contributors
Interfaces
-
public module function dequeue_pie_autopct(autopct_queue, autopct_count) result(value)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=32),
|
intent(inout), |
|
allocatable
|
:: |
autopct_queue(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
autopct_count |
|
Return Value
character(len=32)
-
public module function get_pie_autopct(pie_legend_labels, pie_legend_values, pie_legend_count, label) result(value)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=64),
|
intent(inout), |
|
allocatable
|
:: |
pie_legend_labels(:) |
|
|
character(len=32),
|
intent(inout), |
|
allocatable
|
:: |
pie_legend_values(:) |
|
|
integer,
|
intent(in) |
|
|
:: |
pie_legend_count |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
label |
|
Return Value
character(len=32)
-
public module subroutine render_ascii_legend_specialized(legend, canvas_context, legend_x, legend_y)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(legend_t),
|
intent(in) |
|
|
:: |
legend |
|
|
class(plot_context),
|
intent(inout) |
|
|
:: |
canvas_context |
|
|
real(kind=wp),
|
intent(in) |
|
|
:: |
legend_x |
|
|
real(kind=wp),
|
intent(in) |
|
|
:: |
legend_y |
|
-
public module subroutine calculate_ascii_legend_dimensions(legend, width, legend_width, legend_height)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(legend_t),
|
intent(in) |
|
|
:: |
legend |
|
|
integer,
|
intent(in) |
|
|
:: |
width |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
legend_width |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
legend_height |
|
-
public module subroutine set_ascii_legend_border_width()
Arguments
None
-
public module subroutine calculate_ascii_legend_position(legend, width, height, x, y)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(legend_t),
|
intent(in) |
|
|
:: |
legend |
|
|
integer,
|
intent(in) |
|
|
:: |
width |
|
|
integer,
|
intent(in) |
|
|
:: |
height |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
x |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
y |
|
-
public module subroutine reset_ascii_legend_lines_helper(legend_lines, num_legend_lines)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
num_legend_lines |
|
-
public module subroutine append_ascii_legend_line_helper(legend_lines, num_legend_lines, raw_line)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
num_legend_lines |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
raw_line |
|
-
public module subroutine register_legend_entry_helper(legend_entry_indices, legend_entry_has_autopct, legend_entry_labels, legend_entry_count, legend_autopct_cursor, line_idx, label, has_autopct)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
integer,
|
intent(inout), |
|
allocatable
|
:: |
legend_entry_indices(:) |
|
|
logical,
|
intent(inout), |
|
allocatable
|
:: |
legend_entry_has_autopct(:) |
|
|
character(len=64),
|
intent(inout), |
|
allocatable
|
:: |
legend_entry_labels(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
legend_entry_count |
|
|
integer,
|
intent(inout) |
|
|
:: |
legend_autopct_cursor |
|
|
integer,
|
intent(in) |
|
|
:: |
line_idx |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
label |
|
|
logical,
|
intent(in) |
|
|
:: |
has_autopct |
|
-
public module subroutine assign_pending_autopct_helper(legend_lines, num_legend_lines, pie_autopct_queue, pie_autopct_count, legend_entry_indices, legend_entry_has_autopct, legend_autopct_cursor, legend_entry_count)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(in) |
|
|
:: |
num_legend_lines |
|
|
character(len=32),
|
intent(inout), |
|
allocatable
|
:: |
pie_autopct_queue(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
pie_autopct_count |
|
|
integer,
|
intent(inout), |
|
allocatable
|
:: |
legend_entry_indices(:) |
|
|
logical,
|
intent(inout), |
|
allocatable
|
:: |
legend_entry_has_autopct(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
legend_autopct_cursor |
|
|
integer,
|
intent(in) |
|
|
:: |
legend_entry_count |
|
-
public module subroutine enqueue_pie_autopct(autopct_queue, autopct_count, value)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=32),
|
intent(inout), |
|
allocatable
|
:: |
autopct_queue(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
autopct_count |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
value |
|
-
public module subroutine clear_pie_legend_entries(pie_legend_labels, pie_legend_values, pie_legend_count, autopct_queue, autopct_count)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=64),
|
intent(inout), |
|
allocatable
|
:: |
pie_legend_labels(:) |
|
|
character(len=32),
|
intent(inout), |
|
allocatable
|
:: |
pie_legend_values(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
pie_legend_count |
|
|
character(len=32),
|
intent(inout), |
|
allocatable
|
:: |
autopct_queue(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
autopct_count |
|
-
public module subroutine decode_ascii_legend_line(raw_text, formatted_line, entry_label)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
raw_text |
|
|
character(len=96),
|
intent(out) |
|
|
:: |
formatted_line |
|
|
character(len=64),
|
intent(out) |
|
|
:: |
entry_label |
|
-
public module subroutine ascii_render_legend_impl(legend, legend_lines, num_legend_lines)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(legend_t),
|
intent(in) |
|
|
:: |
legend |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
num_legend_lines |
|
-
public module subroutine ascii_calc_legend_dims_impl(legend, width, legend_width, legend_height)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(legend_t),
|
intent(in) |
|
|
:: |
legend |
|
|
integer,
|
intent(in) |
|
|
:: |
width |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
legend_width |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
legend_height |
|
-
public module subroutine ascii_set_legend_border_impl()
Arguments
None
-
public module subroutine ascii_calc_legend_pos_impl(legend, width, height, legend_width, legend_height, x, y)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(legend_t),
|
intent(in) |
|
|
:: |
legend |
|
|
integer,
|
intent(in) |
|
|
:: |
width |
|
|
integer,
|
intent(in) |
|
|
:: |
height |
|
|
real(kind=wp),
|
intent(in) |
|
|
:: |
legend_width |
|
|
real(kind=wp),
|
intent(in) |
|
|
:: |
legend_height |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
x |
|
|
real(kind=wp),
|
intent(out) |
|
|
:: |
y |
|
-
public module subroutine ascii_add_legend_entry_impl(label, value_text, legend_lines, num_legend_lines)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
label |
|
|
character(len=*),
|
intent(in), |
optional |
|
:: |
value_text |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
num_legend_lines |
|
-
public module subroutine ascii_clear_legend_impl(legend_lines, num_legend_lines, header)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
num_legend_lines |
|
|
character(len=*),
|
intent(in), |
optional |
|
:: |
header |
|
-
public module subroutine ascii_clear_pie_legend_impl(legend_lines, num_legend_lines)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
num_legend_lines |
|
-
public module subroutine ascii_register_pie_legend_impl(label, value_text, legend_lines, num_legend_lines)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
label |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
value_text |
|
|
character(len=96),
|
intent(inout), |
|
allocatable
|
:: |
legend_lines(:) |
|
|
integer,
|
intent(inout) |
|
|
:: |
num_legend_lines |
|