dist/hdsf-hive.js
/**
  * Creates a scale for each accessor object in cfg and adds it to the scaleDict obj.
  * Since any accessor can be used in any frame, the range is deferred until the plugin runs.
  *
  * @param object The accessor cfg
  * @return none
  */
Creates a scale for each accessor object in cfg and adds it to the scaleDict obj.
Since any accessor can be used in any frame, the range is deferred until the plugin runs.

@param object The accessor cfg
@return none
Creates a scale for each accessor object in cfg and adds it to the scaleDict obj . Since any accessor can be used in any frame the range is deferred until the plugin runs . @param object The accessor cfg @return none
entry (cfg) {
    let builtins ={ 
      "_builtin-x_":{field:'x', domain:[0,100], type:'linear', range:'width'},
      "_builtin-y_":{field:'y', domain:[0,100], type:'linear', range:'-height'}
    }
    this.cfg = {...builtins, ...cfg};
    this.scaleDict = {};
    this.dynMethods = ['domain', 'range']; 
    Object.keys(this.cfg).forEach((d, i) => {
      let c = this.cfg[d];
      let type = c.type.charAt(0).toUpperCase() + c.type.slice(1);
      this.scaleDict[d] = d3[`scale${type}`]();
      let methods = Object.keys(this.scaleDict[d]);
      methods.forEach((item, i) => {
        if (this.dynMethods.includes(item) && !Array.isArray(c[item])) return;
        if (item in c) this.scaleDict[d][item](c[item]);
      });
      this.scaleDict[d].cfg = this.cfg[d];
      this.scaleDict[d].field = 'field' in c?c.field:d;
    });
  }
entry ( cfg ) { let builtins = { "_builtin-x_" : { field : 'x' , domain : [ 0 , 100 ] , type : 'linear' , range : 'width' } , "_builtin-y_" : { field : 'y' , domain : [ 0 , 100 ] , type : 'linear' , range : '-height' } } this . cfg = { ... builtins , ... cfg } ; this . scaleDict = { } ; this . dynMethods = [ 'domain' , 'range' ] ; Object . keys ( this . cfg ) . forEach ( ( d , i ) => { let c = this . cfg [ d ] ; let type = c . type . charAt ( 0 ) . toUpperCase ( ) + c . type . slice ( 1 ) ; this . scaleDict [ d ] = d3 [ ` ${ type } ` ] ( ) ; let methods = Object . keys ( this . scaleDict [ d ] ) ; methods . forEach ( ( item , i ) => { if ( this . dynMethods . includes ( item ) && ! Array . isArray ( c [ item ] ) ) return ; if ( item in c ) this . scaleDict [ d ] [ item ] ( c [ item ] ) ; } ) ; this . scaleDict [ d ] . cfg = this . cfg [ d ] ; this . scaleDict [ d ] . field = 'field' in c ? c . field : d ; } ) ; }
Creates a scale for each accessor object in cfg and adds it to the scaleDict obj.
Creates a scale for each accessor object in cfg and adds it to the scaleDict obj .
// used for builtin data // methods whose args can be uniq for each draw // set opts // set variable ranges or domains later