1.1.0 • Published 3 years ago
@saeedghotb/hamnamad-bidask-table v1.1.0
hamnamad-bidask-table
hamnamad trading platform bidask table
Install
install from github
npm install github:hamnamad/bidask-table
Usage
import React, { Component } from 'react'
import Table from 'hamnamad-bidask-table'
import 'hamnamad-bidask-table/dist/index.css'
class Example extends Component {
render() {
return <Table data={[]} />
}
}
API
prop | type | required | default | description |
---|---|---|---|---|
data | DataType | true | undefined | table data |
lang | LangType | false | keywords | language keywords object |
onPriceSelection | function (value:number)=>void | false | call back to return selected price by user | |
onVolumeSelection | function (value:number)=>void | false | call back to select volume by user | |
Cellstyle | CSSProperties | false | data cell style | |
ContainerStyle | CSSProperties | false | container style | |
HeaderStyle | CSSProperties | false | header style | |
TitleStyle | CSSProperties | false | title style | |
skeleton | boolean | false | false | should render skeleton when data is zero length |
skelton_count | number | false | 3 | skeleton row count |
the default language object is
keywords:{
"bid": "bid",
"ask": "ask",
"price": "price",
"count": "count",
"volume": "volume"
}
the data object is an array of the bidask data.
data: [
{
bid_price: number,
bid_count: number,
bid_volume: number,
ask_price: number,
ask_count: number,
ask_volume: number,
order_rank: number
}
]
order_rank
is a number that indicates the order of bidasks in the market. order_rank
starts from 1