Sets the bar graph by a percentage.
@param {Function} callback A function to call when the operation has finished.
549189
function setByPercentage(callback) {
    var percentage = 0;
    
    var setByPercentageInterval = setInterval(function() {
        if (percentage <= 100) {
            dothat.barGraph.setByPercentage(percentage);
            
            percentage++;
        } else {
            clearInterval(setByPercentageInterval);
            
            if (callback) {
                callback();
            }
        }
    }, 50);
}
874514
def save_callback(operation, graphdef):
    ''''''
    if operation == 'test':
        for e in graphdef.expressions:
            if expression_ok(e, msgs):
                graphdef.expression = e
                pipe_graph_input.send('graph ' + graphdef.expression)
                return
        pipe_console_input.send('Invalid graph expressions')
        return
    if operation == 'save':
        save_graph(graphdef)
1054222
function drawLabels() {
            let labelXPosition = isHorizontal ? _labelsHorizontalX : _labelsVerticalX;
            let labelYPosition = isHorizontal ? _labelsHorizontalY : _labelsVerticalY;
            let text = _labelsFormatValue

            if (labelEl) {
                svg.selectAll('.percentage-label-group').remove();
            }

            labelEl = svg.select('.metadata-group')
              .append('g')
                .classed('percentage-label-group', true)
                .selectAll('text')
                .data(data.reverse())
                .enter()
              .append('text');

            labelEl
                .classed('percentage-label', true)
                .attr('x', labelXPosition)
                .attr('y', labelYPosition)
                .text(text)
                .attr('font-size', labelsSize + 'px')
        }
464427
function drawBars() {
            let bars;

            if (isAnimated) {
                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(dataZeroed);

                if (isHorizontal) {
                    drawHorizontalBars(bars);
                } else {
                    drawVerticalBars(bars);
                }

                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(data);

                if (isHorizontal) {
                    drawAnimatedHorizontalBars(bars);
                } else {
                    drawAnimatedVerticalBars(bars);
                }

                // Exit
                bars.exit()
                    .transition()
                    .style('opacity', 0)
                    .remove();
            } else {
                bars = svg.select('.chart-group').selectAll('.bar')
                    .data(data);

                if (isHorizontal) {
                    drawHorizontalBars(bars);
                } else {
                    drawVerticalBars(bars);
                }

                // Exit
                bars.exit()
                    .remove();
            }

        }
715348
def _bar(self, target_name, current, total):
        
        bar_len = 30

        if total is None:
            state = 0
            percent = "?% "
        else:
            total = int(total)
            state = int((100 * current) / total) if current < total else 100
            percent = str(state) + "% "

        if self._n_total > 1:
            num = "({}/{}): ".format(self._n_finished + 1, self._n_total)
        else:
            num = ""

        n_sh = int((state * bar_len) / 100)
        n_sp = bar_len - n_sh
        pbar = "[" + "#" * n_sh + " " * n_sp + "] "

        return num + pbar + percent + target_name
683719
function (e, data) {
                if (data.context) {
                    var progress = Math.floor(data.loaded / data.total * 100);
                    data.context.find('.progress')
                        .attr('aria-valuenow', progress)
                        .find('.bar').css(
                            'width',
                            progress + '%'
                        );
                }
            }
105858
function wrap(stats, callback) {
  return function(err, content) {
    if (err) {
      return callback(err);
    }
    stats.content = content;
    return callback(null, stats);
  };
}
664901
function(callback) {
			var timeout = window.setTimeout(function(){
				callback();
			},2000);
			window.onload = function(){
				clearTimeout(timeout);
				callback();
			};
		}
