Local Development ​
Introduction ​
If you see this, you may be interested in improving the KLineChart core. Thank you @fish2016 This document was written.
Notice ​
File directory description ​
- dist//Â Â Store compiled files
- docs//Â Â Docs directory
- scripts//Â Â Built script directory
- src//Â Â Source code directory
- common//Â Â Store some public basic files
- utils//Â Â Util directory
- component//Â Â Component directory
- extension//Â Â Some module directory that can be extended
- figure//Â Â Basic drawing directory
- i18n//Â Â International directory
- indicator//Â Â Indicator directory
- overlay//Â Â Overlay directory
- styles//Â Â Style directory
- x-axis//Â Â X-axis directory
- y-axis//Â Â Y-axis directory
- pane//Â Â Panel directory
- store//Â Â Data store directory
- view//Â Â Draw module directory
- widget//Â Â Draw module collection directory
- tests//Â Â Test module directory
Module dependencies ​
The above diagram shows the hierarchy of chart modules from top to bottom, with the lower layer serving as the upper layer container.
Figure
Basic shapes, such as circle, polygon, rect, text, etc.View
Retrieve data fromChartStore
and perform single business plotting, such as candlesticks, area, grid line, crosshair, indicator, etcWidget
Create canvas and assemble the relevantView
together.Pane
Create dom container and assemble theWidget
together.Chart
Manage the Panes, such as deleting and adding operations, to form the final chart. In addition, event distribution is also carried out to manipulate the data inChartStore
and notify subordinate components to update as needed.
Development ​
Installation dependencies ​
The project adopts a dependency Node.js The package manager for management requires Node.js environment. You can use npm, pnpm, or yarn to install dependencies.
bash
# Root dir run
npm install
NPM Execute command description ​
lint
: Runnpm run lint
verify code rules.clean
: Runnpm run clean
clean up the built files.build-esm
: Runnpm run build-esm
built esm module.build-cjs
: Runnpm run build-cjs
built commonjs module.build-umd:dev
: Runnpm run build-umd:dev
built umd development module.build-umd:prod
: Runnpm run build-umd:dev
built umd production module.build-umd
: Runnpm run build-umd
built umd development and production module。build-core
: Runnpm run build-core
built esm, commonjs umd development and umd production module.build-dts
: Runnpm run build-dts
generate typescript dependency files.build
: Runnpm run build
built esm, commonjs umd development and umd production module and generate typescript dependency files.
Debug ​
This project does not have a debugging project and requires the creation of a new project, use npm link
import,or import index.ts
debug. You can use vite create a project.