Render a "selection" rect over a set of bars.

@param {array} dataArray An array of data elements for which to render a selection over.
Pass an empty array to remove the selection.
329174
function drawSelection(dataArray) {
		var firstItem = (dataArray && dataArray.length > 0 ? dataArray.slice(0, 1) : []),
			firstItemX = (dataArray && dataArray.length > 0 ? valueX(dataArray[0]) : 0),
			lastItemX = (dataArray && dataArray.length > 0 ? valueX(dataArray[dataArray.length - 1]) : 0),
			width = (lastItemX - firstItemX) + xBar.rangeBand();
		var selectBar = parent.svgHoverRoot.selectAll('rect.selectionbar').data(firstItem);
		selectBar.attr('x', firstItemX)
				.attr('width', width);
		selectBar.enter().append('rect')
				.attr('x', firstItemX)
				.attr('y', 0)
				.attr('height', parent.height)
				.attr('width', width)
				.classed('selectionbar clickable', true);
		selectBar.exit().remove();
	}
108357
function(data){

			//Declare segments as a static property to prevent inheriting across the Chart type prototype
			this.segments = [];
			this.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -	this.options.segmentStrokeWidth/2)/2;

			this.SegmentArc = Chart.Arc.extend({
				ctx : this.chart.ctx,
				x : this.chart.width/2,
				y : this.chart.height/2
			});

			//Set up tooltip events on the chart
			if (this.options.showTooltips){
				helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
					var activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];

					helpers.each(this.segments,function(segment){
						segment.restore(["fillColor"]);
					});
					helpers.each(activeSegments,function(activeSegment){
						activeSegment.fillColor = activeSegment.highlightColor;
					});
					this.showTooltip(activeSegments);
				});
			}
			this.calculateTotal(data);

			helpers.each(data,function(datapoint, index){
				this.addData(datapoint, index, true);
			},this);

			this.render();
		}
236356
function () {
      if (!selection.isSelected()) {
        return;
      }
      var corners = grid.getCornerCoords([priv.selStart, selection.end()]);
      var r, c, changes = [];
      for (r = corners.TL.row; r <= corners.BR.row; r++) {
        for (c = corners.TL.col; c <= corners.BR.col; c++) {
          if (self.getCellMeta(r, c).isWritable) {
            changes.push([r, datamap.colToProp(c), '']);
          }
        }
      }
      self.setDataAtCell(changes);
    }
842819
function _render_select(){

	var buf = new Array();

	//
	buf.push('<select id="');
	buf.push(anchor.mid);
	buf.push('" name="');
	buf.push(anchor.mname);
	buf.push('" multiple size="');
	buf.push(anchor.msize);
	buf.push('">');
	
	buf.push(_render_option());

	//
	buf.push('</select>');

	return buf.join('');
    }
