Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8611134

Browse files
authored
Merge pull request plotly#694 from plotly/dashboard-wrapper
Dashboard wrapper
2 parents 4b06dfd + bb614b3 commit 8611134

File tree

9 files changed

+1036
-44
lines changed

9 files changed

+1036
-44
lines changed

CHANGELOG.md

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
## Added
7+
- dashboards can now be created using the API and uploaded to Plotly. Use `import plotly.dashboard_objs` to be create a dashboard a `Dashboard` object. You can learn more about `Dashboard` objects by running `help(plotly.dashboard_objs.Dashboard)` and `help(plotly.plotly.plotly.dashboard_ops)` for uploading and retrieving dashboards from the cloud.
8+
69

710
## [2.0.2] - 2017-02-20
811
### Fixed
@@ -58,7 +61,7 @@ gone.
5861
## [1.12.12] - 2016-12-06
5962
### Updated
6063
- Updated `plotly.min.js` to version 1.20.5 for `plotly.offline`.
61-
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates
64+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates
6265
- `FF.create_scatterplotmatrix` now by default does not show the trace labels for the box plots, only if `diag=box` is selected for the diagonal subplot type.
6366

6467
## [1.12.11] - 2016-12-01
@@ -72,7 +75,7 @@ gone.
7275

7376
### Added
7477
- Plot configuration options for offline plots. See the list of [configuration options](https://github.com/Rikorose/plotly.py/blob/master/plotly/offline/offline.py#L189) and [examples](https://plot.ly/javascript/configuration-options/) for more information.
75-
- Please note that these configuration options are for offline plots ONLY. For configuration options when embedding online plots please see our [embed tutorial](http://help.plot.ly/embed-graphs-in-websites/#step-8-customize-the-iframe).
78+
- Please note that these configuration options are for offline plots ONLY. For configuration options when embedding online plots please see our [embed tutorial](http://help.plot.ly/embed-graphs-in-websites/#step-8-customize-the-iframe).
7679
- `colors.py` file which contains functions for manipulating and validating colors and arrays of colors
7780
- 'scale' param in `FF.create_trisurf` which now can set the interpolation on the colorscales
7881
- animations now work in offline mode. By running `plotly.offline.plot()` and `plotly.offline.iplot()` with a `fig` with `frames`, the resulting plot will cycle through the figures defined in `frames` either in the browser or in an ipython notebook respectively. Here's an example:
@@ -191,14 +194,14 @@ Then, whenever you update the data in `'my-grid'`, the associated plot will upda
191194
## [1.12.7] - 2016-08-17
192195
### Fixed
193196
- Edited `plotly.min.js` due to issue using `iplot` to plot offline in Jupyter Notebooks
194-
- Please note that `plotly.min.js` may be cached in your Jupyter Notebook. Therefore, if you continue to experience this issue after upgrading the Plotly package please open a new notebook or clear the cache to ensure the correct `plotly.min.js` is referenced.
197+
- Please note that `plotly.min.js` may be cached in your Jupyter Notebook. Therefore, if you continue to experience this issue after upgrading the Plotly package please open a new notebook or clear the cache to ensure the correct `plotly.min.js` is referenced.
195198

196199
## [1.12.6] - 2016-08-09
197200
### Updated
198201
- Updated `plotly.min.js` from 1.14.1 to 1.16.2
199-
- Trace type scattermapbox is now part of the main bundle
200-
- Add updatemenus (aka dropdowns) layout components
201-
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates
202+
- Trace type scattermapbox is now part of the main bundle
203+
- Add updatemenus (aka dropdowns) layout components
204+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates
202205

203206
## [1.12.5] - 2016-08-03
204207
### Updated
@@ -219,10 +222,10 @@ help(tls.FigureFactory.create_2D_density)
219222
## [1.12.3] - 2016-06-30
220223
### Updated
221224
- Updated `plotly.min.js` from 1.13.0 to 1.14.1
222-
- Numerous additions and changes where made to the mapbox layout layers attributes
223-
- Attribute line.color in scatter3d traces now support color scales
224-
- Layout shapes can now be moved and resized (except for 'path' shapes) in editable contexts
225-
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1141----2016-06-28) for additional information regarding the updates
225+
- Numerous additions and changes where made to the mapbox layout layers attributes
226+
- Attribute line.color in scatter3d traces now support color scales
227+
- Layout shapes can now be moved and resized (except for 'path' shapes) in editable contexts
228+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1141----2016-06-28) for additional information regarding the updates
226229
- Updated `default-schema`
227230

228231
### Added
@@ -231,9 +234,9 @@ help(tls.FigureFactory.create_2D_density)
231234
## [1.12.2] - 2016-06-20
232235
### Updated
233236
- Updated plotly.min.js so the offline mode is using plotly.js v1.13.0
234-
- Fix `Plotly.toImage` and `Plotly.downloadImage` bug specific to Chrome 51 on OSX
235-
- Beta version of the scattermapbox trace type - which allows users to create mapbox-gl maps using the plotly.js API. Note that scattermapbox is only available through custom bundling in this release.
236-
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1130----2016-05-26) for additional additions and updates.
237+
- Fix `Plotly.toImage` and `Plotly.downloadImage` bug specific to Chrome 51 on OSX
238+
- Beta version of the scattermapbox trace type - which allows users to create mapbox-gl maps using the plotly.js API. Note that scattermapbox is only available through custom bundling in this release.
239+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1130----2016-05-26) for additional additions and updates.
237240

