<commit_before>import React from 'react';
import d3 from 'd3';
import DataCircles from './data-circles';
import XYAxis from './x-y-axis';

const xMax = (data) => d3.max(data, (d) => d[0]);
const yMax = (data) => d3.max(data, (d) => d[1]);
const xScale = (props) => {
  // return the mean salary & equity from each of the objects
  const arr = props.job.map(function(obj) {
    return obj.mean;
  });
  // create the x axis values
  return d3.scale.linear()
    .domain([0, xMax(arr)])
    .range([props.padding, props.width - props.padding * 2]);
};

const yScale = (props) => {
  // return the mean salary & equity from each of the objects
  const arr = props.job.map(function(obj) {
    return obj.mean;
  });
  // create the y axis values
  return d3.scale.linear()
    .domain([0, yMax(arr)])
    .range([props.height - props.padding, props.padding]);
};

const marshalProps = (props) => {
  const scales = {
    xScale: xScale(props),
    yScale: yScale(props),
  };

  return Object.assign({}, props, scales);
};

export default (props) => {
  console.log('inside scatterplot');
  console.log(props);
  // add xScale and yScale to props before passing it further
  const d3Props = marshalProps(props);
  return <svg width={d3Props.width} height={d3Props.height}>
          <DataCircles {...d3Props} update={props.update}/>
          <XYAxis {...d3Props}/><commit_msg>(chore) Remove unneccessary console logs<commit_after>import React from 'react';
import d3 from 'd3';
import DataCircles from './data-circles';
import XYAxis from './x-y-axis';

const xMax = (data) => d3.max(data, (d) => d[0]);
const yMax = (data) => d3.max(data, (d) => d[1]);
const xScale = (props) => {
  // return the mean salary & equity from each of the objects
  const arr = props.job.map(function(obj) {
    return obj.mean;
  });
  // create the x axis values
  return d3.scale.linear()
    .domain([0, xMax(arr)])
    .range([props.padding, props.width - props.padding * 2]);
};

const yScale = (props) => {
  // return the mean salary & equity from each of the objects
  const arr = props.job.map(function(obj) {
    return obj.mean;
  });
  // create the y axis values
  return d3.scale.linear()
    .domain([0, yMax(arr)])
    .range([props.height - props.padding, props.padding]);
};

const marshalProps = (props) => {
  const scales = {
    xScale: xScale(props),
    yScale: yScale(props),
  };

  return Object.assign({}, props, scales);
};

export default (props) => {
  // add xScale and yScale to props before passing it further
  const d3Props = marshalProps(props);
  return <svg width={d3Props.width} height={d3Props.height}>
          <DataCircles {...d3Props} update={props.update}/>
          <XYAxis {...d3Props}/>
{'fraction_non_alphanumeric': 0.16654384672070743, 'fraction_numerical': 0.011790714812085483, 'mean_word_length': 3.3095238095238093, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, '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': '3722631', 'n_tokens_mistral': 921, 'n_tokens_neox': 912, 'n_words': 260}