NAME

Chart::GGPlot::Backend::Plotly::Geom - Role for geom-specific details with the Plotly backend

VERSION

version 0.002003

CLASS METHODS

split_on

split_on()

Returns an arrayref of aestheics on which continuous variables in the data should be splitted. This is necessary for some geoms, for example, polygons.

hover_on

hover_on()

Return value would be used for plotly trace's hoveron attribute.

use_webgl

use_webgl($df)

Returns a boolean value for whether or not to use webgl, like for scatter plots where Plotly is very slow to generate SVG when the data count is large. Now it decides by comparing the data count in $df against variable $Chart::GGPlot::Backend::Plotly::WEBGL_THRESHOLD. The variable can be adjusted by like,

$Chart::GGPlot::Backend::Plotly::WEBGL_THRESHOLD = 2000;

to_traces

to_traces($df, $params, $plot)

This shall be implemented by consumers of this role. It should return an arrayref of Chart::Plotly::Trace::X objects.

make_hovertext

make_hovertext($df, ArrayRef $hover_labels)

This method is called by Chart::GGPlot::Backend::Plotly for preparing Plotly hovertext. $hover_labels is an associative arrayref that maps aes names to hover text labels.

SEE ALSO

Chart::GGPlot::Backend::Plotly

AUTHOR

Stephan Loyd <sloyd@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2019-2023 by Stephan Loyd.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.