Rx.Plotly (rx v0.1.0)

Copy Markdown View Source

Bridge from R plotly objects to plotly_ex figures.

R plotly objects remain opaque under Rx.decode/1. Use this module when you want the Plotly.js JSON representation wrapped as a %Plotly.Figure{} for Livebook or Phoenix rendering through plotly_ex.

Summary

Functions

Wraps Plotly.js-shaped JSON in a %Plotly.Figure{}.

Wraps Plotly.js-shaped JSON in a %Plotly.Figure{}, raising on error.

Converts an R plotly object handle to a %Plotly.Figure{}.

Converts an R plotly object handle to a %Plotly.Figure{}, raising on error.

Returns the raw Plotly.js JSON string for an R plotly object handle.

Returns the raw Plotly.js JSON string for an R plotly object, raising on error.

Functions

from_json(json)

Wraps Plotly.js-shaped JSON in a %Plotly.Figure{}.

Accepts either a JSON string or an already decoded map. Only data, layout, frames, and config are used; R-specific htmlwidget metadata is ignored. Deprecated Chart Studio config keys removed by the wrapper are exactly: plotlyServerURL, showLink, linkText, showEditInChartStudio, showSendToCloud, and sendData. Other config entries are preserved.

from_json!(json)

Wraps Plotly.js-shaped JSON in a %Plotly.Figure{}, raising on error.

from_r(object)

Converts an R plotly object handle to a %Plotly.Figure{}.

Requires the optional Elixir dependency {:plotly_ex, "~> 0.1"} and the R package plotly.

from_r!(object)

Converts an R plotly object handle to a %Plotly.Figure{}, raising on error.

json_from_r(object)

Returns the raw Plotly.js JSON string for an R plotly object handle.

This does not require plotly_ex; it only requires the R package plotly.

json_from_r!(object)

Returns the raw Plotly.js JSON string for an R plotly object, raising on error.