This function creates the graph using the selection as container
@param {D3Selection} _selection A d3 selection that represents
the container(s) where the chart(s) will be rendered
@param {Object} _data The data to attach and generate the chart
172017
function exports(_selection) {
            _selection.each(function(_data){
                chartWidth = width - margin.left - margin.right;
                chartHeight = height - margin.top - margin.bottom;
                data = _data;

                buildSVG(this);
            });
        }
608091
function () {
		var selected = timeline.getSelection();
		
		if (selected.length > 0) {
			var row = selected[0].row;
			var item = timeline.getItem(row);
			var id = $(item.content).attr('data-id');
			var layer = layers[id];
			
			if (lastLayer && lastLayer.viewedImage) {
				lastLayer.viewedImage.fire('click');
			}
			
			layer._map.panTo(layer.getLatLng());
			layer.fire('click');
			
			lastLayer = layer;
		}
		
		
	}
839950
function colorBox(selection, label) {
  selection
      .classed('form-row', true)
      .classed('align-items-center', true)
      .on('change', () => {
        // avoid update by mousemove on the colorpicker
        d3.event.stopPropagation();
      });
  selection.append('div')
      .classed('form-group', true)
      .classed('col-form-label', true)
      .classed('col-form-label-sm', true)
      .classed('col-4', true)
      .classed('mb-1', true)
      .text(label);
  selection.append('div')
      .classed('form-group', true)
      .classed('col-form-label', true)
      .classed('col-form-label-sm', true)
      .classed('col-4', true)
      .classed('mb-1', true)
    .append('input')
      .classed('form-control', true)
      .classed('form-control-sm', true)
      .attr('type', 'color');
}
126414
function( data ){

            // interpred data as either dom node or event data
            var el = (data instanceof PIXI.Graphics && data) || (data.body && data.body.view);

            if ( el ){
                // remove view from dom
                this.stage.removeChild( el );
            }

            return this;
        }
1337887
function buildSVG(container) {
            if (!svg) {
                svg = d3Selection.select(container)
                    .append('svg')
                      .classed('britechart bullet-chart', true);

                buildContainerGroups();
            }

            svg
                .attr('width', width)
                .attr('height', height);
        }
1280135
function setupChart(data) {
  var margin = {top: 20, right: 20, bottom: 30, left: 40},
    width = 800 - margin.left - margin.right,
    height = 400 - margin.top - margin.bottom;

  color = d3.scaleInteractive('color', updateChart)
    .scaleSequential(d3.interpolateMagma)
    // .scaleOrdinal(d3.schemeCategory10)
    .domain(d3.extent(data, function (d) { return d.v; }));

  x = d3.scaleInteractive('x', updateChart)
  // x = d3
      .scaleLinear()
      .domain(d3.extent(data, function (d) { return d.x; }))
      .range([0, width]);

  // switch to this for time
  // x = d3.scaleInteractive('x', updateChart)
  // // x = d3
      // .scaleTime()
      // .domain(d3.extent(data, function (d) { return d.x; }))
      // .range([0, width]);


  // switch to this for categorical and comment out x.domain(d3.extent ...) below
  // x = d3.scaleInteractive('cat', updateChart)
  // // x = d3
      // .scalePoint()
      // .domain(categories)
      // .range([0, width]);

  y = d3.scaleInteractive('y', updateChart)
  // y = d3
      .scaleLinear()
      .domain(d3.extent(data, function (d) { return d.y; }))
      .range([height, 0]);


  xAxis = d3.axisBottom(x);
  yAxis = d3.axisLeft(y);

  svg = d3.select('.chart-container').append('svg')
      .attr('width', width + margin.left + margin.right)
      .attr('height', height + margin.top + margin.bottom)
    .append('g')
      .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');


  x.domain(d3.extent(data, function(d) { return d.x; })).nice(); // comment this out for categorical
  y.domain(d3.extent(data, function(d) { return d.y; })).nice();

  svg.append('g')
      .attr('class', 'x axis')
      .attr('transform', 'translate(0,' + height + ')')

  svg.append('g')
      .attr('class', 'y axis')

  updateChart(data);
}
182982
function() {

            var self = this;

            var panel =
'<div class="panel panel-success">' +
'  <div class="panel-heading">' +
'    visual data dashboard mockups' +
'  </div>' +
'  <div class="panel-body">' +
'    <div class="row">' +
// the visual chart.
'      <div class="col-md-8">' +
'        <div id="' + self.getId('chart') + '">Charts</div>' +
'      </div>' +
// the information column
'      <div class="col-md-4">' +
'        <div id="' + self.getId('summary') + '">Summary</div>' +
'      </div>' +
'    </div>' +
'  </div>' +
'  <div class="panel-footer">' +
'    visual data footer mockups' +
'  </div>' +
'</div>';

            $('#' + self.attrId).html(panel);

            // Draw the chart,
            $('#' + self.getId('chart')).html('')
              .bilevelSunburst({date: self.options.date},
                               self.treemapData);
        }
