@@ -46,12 +46,22 @@ exports.attributes = {
46
46
] . join ( ' ' )
47
47
} ,
48
48
groupnames : {
49
- valType : 'any' ,
50
- description : [
51
- 'An array of trace names based on group name. Each entry must be an' ,
52
- 'object `{name: "group", value: "trace name"}` which is then applied' ,
53
- 'to the particular group, overriding the name derived from `nameformat`.'
54
- ] . join ( ' ' )
49
+ _isLinkedToArray : 'groupname' ,
50
+ group : {
51
+ valType : 'string' ,
52
+ role : 'info' ,
53
+ description : [
54
+ 'An group to which this name applies. If a `group` and `name` are specified,' ,
55
+ 'that name overrides the `nameformat` for that group\'s trace.'
56
+ ] . join ( ' ' )
57
+ } ,
58
+ name : {
59
+ valType : 'string' ,
60
+ role : 'info' ,
61
+ description : [
62
+ 'Trace names assigned to the grouped traces of the corresponding `group`.'
63
+ ] . join ( ' ' )
64
+ }
55
65
} ,
56
66
styles : {
57
67
_isLinkedToArray : 'style' ,
@@ -90,6 +100,7 @@ exports.attributes = {
90
100
* copy of transformIn that contains attribute defaults
91
101
*/
92
102
exports . supplyDefaults = function ( transformIn ) {
103
+ var i ;
93
104
var transformOut = { } ;
94
105
95
106
function coerce ( attr , dflt ) {
@@ -101,14 +112,24 @@ exports.supplyDefaults = function(transformIn) {
101
112
if ( ! enabled ) return transformOut ;
102
113
103
114
coerce ( 'groups' ) ;
104
- coerce ( 'groupnames' ) ;
105
115
coerce ( 'nameformat' ) ;
106
116
117
+ var nameFormatIn = transformIn . groupnames ;
118
+ var nameFormatOut = transformOut . groupnames = [ ] ;
119
+
120
+ if ( nameFormatIn ) {
121
+ for ( i = 0 ; i < nameFormatIn . length ; i ++ ) {
122
+ nameFormatOut [ i ] = { } ;
123
+ Lib . coerce ( nameFormatIn [ i ] , nameFormatOut [ i ] , exports . attributes . groupnames , 'group' ) ;
124
+ Lib . coerce ( nameFormatIn [ i ] , nameFormatOut [ i ] , exports . attributes . groupnames , 'name' ) ;
125
+ }
126
+ }
127
+
107
128
var styleIn = transformIn . styles ;
108
129
var styleOut = transformOut . styles = [ ] ;
109
130
110
131
if ( styleIn ) {
111
- for ( var i = 0 ; i < styleIn . length ; i ++ ) {
132
+ for ( i = 0 ; i < styleIn . length ; i ++ ) {
112
133
styleOut [ i ] = { } ;
113
134
Lib . coerce ( styleIn [ i ] , styleOut [ i ] , exports . attributes . styles , 'target' ) ;
114
135
Lib . coerce ( styleIn [ i ] , styleOut [ i ] , exports . attributes . styles , 'value' ) ;
0 commit comments