821085
function () {
            this._timerStart = $B.bind(function () {
                //delayComplete
                if ( this._delayCallback ) this._delayCallback.call( this, {type: 'delay', data: this._data} );
                this._clearDelay();
    
                if ( this._duration <= 0 ) {
                    this._cValue = finish;
                    this._progress = 1;
                    this._percent = 1;
    
                    this.dispatch( 'tween', {target: this, currentValue: this._cValue, progress: this._progress, percent: this._percent, currentCount: this._currentCount, totalCount: this._totalCount, data: this._data} );
                    this.dispatch( 'complete', {target: this, currentValue: this._cValue, progress: this._progress, percent: this._percent, currentCount: this._currentCount, totalCount: this._totalCount, data: this._data});
                } else {
                    if ( !this._interval ) this._interval = setInterval( this._intervalHandler, this._loopTime );
                }
            }, this);
    
            this._to = $B.bind(function () {
                //delayComplete
                if ( this._delayCallback ) this._delayCallback.call( this, {type: 'delay', data: this._data} );
                this._clearDelay();
    
                this._currentCount = this._seekCount;
                this._intervalHandler();
            }, this);
    
            this._intervalHandler = $B.bind(function (e) {
                this._cValue = this._ease.call( this, this._currentCount, this._begin, this._finishValue, this._totalCount );
                this._percent = ( this._finishValue == 0 )? 1 : ( this._cValue - this._begin ) / this._finishValue;
                this._progress = this._currentCount / this._totalCount;
    
                var evt = {target: this, currentValue: this._cValue, progress: this._progress, percent: this._percent, currentCount: this._currentCount, totalCount: this._totalCount, data: this._data };
                //tween
                this.dispatch( 'tween', evt );
                //complete
                if ( this._currentCount >= this._totalCount && this._seekCount == this._totalCount ) {
                    this._timerStop();
                    this.dispatch( 'complete', evt );
                    if ( this._seekCom ) this.dispatch( 'seekcomplete', evt );
                //seek
                } else {
                    if ( this._currentCount == this._seekCount ) {
                        this._timerStop();
                        if ( this._seekCom ) this.dispatch( 'complete', evt );
                        return;
                    }
                    if ( this._forward != null ) this._currentCount = ( this._forward )? ++this._currentCount : --this._currentCount;
                }
            }, this);
        }
80510
def SetPercentageView(self, percentageView):
        """"""
        self.percentageView = percentageView
        self.percentageMenuItem.Check(self.percentageView)
        self.percentageViewTool.SetValue(self.percentageView)
        total = self.adapter.value( self.loader.get_root( self.viewType ) )
        for control in self.ProfileListControls:
            control.SetPercentage(self.percentageView, total)
        self.adapter.SetPercentage(self.percentageView, total)
1107346
function makeCallback(callback) {
  if (_.isFunction(callback)) {
    return callback;
  }
  var result = function() { return callback; };
  result._callback = callback;
  return result;
}
1232465
def callback(self, sources):
        """"""
        enable = bool(sources)
        if not enable:
            self.plot_widget.value = False
        enable_widget(self.plot_widget, enable)

        if self.done_callback:
            self.done_callback(sources)
468786
function(n){
    if(this.busy) return;
    this.busy = true;
    
    var that = this,
        config = this.config,
        graph = this.graph,
        clickedNode = n,
        previousClickedNode = this.clickedNode;

    var callback = {
      onComplete: function() {
        //ensure that nodes are shown for that level
        if(config.levelsToShow > 0) {
          that.geom.setRightLevelToShow(n);
        }
        //compute positions of newly inserted nodes
        if(config.request) that.compute();
        if(config.animate) {
          //fade nodes
          graph.nodeList.setDataset(['current', 'end'], {
            'alpha': [1, 0]
          });
          n.eachSubgraph(function(n) {
            n.setData('alpha', 1, 'end');
          }, "ignore");
          that.fx.animate({
            duration: 500,
            modes:['node-property:alpha'],
            onComplete: function() {
              //compute end positions
              that.clickedNode = clickedNode;
              that.compute('end');
              //animate positions
              //TODO(nico) commenting this line didn't seem to throw errors...
              that.clickedNode = previousClickedNode;
              that.fx.animate({
                modes:['linear', 'node-property:width:height'],
                duration: 1000,
                onComplete: function() { 
                  that.busy = false;
                  //TODO(nico) check comment above
                  that.clickedNode = clickedNode;
                }
              });
            }
          });
        } else {
          that.busy = false;
          that.clickedNode = n;
          that.refresh();
        }
      }
    };
    if(config.request) {
      this.requestNodes(clickedNode, callback);
    } else {
      callback.onComplete();
    }
  }
