1.1.0 • Published 3 years ago

@saeedghotb/hamnamad-bidask-table v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

hamnamad-bidask-table

hamnamad trading platform bidask table

NPM JavaScript Style Guide

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

proptyperequireddefaultdescription
dataDataTypetrueundefinedtable data
langLangTypefalsekeywordslanguage keywords object
onPriceSelectionfunction (value:number)=>voidfalsecall back to return selected price by user
onVolumeSelectionfunction (value:number)=>voidfalsecall back to select volume by user
CellstyleCSSPropertiesfalsedata cell style
ContainerStyleCSSPropertiesfalsecontainer style
HeaderStyleCSSPropertiesfalseheader style
TitleStyleCSSPropertiesfalsetitle style
skeletonbooleanfalsefalseshould render skeleton when data is zero length
skelton_countnumberfalse3skeleton 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