pablrod / p5-Chart-Plotly

Generate html/javascript charts with perl data using javascript library Plotly.js
MIT License
9 stars 4 forks source link

Adapters: ease the plot of objects #1

Closed pablrod closed 7 years ago

pablrod commented 7 years ago

Sometimes you have some data (e.g.: a Data::Table object) and you want to plot that data. Usually you have to map the data to the plot, but most of the time there are some "defaults" that you can use.

The idea is just to do something like this:

my $morley = Data::Table::fromFile('morley.csv');
show_plot($morley);

Using class-based dispatch, it can be instantiated automatically an object from the class: Chart::Plotly::Adapter::Class::Name adapting the object to the format expected by Chart::Plotly

pablrod commented 7 years ago

First try: branch feature/adapters 767dd7693a10569ed9cf1d51612eae5e6fba3abe

pablrod commented 7 years ago

With the release of the version v0.009 we have adapters for Data::Table and Data::Frame. With these adapters we can plot data coming from: