File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
components/dash-core-components/src/fragments Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,24 @@ class PlotlyGraph extends Component {
374
374
} ) ;
375
375
}
376
376
377
+ getStyle ( ) {
378
+ let { style, responsive} = this . props ;
379
+
380
+ if ( ! responsive ) {
381
+ return style ;
382
+ }
383
+
384
+ if ( ! style ) {
385
+ style = { } ;
386
+ }
387
+
388
+ if ( ! style . height ) {
389
+ style . height = '100%' ;
390
+ }
391
+
392
+ return style ;
393
+ }
394
+
377
395
componentDidMount ( ) {
378
396
this . plot ( this . props ) ;
379
397
if ( this . props . prependData ) {
@@ -447,7 +465,8 @@ class PlotlyGraph extends Component {
447
465
}
448
466
449
467
render ( ) {
450
- const { className, id, style, loading_state} = this . props ;
468
+ const { className, id, loading_state} = this . props ;
469
+ const style = this . getStyle ( ) ;
451
470
452
471
return (
453
472
< div
You can’t perform that action at this time.
0 commit comments