Skip to content

Latest commit

 

History

History
121 lines (83 loc) · 3.21 KB

jun_plotly.md

File metadata and controls

121 lines (83 loc) · 3.21 KB

Module jun_plotly

The jun_plotly module provides methods to use plotly integrated into erlang code, similar to use plot un jun_pandas.

Description

Example of plotly from erlang:

        {ok, Pid} = jun_worker:start_link(),
        {ok, {_, DataFrame}} = jun_pandas:read_csv(Pid, <<"/files/csv.txt">>, []),
        {ok, _} = jun_plotly:iplot(Pid, DataFrame, <<"line/iplot">>, [{<<"kind">>, <<"line">>}, {<<"x">>, <<"name">>}, {<<"y">>, <<"age">>}]).

Data Types


jun_worker() = pid() 

jun_dataframe() = {<<"pandas.core.frame.DataFrame">>, dataframe()}

dataframe() = {'$erlport.opaque', python, binary()}

keywords() = [{key :: binary(), value :: any()}, ...]

plotly() = {<<"plotly.iplot">>, binary()}

Function Index

iplot/4 creates a new plot into plotly using a dataframe.
plot/4 creates a new plot into a valid plotly url.
extend/4 extends two plots into one (like merge them).
get_figure/4 gets the figure (data representation) from a valid plotly url.

Function Details

iplot/4


iplot(jun_worker(), dataframe(), filename :: binary(), keywords()) -> {error, no_opaque_dataframe} | {ok, plotly()} 

creates a new plot into plotly using a dataframe.

plot/4


plot(jun_worker(), iplot :: binary(), filename :: binary(), keywords()) -> {ok, url :: string()}

creates a new plot into a valid plotly url.

extend/4


extend(jun_worker(), iplotx :: binary(), iploty :: binary(), keywords()) -> {ok, plotly()} 

extends two plots into one (like merge them).

get_figure/4


get_figure(jun_worker(), url :: binary(), filename :: binary(), keywords()) -> {ok, plotly()}

get the figure (data representation) from a valid plotly url.