238241
### Added
239242
- The FigureFactory can now create gantt charts with `.create_gantt`. Check it out with:
@@ -266,19 +269,19 @@ help(tls.FigureFactory.create_violin)
266269
Note: This is a backwards incompatible change.
267270

268271
- Updated plotly.min.js so the offline mode is using plotly.js v1.12.0
269-
- Light position is now configurable in surface traces
270-
- surface and mesh3d lighting attributes are now accompanied with comprehensive descriptions
272+
- Light position is now configurable in surface traces
273+
- surface and mesh3d lighting attributes are now accompanied with comprehensive descriptions
271274

272275
- Allowed `create_scatterplotmatrix` and `create_trisurf` to use divergent and categorical colormaps. The parameter `palette` has been replaced by `colormap` and `use_palette` has been removed. In `create_scatterplotmatrix`, users can now:
273-
- Input a list of different color types (hex, tuple, rgb) to `colormap` to map colors divergently
274-
- Use the same list to categorically group the items in the index column
275-
- Pass a singlton color type to `colormap` to color all the data with one color
276-
- Input a dictionary to `colormap` to map index values to a specific color
277-
- 'cat' and 'seq' are valid options for `colormap_type`, which specify the type of colormap being used
276+
- Input a list of different color types (hex, tuple, rgb) to `colormap` to map colors divergently
277+
- Use the same list to categorically group the items in the index column
278+
- Pass a singlton color type to `colormap` to color all the data with one color
279+
- Input a dictionary to `colormap` to map index values to a specific color
280+
- 'cat' and 'seq' are valid options for `colormap_type`, which specify the type of colormap being used
278281

279282
- In `create_trisurf`, the parameter `dist_func` has been replaced by `color_func`. Users can now:
280-
- Input a list of different color types (hex, tuple, rgb) to `colormap` to map colors divergently
281-
- Input a list|array of hex and rgb colors to `color_func` to assign each simplex to a color
283+
- Input a list of different color types (hex, tuple, rgb) to `colormap` to map colors divergently
284+
- Input a list|array of hex and rgb colors to `color_func` to assign each simplex to a color
282285

283286
### Added
284287
- Added the option to load plotly.js from a CDN by setting the parameter `connected=True`
@@ -326,9 +329,9 @@ help(tls.FigureFactory.create_scatterplotmatrix)
326329
## [1.9.10] - 2016-04-27
327330
### Updated
328331
- Updated plotly.min.js so the offline mode is using plotly.js v1.10.0
329-
- Added beta versions of two new 2D WebGL trace types: heatmapgl, contourgl
330-
- Added fills for scatterternary traces
331-
- Added configurable shapes layer positioning with the shape attribute: `layer`
332+
- Added beta versions of two new 2D WebGL trace types: heatmapgl, contourgl
333+
- Added fills for scatterternary traces
334+
- Added configurable shapes layer positioning with the shape attribute: `layer`
332335

