first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,140 @@
YUI.add('axis-numeric', function (Y, NAME) {
/**
* Provides functionality for drawing a numeric axis for use with a chart.
*
* @module charts
* @submodule axis-numeric
*/
var Y_Lang = Y.Lang;
/**
* NumericAxis draws a numeric axis.
*
* @class NumericAxis
* @constructor
* @extends Axis
* @uses NumericImpl
* @param {Object} config (optional) Configuration parameters.
* @submodule axis-numeric
*/
Y.NumericAxis = Y.Base.create("numericAxis", Y.Axis, [Y.NumericImpl], {
/**
* Calculates and returns a value based on the number of labels and the index of
* the current label.
*
* @method getLabelByIndex
* @param {Number} i Index of the label.
* @param {Number} l Total number of labels.
* @return String
* @private
*/
_getLabelByIndex: function(i, l)
{
var min = this.get("minimum"),
max = this.get("maximum"),
increm = (max - min)/(l-1),
label,
roundingMethod = this.get("roundingMethod");
l -= 1;
//respect the min and max. calculate all other labels.
if(i === 0)
{
label = min;
}
else if(i === l)
{
label = max;
}
else
{
label = (i * increm);
if(roundingMethod === "niceNumber")
{
label = this._roundToNearest(label, increm);
}
label += min;
}
return parseFloat(label);
},
/**
* Returns an object literal containing and array of label values and an array of points.
*
* @method _getLabelData
* @param {Object} startPoint An object containing x and y values.
* @param {Number} edgeOffset Distance to offset coordinates.
* @param {Number} layoutLength Distance that the axis spans.
* @param {Number} count Number of labels.
* @param {String} direction Indicates whether the axis is horizontal or vertical.
* @param {Array} Array containing values for axis labels.
* @return Array
* @private
*/
_getLabelData: function(constantVal, staticCoord, dynamicCoord, min, max, edgeOffset, layoutLength, count, dataValues)
{
var dataValue,
i,
points = [],
values = [],
point,
isVertical = staticCoord === "x",
offset = isVertical ? layoutLength + edgeOffset : edgeOffset;
dataValues = dataValues || this._getDataValuesByCount(count, min, max);
for(i = 0; i < count; i = i + 1)
{
dataValue = parseFloat(dataValues[i]);
if(dataValue <= max && dataValue >= min)
{
point = {};
point[staticCoord] = constantVal;
point[dynamicCoord] = this._getCoordFromValue(
min,
max,
layoutLength,
dataValue,
offset,
isVertical
);
points.push(point);
values.push(dataValue);
}
}
return {
points: points,
values: values
};
},
/**
* Checks to see if data extends beyond the range of the axis. If so,
* that data will need to be hidden. This method is internal, temporary and subject
* to removal in the future.
*
* @method _hasDataOverflow
* @protected
* @return Boolean
*/
_hasDataOverflow: function()
{
var roundingMethod,
min,
max;
if(this.get("setMin") || this.get("setMax"))
{
return true;
}
roundingMethod = this.get("roundingMethod");
min = this._actualMinimum;
max = this._actualMaximum;
if(Y_Lang.isNumber(roundingMethod) &&
((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))
{
return true;
}
return false;
}
});
}, '3.18.1', {"requires": ["axis", "axis-numeric-base"]});
+1
View File
@@ -0,0 +1 @@
YUI.add("axis-numeric",function(e,t){var n=e.Lang;e.NumericAxis=e.Base.create("numericAxis",e.Axis,[e.NumericImpl],{_getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s,o=this.get("roundingMethod");return t-=1,e===0?s=n:e===t?s=r:(s=e*i,o==="niceNumber"&&(s=this._roundToNearest(s,i)),s+=n),parseFloat(s)},_getLabelData:function(e,t,n,r,i,s,o,u,a){var f,l,c=[],h=[],p,d=t==="x",v=d?o+s:s;a=a||this._getDataValuesByCount(u,r,i);for(l=0;l<u;l+=1)f=parseFloat(a[l]),f<=i&&f>=r&&(p={},p[t]=e,p[n]=this._getCoordFromValue(r,i,o,f,v,d),c.push(p),h.push(f));return{points:c,values:h}},_hasDataOverflow:function(){var e,t,r;return this.get("setMin")||this.get("setMax")?!0:(e=this.get("roundingMethod"),t=this._actualMinimum,r=this._actualMaximum,n.isNumber(e)&&(n.isNumber(r)&&r>this._dataMaximum||n.isNumber(t)&&t<this._dataMinimum)?!0:!1)}})},"3.18.1",{requires:["axis","axis-numeric-base"]});
@@ -0,0 +1,140 @@
YUI.add('axis-numeric', function (Y, NAME) {
/**
* Provides functionality for drawing a numeric axis for use with a chart.
*
* @module charts
* @submodule axis-numeric
*/
var Y_Lang = Y.Lang;
/**
* NumericAxis draws a numeric axis.
*
* @class NumericAxis
* @constructor
* @extends Axis
* @uses NumericImpl
* @param {Object} config (optional) Configuration parameters.
* @submodule axis-numeric
*/
Y.NumericAxis = Y.Base.create("numericAxis", Y.Axis, [Y.NumericImpl], {
/**
* Calculates and returns a value based on the number of labels and the index of
* the current label.
*
* @method getLabelByIndex
* @param {Number} i Index of the label.
* @param {Number} l Total number of labels.
* @return String
* @private
*/
_getLabelByIndex: function(i, l)
{
var min = this.get("minimum"),
max = this.get("maximum"),
increm = (max - min)/(l-1),
label,
roundingMethod = this.get("roundingMethod");
l -= 1;
//respect the min and max. calculate all other labels.
if(i === 0)
{
label = min;
}
else if(i === l)
{
label = max;
}
else
{
label = (i * increm);
if(roundingMethod === "niceNumber")
{
label = this._roundToNearest(label, increm);
}
label += min;
}
return parseFloat(label);
},
/**
* Returns an object literal containing and array of label values and an array of points.
*
* @method _getLabelData
* @param {Object} startPoint An object containing x and y values.
* @param {Number} edgeOffset Distance to offset coordinates.
* @param {Number} layoutLength Distance that the axis spans.
* @param {Number} count Number of labels.
* @param {String} direction Indicates whether the axis is horizontal or vertical.
* @param {Array} Array containing values for axis labels.
* @return Array
* @private
*/
_getLabelData: function(constantVal, staticCoord, dynamicCoord, min, max, edgeOffset, layoutLength, count, dataValues)
{
var dataValue,
i,
points = [],
values = [],
point,
isVertical = staticCoord === "x",
offset = isVertical ? layoutLength + edgeOffset : edgeOffset;
dataValues = dataValues || this._getDataValuesByCount(count, min, max);
for(i = 0; i < count; i = i + 1)
{
dataValue = parseFloat(dataValues[i]);
if(dataValue <= max && dataValue >= min)
{
point = {};
point[staticCoord] = constantVal;
point[dynamicCoord] = this._getCoordFromValue(
min,
max,
layoutLength,
dataValue,
offset,
isVertical
);
points.push(point);
values.push(dataValue);
}
}
return {
points: points,
values: values
};
},
/**
* Checks to see if data extends beyond the range of the axis. If so,
* that data will need to be hidden. This method is internal, temporary and subject
* to removal in the future.
*
* @method _hasDataOverflow
* @protected
* @return Boolean
*/
_hasDataOverflow: function()
{
var roundingMethod,
min,
max;
if(this.get("setMin") || this.get("setMax"))
{
return true;
}
roundingMethod = this.get("roundingMethod");
min = this._actualMinimum;
max = this._actualMaximum;
if(Y_Lang.isNumber(roundingMethod) &&
((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))
{
return true;
}
return false;
}
});
}, '3.18.1', {"requires": ["axis", "axis-numeric-base"]});