You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/reportspec.md
+41-33Lines changed: 41 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@
4
4
5
5
After importing plotly, a Report object is created behind-the-scenes.
6
6
There is only one report object per Python session.
7
-
Grids and plots returned from plot.ly are automatically appended to the report object during the Python session,
7
+
Plots returned from plot.ly are automatically appended to the report object during the Python session,
8
8
so that when you create a report:
9
9
10
10
```python
11
11
import plotly
12
12
rp = plotly.report
13
13
```
14
14
15
-
It is pre-loaded with a list of plots, grids, and widget boxes that you've created during your session. Something like
15
+
It is pre-loaded with a list of plots and widget boxes that you've created during your session. Something like
16
16
17
17
```python
18
18
rp.save()
@@ -23,56 +23,65 @@ Would then compile and save the report to a local html file.
23
23
#### Item class
24
24
25
25
Reports would be structured as a list of Item objects.
26
-
Text, Plot, or Grid objects would subclass from an Item class.
26
+
Text, Plot, or Table objects would subclass from an Item class.
27
27
28
28
Item objects would have these methods and attributes:
29
29
30
-
* inline -- True or False. Defaults to false. >=2 sequential Items in report with inline=True will display inline.
30
+
* inline -- True or False. Defaults to false. 2 sequential Items in report with inline=True will display inline. Start with max. allowance of 2 inline items.
31
+
** Uses bootstraps 1-12 grid layout for fluid horizontal layout. Defaults to 3 for Table and vertical WidgetBox objects and 9 for plots. Coud add a "layout" attribute in the future for further control of this.
31
32
* to_html() -- Returns the Item's representation as an html string, including container div.
32
-
*serialize() -- Returns the Item's representation as a dict.
33
+
*to_json() -- Returns the Item's representation as a dict.
33
34
34
35
#### Text class
35
36
36
-
Methods / attributes:
37
+
###### Methods / attributes:
37
38
38
39
* markdown -- True or False. Defaults to False. Used by to_html() to convert content to html.
39
40
* content -- plain text, html, or markdown string of content.
40
41
* type (optional) -- for the html or markdown noob, adds css class to parent div for styling and parent html tags on to_html().
41
42
* possible types: caption, latex, paragraph, title, subtitle.
42
43
43
-
Usage examples:
44
+
###### Usage examples:
44
45
45
46
```python
46
47
t1 = Text( 'Hello, world', type='title' ) # plain text with type
0 commit comments