Skip to content

Commit

Permalink
Removed Example page
Browse files Browse the repository at this point in the history
  • Loading branch information
JusticeV452 committed Apr 18, 2024
1 parent c96927a commit be691b1
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 141 deletions.
23 changes: 3 additions & 20 deletions backend/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,6 @@ def index(request):
return render(request, 'index.html', context)


def example(request, example_id=None):
"""
Example page
"""

context = {
'page_metadata': {
'title': 'Example ID page'
},
'component_props': {
'id': example_id
},
'component_name': 'ExampleId',
}
return render(request, 'index.html', context)


def competitiveness(request):
"""
Competitiveness Map Page
Expand All @@ -73,7 +56,7 @@ def competitiveness(request):
return render(request, 'index.html', context)


def PieChart(request, example_id=None):
def PieChart(request):
"""
Displays PieChart for data from election campaign finance
"""
Expand All @@ -87,7 +70,7 @@ def PieChart(request, example_id=None):
return render(request, 'index.html', context)


def BarChart(request, example_id=None):
def BarChart(request):
"""
Displays Bar Chart for data from election campaign finance
"""
Expand All @@ -101,7 +84,7 @@ def BarChart(request, example_id=None):
return render(request, 'index.html', context)


def FinanceSankey(request, example_id=None):
def FinanceSankey(request):
"""
Displays FinanceSankey for data from election campaign finance
"""
Expand Down
4 changes: 0 additions & 4 deletions backend/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@
# View Pages
################################################################################
path('', views.index),
path('example/', views.example),
path('example/<example_id>', views.example),
path('competitiveness', views.competitiveness),
path('campaign-finance/top-10-donors-piechart/', views.PieChart),
path('campaign-finance/top-10-donors-barchart/', views.BarChart),
path('campaign-finance/donor-party-sankey/', views.FinanceSankey),




################################################################################
# API endpoints
################################################################################
Expand Down
85 changes: 0 additions & 85 deletions frontend/components/ExampleId.js

This file was deleted.

Empty file.
17 changes: 11 additions & 6 deletions frontend/components/global/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@ import React from "react";
import DH_LOGO from "../../images/dh_logo.svg";

const Nav = () => {

return (
<nav className="navbar navbar-light bg-light navbar-expand-sm">
<a className="navbar-brand link-home" href="/">Data Driven Democracy app</a>
<a className="navbar-brand link-home" href="/">
Data Driven Democracy app
</a>
<ul className="navbar-nav mr-auto">
<li className="nav-item">
<a href="/example/1">Example</a>
<a href="/competitiveness">Competitiveness Map</a>
</li>
</ul>
<a className="lab-link" href="https://digitalhumanities.mit.edu/" target="_blank"
rel="noreferrer">
<img className="lab-image" src={DH_LOGO}/>
<a
className="lab-link"
href="https://digitalhumanities.mit.edu/"
target="_blank"
rel="noreferrer"
>
<img className="lab-image" src={DH_LOGO} />
</a>
</nav>
);
Expand Down
6 changes: 2 additions & 4 deletions frontend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "./scss/index.scss";
import "bootstrap/dist/css/bootstrap.min.css";
import Base from "./components/global/Base";
import ErrorNotFoundComponent from "./components/ErrorNotFoundComponent";
import ExampleId from "./components/ExampleId";
import Home from "./components/Home";
import CompetitivenessMap from "./components/CompetitivenessMap";
import PieChart from "./components/PieChart";
Expand All @@ -17,12 +16,11 @@ const COMPONENT_NAME = JSON.parse(COMPONENT_NAME_RAW);

const COMPONENTS = {
ErrorNotFoundComponent,
ExampleId,
CompetitivenessMap,
Home,
PieChart,
BarChart,
FinanceSankey
FinanceSankey,
CompetitivenessMap
};

const PreselectedComponent = COMPONENTS[COMPONENT_NAME || "ErrorNotFoundComponent"];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,45 @@
.example {
.list {
list-style: none;
padding: 0.5rem;
}
.map-display {
display: flex;

}
.dataDisplay{

.data-display {
display: flex;
text-align: left;
font-size: large;
background-color: 'red';
background-color: "red";
width: 30%;
align-items: center;
justify-content: left;
font-size: larger;
padding-left: 2%;
margin-top: 5%;

}

.dataDisplay div {
.data-display div {
margin-top: 5px;

}

.slider{
.slider {
width: 25%;
position: absolute;
right:0;
right: 0;
display: flex;
justify-content: left;
flex-direction: column;

}

.mapTitle{
.map-title {
font-weight: bold;
font-size: xx-large;
margin: 0.5rem;
text-align: center;
}

.mapSubtitle{
.map-subtitle {
font-weight: bold;
font-size: larger;

}

#map-container {
z-index: 1;
height: calc(100vh);
Expand Down
10 changes: 5 additions & 5 deletions frontend/scss/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '~normalize.css';
@import './global.scss';
@import './nav.scss';
@import './example.scss';
@import '~bootstrap/scss/bootstrap';
@import "~normalize.css";
@import "./global.scss";
@import "./nav.scss";
@import "./competitivenessMap.scss";
@import "~bootstrap/scss/bootstrap";

0 comments on commit be691b1

Please sign in to comment.