Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INPROGRESS- Feature/samvritsrinath/Category-Page and Sagas for Data Vizualization #53

Draft
wants to merge 48 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a569a93
Basic React for Landing Page
SamvritSrinath Jan 17, 2023
922d469
modified: ../.DS_Store
SamvritSrinath Jan 24, 2023
df963ab
new file: SDCTA/src/Images/Graph.jpg
SamvritSrinath Jan 24, 2023
73d054f
changed jsx to tsx
meganleongg Jan 24, 2023
05519e0
added separate css file for body component
meganleongg Jan 28, 2023
4ce0e00
modified: src/App.css
SamvritSrinath Jan 28, 2023
1db03c9
Merge branch 'Landing-Page' of https://github.com/TritonSE/SDCTA-Data…
SamvritSrinath Jan 28, 2023
e01e1e4
Images in Body
SamvritSrinath Jan 28, 2023
e594706
Added Education Images
SamvritSrinath Jan 28, 2023
a1fae54
changed heading
meganleongg Jan 28, 2023
477d35e
Merge branch 'Landing-Page' of https://github.com/TritonSE/SDCTA-Data…
meganleongg Jan 28, 2023
c2b444c
Updating Footer Style
SamvritSrinath Jan 28, 2023
06243ea
Updating Footer Style again
SamvritSrinath Jan 28, 2023
fec022b
Fixing white space
SamvritSrinath Jan 28, 2023
3a1292f
put in new images & added image styling
meganleongg Jan 28, 2023
8387f13
pull
meganleongg Jan 28, 2023
3af9aeb
pulling from Megan
SamvritSrinath Jan 28, 2023
81f7982
Formatting into a page
SamvritSrinath Jan 28, 2023
d4beef2
Created the Individual visualization Page
Miyuki-L Jan 30, 2023
1f47d38
Adding Pages
SamvritSrinath Feb 1, 2023
022b792
.
meganleongg Feb 1, 2023
0099b66
Fixed the styling for the page
Miyuki-L Feb 7, 2023
944f74b
Basic Tableau
SamvritSrinath Feb 7, 2023
4942d0c
Image Refactor
SamvritSrinath Feb 7, 2023
4590dac
Landing Page_Body Refactor
SamvritSrinath Feb 7, 2023
faa011d
Images
SamvritSrinath Feb 7, 2023
6d4847f
Final Images
SamvritSrinath Feb 7, 2023
85c3a31
static category page
meganleongg Feb 8, 2023
596be9a
Merge branch 'Feature/samvritsrinath/Category-Page' of https://github…
SamvritSrinath Feb 8, 2023
c1b9f2a
Changing Icon Directory:
SamvritSrinath Feb 8, 2023
5162aca
moved script into body
NirmalAgnihotri Feb 18, 2023
1ae5e98
dispose viz
NirmalAgnihotri Feb 18, 2023
b6846c6
convert embed component to typescript
NirmalAgnihotri Feb 18, 2023
0178d4f
fixed styling
meganleongg Feb 20, 2023
7f713e1
fixed css styling
meganleongg Feb 20, 2023
291e6bc
Merged Branch with origin/Feature/samvritsrinath/Category-Page
Miyuki-L Feb 21, 2023
abfef7d
Embed Tableau and changed to use props (IndivVis and TableauEmbed)
Miyuki-L Feb 21, 2023
5ea0da9
Squashed commit of the following: Main
Miyuki-L Feb 22, 2023
7f0c15a
Multiple tableau embeds in one page
NirmalAgnihotri Feb 25, 2023
a098894
Merge branch 'Landing-Page' into Feature/samvritsrinath/Category-Page
SamvritSrinath Mar 1, 2023
569cf3c
Merge remote-tracking branch 'origin/Feature/NirmalAgnihotri/multi-ta…
SamvritSrinath Mar 1, 2023
002ab83
Files for Megan
SamvritSrinath Mar 7, 2023
b4d6503
Redux-Saga Scaffholding
SamvritSrinath Mar 7, 2023
294d9fb
building component for tableau visualizations
meganleongg Mar 7, 2023
b75d4ad
Merge branch 'Landing-Page' of https://github.com/TritonSE/SDCTA-Data…
meganleongg Mar 7, 2023
959851e
Resolved merge
SamvritSrinath Mar 9, 2023
a651df1
Redux Basics
SamvritSrinath Mar 10, 2023
59024db
Basic Sagas
SamvritSrinath May 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21,247 changes: 5,678 additions & 15,569 deletions SDCTA/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SDCTA/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-dom": "^18.2.0",
"react-icons": "^4.7.1",
"react-redux": "^8.0.5",
"react-router-dom": "^6.7.0",
"react-router-dom": "^6.8.2",
"react-scripts": "5.0.1",
"redux-saga": "^1.2.2",
"web-vitals": "^2.1.4"
Expand Down
2 changes: 2 additions & 0 deletions SDCTA/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<title>React Redux App</title>
</head>
<body>
<script type = "text/javascript" src = "https:public.tableau.com/javascripts/api/tableau-2.min.js"></script>

