File tree 10 files changed +176
-162
lines changed
10 files changed +176
-162
lines changed Original file line number Diff line number Diff line change
1
+ - Sort object key values in schema [[ #5813 ] ( https://github.com/plotly/plotly.js/pull/5813 )]
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ var ONEDAY = constants.ONEDAY;
10
10
11
11
var attributes = {
12
12
valType : 'enumerated' ,
13
- values : Object . keys ( calendars . calendars ) ,
13
+ values : Lib . sortObjectKeys ( calendars . calendars ) ,
14
14
editType : 'calc' ,
15
15
dflt : 'gregorian'
16
16
} ;
Original file line number Diff line number Diff line change 2
2
3
3
var colorbarAttrs = require ( '../colorbar/attributes' ) ;
4
4
var counterRegex = require ( '../../lib/regex' ) . counter ;
5
+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
5
6
6
7
var palettes = require ( './scales.js' ) . scales ;
7
- var paletteStr = Object . keys ( palettes ) ;
8
+ var paletteStr = sortObjectKeys ( palettes ) ;
8
9
9
10
function code ( s ) {
10
11
return '`' + s + '`' ;
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ lib.roundUp = searchModule.roundUp;
67
67
lib . sort = searchModule . sort ;
68
68
lib . findIndexOfMin = searchModule . findIndexOfMin ;
69
69
70
+ lib . sortObjectKeys = require ( './sort_object_keys' ) ;
71
+
70
72
var statsModule = require ( './stats' ) ;
71
73
lib . aggNums = statsModule . aggNums ;
72
74
lib . len = statsModule . len ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ module . exports = function sortObjectKeys ( obj ) {
4
+ return Object . keys ( obj ) . sort ( ) ;
5
+ } ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ var colorAttrs = require('../../components/color/attributes');
4
4
var domainAttrs = require ( '../domain' ) . attributes ;
5
5
var constants = require ( './constants' ) ;
6
6
var overrideAll = require ( '../../plot_api/edit_types' ) . overrideAll ;
7
+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
7
8
8
9
var geoAxesAttrs = {
9
10
range : {
@@ -100,14 +101,14 @@ var attrs = module.exports = overrideAll({
100
101
} ,
101
102
scope : {
102
103
valType : 'enumerated' ,
103
- values : Object . keys ( constants . scopeDefaults ) ,
104
+ values : sortObjectKeys ( constants . scopeDefaults ) ,
104
105
dflt : 'world' ,
105
106
description : 'Set the scope of the map.'
106
107
} ,
107
108
projection : {
108
109
type : {
109
110
valType : 'enumerated' ,
110
- values : Object . keys ( constants . projNames ) ,
111
+ values : sortObjectKeys ( constants . projNames ) ,
111
112
description : 'Sets the projection type.'
112
113
} ,
113
114
rotation : {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
4
+
3
5
var requiredVersion = '1.10.1' ;
4
6
5
7
var OSM = '© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' ;
@@ -156,7 +158,7 @@ var stylesNonMapbox = {
156
158
}
157
159
} ;
158
160
159
- var styleValuesNonMapbox = Object . keys ( stylesNonMapbox ) ;
161
+ var styleValuesNonMapbox = sortObjectKeys ( stylesNonMapbox ) ;
160
162
161
163
module . exports = {
162
164
requiredVersion : requiredVersion ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ var DASHES = require('../../constants/gl3d_dashes');
11
11
var MARKER_SYMBOLS = require ( '../../constants/gl3d_markers' ) ;
12
12
var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
13
13
var overrideAll = require ( '../../plot_api/edit_types' ) . overrideAll ;
14
+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
14
15
15
16
var scatterLineAttrs = scatterAttrs . line ;
16
17
var scatterMarkerAttrs = scatterAttrs . marker ;
@@ -20,7 +21,7 @@ var lineAttrs = extendFlat({
20
21
width : scatterLineAttrs . width ,
21
22
dash : {
22
23
valType : 'enumerated' ,
23
- values : Object . keys ( DASHES ) ,
24
+ values : sortObjectKeys ( DASHES ) ,
24
25
dflt : 'solid' ,
25
26
description : 'Sets the dash style of the lines.'
26
27
}
@@ -122,7 +123,7 @@ var attrs = module.exports = overrideAll({
122
123
marker : extendFlat ( { // Parity with scatter.js?
123
124
symbol : {
124
125
valType : 'enumerated' ,
125
- values : Object . keys ( MARKER_SYMBOLS ) ,
126
+ values : sortObjectKeys ( MARKER_SYMBOLS ) ,
126
127
dflt : 'circle' ,
127
128
arrayOk : true ,
128
129
description : 'Sets the marker symbol type.'
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var scatterAttrs = require('../scatter/attributes');
5
5
var axisHoverFormat = require ( '../../plots/cartesian/axis_format_attributes' ) . axisHoverFormat ;
6
6
var colorScaleAttrs = require ( '../../components/colorscale/attributes' ) ;
7
7
8
+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
8
9
var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
9
10
var overrideAll = require ( '../../plot_api/edit_types' ) . overrideAll ;
10
11
var DASHES = require ( './constants' ) . DASHES ;
@@ -59,7 +60,7 @@ var attrs = module.exports = overrideAll({
59
60
} ,
60
61
dash : {
61
62
valType : 'enumerated' ,
62
- values : Object . keys ( DASHES ) ,
63
+ values : sortObjectKeys ( DASHES ) ,
63
64
dflt : 'solid' ,
64
65
description : 'Sets the style of the lines.'
65
66
}
You can’t perform that action at this time.
0 commit comments