r102381 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102380‎ | r102381 | r102382 >
Date:06:18, 8 November 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
added min param and killed obsolete message
Modified paths:
  • /trunk/extensions/SemanticResultFormats/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticResultFormats/SRF_Messages.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotBar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/RELEASE-NOTES
@@ -8,6 +8,7 @@
99 * Dropped support for MediaWiki 1.15.x and SMW < 1.7.
1010 * Added warning icon with tooltip to jqplotpie shown when there are no results instead of a non-working chart.
1111 * Added value distribution support to jqplotpie and jqplotbar.
 12+* Added min parameter to jqplotbar to set the minimun value for the Y-axis.
1213
1314 New formats in this version are:
1415 * valuerank (written by DaSch)
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php
@@ -77,7 +77,7 @@
7878 'srf_paramdesc_barcolor' => 'The color of the bars',
7979 'srf_paramdesc_bardirection'=> 'The direction of the bar chart',
8080 'srf_paramdesc_barnumbersaxislabel' => 'The label for the numbers axis',
81 - 'srf-paramdesc-distribution' => 'If the distribution of results should be calculated and shown.',
 81+ 'srf-paramdesc-minvalue' => 'The minimun value to show on the Y-axis',
8282
8383 // "gallery" format
8484 'srf_printername_gallery' => 'Gallery',
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotBar.php
@@ -130,8 +130,14 @@
131131 $this->isHTML = true;
132132
133133 $maxValue = count( $data ) == 0 ? 0 : max( $data );
134 - $minValue = count( $data ) == 0 ? 0 : min( $data );
135134
 135+ if ( $this->params['min'] === false ) {
 136+ $minValue = count( $data ) == 0 ? 0 : min( $data );
 137+ }
 138+ else {
 139+ $minValue = $this->params['min'];
 140+ }
 141+
136142 foreach ( $data as $i => &$nr ) {
137143 if ( $this->m_bardirection == 'horizontal' ) {
138144 $nr = array( $nr, $i );
@@ -274,6 +280,10 @@
275281 $params['numbersaxislabel'] = new Parameter( 'numbersaxislabel', Parameter::TYPE_STRING, ' ' );
276282 $params['numbersaxislabel']->setMessage( 'srf_paramdesc_barnumbersaxislabel' );
277283
 284+ $params['min'] = new Parameter( 'min', Parameter::TYPE_INTEGER );
 285+ $params['min']->setMessage( 'srf-paramdesc-minvalue' );
 286+ $params['min']->setDefault( false, false );
 287+
278288 return $params;
279289 }
280290

Status & tagging log