Skip to content

Commit 1a993c4

Browse files
authored
Merge pull request plotly#732 from plotly/dash_api
another api endpoint
2 parents 2be151e + 1a2687d commit 1a993c4

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [Unreleased]
6+
### Added
7+
- 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`
8+
59
## [2.0.8] - 2017-04-21
610
### Added
711
- offline embedded plots are now responsive to window resizing when `output_type == "div"` is set in `plotly.offline.iplot()`.
@@ -10,7 +14,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1014
### Updated
1115
- `plotly.offline.plot` and `plotly.offline.iplot` now accept various [configuration options](https://plot.ly/javascript/configuration-options/) for their arguments.
1216

13-
1417
## [2.0.7] - 2017-04-07
1518
### Updated
1619
- Updated `plotly.min.js` to version 1.25.0 for `plotly.offline`.

plotly/api/v2/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import absolute_import
22

3-
from plotly.api.v2 import (dashboards, files, folders, grids, images, plot_schema,
4-
plots, users)
3+
from plotly.api.v2 import (dash_apps, dashboards, files, folders, grids,
4+
images, plot_schema, plots, users)

plotly/api/v2/dash_apps.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""
2+
Beta interface to Plotly's /v2/dash-apps endpoints.
3+
"""
4+
from __future__ import absolute_import
5+
6+
from plotly.api.v2.utils import build_url, request
7+
8+
RESOURCE = 'dash-apps'
9+
10+
11+
def create(body):
12+
"""Create a dash app item."""
13+
url = build_url(RESOURCE)
14+
return request('post', url, json=body)
15+
16+
17+
def retrieve(fid):
18+
"""Retrieve a dash app from Plotly."""
19+
url = build_url(RESOURCE, id=fid)
20+
return request('get', url)
21+
22+
23+
def update(fid, content):
24+
"""Completely update the writable."""
25+
url = build_url(RESOURCE, id=fid)
26+
return request('put', url, json=content)

0 commit comments

Comments
 (0)