src/draw.js
/**
  * Configures nested HTML elements in the plugins Eg: Axis
  * only basic config w/o scaled accessors etc.
  *
  * @param object Draw directive config
  * @return Object including the attributes and element
  */
Configures nested HTML elements in the plugins Eg: Axis
only basic config w/o scaled accessors etc.

@param object Draw directive config
@return Object including the attributes and element
Configures nested HTML elements in the plugins Eg : Axis only basic config w / o scaled accessors etc . @param object Draw directive config @return Object including the attributes and element
configElements(cfg) {
    let sel = [];
    let cfgAttr = Object.keys(cfg.cfg.attr||{}).filter(a => typeof cfg.cfg.attr[a] == 'object' && !Array.isArray(cfg.cfg.attr[a]));
    cfgAttr.forEach(s => {
      Object.keys(cfg.cfg.attr[s]).forEach(a => {
        sel.push([s, [a, cfg.cfg.attr[s][a]]]);
      });
    });
    sel.forEach((item, i) => {
      cfg.target.selectAll(item[0]).attr(...item[1]);
    });
    cfg.target.selectAll('*').attr('id', d=>cfg.layerState.genID().str);
  }
configElements ( cfg ) { let sel = [ ] ; let cfgAttr = Object . keys ( cfg . cfg . attr || { } ) . filter ( a => typeof cfg . cfg . attr [ a ] == 'object' && ! Array . isArray ( cfg . cfg . attr [ a ] ) ) ; cfgAttr . forEach ( s => { Object . keys ( cfg . cfg . attr [ s ] ) . forEach ( a => { sel . push ( [ s , [ a , cfg . cfg . attr [ s ] [ a ] ] ] ) ; } ) ; } ) ; sel . forEach ( ( item , i ) => { cfg . target . selectAll ( item [ 0 ] ) . attr ( ... item [ 1 ] ) ; } ) ; cfg . target . selectAll ( '*' ) . attr ( 'id' , d => cfg . layerState . genID ( ) . str ) ; }
Configures nested HTML elements in the plugins Eg: Axis
 only basic config w/o scaled accessors etc.
Configures nested HTML elements in the plugins Eg : Axis only basic config w / o scaled accessors etc .
// TODO: Give nicer element specific names?