<commit_before>/**
 * Copyright 2012 <NAME>
 *
 * This file is part of VisuGps3
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 */

/**
 * @fileoverview An overlay is composed of multiple overlying layers.
 * @author <NAME> <<EMAIL>>
 */

goog.provide('vgps3.chart.Overlays');

goog.require('goog.array');
goog.require('goog.events.EventType');
goog.require('goog.style');
goog.require('goog.ui.Component');



/**
 * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper.
 * @constructor
 * @extends {goog.ui.Component}
 */
vgps3.chart.Overlays = function(opt_domHelper) {
  goog.base(this, opt_domHelper);

  /**
  * @type {Array.<Element>} The layers composing this overlay
  * @private
  */
  this.layers_ = [];

  /**
  * @type {!Element} The cursor div
  * @private
  */
  this.cursor_;
};
goog.inherits(vgps3.chart.Overlays, goog.ui.Component);


/**
 * Adds a layer to the set of overlays.
 *
 * The first layer has an opacity set to 0.9 and subsequent ones to 0.3.
 * The layers are added with a decreasing z-index (starting from 100).
 *
 * @return {Element} The layer div.
 */
vgps3.chart.Overlays.prototype.addLayer = function() {
  if (!this.isInDocument()) {
    throw Error(goog.ui.Component.Error.NOT_IN_DOCUMENT);
  }
  var el = this.getDomHelper().createDom('div', 'vgps3-chart-overlay');
  goog.style.setOpacity(el, this.layers_.length > 0 ? 0.3 : 0.9);
  goog.style.setStyle(el, 'zIndex', -this.layers_.length);
  goog.dom.appendChild(this.getElement(), el);
  this.layers_.push(el);
  return el;
};


/**
 * Set the cursor position.
 *
 * @param {number} position 0...1.
 */
vgps3.chart.Overlays.prototype.moveTo = function(position) {
  var width = goog.style.getSize(this.getElement()).width;
  goog.style.setPosition(this.cursor_, Math.round(width * position));
};<commit_msg>[overlays] set all opacity to .9 for all layers<commit_after>/**
 * Copyright 2012 <NAME>
 *
 * This file is part of VisuGps3
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 */

/**
 * @fileoverview An overlay is composed of multiple overlying layers.
 * @author <NAME> <<EMAIL>>
 */

goog.provide('vgps3.chart.Overlays');

goog.require('goog.array');
goog.require('goog.events.EventType');
goog.require('goog.style');
goog.require('goog.ui.Component');



/**
 * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper.
 * @constructor
 * @extends {goog.ui.Component}
 */
vgps3.chart.Overlays = function(opt_domHelper) {
  goog.base(this, opt_domHelper);

  /**
  * @type {Array.<Element>} The layers composing this overlay
  * @private
  */
  this.layers_ = [];

  /**
  * @type {!Element} The cursor div
  * @private
  */
  this.cursor_;
};
goog.inherits(vgps3.chart.Overlays, goog.ui.Component);


/**
 * Adds a layer to the set of overlays.
 *
 * The first layer has an opacity set to 0.9 and subsequent ones to 0.3.
 * The layers are added with a decreasing z-index (starting from 100).
 *
 * @return {Element} The layer div.
 */
vgps3.chart.Overlays.prototype.addLayer = function() {
  if (!this.isInDocument()) {
    throw Error(goog.ui.Component.Error.NOT_IN_DOCUMENT);
  }
  var el = this.getDomHelper().createDom('div', 'vgps3-chart-overlay');
  goog.style.setOpacity(el, 0.9);
  goog.style.setStyle(el, 'zIndex', -this.layers_.length);
  goog.dom.appendChild(this.getElement(), el);
  this.layers_.push(el);
  return el;
};


/**
 * Set the cursor position.
 *
 * @param {number} position 0...1.
 */
vgps3.chart.Overlays.prototype.moveTo = function(position) {
  var width = goog.style.getSize(this.getElement()).width;
  goog.style.setPosition(this.cursor_, Math.round(width * position));
};
{'fraction_non_alphanumeric': 0.15690928270042195, 'fraction_numerical': 0.012658227848101266, 'mean_word_length': 3.831847133757962, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2959424', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1260, 'n_words': 313}