File tree Expand file tree Collapse file tree 10 files changed +176
-162
lines changed Expand file tree Collapse file tree 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;
1010
1111var attributes = {
1212 valType : 'enumerated' ,
13- values : Object . keys ( calendars . calendars ) ,
13+ values : Lib . sortObjectKeys ( calendars . calendars ) ,
1414 editType : 'calc' ,
1515 dflt : 'gregorian'
1616} ;
Original file line number Diff line number Diff line change 22
33var colorbarAttrs = require ( '../colorbar/attributes' ) ;
44var counterRegex = require ( '../../lib/regex' ) . counter ;
5+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
56
67var palettes = require ( './scales.js' ) . scales ;
7- var paletteStr = Object . keys ( palettes ) ;
8+ var paletteStr = sortObjectKeys ( palettes ) ;
89
910function code ( s ) {
1011 return '`' + s + '`' ;
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ lib.roundUp = searchModule.roundUp;
6767lib . sort = searchModule . sort ;
6868lib . findIndexOfMin = searchModule . findIndexOfMin ;
6969
70+ lib . sortObjectKeys = require ( './sort_object_keys' ) ;
71+
7072var statsModule = require ( './stats' ) ;
7173lib . aggNums = statsModule . aggNums ;
7274lib . 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');
44var domainAttrs = require ( '../domain' ) . attributes ;
55var constants = require ( './constants' ) ;
66var overrideAll = require ( '../../plot_api/edit_types' ) . overrideAll ;
7+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
78
89var geoAxesAttrs = {
910 range : {
@@ -100,14 +101,14 @@ var attrs = module.exports = overrideAll({
100101 } ,
101102 scope : {
102103 valType : 'enumerated' ,
103- values : Object . keys ( constants . scopeDefaults ) ,
104+ values : sortObjectKeys ( constants . scopeDefaults ) ,
104105 dflt : 'world' ,
105106 description : 'Set the scope of the map.'
106107 } ,
107108 projection : {
108109 type : {
109110 valType : 'enumerated' ,
110- values : Object . keys ( constants . projNames ) ,
111+ values : sortObjectKeys ( constants . projNames ) ,
111112 description : 'Sets the projection type.'
112113 } ,
113114 rotation : {
Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
4+
35var requiredVersion = '1.10.1' ;
46
57var OSM = '© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' ;
@@ -156,7 +158,7 @@ var stylesNonMapbox = {
156158 }
157159} ;
158160
159- var styleValuesNonMapbox = Object . keys ( stylesNonMapbox ) ;
161+ var styleValuesNonMapbox = sortObjectKeys ( stylesNonMapbox ) ;
160162
161163module . exports = {
162164 requiredVersion : requiredVersion ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ var DASHES = require('../../constants/gl3d_dashes');
1111var MARKER_SYMBOLS = require ( '../../constants/gl3d_markers' ) ;
1212var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
1313var overrideAll = require ( '../../plot_api/edit_types' ) . overrideAll ;
14+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
1415
1516var scatterLineAttrs = scatterAttrs . line ;
1617var scatterMarkerAttrs = scatterAttrs . marker ;
@@ -20,7 +21,7 @@ var lineAttrs = extendFlat({
2021 width : scatterLineAttrs . width ,
2122 dash : {
2223 valType : 'enumerated' ,
23- values : Object . keys ( DASHES ) ,
24+ values : sortObjectKeys ( DASHES ) ,
2425 dflt : 'solid' ,
2526 description : 'Sets the dash style of the lines.'
2627 }
@@ -122,7 +123,7 @@ var attrs = module.exports = overrideAll({
122123 marker : extendFlat ( { // Parity with scatter.js?
123124 symbol : {
124125 valType : 'enumerated' ,
125- values : Object . keys ( MARKER_SYMBOLS ) ,
126+ values : sortObjectKeys ( MARKER_SYMBOLS ) ,
126127 dflt : 'circle' ,
127128 arrayOk : true ,
128129 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');
55var axisHoverFormat = require ( '../../plots/cartesian/axis_format_attributes' ) . axisHoverFormat ;
66var colorScaleAttrs = require ( '../../components/colorscale/attributes' ) ;
77
8+ var sortObjectKeys = require ( '../../lib/sort_object_keys' ) ;
89var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
910var overrideAll = require ( '../../plot_api/edit_types' ) . overrideAll ;
1011var DASHES = require ( './constants' ) . DASHES ;
@@ -59,7 +60,7 @@ var attrs = module.exports = overrideAll({
5960 } ,
6061 dash : {
6162 valType : 'enumerated' ,
62- values : Object . keys ( DASHES ) ,
63+ values : sortObjectKeys ( DASHES ) ,
6364 dflt : 'solid' ,
6465 description : 'Sets the style of the lines.'
6566 }
You can’t perform that action at this time.
0 commit comments