103061
function drawDataReferencePoints() {
            // Creates Dots on Data points
            var points = svg.select('.chart-group').selectAll('.dots')
                .data(layers)
                .enter()
                  .append('g')
                    .attr('class', 'dots')
                    .attr('d', ({values}) => area(values))
                    .attr('clip-path', 'url(#clip)');

            // Processes the points
            // TODO: Optimize this code
            points.selectAll('.dot')
                .data(({values}, index) => values.map((point) => ({index, point})))
                .enter()
                  .append('circle')
                    .attr('class','dot')
                    .attr('r', () => pointsSize)
                    .attr('fill', () => pointsColor)
                    .attr('stroke-width', '0')
                    .attr('stroke', pointsBorderColor)
                    .attr('transform', function(d) {
                        let {point} = d;
                        let key = xScale(point.date);

                        dataPoints[key] = dataPoints[key] || [];
                        dataPoints[key].push(d);

                        let {date, y, y0} = point;

                        return `translate( ${xScale(date)}, ${yScale(y + y0)} )`;
                    });
        }
167926
def draw_js(element_id)
      js = ""
      js << "\n  function #{chart_function_name(element_id)}() {"
      js << "\n    #{@data_table.to_js}"
      js << "\n    var chart = new google.#{chart_class}.#{chart_name}(document.getElementById('#{element_id}'));"
      @listeners.each do |listener|
        js << "\n    google.visualization.events.addListener(chart, '#{listener[:event]}', #{listener[:callback]});"
      end
      js << "\n    chart.draw(data_table, #{js_parameters(@options)});"
      js << "\n  };"
      js
    end
254135
function(data, options, add_to_container) {
		
		TL.Util.setData(this, data);
		
		// Merge Options
		TL.Util.mergeData(this.options, options);
		
		this._el.container = TL.Dom.create("div", "tl-text");
		this._el.container.id = this.data.unique_id;
		
		this._initLayout();
		
		if (add_to_container) {
			add_to_container.appendChild(this._el.container);
		};
		
	}
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();
            }

        }
898106
function(data) {
		
		// DOM ELEMENTS
		this._el = {
			parent: {},
			container: {},
			message: {}
		};
		
		//Options
		this.options = {
			width: 					600,
			height: 				600
		};
		
		// Data
		this.data = {
			label: "",
			rows: 1
		};
		
		
		this._el.container = TL.Dom.create("div", "tl-timegroup"); 
		
		// Merge Data
		TL.Util.mergeData(this.data, data);
		
		// Animation
		this.animator = {};
		
		
		this._initLayout();
		this._initEvents();
	}
