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
- 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
Project mandatory use of [pnpm](https://pnpm.io)As a package manager, it is necessary to use pnpm to install dependencies.
bash
# Root dir run
pnpm install
Execute command description
code-lint
: Runpnpm run code-lint
verify code rules.clean
: Runpnpm run clean
clean up the built files.build-esm
: Runpnpm run build-esm
built esm module.build-cjs
: Runpnpm run build-cjs
built commonjs module.build-umd:dev
: Runpnpm run build-umd:dev
built umd development module.build-umd:prod
: Runpnpm run build-umd:dev
built umd production module.build-umd
: Runpnpm run build-umd
built umd development and production module。build-core
: Runpnpm run build-core
built esm, commonjs umd development and umd production module.build-dts
: Runpnpm run build-dts
generate typescript dependency files.build
: Runpnpm 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.