Releases: plotly/plotly.py
Releases · plotly/plotly.py
v4.9.0 - Kaleido for static image export, Hexbin Tile Maps, and Timelines
See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-9-kaleido-for-static-image-export-hexbin-tile-maps-and-timelines/42524
Added
- Added image export support using Kaleido. The image export backend can be configured using the new
engineargument toplotly.io.to_imageandplotly.io.write_image. Theengineargument may be set to"kaleido","orca", or"auto". The default isengine="auto", in which case the Kaleido backend is enabled if thekaleidopackage from PyPI is installed, otherwise Orca is used. (#2613). plotly.express.timeline()added as an official alternative toplotly.figure_factories.create_gantt()(#2626)create_hexbin_mapbox()added to Figure Factories, with thanks to @RenaudLN for the impressive contribution!facet_row_spacingandfacet_col_spacingadded to Plotly Express cartesian 2d functions (#2614)baseadded to Plotly Expressbarandbar_polarfunctions (#2626)px.NO_COLORconstant to override wide-form color assignment in Plotly Express (#2614)
Fixed
- trendline traces are now of type
scatterglwhenrender_mode="webgl"in Plotly Express (#2614) - regression from 4.8.1 whereby
"parent"was not accepted as part ofpathforpx.sunburst()andpx.treemap()(#2640) create_dendrogram()figure factory now works correctly withscipy1.5.1 (#2627)
Updated
- Updated Plotly.js to version 1.54.6. See the plotly.js CHANGELOG for more information.
- Added all cartesian-2d Plotly Express functions, plus
imshow, to Pandas backend withkindoption (#2541) plotly.express.imshownow uses data frame index and columns names and values to populate axis parameters by default (#2539)- Javascript extensions are now build using Node 12, and have an updated
package-lock.jsonwith many fewer security warnings (#2636)
v4.8.2
See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-8-plotly-express-support-for-wide-and-mixed-form-data-plus-a-pandas-backend/40048
Updated
- Updated Plotly.js to version 1.54.5. See the plotly.js CHANGELOG for more information. This version includes various bug and security fixes.
add_traces()now accepts bareint-like values forrows/colsas well as lists thereof (#2546), with thanks to @MCBoarder289 for the contribution!
Fixed
row/colnow acceptint-like values, not strictlyintvalues (#2451), with thanks to @MCBoarder289 for the contribution!- Fixed special cases with
px.sunburstandpx.treemapwithpathinput (#2524) - Fixed bug in
hover_dataargument ofpxfunctions, when the column name is changed with labels andhover_datais a dictionary setting up a specific format for the hover data (#2544). - Made the Plotly Express
trendlineargument more robust and made it work with datetimexvalues (#2554) - Fixed bug in
px.sunburstandpx.treemap: when thecolorandvaluesarguments correspond to the same column, a different aggregation function has to be used for the two arguments (#2591) - Plotly Express wide mode now accepts mixed integer and float columns (#2598)
- Plotly Express
range_(x|y)should not impact the unlinked range of marginal subplots (#2600) px.linenow setsline_group=<variable>in wide mode by default (#2599)- Corrected some regex warnings (#2577), with thanks to @georgevdd for the contribution!
v4.8.1
See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-8-plotly-express-support-for-wide-and-mixed-form-data-plus-a-pandas-backend/40048
Fixed
- Fixed the accidental removal of some functions and submodules from
plotly.colorsandplotly.express.colors
v4.8.0 - Plotly Express Support for Wide- and Mixed-Form Data, plus a Pandas backend
See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-8-plotly-express-support-for-wide-and-mixed-form-data-plus-a-pandas-backend/40048
Key new documentation pages:
Added
plotlynow provides a Plotly Express-backed Pandas-compatible plotting backend, which can be activated viapandas.options.plotting.backend = "plotly". Note that it is not intended to implement every Pandas plotting function, nor is it intended to replicate the behaviour of every argument, although per the changes below,xandyshould behave similarly. (#2336)- New datasets have been added to
plotly.express.data:stocks,experiment,medals_wideandmedals_long. (#2336) - plotly
go.Figureandgo.FigureWidgetnow have a_repr_html_and a_repr_mimebundle_method, which are standard hooks for integration in systems based on IPython. In particular, with_repr_html_plotly figures can now be used within sphinx-gallery without any scraper. These additions should not change anything to the way plotly figures are displayed in notebook environments, since the_ipython_display_method (already present in earlier versions) takes precedence over the new methods.
Updated
- The behaviour of the
x,y,orientation,histfunc,violinmode,boxmodeandstripmodearguments for 2d-cartesian functions in Plotly Express (i.e.scatter,line,area,bar,histogram,violin,box,strip,funnel,density_heatmapanddensity_contour) has been refined (#2336):- wide-form data support: if either
xory(but not both) may now be provided as a list of column references intodata_frameor columns of data, in which case the imputed data frame will be treated as "wide" data andmelt()ed internally before applying the usual mapping rules, with function-specific defaults. - if neither
xnoryis provided butdata_frameis, the data frame will be treated as "wide" with defaults depending on the value oforientation(andorientationhas accordingly been added toscatter,line,density_heatmap, anddensity_contourfor this purpose). Previously this would have resulted in an empty figure. - if
xoryis missing, it is inferred to be the index ofdata_frameifdata_frameprovided, otherwise a stable index of integers starting at 0. In the case ofpx.bar, if the provided value is not continuous, the missing value is treated as a column of 1s named "count", so as to behave more likepx.histogramand to avoid sizing the resulting bars differently based on their position in the column. Previously, missing values defaulted to integers starting at 0 per trace which made it potentially inconsistent or misleading. - if
x(y) is missing,orientationnow defaults tov(h). Previously it always defaulted tovbut this is not considered a breaking change, as the cases in which it now defaults tohcaused unreadable output if set tov. - if both
xandyare provided and one of them does not contain continuous values,orientationdefaults to the value perpendicular to that axis. Previously it always defaulted tovbut this is not considered a breaking change, as the cases in which it now defaults tohcaused unreadable output if set tov. - if both
xandyare provided tohistogram, and ifx,yandzare provided todensity_heatmapordensity_contour, thenhistfuncnow defaults tosumso as to avoid ignoring the provided data, and to causehistogramandbarto behave more similarly. violinmode,boxmodeandstripmodenow default tooverlayifx(y) in inv(h) orientation is also mapped tocolor, to avoid strange spacing issues with the previous default ofgroupin all cases.
- wide-form data support: if either
- The Plotly Express arguments
color_discrete_map,symbol_mapandline_dash_mapnow accept the string"identity"which causes the corresponding input data to be used as-is rather than mapped intocolor_discrete_sequence,symbol_sequenceorline_dash_sequence, respectively. (#2336) - Plotly Express now accepts
px.Constantorpx.Rangeobjects in the place of column references so as to express constant or increasing integer values. (#2336)
v4.7.1
Fixed
- Fix
AttributeError: module 'plotly.graph_objs' has no attribute 'FigureWidget'exception onfrom plotly.graph_objs import *whenipywidgetsis not installed. Error also occurred when importingplotly.figure_factor. It is now possible to importplotly.graph_objs.FigureWidgetwhenipywidgetsis not installed, and an informativeImportErrorexception will be raised in theFigureWidgetconstructor (#2443, #1111). - Fix
TypeError: unhashable type: 'Template'duringFigureconstruction whenplotly.io.templates.defaultis set to aTemplateobject rather than a string.
v4.7.0
Updated
- Updated Plotly.js to version 1.54.1. See the plotly.js CHANGELOG for more information. The main new feature of this version of Plotly.js is the possibility to draw layout shapes, using custom dragmodes and corresponding modebar buttons.
- The sphinx-gallery scraper has been updated to work with different structures of galleries #2149
Added
- The
hover_dataparameter ofpxfunctions can now be a dictionary. This makes it possible to skip hover information for some arguments or to change the formatting of hover informatiom #2377. - It's now possible to build a development version of Plotly.py against the build artifacts from a non-
masterbranch of Plotly.js, which makes for faster QA and development cycles #2349. Thanks @zouhairm for this Pull Request!
Fixed
- Plotly Express trendlines now handle missing data correctly #2357
Performance
This version includes several performance improvements (#2368, #2403).
- Child graph objects (e.g.
figure.layout.xaxis) are no longer created eagerly during graph object construction. Instead, they are created lazily the first time the property is accessed. - Property validation is now disabled for select internal operations.
- When used with Python 3.7 and above, ploty.py now takes advantage of PEP-562 to perform submodule imports lazily. This dramatically improves import times.
v4.6.0
Updated
- Updated Plotly.js to version 1.53.0. See the plotly.js CHANGELOG for more information on the numerous new features and bug fixes of this release. The main features of the Plotly.js release are
- Introduce range breaks on date axes (for example, to remove week-ends) via
layout.xaxis.rangebreaks - Introduce a new unified x (or y) hovermode (
layout.hovermode="x unified"), in which the hover box shows the information for all traces at a given x (or y) position - Add
node.customdataandlink.customdatato sankey traces
- Introduce range breaks on date axes (for example, to remove week-ends) via
- Updated contributing notes for more explanations on how to contribute to plotly.py #2290. Please give feedback on these notes!
- Updated documentation examples #2325, and to show how to color links in Sankey diagrams #2291.
- Special thanks to @SylwiaOliwia2 and @dangercrow for improving our documentation!
Added
px.imshownow acceptsxarrayinputs, with metadata being used for axis labels, hover and colorbar #2166
Fixed
v4.5.4
Updated
- The documentation of the API https://plot.ly/python-api-reference/ now
documents the full API #2243 - New documentation examples for facets #2235, legend #2227, subplots #2226, axes #2234 and histograms #2242.
Thanks to @SylwiaOliwia2 for all these great
examples!
Fixed
- Jupyterlab extension now compatible with both Jupyterlab 1.2 and 2.0 #2261 with thanks to @consideRatio for the contribution!
- Fixed a bug when using boolean values for the color argument of px functions #2127
- Corrected import bug which was occuring with old versions of ipywidgets #2265
- Fixed python 3.8 syntax warning #2262, with thanks to @sgn for the contribution!
v4.5.3
Updated
- Removed development dependency on
nosetesting framework #2217
Fixed
- JupyterLab extension now compatible with JupyterLab 2.0 #2245 with thanks to @consideRatio for the contribution!