<commit_before>import React, { Component } from 'react';

export default class ApiLegend extends Component {

  constructor (props) {
    super(props);
    this.state = {
      visible: props.visibility,
      opacity: props.defaultOpacity
    };

    this.generateLegends = this.generateLegends.bind(this);
  }


  generateLegends(items, type, language) {
    switch(type) {
      case 'choropleth':
        return (
          items.map((item, i) => {
            const { name, color, outlineColor } = item;
            console.log(outlineColor);
              return (
                <div className='legend-row' key={`webmap-legend-row-${name[language]}-${i}`}>
                  <div style={{
                    backgroundColor: color,
                    border: `1px solid ${outlineColor}`,
                    opacity: this.state.opacity<commit_msg>Add basic legendd type<commit_after>import React, { Component } from 'react';

export default class ApiLegend extends Component {

  constructor (props) {
    super(props);
    this.state = {
      visible: props.visibility,
      opacity: props.defaultOpacity
    };

    this.generateLegends = this.generateLegends.bind(this);
  }


  generateLegends(items, type, language) {
    switch(type) {
      // note: as configured, "basic" is essentially the same as "choropleth"
      case 'basic':
        return items.map((item, i) => {
          const { name, color, outlineColor } = item;
            return (
              <div className='legend-row' key={`webmap-legend-row-${name[language]}-${i}`}>
                <div style={{
                  backgroundColor: color,
                  border: `1px solid ${outlineColor}`,
                  opacity: this.state.opacity
                }} className='legend-icon'></div>
                <div className='legend-label'>{name[language]}</div>
              </div>
            );
          }
        );

      case 'choropleth':
        return (
          items.map((item, i) => {
            const { name, color, outlineColor } = item;
            console.log(outlineColor);
              return (
                <div className='legend-row' key={`webmap-legend-row-${name[language]}-${i}`}>
                  <div style={{
                    backgroundColor: color,
                    border: `1px solid ${outlineColor}`,
                    opacity: this.state.opacity
{'fraction_non_alphanumeric': 0.12773109243697478, 'fraction_numerical': 0.0012605042016806723, 'mean_word_length': 1.858343337334934, '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': '2000460', 'n_tokens_mistral': 664, 'n_tokens_neox': 636, 'n_words': 140}