lightweight-charts
하는 일
이 스킬은 AI 에이전트가 Lightweight Charts 라이브러리로 차트를 만들고 업데이트하도록 돕습니다. 웹 앱에서 가격 차트나 시간 기반 차트를 만드는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓웹 페이지에 캔들스틱, 선, 히스토그램 차트를 추가하고 싶을 때.
- ✓실시간 또는 과거 가격 데이터를 기존 차트에 계속 넣어야 하는 경우.
- ✓차트에 마커, 툴팁, 패널, 색상을 추가하고 싶을 때.
스킬 링크
https://github.com/tradingview/lightweight-charts/blob/master/.github/skills/lightweight-charts/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Lightweight Charts로 실시간 가격 업데이트가 있는 캔들스틱 차트를 추가하는 방법을 보여 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 프로젝트가 쓰는 라이브러리 버전을 확인하고, 타이핑 정보를 읽은 뒤, 올바른 옵션 이름으로 코드를 작성합니다. 존재하지 않는 메서드를 추측해서 쓰지 않습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Lightweight Charts skill
Works the same whether the project is a downstream npm consumer app or an upstream lightweight-charts source checkout. Detect which one you are in (below) and resolve every API name from whatever typings are locally available.
Source lookup order
Do not assume you are inside the upstream source repository.
- In a consumer app, inspect the installed package first:
node_modules/lightweight-charts/package.jsonfor the actual version.node_modules/lightweight-charts/dist/typings.d.tsfor the API surface.
- In the upstream repo, inspect
dist/typings.d.tsfirst, thensrc/if generated output is unavailable. - Use official docs/examples as supporting evidence, but local typings win when they disagree.
Verify before answering (copy-paste):
node -p "require('./node_modules/lightweight-charts/package.json').version"
rg -n "createSeriesMarkers|addSeries|IPrimitivePaneRenderer|createImageWatermark|createOptionsChart" node_modules/lightweight-charts/dist/typings.d.ts
# upstream checkout instead of a consumer app:
rg -n "createSeriesMarkers|IPrimitivePaneRenderer|createImageWatermark|createOptionsChart" dist/typings.d.ts src
If the relevant file is unavailable, say what could not be verified. Do not invent option names, methods, exports, or wrapper behavior.
If the user's code imports from lightweight_charts import ... (underscore), uses pandas/asyncio, or talks about a Python window wrapper, they are probably using the third-party Python wrapper rather than the TypeScript package. Say that clearly before giving core lightweight-charts v5 JavaScript advice.
Mental model
Eight layers, in dependency order. Most bugs come from confusing one for another:
- Chart —
createChart(container, options)returns anIChartApi. One chart per container element. - Series — added via
chart.addSeries(SeriesType, options, paneIndex?). Each call returns anISeriesApi. v5 requires importing the series type explicitly. - Scales —
chart.timeScale()(ITimeScaleApi),chart.priceScale(id)(IPriceScaleApi). Govern range, ticks, autoscale, visibility. - Data model — arrays of
{ time, … }points.Time = UTCTimestamp | BusinessDay | string.UTCTimestampis seconds, not milliseconds. Times must be unique and ascending per series. - Interaction —
chart.subscribeCrosshairMove,chart.subscribeClick,timeScale.subscribeVisibleLogicalRangeChange, etc. - Layout —
chart.panes(),chart.addPane(). Adding a series with an out-of-rangepaneIndexauto-creates the pane. - Extension — pane primitives, series primitives, custom series, watermarks, custom renderers (canvas via
fancy-canvas). - Wrappers — React/Vue/Web Components/iOS/Android. Lifecycle is the wrapper's responsibility; the core library is framework-agnostic.
v5 essentials
The conventions that catch people copying older snippets:
import { createChart, CandlestickSeries, LineSeries } from 'lightweight-charts';
const chart = createChart(container, { /* ChartOptions */ });
const candles = chart.addSeries(CandlestickSeries, { /* options */ });
candles.setData([
{ time: 1700000000, open: 1, high: 2, low: 0.5, close: 1.5 },
]);
Key v5 changes versus older snippets:
chart.addSeries(SeriesType, options, paneIndex?)replacesaddLineSeries/addCandlestickSeries/ …createSeriesMarkers(series, markers)replacesseries.setMarkers(...). The returned primitive owns.setMarkers(...)/.markers().createTextWatermark(pane, options)andcreateImageWatermark(pane, imageUrl, options)replace thewatermarkchart option.- Series types are tree-shaken — importing them is required for ESM.
If a snippet calls addLineSeries or series.setMarkers, it's v4 or older. Confirm the user's version before forwarding it.
When the task targets v5, show the v5 API directly — do not hedge by mixing in v4 syntax.
Triage (problem → API → avoid)
| User asks about | First check | Answer with | Avoid |
|---|---|---|---|
| v5 series creation | package version + typings | chart.addSeries(SeriesType, options) |
addLineSeries / addCandlestickSeries |
| markers | createSeriesMarkers export |
marker primitive + required color |
series.setMarkers |
| timezone | formatter need vs data semantics | Intl.DateTimeFormat in formatters |
fake timeScale.timezone |
| realtime updates | last-bar vs full replace | series.update(point) |
자주 묻는 질문
에이전트가 제 프로젝트에 라이브러리가 설치되어 있어야 하나요?
설치되어 있으면 가장 잘 작동합니다. 정확한 버전과 타이핑 정보를 읽을 수 있기 때문입니다. 필요하면 공식 문서도 활용할 수 있습니다.
React나 Vue 래퍼도 도와줄 수 있나요?
네. 스킬은 두 프레임워크의 래퍼 옵션을 다룹니다.
에이전트가 어떤 내용을 확인하지 못하면 어떻게 하나요?
확인하지 못한 내용을 말해 주므로, 직접 확인해야 할 부분을 알 수 있습니다.
상세 정보
작성자의 원본 설명
Use when working with TradingView's lightweight-charts — creating charts, adding series (Line/Area/Bar/Candlestick/Histogram), configuring time and price scales, streaming realtime or historical data, panes, markers, per-bar/per-point colors, tooltips, coordinate conversion, custom plugins or primitives, non-financial horizontal scales, SSR/browser loading, or React/Vue/Web Components wrappers. Covers v5 API conventions and the common time, scale, marker, plugin, and wrapper foot-guns.
인기도
- GitHub 스타
- 18k
- 순위
- #10735
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.