<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
Expand Down
36 changes: 0 additions & 36 deletions SDCTA/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,3 @@
.opensans {
font-family: "Open Sans", sans-serif;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}

to {
transform: rotate(360deg);
}
}
15 changes: 14 additions & 1 deletion SDCTA/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import "./App.css";
import { Routes } from "./components/Routes";
import TableauEmbed from "./components/TableauEmbed";
import { Education } from "./pages/Education";
import { LandingPage } from "./pages/LandingPage";

declare global{
interface Window{
tableau: any
}
}
const App: React.FC = () => {
return (
<>
<Routes />
<div className="App"></div>
{/* <LandingPage /> */}
{/* <div className="App">
<Education />
</div> */}
</>
);
};

export default App;


Binary file added SDCTA/src/Images/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SDCTA/src/Images/unsplash_dsV4yvL5UJk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions SDCTA/src/Sagas/CategorySagas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {call , put, takeEvery, takeLatest} from 'redux-saga/effects';
import { PayloadAction } from '@reduxjs/toolkit';
import {changeCategory, loadCategory, CategoryType} from '../slices/CategorySlice';
import { Category, Visualization} from '../api/data';






function* watchChangeCategory(action: PayloadAction<Category>){
try{
const visualizations: Array<Visualization> = yield call(fetch, "http://localhost:3001/category/" + action.payload);
console.log(action.payload);
console.log("http://localhost:3001/category/"+ action.payload);
const newCategory: Category = {...action.payload, visualizations};

yield put(loadCategory(newCategory));
}catch(e){
console.log(e);
console.log(action.payload._id);
}
}

function* watchLoadCategory(){
yield takeLatest(changeCategory.type, watchChangeCategory);
}

export default function* categorySaga(){
yield watchLoadCategory();
}

15 changes: 15 additions & 0 deletions SDCTA/src/api/consumer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {Category} from './data'
export const CategoryPrefix = `http://localhost:3001/category`;
export const getCategoryByName = async(categoryName: string) : Promise<Category | null> => {
try {
const url = `${CategoryPrefix}/${categoryName}`;
const response = await fetch(url);
let data = await response.json();
console.log((data as Category))

return (data as Category);

}catch {
return null;
}
}
17 changes: 17 additions & 0 deletions SDCTA/src/api/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export interface Category {
_id: string;
name: string;
visualizations: Array<Visualization>;
}

export interface Visualization{
_id: string;
title: string;
analysis: string;
link: string;
}

export interface changeCategoryPayload {
oldCategory: Category;
newCategory: Category;
}
6 changes: 5 additions & 1 deletion SDCTA/src/app/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
import loginReducer from "../slices/loginSlice";
import subscribeReducer from "../slices/subscribeSlice";
import createSagaMiddleware from "redux-saga";
import tableauReducer from "../slices/CategorySlice"
import categorySaga from "../Sagas/CategorySagas";

// Create the saga middleware
const sagaMiddleware = createSagaMiddleware();
Expand All @@ -15,14 +17,16 @@ export const store = configureStore({
reducer: {
login: loginReducer,
subscribe: subscribeReducer,
changeCategory: tableauReducer,

},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat(middleware),
});

