@lab49/react-order-book
Advanced tools
Comparing version 0.1.2 to 0.1.3
import React from 'react'; | ||
declare type PriceList = string[][]; | ||
declare type RgbColor = number[]; | ||
declare type Interpolator = (start: RenderListOptions['color'], end: RenderListOptions['color'], factor: number) => RgbColor; | ||
interface OrderBook { | ||
interface OrderBookStructure { | ||
asks: PriceList; | ||
bids: PriceList; | ||
} | ||
export declare enum Layout { | ||
declare enum Layout { | ||
Row = "row", | ||
Column = "column" | ||
} | ||
export interface Props { | ||
interface Props { | ||
/** | ||
@@ -29,3 +30,3 @@ * For the internaly calculated colors, apply a background-color in the DOM. | ||
*/ | ||
book: OrderBook; | ||
book: OrderBookStructure; | ||
/** | ||
@@ -89,3 +90,4 @@ * Use a value of 1 for the opacity of each row's generated color. | ||
*/ | ||
export declare const OrderBook: React.FC<Props>; | ||
export {}; | ||
declare const OrderBook: React.FC<Props>; | ||
export { Layout, OrderBook, Props }; |
{ | ||
"name": "@lab49/react-order-book", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Render an order book for any asset class. Flexible and customizable.", | ||
@@ -21,4 +21,4 @@ "author": "brianmcallister", | ||
], | ||
"main": "dist/index.js", | ||
"module": "dist/index.modern.js", | ||
"main": "dist/OrderBook.js", | ||
"module": "dist/OrderBook.mjs", | ||
"source": "src/OrderBook.tsx", | ||
@@ -30,7 +30,7 @@ "files": [ | ||
"build-storybook": "build-storybook", | ||
"build": "microbundle-crl --no-compress --format modern,cjs", | ||
"build": "tsup src/OrderBook.tsx --dts --sourcemap --format esm,cjs,iife", | ||
"chromatic": "chromatic --project-token 60pcjug3hz", | ||
"lint": "eslint --ext ts,tsx src", | ||
"prepare": "npm run build", | ||
"start": "microbundle-crl watch --no-compress --format modern,cjs", | ||
"prepare": "npm run build && husky install", | ||
"start": "tsup src/OrderBook.tsx --watch", | ||
"storybook": "start-storybook -p 9009", | ||
@@ -42,23 +42,6 @@ "test": "jest", | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"src/**/*.{js,ts,jsx,tsx}": [ | ||
"eslint --fix" | ||
], | ||
"*.json": [ | ||
"prettier --write" | ||
] | ||
}, | ||
"peerDependencies": { | ||
"big.js": "^5.x", | ||
"classnames": "^2.x", | ||
"big.js": "^6.1.1", | ||
"react": "^16.x" | ||
}, | ||
"jest": { | ||
"testEnvironment": "jsdom" | ||
}, | ||
"devDependencies": { | ||
@@ -69,28 +52,25 @@ "@babel/plugin-transform-runtime": "^7.15.0", | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@storybook/addon-docs": "^6.2.9", | ||
"@storybook/addon-essentials": "^6.2.9", | ||
"@storybook/addons": "^6.0.16", | ||
"@storybook/preset-create-react-app": "^3.1.4", | ||
"@storybook/addon-docs": "^6.5.15", | ||
"@storybook/addon-essentials": "^6.5.15", | ||
"@storybook/addons": "^6.5.15", | ||
"@storybook/preset-typescript": "^3.0.0", | ||
"@storybook/react": "^6.2.9", | ||
"@storybook/react": "^6.5.15", | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/react": "^9.5.0", | ||
"@testing-library/user-event": "^7.2.1", | ||
"@types/big.js": "^4.0.5", | ||
"@types/classnames": "^2.2.10", | ||
"@types/jest": "^25.1.4", | ||
"@types/node": "^12.12.38", | ||
"@types/big.js": "^6.1.3", | ||
"@types/jest": "^27.4.1", | ||
"@types/node": "^17.0.23", | ||
"@types/react": "^16.9.27", | ||
"@types/react-dom": "^16.9.7", | ||
"@types/testing-library__jest-dom": "^5.14.1", | ||
"@typescript-eslint/eslint-plugin": "^3.8.0", | ||
"@typescript-eslint/parser": "^2.34.0", | ||
"@typescript-eslint/eslint-plugin": "^5.19.0", | ||
"@typescript-eslint/parser": "^5.19.0", | ||
"babel-eslint": "^10.0.3", | ||
"babel-loader": "^8.1.0", | ||
"big.js": "^5.2.2", | ||
"chromatic": "^5.6.2", | ||
"classnames": "^2.2.6", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-typescript": "^9.0.0", | ||
"eslint-config-prettier": "^6.7.0", | ||
"big.js": "^6.1.1", | ||
"chromatic": "^6.5.4", | ||
"eslint": "^8.13.0", | ||
"eslint-config-airbnb-typescript": "^17.0.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
@@ -100,17 +80,29 @@ "eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-promise": "^6.0.0", | ||
"eslint-plugin-react": "^7.20.5", | ||
"eslint-plugin-react-hooks": "^4.0.8", | ||
"husky": "^4.3.8", | ||
"jest": "^26.4.2", | ||
"eslint-plugin-storybook": "^0.6.8", | ||
"husky": "^7.0.4", | ||
"jest": "^27.5.1", | ||
"jest-environment-jsdom": "^27.5.1", | ||
"lint-staged": "^10.5.4", | ||
"microbundle-crl": "^0.13.11", | ||
"prettier": "^2.0.4", | ||
"lint-staged": "^12.3.7", | ||
"prettier": "^2.6.2", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"ts-loader": "^8.0.2", | ||
"typescript": "^3.9.7" | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.6.3" | ||
}, | ||
"lint-staged": { | ||
"src/**/*.{js,ts,jsx,tsx}": [ | ||
"eslint --fix" | ||
], | ||
"*.json": [ | ||
"prettier --write" | ||
], | ||
"*.{ts,tsx}": "eslint --cache --fix" | ||
}, | ||
"jest": { | ||
"testEnvironment": "jsdom" | ||
} | ||
} |
# @lab49/react-order-book | ||
[![codecov](https://codecov.io/gh/lab49/react-order-book/branch/master/graph/badge.svg)](https://codecov.io/gh/lab49/react-order-book) [![Node.js CI](https://github.com/lab49/react-order-book/actions/workflows/CI.yaml/badge.svg)](https://github.com/lab49/react-order-book/actions/workflows/CI.yaml) [![npm version](https://img.shields.io/npm/v/@lab49/react-order-book?label=version&color=%2354C536&logo=npm)](https://www.npmjs.com/package/@lab49/react-order-book) | ||
[![codecov](https://codecov.io/gh/lab49/react-order-book/branch/master/graph/badge.svg)](https://codecov.io/gh/lab49/react-order-book) [![.github/workflows/cicd.yaml](https://github.com/lab49/react-order-book/actions/workflows/cicd.yaml/badge.svg)](https://github.com/lab49/react-order-book/actions/workflows/cicd.yaml) [![npm version](https://img.shields.io/npm/v/@lab49/react-order-book?label=version&color=%2354C536&logo=npm)](https://www.npmjs.com/package/@lab49/react-order-book) | ||
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md) | ||
@@ -13,2 +13,4 @@ | ||
![react-order-book](https://user-images.githubusercontent.com/63244584/163017603-11089e79-9ec9-4b3e-8d09-086e62f32e94.gif) | ||
`react-order-book` is a simple, flexible order book component. Pass in an order book as a prop, and cutomize the look and feel with plenty of configuration options, plus numerous styling hooks for visual customization. | ||
@@ -200,18 +202,2 @@ | ||
## TODO | ||
These items are very high level right now. Further discussion and proper roadmap planning will happen in GitHub issues and projects. | ||
- [ ] Add unit tests. | ||
- [ ] Incorporate a CI process for publishing. | ||
- [ ] Add lint-staged to maintain quality. | ||
- [ ] Add a code of conduct. | ||
- [ ] Add a contributing guide. | ||
- [ ] Create a feature roadmap. | ||
- [ ] Expose functions to help add a price update into the order book. Something like `(book: Book, change: Change) => Book`, but possibly a class to maintain the book prices in a tree for efficient insert and deletes. See [bintrees](https://www.npmjs.com/package/bintrees), and the RBTree. | ||
- [ ] Expose an HOC to connect to some popular streaming APIs and immediately start rendering an `OrderBook`. Plus, expose various props to allow customization of the behavior for use with internal streaming APIs of various types (websocket, SSE, etc). | ||
- [ ] Allow for a custom end color during color interpolation. | ||
- [ ] Add renderer props for various parts of the component structure (e.g., `rowRenderer`). | ||
- [ ] Add formatters for price and size, allow custom formatting. | ||
## Sponsored by Lab49 | ||
@@ -218,0 +204,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
288211
2
45
10
2639
206
1