<commit_before>import * as d3 from 'd3'
import * as ev from '../../../events'
import { moveTooltipTo } from '../../../utilities/mouse'

/**
 * Side buttons in control panel
 */
export default class ControlButtons {
  constructor (panelSelection, infoTooltip, panelConfig) {
    let navControls = panelSelection.append('div')
        .attr('class', 'nav-controls')

    let buttonData = [
      {
        name: 'legendBtn',
        iconText: '☰',
        tooltipText: 'Toggle Legend',
        event: ev.TOGGLE_LEGEND
      },
      {
        name: 'backBtn',
        iconText: '🡸',
        tooltipText: 'Move backward',
        event: ev.MOVE_PREV
      },
      {
        name: 'nextBtn',
        iconText: '🡺',
        tooltipText: 'Move forward',
        event: ev.MOVE_NEXT
      }
    ]

    // Save all the buttons for toggling state and stuff
    let buttons = buttonData.map(data => {
      let btn = navControls.append('div')
          .classed('btn', true)
          .text(data.iconText)
      btn
        .on('mouseover', () => infoTooltip.show())
        .on('mouseout', () => infoTooltip.hide())
        .on('mousemove', function () {
          infoTooltip.renderText({
            title: null,
            text: data.tooltipText
          })
          moveTooltipTo(infoTooltip, d3.select(this), 'left')
        })
        .on('click', () => ev.publish(data.event, {}))
      return btn
    })

    this.legendBtn = buttons[0]
    // this.legendBtn.classed('active', true)
  }

  toggleLegendBtn () {
    this.legendBtn.classed('active', !this.legendBtn.classed('active'))
  }
}<commit_msg>Remove legend toggle comment<commit_after>import * as d3 from 'd3'
import * as ev from '../../../events'
import { moveTooltipTo } from '../../../utilities/mouse'

/**
 * Side buttons in control panel
 */
export default class ControlButtons {
  constructor (panelSelection, infoTooltip, panelConfig) {
    let navControls = panelSelection.append('div')
        .attr('class', 'nav-controls')

    let buttonData = [
      {
        name: 'legendBtn',
        iconText: '☰',
        tooltipText: 'Toggle Legend',
        event: ev.TOGGLE_LEGEND
      },
      {
        name: 'backBtn',
        iconText: '🡸',
        tooltipText: 'Move backward',
        event: ev.MOVE_PREV
      },
      {
        name: 'nextBtn',
        iconText: '🡺',
        tooltipText: 'Move forward',
        event: ev.MOVE_NEXT
      }
    ]

    // Save all the buttons for toggling state and stuff
    let buttons = buttonData.map(data => {
      let btn = navControls.append('div')
          .classed('btn', true)
          .text(data.iconText)
      btn
        .on('mouseover', () => infoTooltip.show())
        .on('mouseout', () => infoTooltip.hide())
        .on('mousemove', function () {
          infoTooltip.renderText({
            title: null,
            text: data.tooltipText
          })
          moveTooltipTo(infoTooltip, d3.select(this), 'left')
        })
        .on('click', () => ev.publish(data.event, {}))
      return btn
    })

    this.legendBtn = buttons[0]
  }

  toggleLegendBtn () {
    this.legendBtn.classed('active', !this.legendBtn.classed('active'))
  }
}
{'fraction_non_alphanumeric': 0.15149606299212598, 'fraction_numerical': 0.0025196850393700786, 'mean_word_length': 2.0509125840537945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3745759', 'n_tokens_mistral': 980, 'n_tokens_neox': 975, 'n_words': 211}