Skip to content

Implement layout.legend.orientation (closes #53) #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 17, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Legend: add mocks with horizontal legends
* Added `legend_horizontal.json` (a mock with a horizontal legend
  without groups).

* Added `legend_horizontal_groups.json` (a mock with a grouped
  horizontal legend).
  • Loading branch information
n-riesco committed May 13, 2016
commit 23e39723b615881ae9fa8a6ac72fb19a30ee6c23
Binary file added test/image/baselines/legend_horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/image/baselines/legend_horizontal_groups.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
211 changes: 211 additions & 0 deletions test/image/mocks/legend_horizontal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"data": [
{
"x": [
0,
0.3571429,
0.7142857,
1.071429,
1.428571,
1.785714,
2.142857,
2.5,
2.857143,
3.214286,
3.571429,
3.928571,
4.285714,
4.642857,
5
],
"y": [
0.869693,
1.088434,
0.758308,
1.849319,
1.728616,
0.9908515,
1.519909,
1.083975,
0.3153477,
0.04181056,
-0.3400965,
-0.1003989,
-0.6768811,
-0.8555722,
-0.4287511
],
"name": "trace 0",
"type": "scatter"
},
{
"x": [
0,
1,
2,
3,
4,
5
],
"y": [
1,
0.5,
0.7,
-1.2,
0.3,
0.4
],
"name": "trace 1",
"type": "bar"
}
],
"layout": {
"title": "Click to enter Plot title",
"titlefont": {
"color": "",
"family": "",
"size": 0
},
"font": {
"family": "'Open sans', verdana, arial, sans-serif",
"size": 12,
"color": "#444"
},
"showlegend": true,
"autosize": true,
"width": 1152,
"height": 481,
"xaxis": {
"title": "Click to enter X axis title",
"titlefont": {
"color": "",
"family": "",
"size": 0
},
"range": [
-0.5,
5.5
],
"domain": [
0,
1
],
"type": "linear",
"rangemode": "normal",
"showgrid": false,
"zeroline": false,
"showline": false,
"autotick": true,
"nticks": 0,
"ticks": "",
"showticklabels": true,
"tick0": 0,
"dtick": 1,
"ticklen": 5,
"tickwidth": 1,
"tickcolor": "#444",
"tickangle": "auto",
"tickfont": {
"family": "",
"size": 0,
"color": ""
},
"exponentformat": "B",
"showexponent": "all",
"gridcolor": "#eee",
"gridwidth": 1,
"zerolinecolor": "#444",
"zerolinewidth": 1,
"linecolor": "#444",
"linewidth": 1,
"anchor": "y",
"position": 0,
"mirror": false,
"overlaying": false,
"autorange": true
},
"yaxis": {
"title": "Click to enter Y axis title",
"titlefont": {
"color": "",
"family": "",
"size": 0
},
"range": [
-1.3694066111111112,
2.018725611111111
],
"domain": [
0,
1
],
"type": "linear",
"rangemode": "normal",
"showgrid": true,
"zeroline": true,
"showline": false,
"autotick": true,
"nticks": 0,
"ticks": "",
"showticklabels": true,
"tick0": 0,
"dtick": 0.5,
"ticklen": 5,
"tickwidth": 1,
"tickcolor": "#444",
"tickangle": "auto",
"tickfont": {
"family": "",
"size": 0,
"color": ""
},
"exponentformat": "B",
"showexponent": "all",
"gridcolor": "#eee",
"gridwidth": 1,
"zerolinecolor": "#444",
"zerolinewidth": 1,
"linecolor": "#444",
"linewidth": 1,
"anchor": "x",
"position": 0,
"mirror": false,
"overlaying": false,
"autorange": true
},
"legend": {
"orientation": "h",
"x": 0,
"xanchor": "left",
"y": -0.1,
"yanchor": "top",
"traceorder": "normal",
"font": {
"family": "",
"size": 0,
"color": ""
},
"bgcolor": "#fff",
"bordercolor": "#444",
"borderwidth": 0
},
"margin": {
"l": 80,
"r": 80,
"b": 80,
"t": 100,
"pad": 0,
"autoexpand": true
},
"paper_bgcolor": "#fff",
"plot_bgcolor": "#fff",
"hovermode": "x",
"dragmode": "zoom",
"barmode": "group",
"bargap": 0.2,
"bargroupgap": 0,
"boxmode": "overlay",
"separators": ".,",
"hidesources": false
}
}
119 changes: 119 additions & 0 deletions test/image/mocks/legend_horizontal_groups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"data": [
{
"type": "scatter",
"x": [
1,
2,
3
],
"y": [
2,
1,
2
],
"legendgroup": "group"
},
{
"type": "box",
"x": [
1,
2,
3
],
"y": [
1,
2,
1
],
"legendgroup": "group",
"showlegend": false
},
{
"type": "bar",
"x": [
1,
2,
3
],
"y": [
2,
1,
2
],
"legendgroup": "group 2"
},
{
"type": "scatter",
"x": [
3,
4,
5
],
"y": [
2,
1,
2
],
"legendgroup": "group"
},
{
"type": "scatter",
"x": [
3,
4,
5
],
"y": [
1,
2,
1
]
},
{
"type": "bar",
"x": [
3,
4,
5
],
"y": [
2,
1,
2
],
"legendgroup": "group 2",
"showlegend": false
}
],
"layout": {
"legend": {
"x": 0,
"xanchor": "left",
"y": -0.1,
"yanchor": "top",
"orientation": "h",
"tracegroupgap": 20
},
"xaxis": {
"type": "linear",
"range": [
0.5,
5.5
],
"autorange": true
},
"yaxis": {
"type": "linear",
"range": [
0,
2.136498516320475
],
"autorange": true
},
"height": 450,
"width": 1000,
"autosize": true,
"showlegend": true
}
}