Skip to content

Commit 063a7ca

Browse files
automargin support
1 parent 65f7bb1 commit 063a7ca

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
npm-debug.log
33
examples/bundle.js
4+
yarn.lock

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"react-dom": ">=15.0.0",
7474
"react-dropzone": "^4.2.1",
7575
"react-hot-loader": "^3.1.1",
76-
"react-plotly.js": "^1.0.2",
76+
"react-plotly.js": "^2.0.0",
7777
"style-loader": "^0.19.0",
7878
"webpack": "^3.8.1",
7979
"webpack-dev-server": "^2.9.3"

src/PlotlyRenderers.jsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,16 @@ function makeRenderer(
7070
width: window.innerWidth / 1.5,
7171
height: window.innerHeight / 1.4 - 50,
7272
/* eslint-enable no-magic-numbers */
73+
xaxis: {
74+
title: transpose ? fullAggName : null,
75+
automargin: true,
76+
},
77+
yaxis: {
78+
title: transpose ? null : fullAggName,
79+
automargin: true,
80+
},
7381
};
7482

75-
if (transpose) {
76-
// eslint-disable-next-line no-magic-numbers
77-
layout.xaxis = {domain: [0.1, 1.0], title: fullAggName};
78-
} else {
79-
layout.yaxis = {title: fullAggName};
80-
}
81-
8283
return (
8384
<PlotlyComponent
8485
data={data}

0 commit comments

Comments
 (0)