File tree Expand file tree Collapse file tree 1 file changed +6
-22
lines changed
Expand file tree Collapse file tree 1 file changed +6
-22
lines changed Original file line number Diff line number Diff line change @@ -5,32 +5,16 @@ var debug = require('debug')('scout-ui:minicharts:unique');
55module . exports = VizView . extend ( {
66 template : require ( './unique.jade' ) ,
77 derived : {
8- orderedValues : {
9- deps : [ 'model.values' ] ,
10- cache : true ,
11- fn : function ( ) {
12- return this . model . values . toJSON ( ) . sort ( ) ;
13- }
14- } ,
15- minValue : {
16- deps : [ 'orderedValues' ] ,
17- cache : true ,
18- fn : function ( ) {
19- return this . orderedValues [ 0 ] ;
20- }
21- } ,
22- maxValue : {
23- deps : [ 'orderedValues' ] ,
24- cache : true ,
25- fn : function ( ) {
26- return this . orderedValues [ this . orderedValues . length - 1 ] ;
27- }
28- } ,
298 randomValues : {
309 deps : [ 'orderedValues' ] ,
3110 cache : false ,
3211 fn : function ( ) {
33- return this . orderedValues . slice ( 1 , 15 ) ;
12+ return _ ( this . model . values . sample ( 15 ) )
13+ . map ( function ( x ) {
14+ return x . value ;
15+ } )
16+ . sort ( )
17+ . value ( ) ;
3418 }
3519 }
3620 } ,
You can’t perform that action at this time.
0 commit comments