Templat...lines3d(3)

πŸ’… Template::Plugin::GD::Graph::lines3d

okay so bestie, this page is from the User Contributed Perl Documentation and it's literally the manual for Template::Plugin::GD::Graph::lines3d, which lives in section 3 of the manual (3 = library calls, iykyk).


✨ NAME ✨

Template::Plugin::GD::Graph::lines3d β€” Create 3D line graphs with axes and legends πŸŽ€

Like, actual three-dimensional-looking line graphs. With axes. With legends. The whole thing. Obsessed.


🌸 SYNOPSIS 🌸

[% USE g = GD.Graph.lines3d(x_size, y_size); %]

That's it, that's the vibe. You USE it, you give it an x_size and a y_size, and a graph object shows up in your template like it was always meant to be there. ✨


πŸ¦‹ EXAMPLES πŸ¦‹

okay this is the part where it gets good, look at this whole situation:

[% FILTER null;
    data = [
        ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
                                     "Sep", "Oct", "Nov", "Dec", ],
        [-5, -4, -3, -3, -1,  0,  2,  1,  3,  4,  6,  7],
        [4,   3,  5,  6,  3,1.5, -1, -3, -4, -6, -7, -8],
        [1,   2,  2,  3,  4,  3,  1, -1,  0,  2,  3,  2],
    ];

    USE my_graph = GD.Graph.lines3d();

    my_graph.set(
            x_label => 'Month',
            y_label => 'Measure of success',
            title => 'A 3d Line Graph',

            y_max_value => 8,
            y_min_value => -8,
            y_tick_number => 16,
            y_label_skip => 2,
            box_axis => 0,
            line_width => 3,
            zero_axis_only => 1,
            x_label_position => 1,
            y_label_position => 1,

            x_label_skip => 3,
            x_tick_offset => 2,

            transparent => 0,
    );
    my_graph.set_legend("Us", "Them", "Others");
    my_graph.plot(data).png | stdout(1);
   END;
-%]

So what's happening here, fr fr:

  • the data array is your classic first-row-is-labels setup β€” all twelve months "Jan" through "Dec" πŸ’–
  • then three more rows of actual numbers, because those are your three data sets (hi "Us", "Them", and "Others" πŸ‘‹)
  • my_graph.set(...) is where you customise literally everything β€” labels, title, axis ranges, tick counts, all of it
  • my_graph.set_legend("Us", "Them", "Others") names your three lines πŸŽ€
  • my_graph.plot(data).png | stdout(1) renders it and pipes the PNG straight out to stdout, and yeah, stdout is spelled that way
  • and the whole thing is wrapped in [% FILTER null; ... END; -%] so the template doesn't leak any stray whitespace into your beautiful image output ✨

no cap, that zero_axis_only => 1 and box_axis => 0 combo is a look.


πŸ‘‘ DESCRIPTION πŸ‘‘

The GD.Graph.lines3d plugin provides an interface to the GD::Graph::lines3d class defined by the GD::Graph3d module. 🫢

It lets you plot one or more (x,y) data sets as y-versus-x lines, and the lines have a 3-dimensional appearance, and there are axes and legends along for the ride. It's giving main character graph energy, honestly.

See GD::Graph3d for more details. That's where the real lore lives. πŸ“š


πŸ’œ AUTHOR πŸ’œ

Real ones built this, let's give credit where it's due:

  • Thomas Boutell wrote the GD graphics library.
  • Lincoln D. Stein wrote the Perl GD modules that interface to it.
  • Martien Verbruggen wrote the GD::Graph module.
  • Craig Barratt <craig@arraycomm.com> wrote the original GD plugins for the Template Toolkit (2001).
  • Andy Wardley <abw@cpan.org> extracted them from the TT core into a separate distribution for TT version 2.15.

collab of the century, honestly 🌈


Copyright (C) 2001 Craig Barratt <craig@arraycomm.com>, 2006 Andy Wardley <abw@cpan.org>.

GD::Graph3d is copyright (C) 1999,2000 Wadsack-Allen. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 🫢


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, lineup below:

  • Template::Plugin::GD
  • Template::Plugin::GD::Graph::lines
  • Template::Plugin::GD::Graph::bars
  • Template::Plugin::GD::Graph::bars3d
  • Template::Plugin::GD::Graph::points
  • Template::Plugin::GD::Graph::linespoints
  • Template::Plugin::GD::Graph::area
  • Template::Plugin::GD::Graph::mixed
  • Template::Plugin::GD::Graph::pie
  • Template::Plugin::GD::Graph::pie3d
  • GD

go read them all, i'm literally begging 🧚


okay that's the whole page! this one's running on perl v5.42.0, dated 2017-10-08, and the source is the User Contributed Perl Documentation β€” so like, a real human contributed this and we're all just vibing on their work. bye bestie, happy graphing πŸ’–βœ¨πŸ’…

πŸ“¦ where this page comes from