GithubHelp home page GithubHelp logo

cr2007 / d3js-us-electric-vehicle-dashboard Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.08 MB

D3.js Interactive Visualization Dashboard - US Electric Vehicle Population

Home Page: https://cr2007.github.io/d3js-us-electric-vehicle-dashboard/

HTML 6.93% JavaScript 83.64% CSS 9.43%
d3-js dashboard data-visualization electric-vehicles interactive-visualizations tesla

d3js-us-electric-vehicle-dashboard's Introduction

F20DV Group Project

Course: Data Visualisation and Analytics (F20DV)

Interactive Visualization Dashboard

Download Cleaned Dataset Link and supporting TopoJSON files: OneDrive Link


Group 10

Team Members:

  • Abdul Rehman - @ar225
  • Ahmed ElZubair - @AhmedElZubair38
  • Chandrashekhar Ramaprasad - @cr2007
  • Tamir Forawi - @tvmir

Index


Introduction

As part of our university coursework, we were tasked with designing and developing an interactive visualization application for the dataset of our choice, using HTML, CSS, JavaScript, and the D3.js library.

The dataset we chose for this project is the Electric Vehicles Population Dataset, a publicly available Kaggle dataset that contains information about electric vehicles (EVs) in the United States of America (USA).
It includes data such as the Make, Model, State, Electric Vehicle Type, and the Electric Range of the vehicles.

Setup

This setup guide is primarily for users of Visual Studio Code. If you're using a different code editor, ensure you have a local web server package like XAMPP installed.

Ensure the following are installed on your machine:

To set up the application:

  1. Clone the repository: git clone https://gitlab-student.macs.hw.ac.uk/cr2007/f20dv-group-project. Alternatively, download the ZIP file from the "Code" button.
  2. Open the project in Visual Studio Code.
  3. Install the recommended extensions in .vscode/extensions.json. Ensure the Live Server extension is installed.
  4. Open index.html and click "Go Live" to run the application on a local server.
  5. The application will open in your default web browser at http://localhost:5500.
  6. Interact with the application and view the visualizations.
  7. Changes to the code will reflect in the browser in real-time.

Architecture

The application is a data visualization dashboard for electric vehicle data. It uses D3.js for creating various types of charts and vanilla JavaScript for data processing and event handling.
The application is styled using CSS and the layout is created using HTML.

Directory Structure

The project is structured as follows:

  • data/: Constains the CSV data file used for generating the charts.
  • lib/: Contains the D3.js library file d3.v7.min.js
  • scripts/: Constains JavaScript file s for each type of chart, connected by the main script file:
  • styles/: Contains CSS files for each type of chart and the main CSS file:
    • main.css: Contains the main style and imports other CSS files
  • index.html: The main HTML file that includes the D3.js library, the main CSS file and placeholders for the charts

Data Processing

The CSV data is loaded and processed in main.js via the d3.csv() function.

The data processing functions transform the raw data into a format suitable for each type of chart.
The processed data is then passed to the corresponding chart's render function.

Event Handling

The event handling is also done in the main.js file.

For example, it includes an event listener for the search input field.
When the user types in the search input field, the data is filtered based on the search query and the charts are updated accordingly.

Charts

Each chart is implemented as a class in its own JavaScript file.

The classes include a render function that takes the processed data and generates the chart.

Styling

The application is styled using CSS. The main CSS file includes styles for the overall layout and imports the CSS files for each type of chart.

HTML Structure

The main HTML file includes the D3.js library, the main CSS file, and placeholders for the charts.

The placeholders are div elements with specific IDs corresponding to each type of chart.


d3js-us-electric-vehicle-dashboard's People

Contributors

cr2007 avatar ahmedelzubair38 avatar tvmir avatar plebras avatar ar225 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.