Skip to content

Commit

Permalink
automargin support
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaskruchten committed Mar 21, 2018
1 parent 65f7bb1 commit 063a7ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
npm-debug.log
examples/bundle.js
yarn.lock
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"react-dom": ">=15.0.0",
"react-dropzone": "^4.2.1",
"react-hot-loader": "^3.1.1",
"react-plotly.js": "^1.0.2",
"react-plotly.js": "^2.0.0",
"style-loader": "^0.19.0",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.3"
Expand Down
15 changes: 8 additions & 7 deletions src/PlotlyRenderers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ function makeRenderer(
width: window.innerWidth / 1.5,
height: window.innerHeight / 1.4 - 50,
/* eslint-enable no-magic-numbers */
xaxis: {
title: transpose ? fullAggName : null,
automargin: true,
},
yaxis: {
title: transpose ? null : fullAggName,
automargin: true,
},
};

if (transpose) {
// eslint-disable-next-line no-magic-numbers
layout.xaxis = {domain: [0.1, 1.0], title: fullAggName};
} else {
layout.yaxis = {title: fullAggName};
}

return (
<PlotlyComponent
data={data}
Expand Down

0 comments on commit 063a7ca

Please sign in to comment.