68955
function(data) {

    let xZero = data.xZero;
    const yZero = data.yZero;
    const n = data.n;
    const k = data.k;
    const selection = data.selection;
    // and checks the prev and next row for selection  -> no borders in a selection
    const mPrevSel= data.mPrevSel;
    const mNextSel = data.mNextSel;

    // get the length of this selection
    let selectionLength = 0;
    const end = data.model.get("seq").length - 1;
    for (let i = n; i <= end; i++) {
      if (selection.indexOf(i) >= 0) {
        selectionLength++;
      } else {
        break;
      }
    }

    // TODO: ugly!
    const boxWidth = this.g.zoomer.get("columnWidth");
    const boxHeight = this.g.zoomer.get("rowHeight");
    const totalWidth = (boxWidth * selectionLength) + 1;

    const hidden = this.g.columns.get('hidden');

    this.ctx.beginPath();
    const beforeWidth = this.ctx.lineWidth;
    this.ctx.lineWidth = 3;
    const beforeStyle = this.ctx.strokeStyle;
    this.ctx.strokeStyle = "#FF0000";

    xZero += k * boxWidth;

    // split up the selection into single cells
    let xPart = 0;
    const end1 = selectionLength - 1;
    for (let i = 0; i <= end1; i++) {
      let xPos = n + i;
      if (hidden.indexOf(xPos) >= 0) {
        continue;
      }
      // upper line
      if (!((typeof mPrevSel !== "undefined" && mPrevSel !== null) && mPrevSel.indexOf(xPos) >= 0)) {
        this.ctx.moveTo(xZero + xPart, yZero);
        this.ctx.lineTo(xPart + boxWidth + xZero, yZero);
      }
      // lower line
      if (!((typeof mNextSel !== "undefined" && mNextSel !== null) && mNextSel.indexOf(xPos) >= 0)) {
        this.ctx.moveTo(xPart + xZero, boxHeight + yZero);
        this.ctx.lineTo(xPart + boxWidth + xZero, boxHeight + yZero);
      }

      xPart += boxWidth;
    }

    // left
    this.ctx.moveTo(xZero,yZero);
    this.ctx.lineTo(xZero, boxHeight + yZero);

    // right
    this.ctx.moveTo(xZero + totalWidth,yZero);
    this.ctx.lineTo(xZero + totalWidth, boxHeight + yZero);

    this.ctx.stroke();
    this.ctx.strokeStyle = beforeStyle;
    return this.ctx.lineWidth = beforeWidth;
  }
248261
function setNewDataTypes() {
    let chartType = getCurrentType();
    let dataTypes = Object.keys(defaultData[chartType]);

    let dataSelector = d3.select(`.${dataSelectorClass}`)
        .selectAll('option')
        .data(dataTypes);

    dataSelector.enter().append('option')
        .merge(dataSelector)
            .attr('value', (d) => d)
            .text((d) => d);

    dataSelector.exit().remove();
}
957674
def on_plot_select(self,event):
        
        if not self.xdata or not self.ydata: return
        pos=event.GetPosition()
        width, height = self.canvas.get_width_height()
        pos[1] = height - pos[1]
        xpick_data,ypick_data = pos
        xdata_org = self.xdata
        ydata_org = self.ydata
        data_corrected = self.map.transData.transform(vstack([xdata_org,ydata_org]).T)
        xdata,ydata = data_corrected.T
        xdata = list(map(float,xdata))
        ydata = list(map(float,ydata))
        e = 4e0

        index = None
        for i,(x,y) in enumerate(zip(xdata,ydata)):
            if 0 < sqrt((x-xpick_data)**2. + (y-ypick_data)**2.) < e:
                index = i
                break
        if index==None: print("Couldn't find point %.1f,%.1f"%(xpick_data,ypick_data))

        self.change_selected(index)
