From 7af18d10dc23084ae8390241c2e9951d530248f7 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Tue, 25 Jan 2011 05:20:28 -0500 Subject: archive some more dead packages --- config/dspam/pear/Image/Graph/Plotarea/Element.php | 87 ------ config/dspam/pear/Image/Graph/Plotarea/Map.php | 304 --------------------- config/dspam/pear/Image/Graph/Plotarea/Radar.php | 243 ---------------- 3 files changed, 634 deletions(-) delete mode 100644 config/dspam/pear/Image/Graph/Plotarea/Element.php delete mode 100644 config/dspam/pear/Image/Graph/Plotarea/Map.php delete mode 100644 config/dspam/pear/Image/Graph/Plotarea/Radar.php (limited to 'config/dspam/pear/Image/Graph/Plotarea') diff --git a/config/dspam/pear/Image/Graph/Plotarea/Element.php b/config/dspam/pear/Image/Graph/Plotarea/Element.php deleted file mode 100644 index a7d1b8d2..00000000 --- a/config/dspam/pear/Image/Graph/Plotarea/Element.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version CVS: $Id$ - * @link http://pear.php.net/package/Image_Graph - */ - -/** - * Include file Image/Graph/Element.php - */ -require_once 'Image/Graph/Element.php'; - -/** - * Representation of a element on a plotarea. - * - * @category Images - * @package Image_Graph - * @author Jesper Veggerby - * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version Release: @package_version@ - * @link http://pear.php.net/package/Image_Graph - * @abstract - */ -class Image_Graph_Plotarea_Element extends Image_Graph_Element -{ - - /** - * Get the X pixel position represented by a value - * - * @param double $point the value to get the pixel-point for - * @return double The pixel position along the axis - * @access private - */ - function _pointX($point) - { - return $this->_parent->_pointX($point); - } - - /** - * Get the Y pixel position represented by a value - * - * @param double $point the value to get the pixel-point for - * @return double The pixel position along the axis - * @access private - */ - function _pointY($point) - { - return $this->_parent->_pointY($point); - } - - /** - * Get the X and Y pixel position represented by a value - * - * @param array $point the values to get the pixel-point for - * @return array The (x, y) pixel position along the axis - * @access private - */ - function _pointXY($point) - { - return array ('X' => $this->_pointX($point), 'Y' => $this->_pointY($point)); - } - -} -?> \ No newline at end of file diff --git a/config/dspam/pear/Image/Graph/Plotarea/Map.php b/config/dspam/pear/Image/Graph/Plotarea/Map.php deleted file mode 100644 index 888d3384..00000000 --- a/config/dspam/pear/Image/Graph/Plotarea/Map.php +++ /dev/null @@ -1,304 +0,0 @@ - - * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version CVS: $Id$ - * @link http://pear.php.net/package/Image_Graph - */ - -/** - * Include file Image/Graph/Plotarea.php - */ -require_once 'Image/Graph/Plotarea.php'; - -/** - * Plot area used for map plots. - * - * A map plot is a chart that displays a map (fx. a world map) in the form of . - * png file. The maps must be located in the /Images/Maps folder and a - * corresponding .txt files mush also exist in this location where named - * locations are mapped to an (x, y) coordinate of the map picture (this text - * file is tab separated with 'Name' 'X' 'Y' values, fx 'Denmark 378 223'). The - * x-values in the dataset are then the named locations (fx 'Denmark') and the - * y-values are then the data to plot. Currently the best (if not only) use is - * to combine a map plot area with a {@link Image_Graph_Plot_Dot} using {@link - * Image_Graph_Marker_PercentageCircle} as marker. - * - * @category Images - * @package Image_Graph - * @subpackage Plotarea - * @author Jesper Veggerby - * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version Release: @package_version@ - * @link http://pear.php.net/package/Image_Graph - */ -class Image_Graph_Plotarea_Map extends Image_Graph_Plotarea -{ - - /** - * The GD image for the map - * @var string - * @access private - */ - var $_imageMap; - - /** - * The value for scaling the width and height to fit into the layout boundaries - * @var int - * @access private - */ - var $_scale; - - /** - * The (x,y)-points for the named point - * @var array - * @access private - */ - var $_mapPoints; - - /** - * The original size of the image map - * @var array - * @access private - */ - var $_mapSize; - - /** - * PlotareaMap [Constructor] - * - * @param string $map The name of the map, i.e. the [name].png and [name]. - * txt files located in the Images/maps folder - */ - function Image_Graph_Plotarea_Map($map) - { - parent::Image_Graph_Plotarea(); - - $this->_imageMap = dirname(__FILE__)."/../Images/Maps/$map.png"; - $points = file(dirname(__FILE__)."/../Images/Maps/$map.txt"); - list($width, $height) = getimagesize($this->_imageMap); - $this->_mapSize['X'] = $width; - $this->_mapSize['Y'] = $height; - - if (is_array($points)) { - unset($this->_mapPoints); - foreach ($points as $line) { - list($country, $x, $y) = explode("\t", $line); - $this->_mapPoints[$country] = array('X' => $x, 'Y' => $y); - } - } - } - - /** - * Left boundary of the background fill area - * - * @return int Leftmost position on the canvas - * @access private - */ - function _fillLeft() - { - return $this->_left + $this->_padding['left']; - } - - /** - * Top boundary of the background fill area - * - * @return int Topmost position on the canvas - * @access private - */ - function _fillTop() - { - return $this->_top + $this->_padding['top']; - } - - /** - * Right boundary of the background fill area - * - * @return int Rightmost position on the canvas - * @access private - */ - function _fillRight() - { - return $this->_right - $this->_padding['right']; - } - - /** - * Bottom boundary of the background fill area - * - * @return int Bottommost position on the canvas - * @access private - */ - function _fillBottom() - { - return $this->_bottom - $this->_padding['bottom']; - } - - /** - * Set the extrema of the axis - * - * @param Image_Graph_Plot $plot The plot that 'hold' the values - * @access private - */ - function _setExtrema(& $plot) - { - } - - /** - * Get the X pixel position represented by a value - * - * @param double $value The value to get the pixel-point for - * @return double The pixel position along the axis - * @access private - */ - function _pointX($value) - { - $country = $value['X']; - return $this->_plotLeft+$this->_mapPoints[$country]['X']*$this->_scale; - } - - /** - * Get the Y pixel position represented by a value - * - * @param double $value The value to get the pixel-point for - * @return double The pixel position along the axis - * @access private - */ - function _pointY($value) - { - $country = $value['X']; - return $this->_plotTop+$this->_mapPoints[$country]['Y']*$this->_scale; - } - - /** - * Hides the axis - */ - function hideAxis() - { - } - - /** - * Add a point to the maps - * - * @param int $latitude The latitude of the point - * @param int $longiude The longitude of the point - * @param string $name The name of the plot - */ - function addMappoint($latitude, $longitude, $name) - { - $x = (($longitude + 180) * ($this->_mapSize['X'] / 360)); - $y = ((($latitude * -1) + 90) * ($this->_mapSize['Y'] / 180)); - $this->_mapPoints[$name] = array('X' => $x, 'Y' => $y); - } - - /** - * Add a point to the maps - * - * @param int $x The latitude of the point - * @param int $y The longitude of the point - * @param string $name The name of the plot - */ - function addPoint($x, $y, $name) - { - $this->_mapPoints[$name] = array('X' => $x, 'Y' => $y); - } - - /** - * Update coordinates - * - * @access private - */ - function _updateCoords() - { - parent::_updateCoords(); - - $mapAspectRatio = $this->_mapSize['X']/$this->_mapSize['Y']; - $plotAspectRatio = ($width = $this->_fillWidth())/($height = $this->_fillHeight()); - - $scaleFactorX = ($mapAspectRatio > $plotAspectRatio); - - if ((($this->_mapSize['X'] <= $width) && ($this->_mapSize['Y'] <= $height)) || - (($this->_mapSize['X'] >= $width) && ($this->_mapSize['Y'] >= $height))) - { - if ($scaleFactorX) { - $this->_scale = $width / $this->_mapSize['X']; - } else { - $this->_scale = $height / $this->_mapSize['Y']; - } - } elseif ($this->_mapSize['X'] < $width) { - $this->_scale = $height / $this->_mapSize['Y']; - } elseif ($this->_mapSize['Y'] < $height) { - $this->_scale = $width / $this->_mapSize['X']; - } - - $this->_plotLeft = ($this->_fillLeft() + $this->_fillRight() - - $this->_mapSize['X']*$this->_scale)/2; - - $this->_plotTop = ($this->_fillTop() + $this->_fillBottom() - - $this->_mapSize['Y']*$this->_scale)/2; - - $this->_plotRight = ($this->_fillLeft() + $this->_fillRight() + - $this->_mapSize['X']*$this->_scale)/2; - - $this->_plotBottom = ($this->_fillTop() + $this->_fillBottom() + - $this->_mapSize['Y']*$this->_scale)/2; - } - - /** - * Output the plotarea to the canvas - * - * @return bool Was the output 'good' (true) or 'bad' (false). - * @access private - */ - function _done() - { - $this->_getFillStyle(); - $this->_canvas->rectangle( - array( - 'x0' => $this->_fillLeft(), - 'y0' => $this->_fillTop(), - 'x1' => $this->_fillRight(), - 'y1' => $this->_fillBottom() - ) - ); - - $scaledWidth = $this->_mapSize['X']*$this->_scale; - $scaledHeight = $this->_mapSize['Y']*$this->_scale; - - $this->_canvas->image( - array( - 'x' => $this->_plotLeft, - 'y' => $this->_plotTop, - 'filename' => $this->_imageMap, - 'width' => $scaledWidth, - 'height' => $scaledHeight - ) - ); - - return Image_Graph_Layout::_done(); - } - -} - -?> \ No newline at end of file diff --git a/config/dspam/pear/Image/Graph/Plotarea/Radar.php b/config/dspam/pear/Image/Graph/Plotarea/Radar.php deleted file mode 100644 index cfb200ea..00000000 --- a/config/dspam/pear/Image/Graph/Plotarea/Radar.php +++ /dev/null @@ -1,243 +0,0 @@ - - * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version CVS: $Id$ - * @link http://pear.php.net/package/Image_Graph - */ - -/** - * Include file Image/Graph/Plotarea.php - */ -require_once 'Image/Graph/Plotarea.php'; - -/** - * Plot area used for radar plots. - * - * @category Images - * @package Image_Graph - * @subpackage Plotarea - * @author Jesper Veggerby - * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen - * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version Release: @package_version@ - * @link http://pear.php.net/package/Image_Graph - */ -class Image_Graph_Plotarea_Radar extends Image_Graph_Plotarea -{ - - /** - * Create the plotarea, implicitely creates 2 normal axis - */ - function Image_Graph_Plotarea_Radar() - { - parent::Image_Graph_Element(); - $this->_padding = array('left' => 10, 'top' => 10, 'right' => 10, 'bottom' => 10); - $this->_axisX =& Image_Graph::factory('Image_Graph_Axis_Radar'); - $this->_axisX->_setParent($this); - $this->_axisY =& Image_Graph::factory('Image_Graph_Axis', IMAGE_GRAPH_AXIS_Y); - $this->_axisY->_setParent($this); - $this->_axisY->_setMinimum(0); - } - - /** - * Get the width of the 'real' plotarea - * - * @return int The width of the 'real' plotarea, ie not including space occupied by padding and axis - * @access private - */ - function _plotWidth() - { - return (min($this->height(), $this->width())) * 0.80; - } - - /** - * Get the height of the 'real' plotarea - * - * @return int The height of the 'real' plotarea, ie not including space occupied by padding and axis - * @access private - */ - function _plotHeight() - { - return (min($this->height(), $this->width())) * 0.80; - } - - /** - * Left boundary of the background fill area - * - * @return int Leftmost position on the canvas - * @access private - */ - function _fillLeft() - { - return (int) (($this->_left + $this->_right - $this->_plotWidth()) / 2); - } - - /** - * Top boundary of the background fill area - * - * @return int Topmost position on the canvas - * @access private - */ - function _fillTop() - { - return (int) (($this->_top + $this->_bottom - $this->_plotHeight()) / 2); - } - - /** - * Right boundary of the background fill area - * - * @return int Rightmost position on the canvas - * @access private - */ - function _fillRight() - { - return (int) (($this->_left + $this->_right + $this->_plotWidth()) / 2); - } - - /** - * Bottom boundary of the background fill area - * - * @return int Bottommost position on the canvas - * @access private - */ - function _fillBottom() - { - return (int) (($this->_top + $this->_bottom + $this->_plotHeight()) / 2); - } - - /** - * Get the X pixel position represented by a value - * - * @param double $value The value to get the pixel-point for - * @return double The pixel position along the axis - * @access private - */ - function _pointX($value) - { - if (is_array($value)) { - if ($value['Y'] == '#min#') { - $radius = 0; - } elseif (($value['Y'] == '#max#') || ($value['Y'] === false)) { - $radius = 1; - } else { - $radius = ($value['Y'] - $this->_axisY->_getMinimum()) / - ($this->_axisY->_getMaximum() - $this->_axisY->_getMinimum()); - } - $x = ($this->_left + $this->_right) / 2 - - $radius * ($this->_plotWidth() / 2) * - cos(deg2rad($this->_axisX->_point($value['X']))); - } - return max($this->_plotLeft, min($this->_plotRight, $x)); - } - - /** - * Get the Y pixel position represented by a value - * - * @param double $value The value to get the pixel-point for - * @return double The pixel position along the axis - * @access private - */ - function _pointY($value) - { - if (is_array($value)) { - if ($value['Y'] == '#min#') { - $radius = 0; - } elseif (($value['Y'] == '#max#') || ($value['Y'] === false)) { - $radius = 1; - } else { - $radius = ($value['Y'] - $this->_axisY->_getMinimum()) / - ($this->_axisY->_getMaximum() - $this->_axisY->_getMinimum()); - } - - $y = ($this->_top + $this->_bottom) / 2 - - $radius * ($this->_plotHeight() / 2) * - sin(deg2rad($this->_axisX->_point($value['X']))); - } - return max($this->_plotTop, min($this->_plotBottom, $y)); - } - - /** - * Update coordinates - * - * @access private - */ - function _updateCoords() - { - if (is_array($this->_elements)) { - $keys = array_keys($this->_elements); - foreach ($keys as $key) { - $element =& $this->_elements[$key]; - if (is_a($element, 'Image_Graph_Plot')) { - $this->_setExtrema($element); - } - } - unset($keys); - } - - $this->_calcEdges(); - - $centerX = (int) (($this->_left + $this->_right) / 2); - $centerY = (int) (($this->_top + $this->_bottom) / 2); - $radius = min($this->_plotHeight(), $this->_plotWidth()) / 2; - - if (is_object($this->_axisX)) { - $this->_axisX->_setCoords( - $centerX - $radius, - $centerY - $radius, - $centerX + $radius, - $centerY + $radius - ); - } - - if (is_object($this->_axisY)) { - $this->_axisY->_setCoords( - $centerX, - $centerY, - $centerX - $radius, - $centerY - $radius - ); - } - - $this->_plotLeft = $this->_fillLeft(); - $this->_plotTop = $this->_fillTop(); - $this->_plotRight = $this->_fillRight(); - $this->_plotBottom = $this->_fillBottom(); - - Image_Graph_Element::_updateCoords(); - - if (is_object($this->_axisX)) { - $this->_axisX->_updateCoords(); - } - - if (is_object($this->_axisY)) { - $this->_axisY->_updateCoords(); - } - - } - -} - -?> \ No newline at end of file -- cgit v1.2.3