ASCII terminal plotting backend - Legend Management
This module handles ASCII-specific legend rendering, positioning, and management including specialized autopct support.
Author: fortplot contributors
Render legend using ASCII-specific compact layout
| 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 | 
Calculate ASCII-specific legend dimensions
| 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 | 
ASCII doesn't use line widths - no-op
Calculate ASCII-specific legend position using character coordinates
| 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 | 
Reset ASCII legend lines array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=96), | intent(inout), | allocatable | :: | legend_lines(:) | ||
| integer, | intent(inout) | :: | num_legend_lines | 
Append a legend line to ASCII backend array
| 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 | 
Register a legend entry for processing
| 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 | 
Assign pending autopct values to legend lines
| 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 |