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.
- Graph Rendering: Modified
renderGraph
method to conditionally render the graph only whenshowGraph
state istrue
. - Continuous Data Fetching: Updated
getDataFromServer
method to continuously fetch data usingsetInterval
with a guard value for stopping the interval. - State Management: Ensured
setState()
is used for state updates outside the constructor.
- HTMLElement Extension: Extended
PerspectiveViewerElement
to behave like anHTMLElement
. - Simplified DOM Access: Updated
componentDidMount
to simplify element access usingdocument.getElementsByTagName
. - Graph Configuration: Added and configured attributes:
view
set toy_line
for continuous line graph.column-pivots
to distinguish between stocks.row-pivots
for x-axis timestamps.columns
focused ontop_ask_price
.aggregates
to handle and average duplicated data points.
- The application now renders a continuous line graph with real-time data updates.