Skip to content

Commit

Permalink
Merge pull request plotly#476 from plotly/rangeslider-tests
Browse files Browse the repository at this point in the history
Rangeslider tests
  • Loading branch information
mdtusz committed Apr 26, 2016
2 parents d7a62b1 + 9a30fda commit c067cc7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ axes.saveRangeInitial = function(gd, overwrite) {
// and make it a tight bound if possible
var FP_SAFE = Number.MAX_VALUE/2;
axes.expand = function(ax, data, options) {
// if(!(ax.autorange || (ax.rangeslider || {}).visible) || !data) return;
if(!(ax.autorange || ax._needsExpand) || !data) return;
if(!ax._min) ax._min = [];
if(!ax._max) ax._max = [];
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
37 changes: 37 additions & 0 deletions test/image/mocks/range_slider_initial_valid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"data": [{
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49],
"y": [61.54407276195499, 53.01489477283346, 54.27395817178983, 53.55001411571369, 78.9775866748205, 31.884243474727825, 56.77854253236383, 4.735201078365101, 63.12484997271903, 43.09882925106262, 43.724822753247224, 24.844310873420152, 34.89218498332549, 36.0460327216264, 28.2174958198741, 29.273481072578775, 70.89188615102645, 59.76636236708869, 66.76528535512163, 11.281051334701928, 78.37153154211197, 66.08349166666542, 50.09727630364335, 58.04698479499695, 59.74272576303902, 41.86433349552978, 48.22485560857029, 37.70855269433609, 21.119967245011217, 75.10194864698312, 55.48369213601815, 59.735088561204854, 60.42028696627966, 0.10938359086638982, 77.3773017472981, 15.086946383114501, 35.82836446307611, 23.689280033989295, 2.362484581742592, 53.40692073882494, 15.134375465281735, 7.3434664768826075, 54.52433252576499, 35.798885397722806, 38.26472971248782, 17.920068000491725, 37.0479742805594, 45.83239633915396, 43.99138484769564, 69.43228444571429],
"line": {
"shape": "spline",
"smoothing": 1
},
"fill": "tozeroy",
"name": "Bird 1"
}, {
"x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49],
"y": [42.61173967030771, 77.84512822099697, 55.39613813617828, 4.0231685798691785, 34.55285260557025, 15.153333721685467, 77.54957038861798, 75.64407363993858, 62.12340236506287, 68.02318161065071, 34.816275599609554, 12.97751450053445, 25.16704221023005, 39.27425976595971, 41.98830052124046, 32.88934713126341, 64.3908328308427, 31.152165702544288, 53.28979283850701, 47.831576036783474, 48.46112255786373, 13.019775174742367, 44.95556684431092, 62.13365414186855, 22.796080092935433, 53.88638249610922, 9.378276407428476, 54.87772961864103, 10.622983213205028, 31.428637782080635, 63.81786719853103, 68.85325763593313, 30.412750136966178, 29.161036950263153, 19.125624934754217, 1.7788679495654591, 31.62390207284494, 33.722958647807374, 35.3846908579102, 41.364380830218224, 24.993662278935265, 39.083235916470116, 59.576257951955824, 33.620531907520075, 11.721918308606636, 10.943094423029738, 20.385230482706316, 39.62659948914896, 72.20357742148559, 38.48711164016425],
"name": "Bird 2"
}],
"layout": {
"title": "Seagull Positions",
"xaxis": {
"rangeslider": {
"visible": true,
"thickness": 0.2,
"bgcolor": "#fafafa",
"bordercolor": "black",
"borderwidth": 2,
"range": [10, 25]
},
"title": "Time (Hours)",
"range": [15, 20]
},
"yaxis": {
"title": "Height (ft)"
},
"paper_bgcolor": "#eee",
"height": 500,
"width": 800
}
}

0 comments on commit c067cc7

Please sign in to comment.