603396
function _colorToRgbArray(color) {
	var originalColor, elem,
		rgb = [],
		multiple = 1;

	// Deal with complete transparency
	if (color === 'transparent') {
		color = 'rgba(0, 0, 0, 0)';
	} else if (color.match(/^([a-z]+|#[0-9a-f]+)$/gi)) {
		// Deal with hexadecimal colors and color names
		elem = document.head;
		originalColor = elem.style.color;
		elem.style.color = color;
		color = $.css(elem, 'color');
		elem.style.color = originalColor;
	}
	// Parse RGB string
	if (color.match(/^rgb/gi)) {
		rgb = color.match(/(\d+(\.\d+)?)/gi);
		// Deal with RGB percentages
		if (color.match(/%/gi)) {
			multiple = 2.55;
		}
		rgb[0] *= multiple;
		rgb[1] *= multiple;
		rgb[2] *= multiple;
		// Ad alpha channel if given
		if (rgb[3] !== undefined) {
			rgb[3] = parseFloat(rgb[3]);
		} else {
			rgb[3] = 1;
		}
	}
	return rgb;
}
96438
function () {
    var draw = this.el.components.draw;
    var selector = this.data.asset;
    var width = draw.data.width;
    var height = draw.data.height;

    if (this.rendering) {
      return;
    }

    this.rendering = true;

    var node = document.querySelector(selector);

    if (!node) {
      console.error('Could not find html element with selector "' + selector + '"');
      return;
    }

    if (!this.observer) {
      this.observer = new MutationObserver(function (mutations) {
        queueRender(node, width, height, function (canvas) {
          renderedCanvas = canvas;
          draw.render();
        });
      });

      var config = { attributes: true, childList: true, characterData: true, subtree: true };
      this.observer.observe(node, config);
    }

    queueRender(node, width, height, function (canvas) {
      renderedCanvas = canvas;
      draw.render();
    });
  }
99911
function exports(_selection) {
            _selection.each(function(_data) {
                chartWidth = width - margin.left - margin.right - (yAxisPaddingBetweenChart * 1.2);
                chartHeight = height - margin.top - margin.bottom;
                ({data, dataZeroed} = sortData(cleanData(_data)));

                buildScales();
                buildAxis();
                buildSVG(this);
                buildGradient();
                drawGridLines();
                drawBars();
                drawAxis();

                if (enableLabels) {
                    drawLabels();
                }
            });
        }
457786
function DataView(buffer, byteOffset, byteLength) {
      if (!(buffer instanceof ArrayBuffer || Class(buffer) === 'ArrayBuffer')) throw TypeError();

      byteOffset = ToUint32(byteOffset);
      if (byteOffset > buffer.byteLength)
        throw RangeError('byteOffset out of range');

      if (byteLength === undefined)
        byteLength = buffer.byteLength - byteOffset;
      else
        byteLength = ToUint32(byteLength);

      if ((byteOffset + byteLength) > buffer.byteLength)
        throw RangeError('byteOffset and length reference an area beyond the end of the buffer');

      Object.defineProperty(this, 'buffer', {value: buffer});
      Object.defineProperty(this, 'byteLength', {value: byteLength});
      Object.defineProperty(this, 'byteOffset', {value: byteOffset});
    }
1285400
function renderComponent() {
    d3.select('svg')
      .datum(svgData)
      .call(crosshairSvg)
      .on('mousemove', function() {
          var point = d3.mouse(this);
          svgData[0] = { x: point[0], y: point[1] };
          render();
      });

    var canvas = d3.select('canvas').node();
    var ctx = canvas.getContext('2d');
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    crosshairCanvas.context(ctx)(canvasData);
    canvas.onmousemove = function({ offsetX, offsetY }) {
        canvasData[0] = { x: offsetX, y: offsetY };
        render();
    };
}
271244
function drawBubblesDataset(animationDecimal, data, config, ctx, statData, vars) {
		var t1, t2, t3, complementaryBar, otherBarHeight, barHeight, i, j, currentAnimPc, fullHeight, sizeTop, sizeBottom, decal;
		var maxBubbleRadius, markerShape, markerStrokeStyle, markerRadius, centerX, centerY, paddingTextX, paddingTextY, dispString, xRadius, yRadius;
		var newRadius, newX, newY;
		var correctedAnimationDecimal;
		for (i = 0; i < data.datasets.length; i++) {
			if (statData[i][0].tpchart != "Bubble") continue;
			for (j = 0; j < data.datasets[i].data.length; j++) {
				correctedAnimationDecimal = correctAnimation(animationDecimal, data, config, i, j, statData, "BUBBLE");
				if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.datasets[i].displayData, config.displayData, "displayData", i, j, {
						nullvalue: null
					}) == false) continue;
				if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.displayData, config.displayData, "displayData", j, -1, {
						nullvalue: null
					}) == false) continue;
				ctx.save();
				if (!(typeof(data.datasets[i].data[j]) == 'undefined')) {
					currentAnimPc = correctedAnimationDecimal.yAxis;
					ctx.beginPath();
					ctx.fillStyle = setOptionValue(true, true, 1, "MARKERFILLCOLOR", ctx, data, statData, data.datasets[i].pointColor, config.defaultStrokeColor, "pointColor", i, j, {
						nullvalue: true
					});
					ctx.strokeStyle = setOptionValue(true, true, 1, "MARKERSTROKESTYLE", ctx, data, statData, data.datasets[i].pointStrokeColor, config.defaultStrokeColor, "pointStrokeColor", i, j, {
						nullvalue: true
					});
					ctx.lineWidth = setOptionValue(true, true, ctx.chartLineScale, "MARKERLINEWIDTH", ctx, data, statData, data.datasets[i].pointDotStrokeWidth, config.pointDotStrokeWidth, "pointDotStrokeWidth", i, j, {
						nullvalue: true
					});
					markerShape = setOptionValue(true, true, 1, "MARKERSHAPE", ctx, data, statData, data.datasets[i].markerShape, config.markerShape, "markerShape", i, j, {
						nullvalue: true
					});
					markerStrokeStyle = setOptionValue(true, true, 1, "MARKERSTROKESTYLE", ctx, data, statData, data.datasets[i].pointDotStrokeStyle, config.pointDotStrokeStyle, "pointDotStrokeStyle", i, j, {
						nullvalue: true
					});
					maxBubbleRadius = config.bubbleMaxRadius * Math.min(statData[i][j].availableHeight, statData[i][j].availableWidth);
					markerRadius = setOptionValue(true, true, ctx.chartSpaceScale, "MARKERRADIUS", ctx, data, statData, data.datasets[i].pointDotRadius, config.pointDotRadius, "pointDotRadius", i, j, {
						nullvalue: true
					});
					markerRadius = currentAnimPc * maxBubbleRadius * (1 * markerRadius - statData[0][0].bubbleMinVal) / (statData[0][0].bubbleMaxVal - statData[0][0].bubbleMinVal);
					markerRadius = setOptionValue(true, true, 1, "MARKERRADIUS", ctx, data, statData, markerRadius, markerRadius, "pointDotRadius", i, j, {
						nullvalue: true
					});
					centerY = statData[i][j].xAxisPosY - statData[i][j].availableHeight / 2;
					centerX = statData[i][j].yAxisPosX + statData[i][j].availableWidth / 2;
					drawMarker(ctx, centerX + currentAnimPc * (statData[i][j].xPos - centerX), centerY + currentAnimPc * (statData[i][j].yAxisPos - centerY - statData[i][j].yPosOffset), markerShape, markerRadius, markerStrokeStyle);
				}
				ctx.restore();
			}
		}
		if (currentAnimPc >= config.animationStopValue) {
			for (i = 0; i < data.datasets.length; i++) {
				for (j = 0; j < data.datasets[i].data.length; j++) {
					if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.datasets[i].displayData, config.displayData, "displayData", i, j, {
							nullvalue: null
						}) == false) continue;
					if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.displayData, config.displayData, "displayData", j, -1, {
							nullvalue: null
						}) == false) continue;
					if (typeof(data.datasets[i].data[j]) == 'undefined') continue;
					if (statData[i][0].tpchart != "Bubble") continue;
					maxBubbleRadius = config.bubbleMaxRadius * Math.min(statData[i][j].availableHeight, statData[i][j].availableWidth);
					markerRadius = setOptionValue(true, true, ctx.chartSpaceScale, "MARKERRADIUS", ctx, data, statData, data.datasets[i].pointDotRadius, config.pointDotRadius, "pointDotRadius", i, j, {
						nullvalue: true
					});
					markerRadius = currentAnimPc * maxBubbleRadius * (1 * markerRadius - statData[0][0].bubbleMinVal) / (statData[0][0].bubbleMaxVal - statData[0][0].bubbleMinVal);
					statData[i][j].markerRadius = markerRadius;
					if (!(data.datasets[i].mouseDetection == false)) jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i, j, statData, setOptionValue(true, true, 1, "ANNOTATEDISPLAY", ctx, data, statData, data.datasets[i].annotateDisplay, config.annotateDisplay, "annotateDisplay", i, j, {
						nullValue: true
					})];
					if (setOptionValue(true, true, 1, "INGRAPHDATASHOW", ctx, data, statData, data.datasets[i].inGraphDataShow, config.inGraphDataShow, "inGraphDataShow", i, j, {
							nullValue: true
						})) {
						ctx.save();
						ctx.textAlign = setOptionValue(true, true, 1, "INGRAPHDATAALIGN", ctx, data, statData, undefined, config.inGraphDataAlign, "inGraphDataAlign", i, j, {
							nullValue: true
						});
						ctx.textBaseline = setOptionValue(true, true, 1, "INGRAPHDATAVALIGN", ctx, data, statData, undefined, config.inGraphDataVAlign, "inGraphDataVAlign", i, j, {
							nullValue: true
						});
						ctx.font = setOptionValue(true, true, 1, "INGRAPHDATAFONTSTYLE", ctx, data, statData, undefined, config.inGraphDataFontStyle, "inGraphDataFontStyle", i, j, {
							nullValue: true
						}) + ' ' + setOptionValue(true, true, ctx.chartTextScale, "INGRAPHDATAFONTSIZE", ctx, data, statData, undefined, config.inGraphDataFontSize, "inGraphDataFontSize", i, j, {
							nullValue: true
						}) + 'px ' + setOptionValue(true, true, 1, "INGRAPHDATAFONTFAMILY", ctx, data, statData, undefined, config.inGraphDataFontFamily, "inGraphDataFontFamily", i, j, {
							nullValue: true
						});
						ctx.fillStyle = setOptionValue(true, true, 1, "INGRAPHDATAFONTCOLOR", ctx, data, statData, undefined, config.inGraphDataFontColor, "inGraphDataFontColor", i, j, {
							nullValue: true
						});
						paddingTextX = setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATAPADDINGX", ctx, data, statData, undefined, config.inGraphDataPaddingX, "inGraphDataPaddingX", i, j, {
							nullValue: true
						});
						paddingTextY = setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATAPADDINGY", ctx, data, statData, undefined, config.inGraphDataPaddingY, "inGraphDataPaddingY", i, j, {
							nullValue: true
						});
						dispString = tmplbis(setOptionValue(true, true, 1, "INGRAPHDATATMPL", ctx, data, statData, undefined, config.inGraphDataTmpl, "inGraphDataTmpl", i, j, {
							nullValue: true
						}), statData[i][j], config);
						if (paddingTextY == 0) {
							newY = 0;
							if (paddingTextX == 0) newX = 0;
							else {
								newX = markerRadius;
								if (paddingTextX < 0) newX = -newX;
							}
							newY = 0;
						} else {
							newRadius = markerRadius + Math.sqrt(paddingTextX * paddingTextX + paddingTextY * paddingTextY);
							newY = Math.sqrt(newRadius * newRadius / (Math.pow(paddingTextX / paddingTextY, 2) + 1));
							if (paddingTextY < 0) newY = -newY;
							newX = newY * paddingTextX / paddingTextY;
						}
						ctx.translate(statData[i][j].xPos + newX, statData[i][j].yAxisPos - currentAnimPc * statData[i][j].yPosOffset - newY);
						var rotateVal = setOptionValue(true, true, 1, "INGRAPHDATAROTATE", ctx, data, statData, undefined, config.inGraphDataRotate, "inGraphDataRotate", i, j, {
							nullValue: true
						}) * (Math.PI / 180);
						ctx.rotate(rotateVal);
						setTextBordersAndBackground(ctx, dispString, setOptionValue(true, true, ctx.chartTextScale, "INGRAPHDATAFONTSIZE", ctx, data, statData, undefined, config.inGraphDataFontSize, "inGraphDataFontSize", i, j, {
							nullValue: true
						}), 0, 0, setOptionValue(true, true, 1, "INGRAPHDATABORDERS", ctx, data, statData, undefined, config.inGraphDataBorders, "inGraphDataBorders", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABORDERSSELECTION", ctx, data, statData, undefined, config.inGraphDataBordersSelection, "inGraphDataBordersSelection", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABORDERSCOLOR", ctx, data, statData, undefined, config.inGraphDataBordersColor, "inGraphDataBordersColor", i, j, {
							nullValue: true
						}), setOptionValue(true, true, ctx.chartLineScale, "INGRAPHDATABORDERSWIDTH", ctx, data, statData, undefined, config.inGraphDataBordersWidth, "inGraphDataBordersWidth", i, j, {
							nullValue: true
						}), setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATABORDERSXSPACE", ctx, data, statData, undefined, config.inGraphDataBordersXSpace, "inGraphDataBordersXSpace", i, j, {
							nullValue: true
						}), setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATABORDERSYSPACE", ctx, data, statData, undefined, config.inGraphDataBordersYSpace, "inGraphDataBordersYSpace", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABORDERSSTYLE", ctx, data, statData, undefined, config.inGraphDataBordersStyle, "inGraphDataBordersStyle", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABACKGROUNDCOLOR", ctx, data, statData, undefined, config.inGraphDataBackgroundColor, "inGraphDataBackgroundColor", i, j, {
							nullValue: true
						}), "INGRAPHDATA", config.inGraphDataBordersRadius);
						ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true, true, ctx.chartTextScale, "INGRAPHDATAFONTSIZE", ctx, data, statData, undefined, config.inGraphDataFontSize, "inGraphDataFontSize", i, j, {
							nullValue: true
						}), true, config.detectMouseOnText, ctx, "INGRAPHDATA_TEXTMOUSE", rotateVal, statData[i][j].xPos + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset - paddingTextY, i, j);
						ctx.restore();
					}
				}
			}
		}
		if (animationDecimal.animationGlobal >= 1 && typeof drawMath == "function") {
			drawMath(ctx, config, data, msr, {
				xAxisPosY: xAxisPosY,
				yAxisPosX: yAxisPosX,
				valueHop: valueHop,
				scaleHop: scaleHop,
				zeroY: zeroY,
				calculatedScale: calculatedScale,
				calculateOffset: calculateOffset,
				additionalSpaceBetweenBars: additionalSpaceBetweenBars,
				barWidth: barWidth
			});
		}
	}
