svg_context Derived Type

type, public, extends(plot_context) :: svg_context


Components

Type Visibility Attributes Name Initial
integer, public :: width
integer, public :: height
real(kind=wp), public :: x_min
real(kind=wp), public :: x_max
real(kind=wp), public :: y_min
real(kind=wp), public :: y_max
logical, public :: has_rendered_arrows = .false.
logical, public :: uses_vector_arrows = .false.
logical, public :: has_triangular_arrows = .false.
character(len=:), public, allocatable :: content_stream
type(plot_margins_t), public :: margins
type(plot_area_t), public :: plot_area
real(kind=wp), public :: current_r = 0.0_wp
real(kind=wp), public :: current_g = 0.0_wp
real(kind=wp), public :: current_b = 0.0_wp
real(kind=wp), public :: current_line_width = 1.0_wp
character(len=32), public :: current_dash_pattern = ''
real(kind=wp), public :: marker_edge_r = 0.0_wp
real(kind=wp), public :: marker_edge_g = 0.0_wp
real(kind=wp), public :: marker_edge_b = 0.0_wp
real(kind=wp), public :: marker_face_r = 0.0_wp
real(kind=wp), public :: marker_face_g = 0.0_wp
real(kind=wp), public :: marker_face_b = 1.0_wp
real(kind=wp), public :: marker_edge_alpha = 1.0_wp
real(kind=wp), public :: marker_face_alpha = 1.0_wp

Type-Bound Procedures

procedure, public :: line => draw_svg_line

  • private subroutine draw_svg_line(this, x1, y1, x2, y2)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x1
    real(kind=wp), intent(in) :: y1
    real(kind=wp), intent(in) :: x2
    real(kind=wp), intent(in) :: y2

procedure, public :: color => set_svg_color

  • private subroutine set_svg_color(this, r, g, b)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: r
    real(kind=wp), intent(in) :: g
    real(kind=wp), intent(in) :: b

procedure, public :: text => draw_svg_text

  • private subroutine draw_svg_text(this, x, y, text)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    character(len=*), intent(in) :: text

procedure, public :: save => write_svg_file

  • private subroutine write_svg_file(this, filename)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    character(len=*), intent(in) :: filename

procedure, public :: set_line_width => set_svg_line_width

  • private subroutine set_svg_line_width(this, width)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: width

procedure, public :: set_line_style => set_svg_line_style

  • private subroutine set_svg_line_style(this, style)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    character(len=*), intent(in) :: style

procedure, public :: draw_marker => draw_svg_marker

  • private subroutine draw_svg_marker(this, x, y, style)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    character(len=*), intent(in) :: style

procedure, public :: set_marker_colors => set_svg_marker_colors

  • private subroutine set_svg_marker_colors(this, edge_r, edge_g, edge_b, face_r, face_g, face_b)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: edge_r
    real(kind=wp), intent(in) :: edge_g
    real(kind=wp), intent(in) :: edge_b
    real(kind=wp), intent(in) :: face_r
    real(kind=wp), intent(in) :: face_g
    real(kind=wp), intent(in) :: face_b

procedure, public :: set_marker_colors_with_alpha => set_svg_marker_colors_alpha

  • private subroutine set_svg_marker_colors_alpha(this, edge_r, edge_g, edge_b, edge_alpha, face_r, face_g, face_b, face_alpha)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: edge_r
    real(kind=wp), intent(in) :: edge_g
    real(kind=wp), intent(in) :: edge_b
    real(kind=wp), intent(in) :: edge_alpha
    real(kind=wp), intent(in) :: face_r
    real(kind=wp), intent(in) :: face_g
    real(kind=wp), intent(in) :: face_b
    real(kind=wp), intent(in) :: face_alpha

procedure, public :: draw_arrow => draw_svg_arrow

  • private subroutine draw_svg_arrow(this, x, y, dx, dy, size, style)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    real(kind=wp), intent(in) :: dx
    real(kind=wp), intent(in) :: dy
    real(kind=wp), intent(in) :: size
    character(len=*), intent(in) :: style

procedure, public :: get_ascii_output => svg_get_ascii_output

  • private function svg_get_ascii_output(this) result(output)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this

    Return Value character(len=:), allocatable

procedure, public :: get_width_scale => svg_get_width_scale

  • private function svg_get_width_scale(this) result(scale)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this

    Return Value real(kind=wp)

procedure, public :: get_height_scale => svg_get_height_scale

  • private function svg_get_height_scale(this) result(scale)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this

    Return Value real(kind=wp)

procedure, public :: fill_quad => svg_fill_quad

  • private subroutine svg_fill_quad(this, x_quad, y_quad)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x_quad(4)
    real(kind=wp), intent(in) :: y_quad(4)

