<commit_before>import * as React from 'react';
import { IHour } from '../../models/Hour';
import { Map } from 'immutable';
import { Tooltip, LineChart, XAxis, YAxis, Legend, Line } from 'recharts';
import styled from 'styled-components';

const mapToChartData = (hours: Map<number, IHour>) => {
  let data = [];
  hours.toIndexedSeq().forEach(hour => {
    if (hour.forecast && hour.sensors[0] && hour.prediction) {
      const hourForGraph = {
        name: hour.number,
        temperature: hour.sensors[0].value,
        forecast: hour.forecast.temperature,
        heat: hour.prediction.heat,
      };
      data.push(hourForGraph);
    }
  });
  return data;
};
const StyledCharts = styled.div`
  position:absolute;
`;
const StyledOneChart: any = styled.div`
  position:absolute;
  top:${(props: any) => props.top}px
  left:${(props: any) => props.left || '0'}px
  right:${(props: any) => props.right || '0'}px
`;
export const DayCharts = (
  props: {
    hours: Map<number, IHour>,
  }
) => (
  <StyledCharts>
    <StyledOneChart right={60}>
      <LineChart width={730} height={250} data={mapToChartData(props.hours)}>
        <XAxis dataKey="name" />
        <YAxis />
        <Tooltip />
        <Legend align="left" />
        <Line type="monotone" dataKey="temperature" stroke="#8884d8" />
        <Line type="monotone" dataKey="forecast" stroke="#82ca9d" />
      </LineChart>
    </StyledOneChart>
    <StyledOneChart top={50} left={60}>
      <LineChart width={730} height={200} data={mapToChartData(props.hours)}>
        <XAxis dataKey="name" />
        <YAxis orientation="right" />
        <Tooltip />
        <Legend align="right" />
        <Line type="monotone" dataKey="heat" stroke="red" />
      </LineChart>
    </StyledOneChart>
  </StyledCharts>
);<commit_msg>charts zindex<commit_after>import * as React from "react";
import { IHour } from "../../models/Hour";
import { Map } from "immutable";
import { Legend, Line, LineChart, Tooltip, XAxis, YAxis } from "recharts";
import styled from "styled-components";

const mapToChartData = (hours: Map<number, IHour>) => {
  let data = [];
  hours.toIndexedSeq().forEach(hour => {
    if (hour.forecast && hour.sensors[0] && hour.prediction) {
      const hourForGraph = {
        name: hour.number,
        temperature: hour.sensors[0].value,
        forecast: hour.forecast.temperature,
        heat: hour.prediction.heat,
      };
      data.push(hourForGraph);
    }
  });
  return data;
};
const StyledCharts = styled.div`
  position:absolute;
`;
const StyledOneChart: any = styled.div`
  position:absolute;
  top:${(props: any) => props.top}px
  left:${(props: any) => props.left || '0'}px
  right:${(props: any) => props.right || '0'}px
`;
const zIndexStyle = {zIndex: 9000}
export const DayCharts = (props: {
  hours: Map<number, IHour>,
}) => (
  <StyledCharts>
    <StyledOneChart right={60}>
      <LineChart width={730} height={250} data={mapToChartData(props.hours)}>
        <XAxis dataKey="name"/>
        <YAxis />
        <Tooltip wrapperStyle={zIndexStyle}/>
        <Legend align="left"/>
        <Line type="monotone" dataKey="temperature" stroke="#8884d8"/>
        <Line type="monotone" dataKey="forecast" stroke="#82ca9d"/>
      </LineChart>
    </StyledOneChart>
    <StyledOneChart top={50} left={60}>
      <LineChart width={730} height={200} data={mapToChartData(props.hours)}>
        <XAxis dataKey="name"/>
        <YAxis orientation="right"/>
        <Tooltip />
        <Legend align="right"/>
        <Line type="monotone" dataKey="heat" stroke="red"/>
      </LineChart>
    </StyledOneChart>
  </StyledCharts>
);
{'fraction_non_alphanumeric': 0.172147001934236, 'fraction_numerical': 0.01768444321635811, 'mean_word_length': 3.2240373395565927, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 61, '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': '346288', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1215, 'n_words': 250}