517406
private void render(SVG.Rect obj)
   {
      debug("Rect render");

      if (obj.width == null || obj.height == null || obj.width.isZero() || obj.height.isZero())
         return;

      updateStyleForElement(state, obj);

      if (!display())
         return;
      if (!visible())
         return;

      if (obj.transform != null)
         canvas.concat(obj.transform);

      Path  path = makePathAndBoundingBox(obj);
      updateParentBoundingBox(obj);

      checkForGradientsAndPatterns(obj);
      checkForClipPath(obj);

      boolean  compositing = pushLayer();

      if (state.hasFill)
         doFilledPath(obj, path);
      if (state.hasStroke)
         doStroke(path);


      if (compositing)
         popLayer(obj);
   }
1030108
function renderChoices(choices, pointer) {
  var output = '';
  var separatorOffset = 0;

  choices.forEach(function(choice, i) {
    if (choice.type === 'separator') {
      separatorOffset++;
      output += ' ' + choice + '\n';
      return;
    }

    if (choice.disabled) {
      separatorOffset++;
      output += ' - ' + choice.name;
      output += ' (' + (typeof choice.disabled === 'string' ? choice.disabled : 'Disabled') + ')';
    } else {
      var isSelected = (i - separatorOffset === pointer);
      output += isSelected ? utils.chalk.cyan(utils.figures.pointer) : ' ';
      output += getCheckbox(choice.checked) + ' ' + choice.name;
    }

    output += '\n';
  });

  return output.replace(/\n$/, '');
}
923427
function exports(_selection) {
            _selection.each(function(_data){
                chartWidth = width - margin.left - margin.right;
                chartHeight = height - margin.top - margin.bottom;
                data = cleanData(_data);

                buildColorScale();
                buildSVG(this);

                if (isHorizontal) {
                    drawHorizontalLegend();
                } else {
                    drawVerticalLegend();
                }

                if (highlightedEntryId) {
                    cleanFadedLines();
                    fadeLinesBut(highlightedEntryId);
                }
            });
        }