// Then run the saga
// uncomment when root saga is made
// sagaMiddleware.run(rootSaga)
sagaMiddleware.run(categorySaga);

export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
Expand Down
60 changes: 60 additions & 0 deletions SDCTA/src/components/Body.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import landscape from '../Images/unsplash_dsV4yvL5UJk.jpg';
//import EdVis from '../Images/Graph.jpg';
import './body.css'
import EducationVis from '../Images/Education_Standin.png';
import HomelessnessVis from '../Images/Homelessness_Standin.png';
import MunicipalVis from '../Images/Municipal_Standin.png'


export const Body = () => {
return (
<><div>
<div className="heading" >
SDTEF Data Museum
</div>
<div className="description" >
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
</div>
<div className="imgbox">
<img className="center-fit" src={landscape} alt="sd landscape" />
</div>
</div>
<div className="box" >
<div className="one">
<div className='img' >
<a href="../pages/Education.tsx">
<img src={EducationVis} alt="Education Visualization" ></img>
</a>
</div>
<div className="box-heading" >
Education
</div>
<div className="box-description" >
Lorem ipsum dolor sit amet, sed do consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
</div>
</div>
<div className="two">
<div className='img' >
<img src={HomelessnessVis} alt="Homelessness Visualization" ></img>
</div>
<div className="box-heading" >
Homelessness
</div>
<div className="box-description" >
Lorem ipsum dolor sit amet, sed do consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
</div>
</div>
<div className="three">
<div className='img' >
<img src={MunicipalVis} alt="Municipal Visualization" ></img>
</div>
<div className="box-heading" >
Municipal
</div>
<div className="box-description" >
Lorem ipsum dolor sit amet, sed do consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
</div>
</div>
</div> </>
)
};
67 changes: 67 additions & 0 deletions SDCTA/src/components/Footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/* Footer Styling */
.footer {
display: flex;
justify-content: space-between;
/* align-items: flex-end; */
padding: 40px;

/* padding-bottom: 50px; */

background-color: #7F1922;
font-size: 18px;
}

.footer-left {
width: 55%;

}

.footer-left h3 {
margin: 0;
color: white;
font-weight: 700;
padding-bottom: 10px;
font-weight: bold;
}

.footer-left p {
margin: 10px 0 0 0;
font-weight: 400;
color: white;

}

.footer-right {
width: 20%;
text-align: right;
}

.address {
margin-bottom: 20px;
}

.address p {
margin: 0;
text-indent: 10px;
line-height: 27px;
text-align: left;
color: white;
}

.social-icons {
margin-top: -5px;
display: flex;
align-items: flex-start;
}

.social-icons a {
margin-left: 12px;
color: #7F1922;
text-decoration: none;

}

.social-icons .icon {
font-size: 20px;
color: white;
}
36 changes: 36 additions & 0 deletions SDCTA/src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { FaFacebookF, FaTwitter, FaInstagram, FaYoutube } from 'react-icons/fa';
import './Footer.css';

export const Footer = () => {
return (
<footer className="footer">
<div className="footer-left">
<h3>San Diego Taxpayers Association</h3>
<p>The San Diego Taxpayers Educational Foundation conducts independent research studies on various issue areas to educate San Diegans and inform the advocacy efforts of the Association.</p>
</div>
<div className="footer-right">
<div className="address">
<p>2508 Historic Decatur Rd. #220</p>
<p>San Diego, CA 92106</p>

<p>Contact: [email protected]</p>
</div>
<div className="social-icons">
<a href="https://www.facebook.com/sdcta">
<FaFacebookF className="icon" />
</a>
<a href="https://twitter.com/sdcta">
<FaTwitter className="icon" />
</a>
<a href="https://www.instagram.com/sdcta">
<FaInstagram className="icon" />
</a>
<a href="https://www.linkedin.com/company/sdcta">
<FaYoutube className="icon" />
</a>
</div>
</div>
</footer>
);

}
Loading