-
Notifications
You must be signed in to change notification settings - Fork 415
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
feat: add lightweight chart lib #3279
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
added core definitions for charts.
9e0767a
to
9744021
Compare
WalkthroughThe updates introduce new chart controllers for different chart types (area and line) using the Lightweight Charts library. A React component, Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant TokenChart
participant HistoricalPriceChartV2
participant AreaChartController
participant LineChartController
User->>TokenChart: Load page
TokenChart->>HistoricalPriceChartV2: Render chart with data
HistoricalPriceChartV2->>AreaChartController: Initialize area chart
HistoricalPriceChartV2->>LineChartController: Initialize line chart
AreaChartController->>HistoricalPriceChartV2: Return chart instance
LineChartController->>HistoricalPriceChartV2: Return chart instance
HistoricalPriceChartV2->>TokenChart: Display chart
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Additional context usedBiome
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (4)
packages/web/pages/assets/[denom].tsx (4)
Line range hint
444-444
: Avoid non-null assertion.Using non-null assertions can lead to runtime errors if the value turns out to be null. Consider adding null checks or using optional chaining.
Line range hint
603-603
: Simplify the computed expression.Consider simplifying this expression to improve readability and potentially enhance performance.
Line range hint
1-13
: Useimport type
for type-only imports.To clarify that these imports are used only for type checking and to potentially optimize bundling, consider using
import type { TypeName } from 'module-name';
for these imports.Also applies to: 15-16, 20-21, 42-49
Line range hint
577-577
: Useconst
for variables that are only assigned once.This variable is only assigned once and does not change, making it a candidate for
const
to ensure immutability and clarity in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (1)
packages/web/components/chart/light-weight-charts/chart.tsx (1)
36-66
: ThetimepointToString
function is a utility for formatting time points. It's well-implemented but consider adding comments to clarify the logic, especially around the handling of different time formats.
What is the purpose of the change:
This PR implements the lightweight charts library which allows us to fix some bugs, but also introduces some features:
Right now we're only using this implementation for the token info pages, we can replace chart in other places but I'll do it in a different PR.
Linear Tasks
Fix Chart Rendering
Switch to lightweight charts library
Brief Changelog
Testing and Verifying