DIR : /home/kozerus/public_html/pn/uize/site-source/js/Uize/Templates/Text/Tables/YinYangBreakdown.js
/home/kozerus/public_html/pn/uize/site-source/js/Uize/Templates/Text/Tables
/*______________
| ______ | U I Z E J A V A S C R I P T F R A M E W O R K
| / / | ---------------------------------------------------
| / O / | MODULE : Uize.Templates.Text.Tables.YinYangBreakdown Package
| / / / |
| / / / /| | ONLINE : http://www.uize.com
| /____/ /__/_| | COPYRIGHT : (c)2014-2016 UIZE
| /___ | LICENSE : Available under MIT License or GNU General Public License
|_______________| http://www.uize.com/license.html
*/
/* Module Meta Data
type: Package
importance: 1
codeCompleteness: 100
docCompleteness: 4
*/
/*?
Introduction
The =Uize.Templates.Text.Tables.YinYangBreakdown= module is a JavaScript Template module, used for generating a text-based yin and yang style breakdown table that can be used when outputting to logs, consoles, terminals, etc.
*DEVELOPERS:* `Chris van Rensburg`
*/
Uize.module ({
name:'Uize.Templates.Text.Tables.YinYangBreakdown',
required:[
'Uize.Templates.Text.Table',
'Uize.Templates.Text.ProgressBar'
],
builder:function () {
'use strict';
return Uize.package ({
process:function (_input) {
var
_countByCategory = _input.countByCategory,
_total = Uize.max (_countByCategory)
;
function _formatPercentColumn (_value) {
return (
(_value * 100).toFixed (1) + '% ' +
Uize.Templates.Text.ProgressBar.process ({
trackLength:20,
endsChar:'',
fullHeadChar:'',
progress:_value
})
);
}
return Uize.Templates.Text.Table.process ({
title:_input.title,
columns:[
{title:'Category'},
{
title:'Count',
align:'right'
},
{
title:'Percent of Total',
align:'right',
formatter:_formatPercentColumn
},
{title:' '},
{title:'Category'},
{
title:'Count',
align:'right'
},
{
title:'Percent of Total',
align:'right',
formatter:_formatPercentColumn
}
],
rows:Uize.map (
Uize.keys (_countByCategory),
function (_category) {
var
_count = _countByCategory [_category],
_categoryYinAndYang = _category.split (',')
;
return [
_categoryYinAndYang [0],_count,_count / _total,
'',
_categoryYinAndYang [1],_total - _count,(_total - _count) / _total
];
}
)
});
}
});
}
});
//
koh5_pano
Drag mouse to navigate.
Navigation
- Left/Right Mouse drag: Changes camera heading.
- Up/Sown Mouse drag: Changes camera pitch.
- Scroll wheel: Changes camera field of view.
- I-Key: Displays Info panel with canvas size, image size and FPS.
17.Aug.2010, Martin Wengenmayer