procedure, public :: fill_heatmap => svg_fill_heatmap

  • private subroutine svg_fill_heatmap(this, x_grid, y_grid, z_grid, z_min, z_max)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x_grid(:)
    real(kind=wp), intent(in) :: y_grid(:)
    real(kind=wp), intent(in) :: z_grid(:,:)
    real(kind=wp), intent(in) :: z_min
    real(kind=wp), intent(in) :: z_max

procedure, public :: render_legend_specialized => svg_render_legend

  • private subroutine svg_render_legend(this, entries, x, y, width, height)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    type(legend_entry_t), intent(in), dimension(:) :: entries
    real(kind=wp), intent(in) :: x
    real(kind=wp), intent(in) :: y
    real(kind=wp), intent(in) :: width
    real(kind=wp), intent(in) :: height

procedure, public :: calculate_legend_dimensions => svg_calc_legend_dims

  • private subroutine svg_calc_legend_dims(this, entries, width, height)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this
    type(legend_entry_t), intent(in), dimension(:) :: entries
    real(kind=wp), intent(out) :: width
    real(kind=wp), intent(out) :: height

procedure, public :: set_legend_border_width => svg_set_legend_border

  • private subroutine svg_set_legend_border(this, width)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: width

procedure, public :: calculate_legend_position_backend => svg_calc_legend_pos

  • private subroutine svg_calc_legend_pos(this, loc, x, y)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this
    character(len=*), intent(in) :: loc
    real(kind=wp), intent(out) :: x
    real(kind=wp), intent(out) :: y

procedure, public :: extract_rgb_data => svg_extract_rgb_data

  • private subroutine svg_extract_rgb_data(this, width, height, rgb_data)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this
    integer, intent(in) :: width
    integer, intent(in) :: height
    real(kind=wp), intent(out) :: rgb_data(width,height,3)

procedure, public :: get_png_data_backend => svg_get_png_data

  • private subroutine svg_get_png_data(this, width, height, png_data, status)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this
    integer, intent(in) :: width
    integer, intent(in) :: height
    integer(kind=1), intent(out), allocatable :: png_data(:)
    integer, intent(out) :: status

procedure, public :: prepare_3d_data => svg_prepare_3d_data

  • private subroutine svg_prepare_3d_data(this, plots)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    type(plot_data_t), intent(in) :: plots(:)

procedure, public :: render_ylabel => svg_render_ylabel

  • private subroutine svg_render_ylabel(this, ylabel)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    character(len=*), intent(in) :: ylabel

procedure, public :: draw_axes_and_labels_backend => svg_draw_axes_labels

  • private subroutine svg_draw_axes_labels(this, xscale, yscale, symlog_threshold, x_min, x_max, y_min, y_max, title, xlabel, ylabel, x_date_format, y_date_format, z_min, z_max, has_3d_plots)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    character(len=*), intent(in) :: xscale
    character(len=*), intent(in) :: yscale
    real(kind=wp), intent(in) :: symlog_threshold
    real(kind=wp), intent(in) :: x_min
    real(kind=wp), intent(in) :: x_max
    real(kind=wp), intent(in) :: y_min
    real(kind=wp), intent(in) :: y_max
    character(len=:), intent(in), optional, allocatable :: title
    character(len=:), intent(in), optional, allocatable :: xlabel
    character(len=:), intent(in), optional, allocatable :: ylabel
    character(len=*), intent(in), optional :: x_date_format
    character(len=*), intent(in), optional :: y_date_format
    real(kind=wp), intent(in), optional :: z_min
    real(kind=wp), intent(in), optional :: z_max
    logical, intent(in) :: has_3d_plots

procedure, public :: save_coordinates => svg_save_coordinates

  • private subroutine svg_save_coordinates(this, x_min, x_max, y_min, y_max)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(in) :: this
    real(kind=wp), intent(out) :: x_min
    real(kind=wp), intent(out) :: x_max
    real(kind=wp), intent(out) :: y_min
    real(kind=wp), intent(out) :: y_max

procedure, public :: set_coordinates => svg_set_coordinates

  • private subroutine svg_set_coordinates(this, x_min, x_max, y_min, y_max)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    real(kind=wp), intent(in) :: x_min
    real(kind=wp), intent(in) :: x_max
    real(kind=wp), intent(in) :: y_min
    real(kind=wp), intent(in) :: y_max

procedure, public :: render_axes => svg_render_axes

  • private subroutine svg_render_axes(this, title_text, xlabel_text, ylabel_text)

    Arguments

    Type IntentOptional Attributes Name
    class(svg_context), intent(inout) :: this
    character(len=*), intent(in), optional :: title_text
    character(len=*), intent(in), optional :: xlabel_text
    character(len=*), intent(in), optional :: ylabel_text