From 01a687013e1f51cb8803e9c3648c05ff99d8fc13 Mon Sep 17 00:00:00 2001 From: chriddyp Date: Wed, 12 Apr 2017 15:40:31 -0400 Subject: [PATCH 1/5] dash api --- plotly/api/v2/__init__.py | 4 ++-- plotly/api/v2/dash_apps.py | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 plotly/api/v2/dash_apps.py diff --git a/plotly/api/v2/__init__.py b/plotly/api/v2/__init__.py index 5ccbccfd4f4..852a18947c7 100644 --- a/plotly/api/v2/__init__.py +++ b/plotly/api/v2/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import -from plotly.api.v2 import (dashboards, files, folders, grids, images, plot_schema, - plots, users) +from plotly.api.v2 import (dash_apps, dashboards, files, folders, grids, + images, plot_schema, plots, users) diff --git a/plotly/api/v2/dash_apps.py b/plotly/api/v2/dash_apps.py new file mode 100644 index 00000000000..3c5f95bf160 --- /dev/null +++ b/plotly/api/v2/dash_apps.py @@ -0,0 +1,26 @@ +""" +Beta interface to Plotly's /v2/dash-apps endpoints. +""" +from __future__ import absolute_import + +from plotly.api.v2.utils import build_url, request + +RESOURCE = 'dash-apps' + + +def create(body): + """Create a dash app item.""" + url = build_url(RESOURCE) + return request('post', url, json=body) + + +def retrieve(fid): + """Retrieve a dashboard from Plotly.""" + url = build_url(RESOURCE, id=fid) + return request('get', url) + + +def update(fid, content): + """Completely update the writable.""" + url = build_url(RESOURCE, id=fid) + return request('put', url, json=content) From d88601d3609b26359f0291e673686b39c20af894 Mon Sep 17 00:00:00 2001 From: chriddyp Date: Wed, 12 Apr 2017 15:43:55 -0400 Subject: [PATCH 2/5] update changelog --- CHANGELOG.md | 1 + test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py diff --git a/CHANGELOG.md b/CHANGELOG.md index a88dfc25447..918f6d6a990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Added - offline embedded plots are now responsive to window resizing when `output_type == "div"` is set in `plotly.offline.iplot()`. +- Beta: Methods were added that wrap the API endpoint for managing Dash objects on plot.ly. The API interface is under `plotly.api.v2.dash_apps` ## [2.0.7] - 2017-04-07 ### Updated diff --git a/test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py b/test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py new file mode 100644 index 00000000000..5ccbccfd4f4 --- /dev/null +++ b/test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py @@ -0,0 +1,4 @@ +from __future__ import absolute_import + +from plotly.api.v2 import (dashboards, files, folders, grids, images, plot_schema, + plots, users) From 186aadcc2faa176178e0313a72bbaf2388dd416d Mon Sep 17 00:00:00 2001 From: chriddyp Date: Wed, 12 Apr 2017 15:55:37 -0400 Subject: [PATCH 3/5] update tense of changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 918f6d6a990..2a627283a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Added - offline embedded plots are now responsive to window resizing when `output_type == "div"` is set in `plotly.offline.iplot()`. -- Beta: Methods were added that wrap the API endpoint for managing Dash objects on plot.ly. The API interface is under `plotly.api.v2.dash_apps` +- Beta: Added API methods that wrap the API endpoint for managing Dash objects on plot.ly. The API interface is under `plotly.api.v2.dash_apps` ## [2.0.7] - 2017-04-07 ### Updated From 44c7248443de0bef8cb5c11173d1882ad45bd17e Mon Sep 17 00:00:00 2001 From: chriddyp Date: Wed, 12 Apr 2017 15:57:44 -0400 Subject: [PATCH 4/5] typo --- plotly/api/v2/dash_apps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/api/v2/dash_apps.py b/plotly/api/v2/dash_apps.py index 3c5f95bf160..e38848b53ae 100644 --- a/plotly/api/v2/dash_apps.py +++ b/plotly/api/v2/dash_apps.py @@ -15,7 +15,7 @@ def create(body): def retrieve(fid): - """Retrieve a dashboard from Plotly.""" + """Retrieve a dash app from Plotly.""" url = build_url(RESOURCE, id=fid) return request('get', url) From ff3ca26649ca37bbec5b2fc9c03ac7a3deb4989c Mon Sep 17 00:00:00 2001 From: chriddyp Date: Wed, 12 Apr 2017 16:30:44 -0400 Subject: [PATCH 5/5] typo --- test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py diff --git a/test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py b/test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py deleted file mode 100644 index 5ccbccfd4f4..00000000000 --- a/test/vv/lib/python2.7/site-packages/plotly/api/v2/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import absolute_import - -from plotly.api.v2 import (dashboards, files, folders, grids, images, plot_schema, - plots, users)