@@ -698,9 +698,9 @@ def mkdirs(cls, folder_path):
698
698
class grid_ops :
699
699
""" Interface to Plotly's Grid API.
700
700
Plotly Grids are Plotly's tabular data object, rendered
701
- in a online spreadsheet. Plotly graphs can be made from
701
+ in an online spreadsheet. Plotly graphs can be made from
702
702
references of columns of Plotly grid objects. Free-form
703
- JSON Meta data can be saved with Plotly grids.
703
+ JSON Metadata can be saved with Plotly grids.
704
704
705
705
To create a Plotly grid in your Plotly account from Python,
706
706
see `grid_ops.upload`.
@@ -724,57 +724,62 @@ def _fill_in_response_column_ids(cls, request_columns,
724
724
@classmethod
725
725
def upload (cls , grid , filename ,
726
726
world_readable = True , auto_open = True , meta = None ):
727
- """ Upload a grid to your Plotly account with the specified filename.
728
-
729
- Positional arguments:
730
- - grid: A plotly.grid_objs.Grid object,
731
- call `help(plotly.grid_ops.Grid)` for more info.
732
- - filename: Name of the grid to be saved in your Plotly account.
733
- To save a grid in a folder in your Plotly account,
734
- separate specify a filename with folders and filename
735
- separated by backslashes (`/`).
736
- If a grid, plot, or folder already exists with the same
737
- filename, a `plotly.exceptions.RequestError` will be thrown
738
- with status_code 409
739
-
740
- Optional keyword arguments:
741
- - world_readable (default=True): make this grid publically (True)
742
- or privately (False) viewable.
743
- - auto_open (default=True): Automatically open this grid in
744
- the browser (True)
745
- - meta (default=None): Optional meta data to associate with
746
- this grid.
747
- Meta data is any arbitrary
748
- JSON-encodable object, for example:
749
- `{"experiment name": "GaAs"}`
750
-
751
- Usage example 1: Upload a plotly grid
752
- ```
753
- from plotly.grid_objs import Grid, Column
754
- import plotly.plotly as py
755
- column_1 = Column([1, 2, 3], 'time')
756
- column_2 = Column([4, 2, 5], 'voltage')
757
- grid = Grid([column_1, column_2])
758
- py.grid_ops.upload(grid, 'time vs voltage')
759
- ```
727
+ """
728
+ Upload a grid to your Plotly account with the specified filename.
729
+
730
+ Positional arguments:
731
+ - grid: A plotly.grid_objs.Grid object,
732
+ call `help(plotly.grid_ops.Grid)` for more info.
733
+ - filename: Name of the grid to be saved in your Plotly account.
734
+ To save a grid in a folder in your Plotly account,
735
+ separate specify a filename with folders and filename
736
+ separated by backslashes (`/`).
737
+ If a grid, plot, or folder already exists with the same
738
+ filename, a `plotly.exceptions.RequestError` will be thrown
739
+ with status_code 409
740
+
741
+ Optional keyword arguments:
742
+ - world_readable (default=True): make this grid publically (True)
743
+ or privately (False) viewable.
744
+ - auto_open (default=True): Automatically open this grid in
745
+ the browser (True)
746
+ - meta (default=None): Optional Metadata to associate with
747
+ this grid.
748
+ Metadata is any arbitrary
749
+ JSON-encodable object, for example:
750
+ `{"experiment name": "GaAs"}`
751
+
752
+ Filenames must be unique. To overwrite a grid with the same filename,
753
+ you'll first have to delete the grid with the blocking name. See
754
+ `plotly.plotly.grid_ops.delete`.
755
+
756
+ Usage example 1: Upload a plotly grid
757
+ ```
758
+ from plotly.grid_objs import Grid, Column
759
+ import plotly.plotly as py
760
+ column_1 = Column([1, 2, 3], 'time')
761
+ column_2 = Column([4, 2, 5], 'voltage')
762
+ grid = Grid([column_1, column_2])
763
+ py.grid_ops.upload(grid, 'time vs voltage')
764
+ ```
760
765
761
- Usage example 2: Make a graph based with data that is sourced
762
- from a newly uploaded Plotly grid
763
- ```
764
- import plotly.plotly as py
765
- from plotly.grid_objs import Grid, Column
766
- from plotly.graph_objs import Scatter
767
- # Upload a grid
768
- column_1 = Column([1, 2, 3], 'time')
769
- column_2 = Column([4, 2, 5], 'voltage')
770
- grid = Grid([column_1, column_2])
771
- py.grid_ops.upload(grid, 'time vs voltage')
766
+ Usage example 2: Make a graph based with data that is sourced
767
+ from a newly uploaded Plotly grid
768
+ ```
769
+ import plotly.plotly as py
770
+ from plotly.grid_objs import Grid, Column
771
+ from plotly.graph_objs import Scatter
772
+ # Upload a grid
773
+ column_1 = Column([1, 2, 3], 'time')
774
+ column_2 = Column([4, 2, 5], 'voltage')
775
+ grid = Grid([column_1, column_2])
776
+ py.grid_ops.upload(grid, 'time vs voltage')
772
777
773
- # Build a Plotly graph object sourced from the
774
- # grid's columns
775
- trace = Scatter(xsrc=grid[0], ysrc=grid[1])
776
- py.plot([trace], filename='graph from grid')
777
- ```
778
+ # Build a Plotly graph object sourced from the
779
+ # grid's columns
780
+ trace = Scatter(xsrc=grid[0], ysrc=grid[1])
781
+ py.plot([trace], filename='graph from grid')
782
+ ```
778
783
"""
779
784
780
785
# Make a folder path
@@ -974,35 +979,35 @@ def append_rows(cls, rows, grid=None, grid_url=None):
974
979
@classmethod
975
980
def delete (cls , grid = None , grid_url = None ):
976
981
'''
977
- Delete a grid from your Plotly account.
982
+ Delete a grid from your Plotly account.
978
983
979
- Only one of `grid` or `grid_url` needs to be specified.
984
+ Only one of `grid` or `grid_url` needs to be specified.
980
985
981
- `grid` is a plotly.grid_objs.Grid object that has already
982
- been uploaded to Plotly.
986
+ `grid` is a plotly.grid_objs.Grid object that has already
987
+ been uploaded to Plotly.
983
988
984
- `grid_url` is the URL of the Plotly grid to delete
989
+ `grid_url` is the URL of the Plotly grid to delete
985
990
986
- Usage example 1: Upload a grid to plotly, then delete it
987
- ```
988
- from plotly.grid_objs import Grid, Column
989
- import plotly.plotly as py
990
- column_1 = Column([1, 2, 3], 'time')
991
- column_2 = Column([4, 2, 5], 'voltage')
992
- grid = Grid([column_1, column_2])
993
- py.grid_ops.upload(grid, 'time vs voltage')
991
+ Usage example 1: Upload a grid to plotly, then delete it
992
+ ```
993
+ from plotly.grid_objs import Grid, Column
994
+ import plotly.plotly as py
995
+ column_1 = Column([1, 2, 3], 'time')
996
+ column_2 = Column([4, 2, 5], 'voltage')
997
+ grid = Grid([column_1, column_2])
998
+ py.grid_ops.upload(grid, 'time vs voltage')
994
999
995
- # now delete it, and free up that filename
996
- py.grid_ops.delete(grid)
997
- ```
1000
+ # now delete it, and free up that filename
1001
+ py.grid_ops.delete(grid)
1002
+ ```
998
1003
999
- Usage example 2: Delete a plotly grid by url
1000
- ```
1001
- import plotly.plotly as py
1004
+ Usage example 2: Delete a plotly grid by url
1005
+ ```
1006
+ import plotly.plotly as py
1002
1007
1003
- grid_url = 'https://plot.ly/~chris/3'
1004
- py.grid_ops.delete(grid_url=grid_url)
1005
- ```
1008
+ grid_url = 'https://plot.ly/~chris/3'
1009
+ py.grid_ops.delete(grid_url=grid_url)
1010
+ ```
1006
1011
'''
1007
1012
1008
1013
grid_id = _api_v2 .parse_grid_id_args (grid , grid_url )
@@ -1014,32 +1019,32 @@ def delete(cls, grid=None, grid_url=None):
1014
1019
class meta_ops :
1015
1020
""" Interface to Plotly's Metadata API.
1016
1021
1017
- In Plotly, meta data is arbitrary, free-form JSON data that is
1018
- associated with Plotly grids. Meta data is viewable with any grid
1022
+ In Plotly, Metadata is arbitrary, free-form JSON data that is
1023
+ associated with Plotly grids. Metadata is viewable with any grid
1019
1024
that is shared and grids are searchable by key value pairs in
1020
- the meta data. Meta data is any JSON-encodable object.
1025
+ the Metadata. Metadata is any JSON-encodable object.
1021
1026
1022
- To upload meta data , either use the optional keyword argument `meta`
1027
+ To upload Metadata , either use the optional keyword argument `meta`
1023
1028
in the `py.grid_ops.upload` method, or use `py.meta_ops.upload`.
1024
1029
1025
1030
"""
1026
1031
1027
1032
@classmethod
1028
1033
def upload (cls , meta , grid = None , grid_url = None ):
1029
1034
'''
1030
- Upload meta data to a Plotly grid.
1035
+ Upload Metadata to a Plotly grid.
1031
1036
1032
- Meta data is any JSON-encodable object. For example,
1037
+ Metadata is any JSON-encodable object. For example,
1033
1038
a dictionary, string, or list.
1034
1039
1035
1040
Only one of `grid` or `grid_url` needs to be specified.
1036
1041
1037
1042
`grid` is a plotly.grid_objs.Grid object that has already
1038
1043
been uploaded to Plotly.
1039
1044
1040
- `grid_url` is the URL of the Plotly grid to attach meta data to.
1045
+ `grid_url` is the URL of the Plotly grid to attach Metadata to.
1041
1046
1042
- Usage example 1: Upload a grid to Plotly, then attach meta data to it
1047
+ Usage example 1: Upload a grid to Plotly, then attach Metadata to it
1043
1048
```
1044
1049
from plotly.grid_objs import Grid, Column
1045
1050
import plotly.plotly as py
@@ -1048,12 +1053,12 @@ def upload(cls, meta, grid=None, grid_url=None):
1048
1053
grid = Grid([column_1, column_2])
1049
1054
py.grid_ops.upload(grid, 'time vs voltage')
1050
1055
1051
- # now attach meta data to the grid
1056
+ # now attach Metadata to the grid
1052
1057
meta = {'experment': 'GaAs'}
1053
1058
py.meta_ops.upload(meta, grid=grid)
1054
1059
```
1055
1060
1056
- Usage example 2: Upload meta data to an existing Plotly grid
1061
+ Usage example 2: Upload Metadata to an existing Plotly grid
1057
1062
```
1058
1063
import plotly.plotly as py
1059
1064
0 commit comments