Skip to content

Commit

Permalink
DepthChart: added props description
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroshch committed Feb 2, 2022
1 parent 97744bb commit f6d7035
Showing 1 changed file with 69 additions and 2 deletions.
71 changes: 69 additions & 2 deletions packages/core/src/components/DepthChart/DepthChart.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import cx from 'classnames'
import _values from 'lodash/values'
import PropTypes from 'prop-types'
import React, { memo, useEffect, useRef } from 'react'
import { useTranslation } from 'react-i18next'

import * as Classes from '../../common/classes'
import { getCurrentStyle } from '../../common/themes'
import { getCurrentStyle, THEMES } from '../../common/themes'
import withI18nProvider from '../../hoc/withI18nProvider'
import { PROP_BOOK_TRADE, PROP_BOOK } from '../Book/Book.props'
import Spinner from '../ui/Spinner'
Expand Down Expand Up @@ -106,35 +107,101 @@ export const DepthChart = ({
}

DepthChart.propTypes = {
/**
*If true, showing loader
*/
loading: PropTypes.bool,
/**
* The data to show on asks side.
*/
asks: PropTypes.objectOf(PropTypes.shape(PROP_BOOK)),
/**
* The data to show on bids side.
*/
bids: PropTypes.objectOf(PropTypes.shape(PROP_BOOK)),
/**
* The asks data with 'total' field that is cumulative sum of amount.
*/
tAsks: PropTypes.objectOf(
PropTypes.oneOfType([PropTypes.shape(PROP_BOOK_TRADE), PropTypes.number]),
).isRequired,
/**
* The bids data with 'total' field that is cumulative sum of amount.
*/
tBids: PropTypes.objectOf(
PropTypes.oneOfType([PropTypes.shape(PROP_BOOK_TRADE), PropTypes.number]),
).isRequired,
/**
* The sorted price list to show on asks side.
*/
pAsks: PropTypes.arrayOf(PropTypes.number).isRequired,
/**
* The sorted price list to show on bids side.
*/
pBids: PropTypes.arrayOf(PropTypes.number).isRequired,
/**
* The book data that includes the lowest cluster of ask orders
*/
asksTop: PropTypes.objectOf(PropTypes.shape(PROP_BOOK)),
/**
* The book data that includes the highest cluster of bid orders
*/
bidsTop: PropTypes.objectOf(PropTypes.shape(PROP_BOOK)),
/**
* The book data that includes the lowest cluster of ask orders with 'total' field
*/
tAsksTop: PropTypes.objectOf(
PropTypes.oneOfType([PropTypes.shape(PROP_BOOK_TRADE), PropTypes.number]),
).isRequired,
/**
* The book data that includes the highest cluster of bid orders with 'total' field
*/
tBidsTop: PropTypes.objectOf(
PropTypes.oneOfType([PropTypes.shape(PROP_BOOK_TRADE), PropTypes.number]),
).isRequired,
/**
* The sorted lowest price to show on asks side
*/
pAsksTop: PropTypes.arrayOf(PropTypes.number).isRequired,
/**
* The sorted highest price to show on bids side
*/
pBidsTop: PropTypes.arrayOf(PropTypes.number).isRequired,
/**
* The className of the Book’s outer element.
*/
className: PropTypes.string,
/**
* One of available themes
*/
theme: PropTypes.string,
/**
* Width of Chart, in px
*/
width: PropTypes.number,
/**
* Height of Chart, in px
*/
height: PropTypes.number,
/**
* The zoom level for bar graph.
*/
zoom: PropTypes.number,
/**
* The precision level of Chart
*/
prec: PropTypes.number,
/**
* Callback, invoked when user change zoom slider
*/
updateZoom: PropTypes.func.isRequired,
/**
* Font, using for Chart texts
*/
fontFamily: PropTypes.string,
/**
* Current currency pair
*/
currentPair: PropTypes.string.isRequired,
}

Expand All @@ -145,7 +212,7 @@ export const defaultProps = {
bidsTop: {},
loading: false,
className: null,
theme: 'dark-theme',
theme: THEMES.DARK_THEME,
width: 600,
height: 220,
zoom: 50,
Expand Down

0 comments on commit f6d7035

Please sign in to comment.