fortplot_ascii_legend Module

ASCII terminal plotting backend - Legend Management

This module handles ASCII-specific legend rendering, positioning, and management including specialized autopct support.

Author: fortplot contributors



Subroutines

public subroutine render_ascii_legend_specialized(legend, canvas_context, legend_x, legend_y)

Render legend using ASCII-specific compact layout

Arguments

Type IntentOptional 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 subroutine calculate_ascii_legend_dimensions(legend, width, legend_width, legend_height)

Calculate ASCII-specific legend dimensions

Arguments

Type IntentOptional 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 subroutine set_ascii_legend_border_width()

ASCII doesn't use line widths - no-op

Arguments

None

public subroutine calculate_ascii_legend_position(legend, width, height, x, y)

Calculate ASCII-specific legend position using character coordinates

Arguments

Type IntentOptional 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 subroutine reset_ascii_legend_lines_helper(legend_lines, num_legend_lines)

Reset ASCII legend lines array

Arguments

Type IntentOptional Attributes Name
character(len=96), intent(inout), allocatable :: legend_lines(:)
integer, intent(inout) :: num_legend_lines

public subroutine append_ascii_legend_line_helper(legend_lines, num_legend_lines, raw_line)

Append a legend line to ASCII backend array

Arguments

Type IntentOptional Attributes Name
character(len=96), intent(inout), allocatable :: legend_lines(:)
integer, intent(inout) :: num_legend_lines
character(len=*), intent(in) :: raw_line

public 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)

Register a legend entry for processing

Arguments

Type IntentOptional 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 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)

Assign pending autopct values to legend lines

Arguments

Type IntentOptional 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