From 6cd1e9e7ef8d44ca2db36be80f962c3fe0d01413 Mon Sep 17 00:00:00 2001 From: yankev Date: Fri, 17 Jun 2016 20:58:32 -0400 Subject: [PATCH 1/2] addressing #504 and #505 --- plotly/offline/offline.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index c1ca5256e57..e06f28c27a3 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -176,11 +176,11 @@ def _plot_html(figure_or_data, show_link, link_text, validate, width = str(width) + 'px' try: - float(width) + float(height) except (ValueError, TypeError): pass else: - width = str(width) + 'px' + height = str(height) + 'px' plotdivid = uuid.uuid4() jdata = json.dumps(figure.get('data', []), cls=utils.PlotlyJSONEncoder) @@ -202,6 +202,7 @@ def _plot_html(figure_or_data, show_link, link_text, validate, .replace('https://', '')\ .replace('http://', '') link_text = link_text.replace('plot.ly', link_domain) + config['linkText'] = link_text script = 'Plotly.newPlot("{id}", {data}, {layout}, {config})'.format( id=plotdivid, From fd2c4d1732089a2c871d849a102cd5a155a7879d Mon Sep 17 00:00:00 2001 From: yankev Date: Mon, 20 Jun 2016 14:18:30 -0400 Subject: [PATCH 2/2] updated changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36eece963c4..fbcc2bbdea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). import plotly.tools as tls help(tls.FigureFactory.create_gantt) ``` -- Ability to download images in offline mode. By providing an extra keyword `image` to the existing plot calls, you can now download the images of the plots youmake in offline mode. +- Ability to download images in offline mode. By providing an extra keyword `image` to the existing plot calls, you can now download the images of the plots you make in offline mode. + +### Fixed +- Fixed check for the height parameter passed to `_plot_html`, and now sets the correct `link text` for plots +generated in offline mode. ## [1.12.1] - 2016-06-19