static/js/org/cytoscape.js
function( params ){
      var defaults = { 
        field: 'data',
        event: 'data',
        triggerFnName: 'trigger',
        triggerEvent: false,
        immutableKeys: {} // key => true if immutable
      };
      params = $$.util.extend({}, defaults, params);

      return function removeDataImpl( names ){
        var p = params;
        var self = this;
        var selfIsArrayLike = self.length !== undefined;
        var all = selfIsArrayLike ? self : [self]; // put in array if not array-like
        var single = selfIsArrayLike ? self[0] : self;
        
        // .removeData('foo bar')
        if( $$.is.string(names) ){ // then get the list of keys, and delete them
          var keys = names.split(/\s+/);
          var l = keys.length;

          for( var i = 0; i < l; i++ ){ // delete each non-empty key
            var key = keys[i];
            if( $$.is.emptyString(key) ){ continue; }

            var valid = !p.immutableKeys[ key ]; // not valid if immutable
            if( valid ){
              for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
                delete all[ i_a ]._private[ p.field ][ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }

        // .removeData()
        } else if( names === undefined ){ // then delete all keys

          for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
            var _privateFields = all[ i_a ]._private[ p.field ];
            
            for( var key in _privateFields ){
              var validKeyToDelete = !p.immutableKeys[ key ];

              if( validKeyToDelete ){
                delete _privateFields[ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }
        }

        return self; // maintain chaining
      }; // function
    }
function( params ){
      var defaults = { 
        field: 'data',
        event: 'data',
        triggerFnName: 'trigger',
        triggerEvent: false,
        immutableKeys: {} // key => true if immutable
      };
      params = $$.util.extend({}, defaults, params);

      return function removeDataImpl( names ){
        var p = params;
        var self = this;
        var selfIsArrayLike = self.length !== undefined;
        var all = selfIsArrayLike ? self : [self]; // put in array if not array-like
        var single = selfIsArrayLike ? self[0] : self;
        
        // .removeData('foo bar')
        if( $$.is.string(names) ){ // then get the list of keys, and delete them
          var keys = names.split(/\s+/);
          var l = keys.length;

          for( var i = 0; i < l; i++ ){ // delete each non-empty key
            var key = keys[i];
            if( $$.is.emptyString(key) ){ continue; }

            var valid = !p.immutableKeys[ key ]; // not valid if immutable
            if( valid ){
              for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
                delete all[ i_a ]._private[ p.field ][ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }

        // .removeData()
        } else if( names === undefined ){ // then delete all keys

          for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
            var _privateFields = all[ i_a ]._private[ p.field ];
            
            for( var key in _privateFields ){
              var validKeyToDelete = !p.immutableKeys[ key ];

              if( validKeyToDelete ){
                delete _privateFields[ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }
        }

        return self; // maintain chaining
      }; // function
    }
function ( params ) { var defaults = { field : 'data' , event : 'data' , triggerFnName : 'trigger' , triggerEvent : false , immutableKeys : { } // key => true if immutable } ; params = $$ . util . extend ( { } , defaults , params ) ; return function removeDataImpl ( names ) { var p = params ; var self = this ; var selfIsArrayLike = self . length !== undefined ; var all = selfIsArrayLike ? self : [ self ] ; // put in array if not array-like var single = selfIsArrayLike ? self [ 0 ] : self ; // .removeData('foo bar') if ( $$ . is . string ( names ) ) { // then get the list of keys, and delete them var keys = names . split ( / \s+ / ) ; var l = keys . length ; for ( var i = 0 ; i < l ; i ++ ) { // delete each non-empty key var key = keys [ i ] ; if ( $$ . is . emptyString ( key ) ) { continue ; } var valid = ! p . immutableKeys [ key ] ; // not valid if immutable if ( valid ) { for ( var i_a = 0 , l_a = all . length ; i_a < l_a ; i_a ++ ) { delete all [ i_a ] . _private [ p . field ] [ key ] ; } } } if ( p . triggerEvent ) { self [ p . triggerFnName ] ( p . event ) ; } // .removeData() } else if ( names === undefined ) { // then delete all keys for ( var i_a = 0 , l_a = all . length ; i_a < l_a ; i_a ++ ) { var _privateFields = all [ i_a ] . _private [ p . field ] ; for ( var key in _privateFields ) { var validKeyToDelete = ! p . immutableKeys [ key ] ; if ( validKeyToDelete ) { delete _privateFields [ key ] ; } } } if ( p . triggerEvent ) { self [ p . triggerFnName ] ( p . event ) ; } } return self ; // maintain chaining } ; // function }
remove data field
remove data field