Skip to content

Commit c26b763

Browse files
committed
tests are working
1 parent 9705dde commit c26b763

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

plotly/dashboard_objs/dashboard_objs.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ def get_preview(self):
377377

378378
# determine the specs for resulting two box split
379379
if is_horizontal:
380-
print 'is horizontal'
381380
new_top_left_x = top_left_x
382381
new_top_left_y = top_left_y
383382
new_box_w = box_w * (fill_percent / 100.)
@@ -388,7 +387,6 @@ def get_preview(self):
388387
new_box_w_2 = box_w * ((100 - fill_percent) / 100.)
389388
new_box_h_2 = box_h
390389
else:
391-
print 'is vertical'
392390
new_top_left_x = top_left_x
393391
new_top_left_y = top_left_y
394392
new_box_w = box_w
@@ -440,11 +438,14 @@ def insert(self, box, side='above', box_id=None, fill_percent=50):
440438
'left', and 'right'.
441439
:param (int) box_id: the box id which is used as the reference box for
442440
the insertion of the box.
443-
:param (float) fill_percent: specifies the percentage of the box area
444-
which the new box is occupying. The default is `fill_percent=50`
445-
which splits the region into two equally sized pieces with `box`
446-
and the box corresponding to `box_id` in this area of the layout.
447-
441+
:param (float) fill_percent: specifies the percentage of the container
442+
box from the given 'side' that the new box occupies. For example
443+
if you apply the method\n
444+
.insert(box=new_box, box_id=2, side='left', fill_percent=20)\n
445+
to a dashboard object, a new box is inserted 20% from the left side
446+
of the box with id #2. Run .get_preview() to see the box ids
447+
assigned to each box in the dashboard layout.
448+
Default = 50
448449
Example:
449450
```
450451
import plotly.dashboard_objs as dashboard
@@ -461,7 +462,7 @@ def insert(self, box, side='above', box_id=None, fill_percent=50):
461462
my_dboard.insert(box_1, 'left', 1)
462463
my_dboard.insert(box_1, 'below', 2)
463464
my_dboard.insert(box_1, 'right', 3)
464-
my_dboard.insert(box_1, 'above', 4)
465+
my_dboard.insert(box_1, 'above', 4, fill_percent=30)
465466
466467
my_dboard.get_preview()
467468
```

plotly/tests/test_core/test_dashboard/test_dashboard.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ def test_dashboard_dict(self):
131131
'sizeUnit': '%',
132132
'type': 'split'},
133133
'second': {'boxType': 'empty', 'type': 'box'},
134-
'size': 1000,
135-
'sizeUnit': 'px',
136-
'type': 'split'},
134+
'size': 500,
135+
'sizeUnit': 'px',
136+
'type': 'split'},
137137
'settings': {},
138138
'version': 2
139139
}
140140

141+
141142
self.assertEqual(dash['layout'], expected_dashboard['layout'])

0 commit comments

Comments
 (0)