index.js
function () {

    // trim number to 3 decimals
    function dec3 (v) {
      return Math.floor(v * 1000) / 1000;
    }

    var params = [];
    var usingPreset = this.data.preset != 'none' ? this.presets[this.data.preset] : false;

    if (usingPreset) {
      params.push('preset: ' + this.data.preset);
    }

    for (var i in this.schema) {
      if (i == 'preset' || (usingPreset && usingPreset[i] === undefined)) {
        continue;
      }
      var def = usingPreset ? usingPreset[i] : this.schema[i].default;
      var data = this.data[i];
      var type = this.schema[i].type;
      if (type == 'vec3') {
        var coords = def;
        if (typeof(def) == 'string') {
          def = def.split(' ');
          coords = {x: def[0], y: def[1], z: def[2]};
        }
        if (dec3(coords.x) != dec3(data.x) || dec3(coords.y) != dec3(data.y) || dec3(coords.z) != dec3(data.z)) {
          params.push(i + ': ' + dec3(data.x) + ' ' + dec3(data.y) + ' ' + dec3(data.z));
        }
      }
      else {
        if (def != data) {
          if (this.schema[i].type == 'number') {
            data = dec3(data);
          }
          params.push(i + ': ' + data);
        }
      }
    }
    console.log('%c' + params.join('; '), 'color: #f48;font-weight:bold');
  }
function () {

    // trim number to 3 decimals
    function dec3 (v) {
      return Math.floor(v * 1000) / 1000;
    }

    var params = [];
    var usingPreset = this.data.preset != 'none' ? this.presets[this.data.preset] : false;

    if (usingPreset) {
      params.push('preset: ' + this.data.preset);
    }

    for (var i in this.schema) {
      if (i == 'preset' || (usingPreset && usingPreset[i] === undefined)) {
        continue;
      }
      var def = usingPreset ? usingPreset[i] : this.schema[i].default;
      var data = this.data[i];
      var type = this.schema[i].type;
      if (type == 'vec3') {
        var coords = def;
        if (typeof(def) == 'string') {
          def = def.split(' ');
          coords = {x: def[0], y: def[1], z: def[2]};
        }
        if (dec3(coords.x) != dec3(data.x) || dec3(coords.y) != dec3(data.y) || dec3(coords.z) != dec3(data.z)) {
          params.push(i + ': ' + dec3(data.x) + ' ' + dec3(data.y) + ' ' + dec3(data.z));
        }
      }
      else {
        if (def != data) {
          if (this.schema[i].type == 'number') {
            data = dec3(data);
          }
          params.push(i + ': ' + data);
        }
      }
    }
    console.log('%c' + params.join('; '), 'color: #f48;font-weight:bold');
  }
function ( ) { // trim number to 3 decimals function dec3 ( v ) { return Math . floor ( v * 1000 ) / 1000 ; } var params = [ ] ; var usingPreset = this . data . preset != 'none' ? this . presets [ this . data . preset ] : false ; if ( usingPreset ) { params . push ( 'preset: ' + this . data . preset ) ; } for ( var i in this . schema ) { if ( i == 'preset' || ( usingPreset && usingPreset [ i ] === undefined ) ) { continue ; } var def = usingPreset ? usingPreset [ i ] : this . schema [ i ] . default ; var data = this . data [ i ] ; var type = this . schema [ i ] . type ; if ( type == 'vec3' ) { var coords = def ; if ( typeof ( def ) == 'string' ) { def = def . split ( ' ' ) ; coords = { x : def [ 0 ] , y : def [ 1 ] , z : def [ 2 ] } ; } if ( dec3 ( coords . x ) != dec3 ( data . x ) || dec3 ( coords . y ) != dec3 ( data . y ) || dec3 ( coords . z ) != dec3 ( data . z ) ) { params . push ( i + ': ' + dec3 ( data . x ) + ' ' + dec3 ( data . y ) + ' ' + dec3 ( data . z ) ) ; } } else { if ( def != data ) { if ( this . schema [ i ] . type == 'number' ) { data = dec3 ( data ) ; } params . push ( i + ': ' + data ) ; } } } console . log ( '%c' + params . join ( '; ' ) , 'color: #f48;font-weight:bold' ) ; }
dumps current component settings to console.
dumps current component settings to console .