@@ -24748,7 +24748,7 @@ module.exports = {
2474824748 },
2474924749 traceorder: {
2475024750 valType: 'flaglist',
24751- flags: ['reversed', 'grouped'],
24751+ flags: ['reversed', 'grouped', 'alphabetical' ],
2475224752 extras: ['normal'],
2475324753
2475424754 editType: 'legend',
@@ -25680,13 +25680,11 @@ function expandHorizontalMargin(gd) {
2568025680* LICENSE file in the root directory of this source tree.
2568125681*/
2568225682
25683-
2568425683'use strict';
2568525684
2568625685var Registry = require('../../registry');
2568725686var helpers = require('./helpers');
2568825687
25689-
2569025688module.exports = function getLegendData(calcdata, opts) {
2569125689 var lgroupToTraces = {},
2569225690 lgroups = [],
@@ -25721,7 +25719,7 @@ module.exports = function getLegendData(calcdata, opts) {
2572125719 lgroup = trace.legendgroup;
2572225720
2572325721 if(!helpers.legendGetsTrace(trace) || !trace.showlegend) continue;
25724-
25722+
2572525723 if(Registry.traceIs(trace, 'pie')) {
2572625724 if(!slicesShown[lgroup]) slicesShown[lgroup] = {};
2572725725
@@ -25773,6 +25771,20 @@ module.exports = function getLegendData(calcdata, opts) {
2577325771
2577425772 // needed in repositionLegend
2577525773 opts._lgroupsLength = lgroupsLength;
25774+
25775+ if (opts.traceorder === "alphabetical") {
25776+ legendData[0].sort((a, b) => {
25777+ if (a[0] && a[0].label) {
25778+ return a[0].label.localeCompare(b[0].label);
25779+ } else {
25780+ if (a[0] && a[0].trace && a[0].trace.name) {
25781+ return a[0].trace.name.localeCompare(b[0].trace.name);
25782+ }
25783+ }
25784+ });
25785+ }
25786+
25787+
2577625788 return legendData;
2577725789};
2577825790
@@ -32811,7 +32823,7 @@ exports.svgAttrs = {
3281132823var Plotly = require('./plotly');
3281232824
3281332825// package version injected by `npm run preprocess`
32814- exports.version = '1.33.1-ion37 ';
32826+ exports.version = '1.33.1-ion38 ';
3281532827
3281632828// inject promise polyfill
3281732829require('es6-promise').polyfill();
@@ -33104,7 +33116,7 @@ exports.valObjectMeta = {
3310433116 },
3310533117 colorlist: {
3310633118
33107- requiredOpts: [],
33119+
3310833120
3310933121 coerceFunction: function(v, propOut, dflt) {
3311033122 function isColor(color) {
@@ -54825,7 +54837,7 @@ module.exports = overrideAll({
5482554837 showcountries: {
5482654838 valType: 'boolean',
5482754839
54828- description: 'Sets whether or not country boundaries are drawn.'
54840+
5482954841 },
5483054842 countrycolor: {
5483154843 valType: 'color',
0 commit comments