Skip to content

Commit

Permalink
Upgrade Plotly (#4752)
Browse files Browse the repository at this point in the history
* Upgrade Plotly

* Fixes to Plotly wrapper

* Decrease plot margins

* Adjust plot margins
  • Loading branch information
kravets-levko authored Apr 6, 2020
1 parent 54b04ea commit 51b5732
Show file tree
Hide file tree
Showing 13 changed files with 384 additions and 1,539 deletions.
1 change: 1 addition & 0 deletions client/app/visualizations/chart/plotly/applyLayoutFixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function applyLayoutFixes(plotlyElement, layout, updatePlot) {
// half of plot container's height - legend will have max height equal to
// plot height), re-render plot again and offset legend to the space under
// the plot.
// Related issue: https://github.com/plotly/plotly.js/issues/1199
layout.legend = {
orientation: "h",
// locate legend inside of plot area - otherwise plotly will preserve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": true,
"boxmode": "group",
"boxgroupgap": 0.50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": true,
"boxmode": "group",
"boxgroupgap": 0.50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": true,
"xaxis": {
"automargin": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": true,
"xaxis": {
"automargin": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": false,
"barmode": "relative",
"xaxis": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": false,
"xaxis": {
"automargin": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": true,
"annotations": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": true,
"annotations": []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
},
"output": {
"layout": {
"margin": { "l": 10, "r": 10, "b": 10, "t": 25, "pad": 4 },
"margin": { "l": 10, "r": 10, "b": 5, "t": 20, "pad": 4 },
"width": 400,
"height": 300,
"autosize": true,
"autosize": false,
"showlegend": true,
"annotations": [
{
Expand Down
4 changes: 2 additions & 2 deletions client/app/visualizations/chart/plotly/prepareLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ function prepareBoxLayout(layout, options, data) {

export default function prepareLayout(element, options, data) {
const layout = {
margin: { l: 10, r: 10, b: 10, t: 25, pad: 4 },
margin: { l: 10, r: 10, b: 5, t: 20, pad: 4 },
width: Math.floor(element.offsetWidth),
height: Math.floor(element.offsetHeight),
autosize: true,
autosize: false,
showlegend: has(options, "legend") ? options.legend.enabled : true,
};

Expand Down
Loading

0 comments on commit 51b5732

Please sign in to comment.