Skip to content

Commit

Permalink
Added All Files
Browse files Browse the repository at this point in the history
  • Loading branch information
shashankmotruri committed Jan 15, 2021
0 parents commit f752a37
Show file tree
Hide file tree
Showing 16 changed files with 17,902 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

/node_modules


16,526 changes: 16,526 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "mern-auth",
"version": "0.1.0",
"private": true,
"dependencies": {
"@data-ui/histogram": "0.0.84",
"@reactchartjs/react-chart.js": "^1.0.0-rc.3",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.19.2",
"chart.js": "^2.9.4",
"react": "^16.13.1",
"react-bootstrap-table": "^4.3.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"react-table": "^7.6.3",
"recharts": "^2.0.3",
"semantic-ui-react": "^2.0.1",
"semiotic": "1.20.6"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"proxy": "http://localhost:5000/",
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
43 changes: 43 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
25 changes: 25 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
21 changes: 21 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.bar-graph-conatiner {
position: absolute;
width: 300px;
right: 60px;
top: 100px;
}
.bar-h1{
margin: 0;
padding:0;
display: inline-block;
}
.graph-head {
margin: 0;
display: inline-block;
position: absolute;
top: 150px;
width: 300px;
right: 30px;
border-bottom: 2px solid #555;
padding: 5px;
}
19 changes: 19 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import "./App.css"
import Twitter from './components/twitter-table/twitter'
import {WWC} from './components/wwc/WWC'



function App(){
return (
<div className="App">
<WWC />
<Twitter />
<h2 className="graph-head">What it means</h2>
</div>
);

}

export default App;
107 changes: 107 additions & 0 deletions src/components/twitter-table/table2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.twitter-followers {
float: left;
margin: 0;
width: 575px;
font-family: Karla, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.followers-header {
margin: 18px 0;
font-size: 16px;
}
tr{
color: #333;
line-height: 25px;
}

.followers-tbl {
font-size: 16px;
line-height: 18px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.followers-tbl a {
color: #333;
text-decoration: none;
}
.followers-tbl a:hover{
text-decoration: underline;
}

.header {
border-bottom: 2px solid #555;
font-size: 16px;
font-weight: 400;
text-transform: uppercase;
}

.header:hover {
background-color: #eee;
cursor: pointer;
}

.bar-chart{
margin-right: 6px;
}
.bar{
width :9px;
background-color :#3fc1c9;
}
.bar-cell {
display: flex;
width: 100%;
align-items: center;
}

.number {
font-family: "Fira Mono", Consolas, Monaco, monospace;
font-size: 16px;
white-space: pre;
margin: 0;
padding-top: 6px;
width: 70px;
height:30px;
}

.bar-chart {
flex-grow: 1;
margin-left: 6px;
margin-right: 6px;
width: 100%;
height: 14px;
}

.bar {
width: 100%;
height: 100%;
background-color: rgb(63, 193, 201);
}
.Ex-bar{
width: 100%;
height: 100%;
background-color: #fc5185;
}
.recharts-wrapper {
width: 0px !important;
height: 0px !important;
}

.recharts-surface {
position: absolute;
top: 400px;
left: 1080px;
right: -1150px;
}
.barchart-message{
margin: 0;
padding: 0;
width: 150px;
font-size: x-large;
}
.barchart-msg-container{
display: inline-block;
position: absolute;
top: 410px;
right: 25px;

}
90 changes: 90 additions & 0 deletions src/components/twitter-table/twitter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import React from 'react'
import {twitterData} from './twitter_data'
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
import "./table2.css"

import TwitterBarChart from './twitterChart';


class Twitter extends React.Component {
constructor(props) {
super(props)
this.state = {
data:twitterData,
twitter_account:'BernieSanders',
twitter_followers:9254423,
}
this.onRowMouseOver = this.onRowMouseOver.bind(this);
}

onRowMouseOver(row){
this.setState({twitter_account:row.account,twitter_followers:row.followers});
}


render() {

const CellFormatter = (cell, row) => {
return (<div className="followers-tbl"><a href={"https://twitter.com/"+cell}>@{cell}</a></div>);
}

function getWidth(temp){
return ( temp*100/maxC);
}
var maxC = Math.max(...this.state.data.map(o=>o.followers));

const FollowerCellFormatter = (cell, row) => {
return (
<div>
<div className="bar-cell">
<span className="number">{cell}</span>
<div className="bar-chart">
<div className="bar" style={{width: getWidth(cell)+"%"}}></div>
</div>
</div>
</div>);
}

function getExclusiveWidth(tem){
return (tem*100).toFixed(2);
}

const ExclusiveFollowerCellFormatter = (cell, row) => {
return (
<div>
<div className="bar-cell">
<span className="number">{getExclusiveWidth(cell)}%</span>
<div className="bar-chart" style={{backgroundColor: "#e1e1e1"}}>
<div className="Ex-bar" style={{width: getExclusiveWidth(cell)+"%"}}></div>
</div>
</div>
</div>
);
}


const options = {
onRowMouseOver: this.onRowMouseOver,
};

return (
<div>
<div className="twitter-followers">
<div className="followers-header">
<BootstrapTable data={this.state.data} options={options}>
<TableHeaderColumn dataField='account' dataFormat={CellFormatter} isKey={true} dataSort={ true } dataAlign='left' width='120' headerAlign='left' className="header">ACCOUNT</TableHeaderColumn>
<TableHeaderColumn dataField='followers'dataFormat={FollowerCellFormatter} dataSort={ true } width='120' dataAlign='center' headerAlign='left' className="header">FOLLOWERS</TableHeaderColumn>
<TableHeaderColumn dataField='exclusive_followers_pct' dataFormat={ExclusiveFollowerCellFormatter} dataSort={ true } width='120' headerAlign='left' className="header">EXCLUSIVE FOLLOWERS</TableHeaderColumn>
</BootstrapTable>
</div>
</div>

<TwitterBarChart account={this.state.twitter_account} followers={this.state.twitter_followers}/>

</div>
)
}
}


export default Twitter;
Loading

0 comments on commit f752a37

Please sign in to comment.