<commit_before>define([
  'dojo/_base/declare', 'dojo/_base/lang',
  'dojo/on', 'dojo/topic', 'dojo/dom-construct', 'dojo/dom', 'dojo/query', 'dojo/when', 'dojo/request',
  'dijit/layout/ContentPane', 'dijit/layout/BorderContainer', 'dijit/TooltipDialog', 'dijit/Dialog', 'dijit/popup',
  'dijit/TitlePane', 'dijit/registry', 'dijit/form/Form', 'dijit/form/RadioButton', 'dijit/form/Select', 'dijit/form/Button',
  './ContainerActionBar', './HeatmapContainer', './SelectionToGroup', '../util/PathJoin', 'FileSaver'

], function (
  declare, lang,
  on, Topic, domConstruct, dom, Query, when, request,
  ContentPane, BorderContainer, TooltipDialog, Dialog, popup,
  TitlePane, registry, Form, RadioButton, Select, Button,
  ContainerActionBar, HeatmapContainer, SelectionToGroup, PathJoin, saveAs
) {

  return declare([BorderContainer, HeatmapContainer], {
    gutters: false,
    state: null,
    visible: false,
    pmState: null,
    containerActions: [
      [<commit_msg>add legend on pathway viewer heatmap. resolves PATRIC3/patric3_website#1668<commit_after>define([
  'dojo/_base/declare', 'dojo/_base/lang',
  'dojo/on', 'dojo/topic', 'dojo/dom-construct', 'dojo/dom', 'dojo/query', 'dojo/when', 'dojo/request',
  'dijit/layout/ContentPane', 'dijit/layout/BorderContainer', 'dijit/TooltipDialog', 'dijit/Dialog', 'dijit/popup',
  'dijit/TitlePane', 'dijit/registry', 'dijit/form/Form', 'dijit/form/RadioButton', 'dijit/form/Select', 'dijit/form/Button',
  './ContainerActionBar', './HeatmapContainer', './SelectionToGroup', '../util/PathJoin', 'FileSaver'

], function (
  declare, lang,
  on, Topic, domConstruct, dom, Query, when, request,
  ContentPane, BorderContainer, TooltipDialog, Dialog, popup,
  TitlePane, registry, Form, RadioButton, Select, Button,
  ContainerActionBar, HeatmapContainer, SelectionToGroup, PathJoin, saveAs
) {

  var legend = [
    '<div>',
    '<h5>HeatMap Cells</h5>',
    '<p>Cell color represents the number of proteins <br/> from a specific genome in a given pathway.</p>',
    '<br>',
    '<span class="heatmap-legend-entry black"></span>',
    '<span class="heatmap-legend-label">0</span>',
    '<div class="clear"></div>',
    '<span class="heatmap-legend-entry yellow"></span>',
    '<span class="heatmap-legend-label">1</span>',
    '<div class="clear"></div>',
    '<span class="heatmap-legend-entry orange"></span>',
    '<span class="heatmap-legend-label">2</span>',
    '<div class="clear"></div>',
    '<span class="heatmap-legend-entry red"></span>',
    '<span class="heatmap-legend-label">3+</span>',
    '<div class="clear"></div>',
    '</div>'
  ].join('\n');

  return declare([BorderContainer, HeatmapContainer], {
    gutters: false,
    state: null,
    visible: false,
    pmState: null,
    containerActions: [
      [
        'Legend',
        'fa icon-bars fa-2x',
        { label: 'Legend', multiple: false, validTypes: ['*'] },
        function () {
          if (this.containerActionBar._actions.Legend.options.tooltipDialog == null) {
            this.tooltip_legend = new TooltipDialog({
              content: legend
            });
            this.containerActionBar._actions.Legend.options.tooltipDialog = this.tooltip_legend;
          }

          if (this.isPopupOpen) {
            this.isPopupOpen = false;
            popup.close();
          } else {
            popup.open({
              parent: this,
              popup: this.containerActionBar._actions.Legend.options.tooltipDialog,
              around: this.containerActionBar._actions.Legend.button,
              orient: ['below']
            });
            this.isPopupOpen = true;
          }
        },
        true
      ],
      [
{'fraction_non_alphanumeric': 0.1701086956521739, 'fraction_numerical': 0.003532608695652174, 'mean_word_length': 3.310304449648712, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '4326233', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1191, 'n_words': 225}