<commit_before>part of periodic_table;

class CategoryButton extends Sprite {

  Map category;

  CategoryButton(this.category) {

    var name = this.category["name"];
    var color = int.parse(category["color"], radix: 16) | 0xFF000000;

    this.pivotX = 80;
    this.pivotY = 50;
    this.scaleX = 0.5;
    this.scaleY = 0.5;
    this.useHandCursor = true;
    this.mouseChildren = false;

    this.graphics.beginPath();
    this.graphics.rectRound(6, 6, 148, 88, 8, 8);
    this.graphics.closePath();
    this.graphics.fillColor(color);
    this.graphics.strokeColor(Color.Black, 1);

    var font =  "Open Sans, Helvetica Neue, Helvetica, Arial, sans-serif";
    var textFormat = new TextFormat(font, 20, Color.Black, bold:true,
        align: TextFormatAlign.CENTER);

    var textField = new TextField()
      ..defaultTextFormat = textFormat
      ..x = 5
      ..y = 12
      ..wordWrap = true
      ..multiline = true
      ..width = 150
      ..height= 100
      ..cacheAsBitmap = false
      ..mouseEnabled = false
      ..text = name;

    textField.height = textField.textHeight + 1;
    textField.y = (100 -textField.textHeight) ~/ 2;

    addChild(textField);
    applyCache(0, 0, 200, 100);
  }

  //-----------------------------------------------------------------------------------------------
  //-----------------------------------------------------------------------------------------------

  animateTo(num scale, num alpha) {
    var juggler = this.stage.juggler;
    juggler.removeTweens(this);

    juggler.tween(this, 0.25, TransitionFunction.easeOutQuadratic)
      ..animate.scaleX.to(scale)
      ..animate.scaleY.to(scale)<commit_msg>Minor code beautification<commit_after>part of periodic_table;

class CategoryButton extends Sprite {

  Map category;

  CategoryButton(this.category) {

    var name = this.category["name"];
    var color = int.parse(category["color"], radix: 16) | 0xFF000000;

    this.pivotX = 80;
    this.pivotY = 50;
    this.scaleX = 0.5;
    this.scaleY = 0.5;
    this.useHandCursor = true;
    this.mouseChildren = false;

    this.graphics.beginPath();
    this.graphics.rectRound(6, 6, 148, 88, 8, 8);
    this.graphics.closePath();
    this.graphics.fillColor(color);
    this.graphics.strokeColor(Color.Black, 1);

    var font =  "Open Sans, Helvetica Neue, Helvetica, Arial, sans-serif";
    var textFormat = new TextFormat(font, 20, Color.Black, bold:true,
        align: TextFormatAlign.CENTER);

    var textField = new TextField()
      ..defaultTextFormat = textFormat
      ..x = 5
      ..y = 12
      ..wordWrap = true
      ..multiline = true
      ..width = 150
      ..height= 100
      ..cacheAsBitmap = false
      ..mouseEnabled = false
      ..text = name;

    textField.height = textField.textHeight + 1;
    textField.y = (100 -textField.textHeight) ~/ 2;

    addChild(textField);
    applyCache(0, 0, 200, 100);
  }

  //-----------------------------------------------------------------------------------------------
  //-----------------------------------------------------------------------------------------------

  animateTo(num scale, num alpha) {
    this.stage.juggler.removeTweens(this);
    this.stage.juggler.tween(this, 0.25, TransitionFunction.easeOutQuadratic)
      ..animate.scaleX.to(scale)
      ..animate.scaleY.to(scale)
{'fraction_non_alphanumeric': 0.23143973549744515, 'fraction_numerical': 0.032461677186654644, 'mean_word_length': 1.796638655462185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7383413', 'n_tokens_mistral': 1115, 'n_tokens_neox': 982, 'n_words': 216}