Skip to content
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

Add chart component #170

Merged
merged 27 commits into from
Nov 27, 2023
Merged

Add chart component #170

merged 27 commits into from
Nov 27, 2023

Conversation

ukorvl
Copy link
Member

@ukorvl ukorvl commented Oct 16, 2023

This diff adds Chart, LineSeries, HistogramSeries, CandlestickSeries, TimeScale and PriceScale components.
All of the components actually render almost nothing in terms of html, but they work with lightweight-charts api to draw the chart and scales on html canvas element.

Chart has some features out of the box - auto resizing and default corporate style according to the design system.
This is not final version of api, because we need to implement ChartToolbar and ChartLegend as well and with high probability some props will be changed after testing in real project.

Inspired by https://github.com/trash-and-fire/lightweight-charts-react-wrapper

Example of usage:

<Chart>
  <HistogramSeries data={[]} />
  <PriceScale />
  <TimeScale />
</Chart>

closes #169

@ukorvl ukorvl self-assigned this Oct 16, 2023
@ukorvl ukorvl marked this pull request as draft October 16, 2023 12:30
@ukorvl ukorvl marked this pull request as ready for review November 26, 2023 19:12
Copy link

github-actions bot commented Nov 26, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/ui-kit.js 100.57 KB (+1.73% 🔺) 2.1 s (+1.73% 🔺) 51 ms (+73.63% 🔺) 2.1 s

@ukorvl ukorvl requested a review from KlonD90 November 27, 2023 06:11
src/components/chart/useInitChart.ts Outdated Show resolved Hide resolved
src/components/chart/series/useInitSeries.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@KlonD90 KlonD90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ukorvl ukorvl merged commit 8d16f14 into master Nov 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create reusable chart component
2 participants