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

Mattupham/fe 944 portfolio add chart expand minimize #3703

Merged
merged 36 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e99083b
preserveAspectRatio
mattupham Aug 8, 2024
f8472aa
Get animations working
mattupham Aug 8, 2024
435ba01
Clean up with ref
mattupham Aug 8, 2024
b4a8b71
Handle show scales
mattupham Aug 8, 2024
1b1d0da
add button to minimize
mattupham Aug 8, 2024
5a19a1e
Add transition
mattupham Aug 8, 2024
a1f7bc0
Add hover state
mattupham Aug 8, 2024
05be302
Add card
mattupham Aug 8, 2024
f89adaf
Clean up
mattupham Aug 8, 2024
18d6c2b
Merge branch 'stage' into mattupham/fe-944-portfolio-add-chart-expand…
mattupham Aug 8, 2024
d57825b
Add optional skeleton
mattupham Aug 8, 2024
249bc64
Update chart style
mattupham Aug 8, 2024
abc30ee
Merge with stage
mattupham Aug 8, 2024
040eb53
Update transitions
mattupham Aug 8, 2024
f045ff2
Clean up
mattupham Aug 8, 2024
70020ba
udpates
mattupham Aug 8, 2024
4dcc033
migrate portfolio performance
mattupham Aug 8, 2024
8d6405c
Clean up globals
mattupham Aug 8, 2024
3d927b5
Add transitions
mattupham Aug 8, 2024
9d486ee
Update expand area
mattupham Aug 8, 2024
007783a
add transitions
mattupham Aug 8, 2024
e2f04eb
Clean up
mattupham Aug 8, 2024
492f523
Make chart not selectable
mattupham Aug 8, 2024
0329da6
Fix fit
mattupham Aug 9, 2024
c499fb4
Clean up
mattupham Aug 9, 2024
e262910
Clean up chart minimization
mattupham Aug 9, 2024
fee8c56
Clean up scales
mattupham Aug 9, 2024
1256615
Clean up config
mattupham Aug 9, 2024
f2a4629
Cleanup
mattupham Aug 9, 2024
e42da54
Clean up ref
mattupham Aug 9, 2024
c807961
Clean up
mattupham Aug 9, 2024
c0c8d3b
Clean up i18n
mattupham Aug 9, 2024
73404cc
Fix coins
mattupham Aug 9, 2024
420a479
Merge branch 'stage' into mattupham/fe-944-portfolio-add-chart-expand…
mattupham Aug 9, 2024
23035fa
Fix import
mattupham Aug 9, 2024
042dda9
Remove extra state
mattupham Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion packages/web/components/chart/historical-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,36 @@ interface HistoricalChartProps {
onPointerHover?: (price: number, time: Time) => void;
onPointerOut?: () => void;
style?: Style;
showScales?: boolean;
}

export const HistoricalChart = memo((props: HistoricalChartProps) => {
const { data = [], onPointerHover, onPointerOut, style = "neutral" } = props;
const {
data = [],
onPointerHover,
onPointerOut,
style = "neutral",
showScales = true,
} = props;

const options = showScales
? {}
: {
rightPriceScale: {
visible: false,
},
leftPriceScale: {
visible: false,
},
timeScale: {
visible: false,
},
};

return (
<Chart
Controller={AreaChartController}
options={options}
series={[
{
type: "Area",
Expand Down Expand Up @@ -164,6 +186,7 @@ export const HistoricalChartSkeleton = () => {
viewBox="0 0 700 346"
fill="none"
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="none"
>
<g clipPath="url(#clip0_2029_22138)">
<path
Expand Down
12 changes: 12 additions & 0 deletions packages/web/components/chart/light-weight-charts/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const defaultOptions: DeepPartial<TimeChartOptions> = {
borderVisible: false,
ticksVisible: false,
entireTextOnly: true,
// visible: false, // Hide the right price scale
scaleMargins: {
top: 0.25,
bottom: 0.1,
Expand All @@ -64,6 +65,7 @@ export const defaultOptions: DeepPartial<TimeChartOptions> = {
borderVisible: false,
ticksVisible: false,
entireTextOnly: true,
// visible: true, // Hide the left price scale
scaleMargins: {
top: 0.25,
bottom: 0.1,
Expand Down Expand Up @@ -106,6 +108,7 @@ export const defaultOptions: DeepPartial<TimeChartOptions> = {
},
},
timeScale: {
// visible: false, // Hide the time scale
timeVisible: true,
secondsVisible: false,
lockVisibleTimeRangeOnResize: true,
Expand Down Expand Up @@ -146,8 +149,17 @@ const defaultOptionsWithSeries = (
series?: Series[]
): DeepPartial<TimeChartOptions> => ({
...defaultOptions,
leftPriceScale: {
...defaultOptions.leftPriceScale,
// visible: false,
},
rightPriceScale: {
...defaultOptions.rightPriceScale,
// visible: false,
},
timeScale: {
...defaultOptions.timeScale,
// visible: false,
tickMarkFormatter: (timePoint: Time, tickMarkType: TickMarkType) => {
const formatOptions: Intl.DateTimeFormatOptions = {};

Expand Down
Loading
Loading