171881
function (count, total, rounded) {
        var scale;
        if (rounded) {
            scale = this._0digitsScale;
        } else {
            scale = this._2digitsScale;
        }
        return Math.floor(this._percentage * scale * count / total) / scale;
    }
974936
public void completeCallback(final Callback callback, final String error, final JsonNode result) {
        ObjectNode req = makeRequest("complete");
        req.put("cbid", callback.getCbid());
        req.put("err", error);
        req.set("result", result);

        this.runtime.requestResponse(req);
    }
804170
function() {
            var
              barWidth       = $bar.width(),
              totalWidth     = $module.width(),
              minDisplay     = parseInt($bar.css('min-width'), 10),
              displayPercent = (barWidth > minDisplay)
                ? (barWidth / totalWidth * 100)
                : module.percent
            ;
            return (settings.precision > 0)
              ? Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision)
              : Math.round(displayPercent)
            ;
          }
785603
function DrawBars() {

    if ($this->data_type != "text-data") {
      $this->DrawError('Bar plots must be text-data: use function SetDataType("text-data")');
    }

    $xadjust = ($this->records_per_group * $this->record_bar_width )/4;

    reset($this->data_values);
    while (list($j, $row) = each($this->data_values)) {

      $color_index = 0;
      $colbarcount = 0;
      $x_now = $this->xtr($j+.5);

      while (list($k, $v) = each($row)) {
        if ($k == 0) {
          //Draw Data Labels
          $xlab = SubStr($v,0,$this->x_datalabel_maxlength);
          $this->DrawXDataLabel($xlab,$x_now);
        } else {
          // Draw Bars ($v)
          $x1 = $x_now - $this->data_group_space + ($k-1)*$this->record_bar_width;
          $x2 = $x1 + $this->record_bar_width*$this->bar_width_adjust;

          if ($v < $this->x_axis_position) {
            $y1 = $this->ytr($this->x_axis_position);
            $y2 = $this->ytr($v);
          } else {
            $y1 = $this->ytr($v);
            $y2 = $this->ytr($this->x_axis_position);
          }

          if ($color_index >= count($this->ndx_data_color)) $color_index=0;
          if ($colbarcount >= count($this->ndx_data_border_color)) $colbarcount=0;
          $barcol = $this->ndx_data_color[$color_index];
          $bordercol = $this->ndx_data_border_color[$colbarcount];

          if ((strval($v) != "") ) {   //Allow for missing Y data
            if ($this->shading > 0) {
              for($i=0;$i<($this->shading);$i++) {
              //Shading set in SetDefaultColors
              ImageFilledRectangle($this->img, $x1+$i, $y1-$i, $x2+$i, $y2-$i, $this->ndx_i_light);
              }
            }

            ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $barcol);
            ImageRectangle($this->img, $x1, $y1, $x2, $y2, $bordercol);
            if ($this->draw_data_labels == '1') {  //ajo
              $y1 = $this->ytr($this->label_scale_position * $v);
              //$this->DrawDataLabel($v,$j + .5,$v*$this->label_scale_position);
              $this->DrawText($this->small_font, $this->x_label_angle,
                $x1+$this->record_bar_width/2, $y1, $this->ndx_label_color, $this->x_label_ttffont_size, $v,'center','top');
            }
          }

          $color_index++;
          $colbarcount++;
        }
      }
    }
  }