| 34 | } |
| 35 | var SimpleOptionPlayer = (function () { |
| 36 | function SimpleOptionPlayer(opt) { |
| 37 | assert(opt.chart |
| 38 | && isObject(opt.dataMeta) |
| 39 | && isArray(opt.optionList) |
| 40 | && opt.seriesIndex != null |
| 41 | && opt.optionList.length); |
| 42 | this._chart = opt.chart; |
| 43 | this._dataMeta = opt.dataMeta; |
| 44 | var optionList = this._optionList = opt.optionList; |
| 45 | var optionMap = this._optionMap = {}; |
| 46 | this._replaceMerge = opt.replaceMerge; |
| 47 | this._seriesIndex = opt.seriesIndex; |
| 48 | this._currOptionIdx = null; |
| 49 | for (var i = 0; i < optionList.length; i++) { |
| 50 | var optionWrap = optionList[i]; |
| 51 | var optionKey = optionWrap.key; |
| 52 | if (optionKey != null) { |
| 53 | assert(!hasOwn(optionMap, optionKey), 'option key duplicat: ' + optionKey); |
| 54 | optionMap[optionKey] = i; |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | SimpleOptionPlayer.prototype.next = function () { |
| 59 | var optionList = this._optionList; |
| 60 | var newOptionIdx = this._currOptionIdx == null |