8000 make style a prop · timonweb-forks/react-plotly.js@05947dc · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 05947dc

Browse files
make style a prop
1 parent 16644d7 commit 05947dc

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/factory.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,7 @@ export default function plotComponentFactory(Plotly) {
252252
}
253253

254254
render() {
255-
return (
256-
<div
257-
style={{
258-
position: 'relative',
259-
display: 'inline-block',
260-
}}
261-
ref={this.getRef}
262-
/>
263-
);
255+
return <div style={this.props.style} ref={this.getRef} />;
264256
}
265257
}
266258

@@ -276,6 +268,7 @@ export default function plotComponentFactory(Plotly) {
276268
onError: PropTypes.func,
277269
onUpdate: PropTypes.func,
278270
debug: PropTypes.bool,
271+
style: PropTypes.object,
279272
};
280273

281274
for (let i = 0; i < eventNames.length; i++) {
@@ -286,6 +279,7 @@ export default function plotComponentFactory(Plotly) {
286279
debug: false,
287280
fit: false,
288281
data: [],
282+
style: {position: 'relative', display: 'inline-block'},
289283
};
290284

291285
return PlotlyComponent;

0 commit comments

Comments
 (0)
0