@@ -14,6 +14,7 @@ callWithJQuery ($, Plotly) ->
14
14
defaults =
15
15
localeStrings : {vs : " vs" , by : " by" }
16
16
plotly : {}
17
+ plotlyConfig : {}
17
18
18
19
opts = $ .extend (true , {}, defaults, opts)
19
20
@@ -68,13 +69,14 @@ callWithJQuery ($, Plotly) ->
68
69
}
69
70
70
71
result = $ (" <div>" ).appendTo $ (" body" )
71
- Plotly .newPlot (result[0 ], data, $ .extend (layout, layoutOptions, opts .plotly ))
72
+ Plotly .newPlot (result[0 ], data, $ .extend (layout, layoutOptions, opts .plotly ), opts . plotlyConfig )
72
73
return result .detach ()
73
74
74
75
makePlotlyScatterChart = -> (pivotData , opts ) ->
75
76
defaults =
76
77
localeStrings : {vs : " vs" , by : " by" }
77
78
plotly : {}
79
+ plotlyConfig : {}
78
80
79
81
opts = $ .extend (true , {}, defaults, opts)
80
82
@@ -96,15 +98,15 @@ callWithJQuery ($, Plotly) ->
96
98
layout = {
97
99
title : pivotData .rowAttrs .join (" -" ) + ' vs ' + pivotData .colAttrs .join (" -" )
98
100
hovermode : ' closest' ,
99
- xaxis : {title : pivotData .colAttrs .join (' -' ), domain : [ 0.1 , 1.0 ] },
100
- yaxis : {title : pivotData .rowAttrs .join (' -' )},
101
+ xaxis : {title : pivotData .colAttrs .join (' -' ), automargin : true },
102
+ yaxis : {title : pivotData .rowAttrs .join (' -' ), automargin : true },
101
103
width : window .innerWidth / 1.5 ,
102
104
height : window .innerHeight / 1.4 - 50
103
105
}
104
106
105
107
renderArea = $ (" <div>" , style : " display:none;" ).appendTo $ (" body" )
106
108
result = $ (" <div>" ).appendTo renderArea
107
- Plotly .newPlot (result[0 ], [data], $ .extend (layout, opts .plotly ))
109
+ Plotly .newPlot (result[0 ], [data], $ .extend (layout, opts .plotly ), opts . plotlyConfig )
108
110
result .detach ()
109
111
renderArea .remove ()
110
112
return result
0 commit comments