Repository navigation
1.0.0
A rewrite. Figures are now plain hashes checked against the plot schema of a pinned
plotly.js release, instead of hand-written classes that covered a few attributes.
Added
Plotly::Figurewithadd_trace, anadd_<type>helper for each of plotly.js' 47 trace
types,update_layout,update_traces(withselector:),update_xaxes,update_yaxes
andupdate_config.- Validation of attribute names, enumerated values, flag lists, booleans and number ranges
against plotly.js 4.1.2, with the attribute path and a spelling suggestion in
Plotly::ValidationError.validate: falseturns it off. - Underscore paths for nested attributes:
marker_line_width: 2. Plotly.make_subplotswith shared axes and subplot titles;row:/col:on trace and
axis updates.include_plotlyjs:(:cdn,:inline,falseor a URL),div_id:,width:,height:
andfull_html:onto_html;write_htmlembeds plotly.js by default so files work offline.to_json/to_h. Dates and times,NaN, ranges,BigDecimaland objects with#to_a
(Numo, Polars, Daru columns) are converted to what plotly.js expects.- An example gallery (
rake gallery) and specs that draw the generated HTML in headless Chrome.
Changed
- Requires Ruby 3.3 or later.
- Bundles plotly.js 4.1.2 (was 1.16.2). The CDN URL is pinned to the same release instead of
plotly-latest, which stopped updating at 1.x. - JSON inside
<script>is escaped so that strings such as"</script>"cannot end the
element. - Charts resize with their container through plotly.js'
responsiveconfig. - No runtime dependencies besides
json(faraday,uuidtoolsandlaunchyare gone).
Fixed
- Charts render in JupyterLab: notebook output no longer relies on RequireJS, and
to_iruby_mimebundlekeeps IRuby 0.8 from choosingto_html, whose script would run
before plotly.js loads (#10). - Subplots are supported (#8).
- Tests run without a plot.ly account, and the README explains how to run them
(#9).
Deprecated
Plotly::Plot. It still acceptsdata:/layout:andgenerate_html(path:, open:),
and prints a warning; usePlotly::Figureandwrite_html. It will be removed in 2.0.
Removed
Plotly.auth,Plotly::Clientand#download_image, which used the plot.ly cloud API.- The attribute classes (
Plotly::Data,Layout,Axis,Marker,Line) and
Object#convert_to, which was added to every object.