930448
function drawBars(table) {
        var tableDetails = getTableDetails(table);
        var tableGrid = getTableGrid(tableDetails);
        var rows = getRowBlocks(tableGrid);
        var cols = getColumnBlocks(tableGrid);

        var tablePosition = editor.dom.getPos(table);
        var rowPositions = rows.length > 0 ? findPositions(getTopEdge, getBottomEdge, rows) : [];
        var colPositions = cols.length > 0 ? findPositions(getInnerEdge, getOuterEdge, cols) : [];

        drawRows(rowPositions, table.offsetWidth, tablePosition);
        drawCols(colPositions, table.offsetHeight, tablePosition);
      }
1148721
function verticalBarsTween(d) {
            let node = d3Selection.select(this),
                i = d3Interpolate.interpolateRound(0, chartHeight - yScale(getValue(d))),
                y = d3Interpolate.interpolateRound(chartHeight, yScale(getValue(d))),
                j = d3Interpolate.interpolateNumber(0, 1);

            return function (t) {
                node.attr('y', y(t))
                    .attr('height', i(t)).style('opacity', j(t));
            }
        }
1056296
function renderChoices( pointer ) {
  var output = "";
  var separatorOffset = 0;

  this.choices.forEach(function( choice, i ) {
    if ( choice.type === "separator" ) {
      separatorOffset++;
      output += " " + choice + "\n";
      return;
    }

    if ( choice.disabled ) {
      separatorOffset++;
      output += " - " + choice.name;
      output += " (" + (_.isString(choice.disabled) ? choice.disabled : "Disabled") + ")";
    } else {
      var isSelected = (i - separatorOffset === pointer);
      output += isSelected ? chalk.cyan(utils.getPointer()) : " ";
      output += utils.getCheckbox( choice.checked, choice.name );
    }

    output += "\n";
  }.bind(this));

  return output.replace(/\n$/, "");
}
403090
function render(code, data) {
  var js = '```js' + code + '```'
  return `<div class="vomit-snippet"><div class="column">${marked(js)}</div><div class="column"><script>
(function() {${code}document.currentScript.parentElement.appendChild(component(${JSON.stringify(data.data)}))
})()</script></div></div>`
}