@ -258,7 +258,7 @@
var isTimeSeries = ( _ _axis _x _type === 'timeseries' ) ,
isCategorized = ( _ _axis _x _type === 'categorized' ) ,
isCustomX = ! isTimeSeries && ( _ _data _x || ! is Empty( _ _data _xs ) ) ;
isCustomX = ! isTimeSeries && ( _ _data _x || not Empty( _ _data _xs ) ) ;
var dragStart = null , dragging = false , cancelClick = false ;
@ -1190,13 +1190,13 @@
//-- Data --//
function isX ( key ) {
return ( _ _data _x && key === _ _data _x ) || ( ! is Empty( _ _data _xs ) && hasValue ( _ _data _xs , key ) ) ;
return ( _ _data _x && key === _ _data _x ) || ( not Empty( _ _data _xs ) && hasValue ( _ _data _xs , key ) ) ;
}
function isNotX ( key ) {
return ! isX ( key ) ;
}
function getXKey ( id ) {
return _ _data _x ? _ _data _x : ! is Empty( _ _data _xs ) ? _ _data _xs [ id ] : null ;
return _ _data _x ? _ _data _x : not Empty( _ _data _xs ) ? _ _data _xs [ id ] : null ;
}
function getXValue ( id , i ) {
return id in c3 . data . x && c3 . data . x [ id ] && c3 . data . x [ id ] [ i ] ? c3 . data . x [ id ] [ i ] : i ;
@ -1784,7 +1784,7 @@
function generateColor ( _colors , _pattern ) {
var ids = [ ] ,
colors = _colors ,
pattern = ! is Empty( _pattern ) ? _pattern : [ '#1f77b4' , '#ff7f0e' , '#2ca02c' , '#d62728' , '#9467bd' , '#8c564b' , '#e377c2' , '#7f7f7f' , '#bcbd22' , '#17becf' ] ; //same as d3.scale.category10()
pattern = not Empty( _pattern ) ? _pattern : [ '#1f77b4' , '#ff7f0e' , '#2ca02c' , '#d62728' , '#9467bd' , '#8c564b' , '#e377c2' , '#7f7f7f' , '#bcbd22' , '#17becf' ] ; //same as d3.scale.category10()
return function ( id ) {
// if specified, choose that color
@ -1829,8 +1829,8 @@
return false ;
}
function isEmpty ( dict ) {
return Object . keys ( dict ) . length === 0 ;
function notEmpty ( o ) {
return Object . keys ( o ) . length > 0 ;
}
function hasValue ( dict , value ) {
var found = false ;
@ -2285,7 +2285,7 @@
if ( _ _grid _x _show ) {
grid . append ( "g" ) . attr ( "class" , CLASS . xgrids ) ;
}
if ( ! is Empty( _ _grid _x _lines ) ) {
if ( not Empty( _ _grid _x _lines ) ) {
grid . append ( 'g' ) . attr ( "class" , CLASS . xgridLines ) ;
}
if ( _ _point _focus _line _enabled ) {
@ -2303,7 +2303,7 @@
if ( _ _grid _y _show ) {
grid . append ( 'g' ) . attr ( 'class' , CLASS . ygrids ) ;
}
if ( ! is Empty( _ _grid _y _lines ) ) {
if ( not Empty( _ _grid _y _lines ) ) {
grid . append ( 'g' ) . attr ( 'class' , CLASS . ygridLines ) ;
}
@ -2788,7 +2788,7 @@
. style ( "opacity" , function ( ) { return + d3 . select ( this ) . attr ( _ _axis _rotated ? 'y1' : 'x1' ) === ( _ _axis _rotated ? height : 0 ) ? 0 : 1 ; } ) ;
xgrid . exit ( ) . remove ( ) ;
}
if ( ! is Empty( _ _grid _x _lines ) ) {
if ( not Empty( _ _grid _x _lines ) ) {
xgridLines = main . select ( '.' + CLASS . xgridLines ) . selectAll ( '.' + CLASS . xgridLine )
. data ( _ _grid _x _lines ) ;
// enter
@ -2833,7 +2833,7 @@
. attr ( "y2" , _ _axis _rotated ? height : y ) ;
ygrid . exit ( ) . remove ( ) ;
}
if ( withY && ! is Empty( _ _grid _y _lines ) ) {
if ( withY && not Empty( _ _grid _y _lines ) ) {
ygridLines = main . select ( '.' + CLASS . ygridLines ) . selectAll ( '.' + CLASS . ygridLine )
. data ( _ _grid _y _lines ) ;
// enter
@ -3014,7 +3014,7 @@
. attr ( "cy" , _ _axis _rotated ? circleX : circleY ) ;
// rect for mouseover
if ( ! is Empty( _ _data _xs ) ) {
if ( not Empty( _ _data _xs ) ) {
eventRectUpdate = main . select ( '.' + CLASS . eventRects ) . selectAll ( '.' + CLASS . eventRect )
. data ( [ 0 ] ) ;
// enter : only one rect will be added