1293765
function ($appendTo, data) {
      var that = this;
      var opts = this.options;
      var level = 0;
      if (data.level) {
        level = data.level;
      } else {
        level = data.level = $appendTo.parentsUntil('.orgchart', '.nodes').length + 1;
      }
      // Construct the node
      var childrenData = data.children;
      var hasChildren = childrenData ? childrenData.length : false;
      var $nodeWrapper;
      if (Object.keys(data).length > 2) {
        var $nodeDiv = this.createNode(data);
        if (opts.verticalLevel && level >= opts.verticalLevel) {
          $appendTo.append($nodeDiv);
        }else {
          $nodeWrapper = $('<table>');
          $appendTo.append($nodeWrapper.append($('<tr/>').append($('<td' + (hasChildren ? ' colspan="' + childrenData.length * 2 + '"' : '') + '></td>').append($nodeDiv))));
        }
      }
      // Construct the lower level(two "connectiong lines" rows and "inferior nodes" row)
      if (hasChildren) {
        var isHidden = (level + 1 > opts.visibleLevel || data.collapsed) ? ' hidden' : '';
        var isVerticalLayer = (opts.verticalLevel && (level + 1) >= opts.verticalLevel) ? true : false;
        var $nodesLayer;
        if (isVerticalLayer) {
          $nodesLayer = $('<ul>');
          if (isHidden && level + 1 > opts.verticalLevel) {
            $nodesLayer.addClass(isHidden);
          }
          if (level + 1 === opts.verticalLevel) {
            $appendTo.children('table').append('<tr class="verticalNodes' + isHidden + '"><td></td></tr>')
              .find('.verticalNodes').children().append($nodesLayer);
          } else {
            $appendTo.append($nodesLayer);
          }
        } else {
          var $upperLines = $('<tr class="lines' + isHidden + '"><td colspan="' + childrenData.length * 2 + '"><div class="downLine"></div></td></tr>');
          var lowerLines = '<tr class="lines' + isHidden + '"><td class="rightLine"></td>';
          for (var i=1; i<childrenData.length; i++) {
            lowerLines += '<td class="leftLine topLine"></td><td class="rightLine topLine"></td>';
          }
          lowerLines += '<td class="leftLine"></td></tr>';
          $nodesLayer = $('<tr class="nodes' + isHidden + '">');
          if (Object.keys(data).length === 2) {
            $appendTo.append($upperLines).append(lowerLines).append($nodesLayer);
          } else {
            $nodeWrapper.append($upperLines).append(lowerLines).append($nodesLayer);
          }
        }
        // recurse through children nodes
        $.each(childrenData, function () {
          var $nodeCell = isVerticalLayer ? $('<li>') : $('<td colspan="2">');
          $nodesLayer.append($nodeCell);
          this.level = level + 1;
          that.buildHierarchy($nodeCell, this);
        });
      }
    }
32161
function() {

    this.selection.fireSelectEvent('selecting');

    var s = this.selection.selection,
      octx = this.octx,
      options = this.options,
      plotOffset = this.plotOffset,
      prevSelection = this.selection.prevSelection;
    
    if (prevSelection &&
      s.first.x == prevSelection.first.x &&
      s.first.y == prevSelection.first.y && 
      s.second.x == prevSelection.second.x &&
      s.second.y == prevSelection.second.y) {
      return;
    }

    octx.save();
    octx.strokeStyle = this.processColor(options.selection.color, {opacity: 0.8});
    octx.lineWidth = 1;
    octx.lineJoin = 'miter';
    octx.fillStyle = this.processColor(options.selection.color, {opacity: 0.4});

    this.selection.prevSelection = {
      first: { x: s.first.x, y: s.first.y },
      second: { x: s.second.x, y: s.second.y }
    };

    var x = Math.min(s.first.x, s.second.x),
        y = Math.min(s.first.y, s.second.y),
        w = Math.abs(s.second.x - s.first.x),
        h = Math.abs(s.second.y - s.first.y);

    octx.fillRect(x + plotOffset.left+0.5, y + plotOffset.top+0.5, w, h);
    octx.strokeRect(x + plotOffset.left+0.5, y + plotOffset.top+0.5, w, h);
    octx.restore();
  }