<commit_before>import React, { Component } from 'react';
import { Panel, Col, Row, Button } from 'react-bootstrap';
import { VictoryBar, VictoryChart, VictoryAxis } from 'victory';


export default class RoomPage extends Component {
	constructor(props) {
		super(props)
		this.state = {

		}
	}

	render() {
		const roomName = this.props.match.params.roomName;
		return (
			<div className="container-fluid" style={{paddingTop: "20px"}}>
				<Row>
					<StatusPanel roomName={roomName} />
					<ButtonGroup roomName={roomName} />
				</Row>
				<Row>
					<DailyPanel roomName={roomName} />
					<WeeklyPanel roomName={roomName} />
				</Row>
			</div>
		)
	}
}

class DailyChart extends Component {
	constructor() {
		super();
		this.state = {
			data: null,
			updatedAt:null
		}
	}

	componentDidMount() {
	    fetch('/api/rooms/ccc/currentDayDataPoints')
	      .then(response => {
	        if (!response.ok) {
	          console.log('response')
	          console.log(response.status)
	          throw new Error(`status ${response.status}`);
	        }
	        return response.json();
	      }).then(json => {
	        console.log(json);
	        this.setState({
	          data: json.data,
	          updatedAt: json.updated_at
	        })
	      }).catch(e => {
	        throw e;
	      });
	  }

	render() {
		if (!this.state.data) {
			return <div></div>
		}

		// const data = [
		//   {quarter: 1, earnings: 13000},
		//   {quarter: 2, earnings: 16500},
		//   {quarter: 3, earnings: 14250},
		//   {quarter: 4, earnings: 19000}
		// ];
		console.log(this.state.updatedAt);
		updatedAt.setDay(updatedAt.getDay() - 1);
		console.log(this.state.updatedAt);


		// const formattedData = this.state.data.map((dp, index) => {
		// 	return {
		// 		hour: ,
		// 		value: 
		// 	}
		// });

		return (
			<div>
			    <VictoryChart
			        // domainPadding will add space to each side of VictoryBar to
			        // prevent it from overlapping the axis
			        domainPadding={20}>
			        <VictoryAxis
			          // tickValues specifies both the number of ticks and where
			          // they are placed on the axis
			          tickValues={[1, 2, 3, 4]}
			          tickFormat={["Quarter 1", "Quarter 2", "Quarter 3", "Quarter 4"]}
			        />
			        <VictoryAxis
			          dependentAxis
			          // tickFormat specifies how ticks should be displayed
			          tickFormat={(x) => (`$${x / 1000}k`)}
			        />
			        <VictoryBar
			          data={this.state.data}
			          x="quarter"<commit_msg>I hate qualcomm wifi pt3<commit_after>import React, { Component } from 'react';
import { Panel, Col, Row, Button } from 'react-bootstrap';
import { VictoryBar, VictoryChart, VictoryAxis } from 'victory';


export default class RoomPage extends Component {
	constructor(props) {
		super(props)
		this.state = {

		}
	}

	render() {
		const roomName = this.props.match.params.roomName;
		return (
			<div className="container-fluid" style={{paddingTop: "20px"}}>
				<Row>
					<StatusPanel roomName={roomName} />
					<ButtonGroup roomName={roomName} />
				</Row>
				<Row>
					<DailyPanel roomName={roomName} />
					<WeeklyPanel roomName={roomName} />
				</Row>
			</div>
		)
	}
}

class DailyChart extends Component {
	constructor() {
		super();
		this.state = {
			data: null,
			updatedAt:null
		}
	}

	componentDidMount() {
	    fetch('/api/rooms/ccc/currentDayDataPoints')
	      .then(response => {
	        if (!response.ok) {
	          console.log('response')
	          console.log(response.status)
	          throw new Error(`status ${response.status}`);
	        }
	        return response.json();
	      }).then(json => {
	        console.log(json);
	        this.setState({
	          data: json.data,
	          updatedAt: json.updated_at
	        })
	      }).catch(e => {
	        throw e;
	      });
	  }

	render() {
		if (!this.state.data) {
			return <div></div>
		}

		// const data = [
		//   {quarter: 1, earnings: 13000},
		//   {quarter: 2, earnings: 16500},
		//   {quarter: 3, earnings: 14250},
		//   {quarter: 4, earnings: 19000}
		// ];
		const updatedAt = this.state.updatedAt;

		console.log(updatedAt);
		updatedAt.setDay(updatedAt.getDay() - 1);
		console.log(updatedAt);


		// const formattedData = this.state.data.map((dp, index) => {
		// 	return {
		// 		hour: ,
		// 		value: 
		// 	}
		// });

		return (
			<div>
			    <VictoryChart
			        // domainPadding will add space to each side of VictoryBar to
			        // prevent it from overlapping the axis
			        domainPadding={20}>
			        <VictoryAxis
			          // tickValues specifies both the number of ticks and where
			          // they are placed on the axis
			          tickValues={[1, 2, 3, 4]}
			          tickFormat={["Quarter 1", "Quarter 2", "Quarter 3", "Quarter 4"]}
			        />
			        <VictoryAxis
			          dependentAxis
			          // tickFormat specifies how ticks should be displayed
			          tickFormat={(x) => (`$${x / 1000}k`)}
			        />
			        <VictoryBar
			          data={this.state.data}
			          x="quarter"
{'fraction_non_alphanumeric': 0.14464425332290853, 'fraction_numerical': 0.01622361219702893, 'mean_word_length': 1.9994138335287222, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 45, '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': '323380', 'n_tokens_mistral': 1979, 'n_tokens_neox': 1573, 'n_words': 364}