<commit_before>import React, { PropTypes } from "react";
import { Helpers, VictoryLabel } from "victory-core";
import merge from "lodash/object/merge";
import assign from "lodash/object/assign";

export default class SliceLabel extends React.Component {
  static propTypes = {
    labelComponent: PropTypes.any,
    positionFunction: PropTypes.func,
    slice: PropTypes.object,
    style: PropTypes.object
  };

  renderLabelComponent(props, position, label) {
    const component = props.labelComponent;
    const style = Helpers.evaluateStyle(
      merge({padding: 0}, props.style, component.props.style),
      this.data
    );
    const children = component.props.children || label;
    const newProps = {
      x: component.props.x || position[0],
      y: component.props.y || position[1],
      data: props.slice.data, // Pass data for custom label component to access
      textAnchor: component.props.textAnchor || "start",
      verticalAnchor: component.props.verticalAnchor || "middle",
      style
    };
    return React.cloneElement(component, newProps, children);
  }

  renderVictoryLabel(props, position, label) {
    const style = Helpers.evaluateStyle(
      assign({padding: 0}, props.style),
      props.slice.data
    );
    return (
      <VictoryLabel
        x={position[0]}
        y={position[1]}
        data={props.slice.data}
        style={style}
      >
        {label}
      </VictoryLabel>
    );
  }

  renderLabel(props) {
    const position = props.positionFunction(props.slice);
    const data = props.slice.data;
    const dataLabel = data.xName ? `${data.xName}` : `${data.x}`;
    const label = data.label ?
    `${Helpers.evaluateProp(data.label, data)}` : dataLabel;
    return props.labelComponent ?
      this.renderLabelComponent(props, position, label) :
      this.renderVictoryLabel(props, position, label);
  }

  render() {
    return this.renderLabel(this.props);
  }
}
<commit_msg>prop data now datum in VictoryLabel<commit_after>import React, { PropTypes } from "react";
import { Helpers, VictoryLabel } from "victory-core";
import merge from "lodash/object/merge";
import assign from "lodash/object/assign";

export default class SliceLabel extends React.Component {
  static propTypes = {
    labelComponent: PropTypes.any,
    positionFunction: PropTypes.func,
    slice: PropTypes.object,
    style: PropTypes.object
  };

  renderLabelComponent(props, position, label) {
    const component = props.labelComponent;
    const style = Helpers.evaluateStyle(
      merge({padding: 0}, props.style, component.props.style),
      this.data
    );
    const children = component.props.children || label;
    const newProps = {
      x: component.props.x || position[0],
      y: component.props.y || position[1],
      data: props.slice.data, // Pass data for custom label component to access
      textAnchor: component.props.textAnchor || "start",
      verticalAnchor: component.props.verticalAnchor || "middle",
      style
    };
    return React.cloneElement(component, newProps, children);
  }

  renderVictoryLabel(props, position, label) {
    const style = Helpers.evaluateStyle(
      assign({padding: 0}, props.style),
      props.slice.data
    );
    return (
      <VictoryLabel
        x={position[0]}
        y={position[1]}
        datum={props.slice.data}
        style={style}
      >
        {label}
      </VictoryLabel>
    );
  }

  renderLabel(props) {
    const position = props.positionFunction(props.slice);
    const data = props.slice.data;
    const dataLabel = data.xName ? `${data.xName}` : `${data.x}`;
    const label = data.label ?
    `${Helpers.evaluateProp(data.label, data)}` : dataLabel;
    return props.labelComponent ?
      this.renderLabelComponent(props, position, label) :
      this.renderVictoryLabel(props, position, label);
  }

  render() {
    return this.renderLabel(this.props);
  }
}

{'fraction_non_alphanumeric': 0.12419810110341288, 'fraction_numerical': 0.003079291762894534, 'mean_word_length': 3.1292372881355934, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2465648', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1146, 'n_words': 261}