Skip to content

Task 2: Enhancing Data Visualization in React Application

Notifications You must be signed in to change notification settings

chriszimbizi/forage-jpmc-swe-task-2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task 2: Enhancing Data Visualization in React Application

Overview

Updated the App.tsx and Graph.tsx files to improve data visualization in the React application. Changes include rendering conditional graphs, continuous data fetching, and configuring the Graph component for better data presentation.

Changes Made

App.tsx

  • Graph Rendering: Modified renderGraph method to conditionally render the graph only when showGraph state is true.
  • Continuous Data Fetching: Updated getDataFromServer method to continuously fetch data using setInterval with a guard value for stopping the interval.
  • State Management: Ensured setState() is used for state updates outside the constructor.

Graph.tsx

  • HTMLElement Extension: Extended PerspectiveViewerElement to behave like an HTMLElement.
  • Simplified DOM Access: Updated componentDidMount to simplify element access using document.getElementsByTagName.
  • Graph Configuration: Added and configured attributes:
    • view set to y_line for continuous line graph.
    • column-pivots to distinguish between stocks.
    • row-pivots for x-axis timestamps.
    • columns focused on top_ask_price.
    • aggregates to handle and average duplicated data points.

Result

  • The application now renders a continuous line graph with real-time data updates.

About

Task 2: Enhancing Data Visualization in React Application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 53.7%
  • TypeScript 31.6%
  • HTML 7.9%
  • CSS 5.6%
  • JavaScript 1.2%