pnftrading
v0.7.11
Published
Highly customizable stock charts with ReactJS and d3
Readme
React Stockcharts
Create highly customizable stock charts with React 18 and D3.
Note: This project has been upgraded to support Node.js v20+ and React v18.
Table of Contents
Features
- Chart types: Scatter, Area, Line, Candlestick, OHLC, HeikenAshi, Renko, Kagi, Point & Figure.
- Indicators: EMA, SMA, WMA, TMA, Bollinger band, SAR, MACD, RSI, ATR, Stochastic, ForceIndex, ElderRay, Elder Impulse.
- Interactive: Trendline, Fibonacci Retracements, Gann Fan, Channel.
- Performance: Uses Canvas and SVG for high performance rendering.
- Responsive: Pan, zoom, and touch support.
Heads Up (Upgrade Notes)
This repository has been modernized:
- Node.js: v20.19.6 (Required)
- React: v18.2.0 (Using
createRootAPI) - Wallpaper: Webpack 5 & Babel 7
- Styles: Dart Sass
Getting Started
Prerequisites
- Node.js v20 or higher.
- npm v10 or higher.
We recommend using nvm to manage your Node versions:
nvm use
# or
nvm install 20
nvm use 20Installation
Clone the repository and install dependencies:
git clone https://github.com/your-username/react-stockcharts.git
cd react-stockcharts
npm install --legacy-peer-deps pnftradingNote: --legacy-peer-deps may be required due to some older D3 dependencies.
Running the Demo
To start the development server and view the documentation/examples:
npm startOpen http://localhost:8080 in your browser.
Building for Production
To build the library for distribution (CommonJS and ES Modules):
npm run buildThis will generate the build/ folder.
Publishing to NPM
To publish this package to the npm registry, follow these steps:
Login to npm:
npm login(You will be prompted for your username, password, and email).
Update Version: Update the
versionfield inpackage.jsonfollowing semantic versioning (e.g.,0.7.9).npm version patch # or minor, majorBuild the Project: Ensure you have the latest build artifacts.
npm run buildPublish:
npm publishNote: If you are publishing a scoped package (e.g.,
@yourname/react-stockcharts), add--access public.
