File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/datascience-ui/renderers Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export class CellOutput extends React.Component<ICellOutputProps> {
3131 return this . renderImage ( mimeBundle , this . props . output . metadata ) ;
3232
3333 default :
34- return this . renderOutput ( data ) ;
34+ return this . renderOutput ( data , this . props . mimeType ) ;
3535 }
3636 }
3737 /**
@@ -73,10 +73,13 @@ export class CellOutput extends React.Component<ICellOutputProps> {
7373 </ div >
7474 ) ;
7575 }
76- private renderOutput ( data : nbformat . MultilineString | JSONObject ) {
76+ private renderOutput ( data : nbformat . MultilineString | JSONObject , mimeType ?: string ) {
7777 const Transform = getTransform ( this . props . mimeType ! ) ;
78+ const divStyle : React . CSSProperties = {
79+ backgroundColor : mimeType && isAltairPlot ( mimeType ) ? 'white' : undefined
80+ } ;
7881 return (
79- < div >
82+ < div style = { divStyle } >
8083 < Transform data = { data } />
8184 </ div >
8285 ) ;
@@ -87,3 +90,7 @@ export class CellOutput extends React.Component<ICellOutputProps> {
8790 return this . renderOutput ( data ) ;
8891 }
8992}
93+
94+ function isAltairPlot ( mimeType : string ) {
95+ return mimeType . includes ( 'application/vnd.vega' ) ;
96+ }
You can’t perform that action at this time.
0 commit comments