Skip to content

Conversation

@tomaszantas
Copy link
Contributor

@tomaszantas tomaszantas commented Nov 27, 2024

Description

Add quarter and year scopes to the PnL chart.

To-do:

  • to discuss: how to release changes to layouts? as a new version or update existing?
  • integrate with API

How this has been tested?

image

image

image

image

Screen.Recording.2024-11-29.at.19.06.57.mov

import { CategoricalChartFunc } from 'recharts/types/chart/generateCategoricalChart'
import { Props as LegendProps } from 'recharts/types/component/DefaultLegendContent'

const getChartWindow = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: I moved most of such functions into ./utils.ts to thin this file

.map(x => summarizePnL(x))
}, [selectionMonth, chartWindow, data, loaded, compactView])
/** @TODO temp */
const len = period === 'year' ? 1 : period === 'quarter' ? 4 : 12
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: Temporary - just to limit number of bars on the chart. It needs to be removed when API endpoint is ready

@@ -0,0 +1,171 @@
import React, { ReactNode, useState } from 'react'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this file is needed at all. The difference between "v1" and "v2" are not large but noticeable.
To discuss: how much we can modify layouts (views) provided with the package in terms of client awareness for such changes?

@tomaszantas tomaszantas self-assigned this Nov 29, 2024
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.

2 participants