code: function (optionList, result, parentOption) {
          zrUtil.each(optionList, function (option) {
              if (!option) {
                  return;
              }
  
              if (parentOption) {
                  option.parentOption = parentOption;
              }
  
              result.push(option);
  
              var children = option.children;
              if (option.type === 'group' && children) {
                  this._flatten(children, result, option);
              }
              // Deleting for JSON output, and for not affecting group creation.
              delete option.children;
          }, this);
      }
docs: Convert
  [{
  type: 'group',
  id: 'xx',
  children: [{type: 'circle'}, {type: 'polygon'}]
  }]
  to
  [
  {type: 'group', id: 'xx'},
  {type: 'circle', parentId: 'xx'},
  {type: 'polygon', parentId: 'xx'}
  ]
  
  @private
  @param {Array.<Object>} optionList option list
  @param {Array.<Object>} result result of flatten
  @param {Object} parentOption parent option