NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / series-ohlc / series-ohlc-coverage.js
blobf69bc6d1406ac9dab2bd2dbfafbc05b7f5fda3dc
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
9 if (!__coverage__['build/series-ohlc/series-ohlc.js']) {
10    __coverage__['build/series-ohlc/series-ohlc.js'] = {"path":"build/series-ohlc/series-ohlc.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":42}}},"2":{"name":"OHLCSeries","line":19,"loc":{"start":{"line":19,"column":0},"end":{"line":20,"column":0}}},"3":{"name":"(anonymous_3)","line":48,"loc":{"start":{"line":48,"column":16},"end":{"line":48,"column":30}}},"4":{"name":"(anonymous_4)","line":129,"loc":{"start":{"line":129,"column":18},"end":{"line":130,"column":4}}},"5":{"name":"(anonymous_5)","line":176,"loc":{"start":{"line":176,"column":20},"end":{"line":177,"column":4}}},"6":{"name":"(anonymous_6)","line":188,"loc":{"start":{"line":188,"column":16},"end":{"line":189,"column":4}}},"7":{"name":"(anonymous_7)","line":210,"loc":{"start":{"line":210,"column":23},"end":{"line":211,"column":4}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":234,"column":45}},"2":{"start":{"line":19,"column":0},"end":{"line":22,"column":1}},"3":{"start":{"line":21,"column":4},"end":{"line":21,"column":61}},"4":{"start":{"line":24,"column":0},"end":{"line":24,"column":31}},"5":{"start":{"line":26,"column":0},"end":{"line":111,"column":2}},"6":{"start":{"line":50,"column":12},"end":{"line":52,"column":13}},"7":{"start":{"line":51,"column":16},"end":{"line":51,"column":43}},"8":{"start":{"line":53,"column":12},"end":{"line":55,"column":16}},"9":{"start":{"line":56,"column":12},"end":{"line":58,"column":16}},"10":{"start":{"line":59,"column":12},"end":{"line":59,"column":23}},"11":{"start":{"line":113,"column":0},"end":{"line":230,"column":3}},"12":{"start":{"line":131,"column":8},"end":{"line":141,"column":15}},"13":{"start":{"line":142,"column":8},"end":{"line":142,"column":38}},"14":{"start":{"line":143,"column":8},"end":{"line":143,"column":42}},"15":{"start":{"line":144,"column":8},"end":{"line":144,"column":25}},"16":{"start":{"line":145,"column":8},"end":{"line":145,"column":27}},"17":{"start":{"line":146,"column":8},"end":{"line":164,"column":9}},"18":{"start":{"line":148,"column":12},"end":{"line":148,"column":42}},"19":{"start":{"line":149,"column":12},"end":{"line":149,"column":34}},"20":{"start":{"line":150,"column":12},"end":{"line":150,"column":35}},"21":{"start":{"line":151,"column":12},"end":{"line":151,"column":38}},"22":{"start":{"line":152,"column":12},"end":{"line":152,"column":38}},"23":{"start":{"line":153,"column":12},"end":{"line":153,"column":36}},"24":{"start":{"line":154,"column":12},"end":{"line":154,"column":40}},"25":{"start":{"line":155,"column":12},"end":{"line":155,"column":40}},"26":{"start":{"line":156,"column":12},"end":{"line":156,"column":42}},"27":{"start":{"line":157,"column":12},"end":{"line":157,"column":48}},"28":{"start":{"line":158,"column":12},"end":{"line":158,"column":43}},"29":{"start":{"line":159,"column":12},"end":{"line":159,"column":41}},"30":{"start":{"line":160,"column":12},"end":{"line":160,"column":41}},"31":{"start":{"line":161,"column":12},"end":{"line":161,"column":40}},"32":{"start":{"line":162,"column":12},"end":{"line":162,"column":42}},"33":{"start":{"line":163,"column":12},"end":{"line":163,"column":45}},"34":{"start":{"line":165,"column":8},"end":{"line":165,"column":23}},"35":{"start":{"line":166,"column":8},"end":{"line":166,"column":25}},"36":{"start":{"line":178,"column":8},"end":{"line":178,"column":53}},"37":{"start":{"line":179,"column":8},"end":{"line":179,"column":55}},"38":{"start":{"line":190,"column":8},"end":{"line":191,"column":48}},"39":{"start":{"line":192,"column":8},"end":{"line":195,"column":9}},"40":{"start":{"line":194,"column":12},"end":{"line":194,"column":31}},"41":{"start":{"line":196,"column":8},"end":{"line":199,"column":9}},"42":{"start":{"line":198,"column":12},"end":{"line":198,"column":33}},"43":{"start":{"line":212,"column":8},"end":{"line":227,"column":10}},"44":{"start":{"line":228,"column":8},"end":{"line":228,"column":84}},"45":{"start":{"line":231,"column":0},"end":{"line":231,"column":26}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":12},"end":{"line":50,"column":12}},{"start":{"line":50,"column":12},"end":{"line":50,"column":12}}]},"2":{"line":157,"type":"cond-expr","locations":[{"start":{"line":157,"column":26},"end":{"line":157,"column":34}},{"start":{"line":157,"column":37},"end":{"line":157,"column":47}}]},"3":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":8},"end":{"line":192,"column":8}},{"start":{"line":192,"column":8},"end":{"line":192,"column":8}}]},"4":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]}},"code":["(function () { YUI.add('series-ohlc', function (Y, NAME) {","","/**"," * Provides functionality for creating a ohlc series."," *"," * @module charts"," * @submodule series-ohlc"," */","/**"," * The OHLCSeries class renders lines representing the open, high, low and close"," * values for a chart."," *"," * @class OHLCSeries"," * @extends RangeSeries"," * @constructor"," * @param {Object} config (optional) Configuration parameters."," * @submodule series-ohlc"," */","function OHLCSeries()","{","    OHLCSeries.superclass.constructor.apply(this, arguments);","}","","OHLCSeries.NAME = \"ohlcSeries\";","","OHLCSeries.ATTRS = {","    /**","     * Read-only attribute indicating the type of series.","     *","     * @attribute type","     * @type String","     * @readOnly","     * @default ohlc","     */","    type: {","        value: \"ohlc\"","    },","","    /**","     * The graphic in which drawings will be rendered.","     *","     * @attribute graphic","     * @type Graphic","     */","    graphic: {","        lazyAdd: false,","","        setter: function(val) {","            //woraround for Attribute order of operations bug","            if(!this.get(\"rendered\")) {","                this.set(\"rendered\", true);","            }","            this.set(\"upmarker\", val.addShape({","               type: \"path\"","            }));","            this.set(\"downmarker\", val.addShape({","               type: \"path\"","            }));","            return val;","        }","    },","","    upmarker: {},","","    downmarker: {}","","    /**","     * Style properties used for drawing markers. This attribute is inherited from `RangeSeries`. Below are the default values:","     *  <dl>","     *      <dt>upmarker</dt><dd>Properties for a marker representing a period that closes higher than it opens.","     *          <dl>","     *              <dt>fill</dt><dd>A hash containing the following values:","     *                  <dl>","     *                      <dt>color</dt><dd>Color of the fill. The default value is \"#00aa00\".</dd>","     *                      </dd>","     *                      <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>","     *                  </dl>","     *              </dd>","     *              <dt>border</dt><dd>A hash containing the following values:","     *                  <dl>","     *                      <dt>color</dt><dd>Color of the border. The default value is \"#000000\".</dd>","     *                      <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>","     *                      <dt>weight</dt><dd>Number indicating the width of the border. The default value is 0.</dd>","     *                  </dl>","     *              </dd>","     *          </dl>","     *      </dd>","     *      <dt>downmarker</dt><dd>Properties for a marker representing a period that opens higher than it closes.","     *          <dl>","     *              <dt>fill</dt><dd>A hash containing the following values:","     *                  <dl>","     *                      <dt>color</dt><dd>Color of the fill. The default value is \"#aa0000\".</dd>","     *                      </dd>","     *                      <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>","     *                  </dl>","     *              </dd>","     *              <dt>border</dt><dd>A hash containing the following values:","     *                  <dl>","     *                      <dt>color</dt><dd>Color of the border. The default value is \"#000000\".</dd>","     *                      <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>","     *                      <dt>weight</dt><dd>Number indicating the width of the border. The default value is 0.</dd>","     *                  </dl>","     *              </dd>","     *          </dl>","     *      </dd>","     *  </dl>","     *","     * @attribute styles","     * @type Object","     */","};","","Y.extend(OHLCSeries, Y.RangeSeries, {","    /**","     * Draws markers for an OHLC series.","     *","     * @method","     * @param {Array} xcoords The xcoordinates to be plotted.","     * @param {Array} opencoords The coordinates representing the open values.","     * @param {Array} highcoords The coordinates representing the high values.","     * @param {Array} lowcoords The coordinates representing the low values.","     * @param {Array} closecoords The coordinates representing the close values.","     * @param {Number} len The number of x coordinates to plot.","     * @param {Number} width The width of each ohlc marker.","     * @param {Number} halfwidth Half the width of each ohlc marker.","     * @param {Object} styles The styles for the series.","     * @private","     */","    _drawMarkers: function(xcoords, opencoords, highcoords, lowcoords, closecoords, len, width, halfwidth, styles)","    {","        var upmarker = this.get(\"upmarker\"),","            downmarker = this.get(\"downmarker\"),","            opencoord,","            highcoord,","            lowcoord,","            closecoord,","            left,","            right,","            leftPadding = styles.padding.left,","            marker,","            up;","        upmarker.set(styles.upmarker);","        downmarker.set(styles.downmarker);","        upmarker.clear();","        downmarker.clear();","        for(i = 0; i < len; i = i + 1)","        {","            cx = xcoords[i] + leftPadding;","            left = cx - halfwidth;","            right = cx + halfwidth;","            opencoord = opencoords[i];","            highcoord = highcoords[i];","            lowcoord = lowcoords[i];","            closecoord = closecoords[i];","            up = opencoord > closecoord;","            height = lowcoord - highcoord;","            marker = up ? upmarker : downmarker;","            marker.moveTo(left, opencoord);","            marker.lineTo(cx, opencoord);","            marker.moveTo(cx, highcoord);","            marker.lineTo(cx, lowcoord);","            marker.moveTo(cx, closecoord);","            marker.lineTo(right, closecoord);","        }","        upmarker.end();","        downmarker.end();","    },","","    /**","     * Toggles visibility","     *","     * @method _toggleVisible","     * @param {Boolean} visible indicates visibilitye","     * @private","     */","    _toggleVisible: function(visible)","    {","        this.get(\"upmarker\").set(\"visible\", visible);","        this.get(\"downmarker\").set(\"visible\", visible);","    },","","    /**","     * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances.","     *","     * @method destructor","     * @protected","     */","    destructor: function()","    {","        var upmarker = this.get(\"upmarker\"),","            downmarker = this.get(\"downmarker\");","        if(upmarker)","        {","            upmarker.destroy();","        }","        if(downmarker)","        {","            downmarker.destroy();","        }","    },","","    /**","     * Gets the default value for the `styles` attribute. Overrides","     * base implementation.","     *","     * @method _getDefaultStyles","     * @return Object","     * @private","     */","    _getDefaultStyles: function()","    {","        var styles = {","            upmarker: {","                stroke: {","                    color: \"#00aa00\",","                    alpha: 1,","                    weight: 1","                }","            },","            downmarker: {","                stroke: {","                    color: \"#aa0000\",","                    alpha: 1,","                    weight: 1","                }","            }","        };","        return this._mergeStyles(styles, OHLCSeries.superclass._getDefaultStyles());","    }","});","Y.OHLCSeries = OHLCSeries;","","","}, '3.13.0', {\"requires\": [\"series-range\"]});","","}());"]};
12 var __cov_2F3hQ8Z6HYLicKywRPqpPw = __coverage__['build/series-ohlc/series-ohlc.js'];
13 __cov_2F3hQ8Z6HYLicKywRPqpPw.s['1']++;YUI.add('series-ohlc',function(Y,NAME){__cov_2F3hQ8Z6HYLicKywRPqpPw.f['1']++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['2']++;function OHLCSeries(){__cov_2F3hQ8Z6HYLicKywRPqpPw.f['2']++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['3']++;OHLCSeries.superclass.constructor.apply(this,arguments);}__cov_2F3hQ8Z6HYLicKywRPqpPw.s['4']++;OHLCSeries.NAME='ohlcSeries';__cov_2F3hQ8Z6HYLicKywRPqpPw.s['5']++;OHLCSeries.ATTRS={type:{value:'ohlc'},graphic:{lazyAdd:false,setter:function(val){__cov_2F3hQ8Z6HYLicKywRPqpPw.f['3']++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['6']++;if(!this.get('rendered')){__cov_2F3hQ8Z6HYLicKywRPqpPw.b['1'][0]++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['7']++;this.set('rendered',true);}else{__cov_2F3hQ8Z6HYLicKywRPqpPw.b['1'][1]++;}__cov_2F3hQ8Z6HYLicKywRPqpPw.s['8']++;this.set('upmarker',val.addShape({type:'path'}));__cov_2F3hQ8Z6HYLicKywRPqpPw.s['9']++;this.set('downmarker',val.addShape({type:'path'}));__cov_2F3hQ8Z6HYLicKywRPqpPw.s['10']++;return val;}},upmarker:{},downmarker:{}};__cov_2F3hQ8Z6HYLicKywRPqpPw.s['11']++;Y.extend(OHLCSeries,Y.RangeSeries,{_drawMarkers:function(xcoords,opencoords,highcoords,lowcoords,closecoords,len,width,halfwidth,styles){__cov_2F3hQ8Z6HYLicKywRPqpPw.f['4']++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['12']++;var upmarker=this.get('upmarker'),downmarker=this.get('downmarker'),opencoord,highcoord,lowcoord,closecoord,left,right,leftPadding=styles.padding.left,marker,up;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['13']++;upmarker.set(styles.upmarker);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['14']++;downmarker.set(styles.downmarker);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['15']++;upmarker.clear();__cov_2F3hQ8Z6HYLicKywRPqpPw.s['16']++;downmarker.clear();__cov_2F3hQ8Z6HYLicKywRPqpPw.s['17']++;for(i=0;i<len;i=i+1){__cov_2F3hQ8Z6HYLicKywRPqpPw.s['18']++;cx=xcoords[i]+leftPadding;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['19']++;left=cx-halfwidth;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['20']++;right=cx+halfwidth;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['21']++;opencoord=opencoords[i];__cov_2F3hQ8Z6HYLicKywRPqpPw.s['22']++;highcoord=highcoords[i];__cov_2F3hQ8Z6HYLicKywRPqpPw.s['23']++;lowcoord=lowcoords[i];__cov_2F3hQ8Z6HYLicKywRPqpPw.s['24']++;closecoord=closecoords[i];__cov_2F3hQ8Z6HYLicKywRPqpPw.s['25']++;up=opencoord>closecoord;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['26']++;height=lowcoord-highcoord;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['27']++;marker=up?(__cov_2F3hQ8Z6HYLicKywRPqpPw.b['2'][0]++,upmarker):(__cov_2F3hQ8Z6HYLicKywRPqpPw.b['2'][1]++,downmarker);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['28']++;marker.moveTo(left,opencoord);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['29']++;marker.lineTo(cx,opencoord);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['30']++;marker.moveTo(cx,highcoord);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['31']++;marker.lineTo(cx,lowcoord);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['32']++;marker.moveTo(cx,closecoord);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['33']++;marker.lineTo(right,closecoord);}__cov_2F3hQ8Z6HYLicKywRPqpPw.s['34']++;upmarker.end();__cov_2F3hQ8Z6HYLicKywRPqpPw.s['35']++;downmarker.end();},_toggleVisible:function(visible){__cov_2F3hQ8Z6HYLicKywRPqpPw.f['5']++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['36']++;this.get('upmarker').set('visible',visible);__cov_2F3hQ8Z6HYLicKywRPqpPw.s['37']++;this.get('downmarker').set('visible',visible);},destructor:function(){__cov_2F3hQ8Z6HYLicKywRPqpPw.f['6']++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['38']++;var upmarker=this.get('upmarker'),downmarker=this.get('downmarker');__cov_2F3hQ8Z6HYLicKywRPqpPw.s['39']++;if(upmarker){__cov_2F3hQ8Z6HYLicKywRPqpPw.b['3'][0]++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['40']++;upmarker.destroy();}else{__cov_2F3hQ8Z6HYLicKywRPqpPw.b['3'][1]++;}__cov_2F3hQ8Z6HYLicKywRPqpPw.s['41']++;if(downmarker){__cov_2F3hQ8Z6HYLicKywRPqpPw.b['4'][0]++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['42']++;downmarker.destroy();}else{__cov_2F3hQ8Z6HYLicKywRPqpPw.b['4'][1]++;}},_getDefaultStyles:function(){__cov_2F3hQ8Z6HYLicKywRPqpPw.f['7']++;__cov_2F3hQ8Z6HYLicKywRPqpPw.s['43']++;var styles={upmarker:{stroke:{color:'#00aa00',alpha:1,weight:1}},downmarker:{stroke:{color:'#aa0000',alpha:1,weight:1}}};__cov_2F3hQ8Z6HYLicKywRPqpPw.s['44']++;return this._mergeStyles(styles,OHLCSeries.superclass._getDefaultStyles());}});__cov_2F3hQ8Z6HYLicKywRPqpPw.s['45']++;Y.OHLCSeries=OHLCSeries;},'3.13.0',{'requires':['series-range']});