333336
## [1.9.9] - 2016-04-15
334337
### Fixed
@@ -340,20 +343,20 @@ help(tls.FigureFactory.create_scatterplotmatrix)
340343

341344
### Updated
342345
- Updated plotly.min.js so offline is using plotly.js v1.9.0
343-
- Added Ternary plots with support for scatter traces (trace type `scatterternary`, currently only available in offline mode)
344-
- For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
346+
- Added Ternary plots with support for scatter traces (trace type `scatterternary`, currently only available in offline mode)
347+
- For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
345348

346349
## [1.9.7] - 2016-04-04
347350
### Fixed
348351
- Offline mode will no longer delete the Jupyter Notebook's require, requirejs, and define variables.
349352

350353
### Updated
351354
- Updated plotly.min.js so offline is using plotly.js v1.8.0
352-
- Added range selector functionality for cartesian plots
353-
- Added range slider functionality for scatter traces
354-
- Added custom surface color functionality
355-
- Added ability to subplot multiple graph types (SVG cartesian, 3D, maps, pie charts)
356-
- For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
355+
- Added range selector functionality for cartesian plots
356+
- Added range slider functionality for scatter traces
357+
- Added custom surface color functionality
358+
- Added ability to subplot multiple graph types (SVG cartesian, 3D, maps, pie charts)
359+
- For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
357360

358361
## [1.9.6] - 2016-02-18
359362
### Updated
@@ -528,18 +531,18 @@ it does.
528531
### Removed
529532
- `height` and `width` are no longer accepted in `iplot`. Just stick them into your figure's layout instead, it'll be more consistent when you view it outside of the IPython notebook environment. So, instead of this:
530533

531-
```
532-
py.iplot([{'x': [1, 2, 3], 'y': [3, 1, 5]}], height=800)
533-
```
534+
```
535+
py.iplot([{'x': [1, 2, 3], 'y': [3, 1, 5]}], height=800)
536+
```
534537

535-
do this:
538+
do this:
536539

537-
```
538-
py.iplot({
539-
'data': [{'x': [1, 2, 3], 'y': [3, 1, 5]}],
540-
'layout': {'height': 800}
541-
})
542-
```
540+
```
541+
py.iplot({
542+
'data': [{'x': [1, 2, 3], 'y': [3, 1, 5]}],
543+
'layout': {'height': 800}
544+
})
545+
```
543546

544547
### Fixed
545548
- The height of the graph in `iplot` respects the figure's height in layout

plotly/api/v2/__init__.py

Lines changed: 2 additions & 2 deletions
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 (files, folders, grids, images, plot_schema, plots,
4-
users)
3+
from plotly.api.v2 import (dashboards, files, folders, grids, images, plot_schema,
4+
plots, users)

plotly/api/v2/dashboards.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""
2+
Interface to Plotly's /v2/dashboards endpoints.
3+
4+
Partially complete at the moment. Only being used by
5+
plotly.plotly.dashboard_ops.
6+
"""
7+
from __future__ import absolute_import
8+
9+
from plotly.api.v2.utils import build_url, request
10+
11+
RESOURCE = 'dashboards'
12+
13+
14+
def create(body):
15+
"""Create a dashboard."""
16+
url = build_url(RESOURCE)
17+
return request('post', url, json=body)
18+
19+
20+
def list():
21+
"""Returns the list of all users' dashboards."""
22+
url = build_url(RESOURCE)
23+
return request('get', url)
24+
25+
26+
def retrieve(fid):
27+
"""Retrieve a dashboard from Plotly."""
28+
url = build_url(RESOURCE, id=fid)
29+
return request('get', url)
30+
31+
32+
def update(fid, content):
33+
"""Completely update the writable."""
34+
url = build_url(RESOURCE, id=fid)
35+
return request('put', url, json=content)
36+
37+
38+
def schema():
39+
"""Retrieve the dashboard schema."""
40+
url = build_url(RESOURCE, route='schema')
41+
return request('get', url)

plotly/dashboard_objs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . dashboard_objs import Dashboard

0 commit comments

Comments
 (0)