Skip to content

Commit b191366

Browse files
committed
feat: initial implementation of tradingview widgets
1 parent a8dc388 commit b191366

34 files changed

+10595
-60
lines changed

README.md

Lines changed: 238 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,263 @@
11
<p>
2-
<img width="100%" src="https://assets.solidjs.com/banner?type=Ecosystem&background=tiles&project=library-name" alt="solid-create-script">
2+
<img width="100%" src="https://assets.solidjs.com/banner?type=Ecosystem&background=tiles&project=Solid-TradingView-Widgets" alt="SolidJS TradingView Widgets">
33
</p>
44

5-
# Template: SolidJS Library
5+
# @dschz/solid-tradingview-widgets
66

7-
Template for [SolidJS](https://www.solidjs.com/) library package. Bundling of the library is managed by [tsup](https://tsup.egoist.dev/).
7+
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
8+
[![npm](https://img.shields.io/npm/v/@dschz/solid-tradingview-widgets?color=blue)](https://www.npmjs.com/package/@dschz/solid-tradingview-widgets)
9+
[![Bundle Size](https://img.shields.io/bundlephobia/minzip/@dschz/solid-tradingview-widgets)](https://bundlephobia.com/package/@dschz/solid-tradingview-widgets)
10+
[![CI](https://github.com/dsnchz/solid-tradingview-widgets/actions/workflows/ci.yaml/badge.svg)](https://github.com/dsnchz/solid-tradingview-widgets/actions/workflows/ci.yaml)
811

9-
Other things configured include:
12+
A comprehensive collection of **embeddable TradingView iframe widgets** for [SolidJS](https://www.solidjs.com/) applications. This library provides type-safe, reactive components that embed TradingView's powerful financial widgets directly into your SolidJS applications.
1013

11-
- Bun (for dependency management and running scripts)
12-
- TypeScript
13-
- ESLint / Prettier
14-
- Solid Testing Library + Vitest (for testing)
15-
- Playground app using library
16-
- GitHub Actions (for all CI/CD)
14+
## 🌟 Features
1715

18-
## Getting Started
16+
- **🎯 Type-Safe**: Full TypeScript support with comprehensive prop validation
17+
- **⚡ Reactive**: Built for SolidJS with reactive prop updates
18+
- **🎨 Customizable**: Extensive theming and styling options
19+
- **📱 Responsive**: Mobile-friendly widgets that adapt to container sizes
20+
- **🌍 Multi-Language**: Support for 30+ locales
21+
- **🔧 iframe-Based**: Secure, sandboxed TradingView widgets
22+
- **📦 Tree-Shakable**: Import only the widgets you need
23+
- **🚀 Performance**: Optimized loading and error handling
1924

20-
Some pre-requisites before install dependencies:
25+
## 🎮 Interactive Playground
2126

22-
- Install Node Version Manager (NVM)
23-
```bash
24-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
25-
```
26-
- Install Bun
27-
```bash
28-
curl -fsSL https://bun.sh/install | bash
29-
```
27+
![Demo screenshot](./assets/playground_snap.png)
3028

31-
### Installing Dependencies
29+
Explore all 12 widgets with real-time configuration controls, theme switching, and live examples.
30+
31+
The playground features:
32+
33+
- **📊 12 Widgets**: Complete collection with interactive demos (more to come in the future)
34+
- **⚙️ Live Configuration**: Adjust props and see changes instantly
35+
- **🎨 Theme Testing**: Switch between light/dark modes
36+
- **📱 Responsive Preview**: Test different sizes and layouts
37+
- **🔍 Feature Comparison**: Side-by-side widget comparisons
38+
- **📝 Code Examples**: Copy implementation examples
39+
40+
Perfect for testing widgets before integration, exploring customization options, and understanding each widget's capabilities.
41+
42+
### Run Playground Locally
43+
44+
To explore the playground locally or contribute to its development:
3245

3346
```bash
34-
nvm use
47+
# Clone the repository
48+
git clone https://github.com/dsnchz/solid-tradingview-widgets.git
49+
cd solid-tradingview-widgets
50+
51+
# Install dependencies
3552
bun install
53+
# or yarn install
54+
# or pnpm install
55+
56+
# Start the development server
57+
bun start
58+
59+
# Open http://localhost:3000 in your browser
3660
```
3761

38-
### Local Development Build
62+
The local playground includes hot-reload for instant feedback when exploring widget configurations or contributing improvements.
63+
64+
## 📊 Available Widgets
65+
66+
> Note: Not all widget components have been implemented. The rest will be planned in a future release.
67+
68+
### 📈 Charts
69+
70+
| Widget | Description | Key Features |
71+
| ------------------ | --------------------------- | ------------------------------------------------ |
72+
| **AdvancedChart** | Full-featured trading chart | 100+ indicators, drawing tools, multi-timeframes |
73+
| **MiniChart** | Compact price chart | Lightweight, customizable colors, date ranges |
74+
| **SymbolOverview** | Symbol with mini chart | Price + chart combination |
75+
76+
### 🏷️ Symbol Details
77+
78+
| Widget | Description | Key Features |
79+
| --------------------- | -------------------------- | ---------------------------------------- |
80+
| **SymbolInfo** | Real-time symbol data | Price, change, volume, market cap |
81+
| **TechnicalAnalysis** | Technical indicator gauges | RSI, MACD, moving averages analysis |
82+
| **FundamentalData** | Financial metrics | P/E ratios, revenue, margins, growth |
83+
| **CompanyProfile** | Company information | Business description, sector, statistics |
84+
85+
### 🎯 Tickers
86+
87+
| Widget | Description | Key Features |
88+
| ---------------- | ------------------------ | --------------------- |
89+
| **SingleTicker** | Individual symbol ticker | Compact price display |
90+
91+
### 🔍 Screeners
92+
93+
| Widget | Description | Key Features |
94+
| ---------------- | ------------------------------ | ----------------------------------- |
95+
| **Screener** | Multi-market stock screener | Filter by fundamentals & technicals |
96+
| **CryptoMarket** | Cryptocurrency market overview | USD/BTC pricing, market cap ranking |
97+
98+
### 📰 News & Events
99+
100+
| Widget | Description | Key Features |
101+
| -------------------- | ------------------------ | ------------------------------------ |
102+
| **TopStories** | Financial news feed | Market news, symbol-specific stories |
103+
| **EconomicCalendar** | Economic events calendar | GDP, inflation, central bank events |
104+
105+
## 🚀 Quick Start
106+
107+
### Installation
39108

40109
```bash
41-
bun start
110+
npm install @dschz/solid-tradingview-widgets
111+
# or
112+
yarn add @dschz/solid-tradingview-widgets
113+
# or
114+
pnpm add @dschz/solid-tradingview-widgets
115+
# or
116+
bun add @dschz/solid-tradingview-widgets
42117
```
43118

44-
### Linting & Formatting
119+
### Basic Usage
45120

46-
```bash
47-
bun run lint # checks source for lint violations
48-
bun run format # checks source for format violations
121+
```tsx
122+
import { AdvancedChart, SingleTicker, TopStories } from "@dschz/solid-tradingview-widgets";
123+
124+
function App() {
125+
return (
126+
<div>
127+
{/* Apple stock chart */}
128+
<AdvancedChart symbol="NASDAQ:AAPL" colorTheme="dark" width={800} height={400} />
129+
130+
{/* Bitcoin price ticker */}
131+
<SingleTicker symbol="BINANCE:BTCUSDT" colorTheme="light" />
132+
133+
{/* Financial news */}
134+
<TopStories feedMode="all_symbols" colorTheme="light" />
135+
</div>
136+
);
137+
}
138+
```
139+
140+
## 🎨 Theming & Customization
141+
142+
All widgets support extensive customization options:
49143

50-
bun run lint:fix # fixes lint violations
51-
bun run format:fix # fixes format violations
144+
```tsx
145+
<AdvancedChart
146+
symbol="NASDAQ:AAPL"
147+
colorTheme="dark"
148+
backgroundColor="rgba(13, 13, 13, 1)"
149+
gridColor="rgba(255, 255, 255, 0.1)"
150+
locale="es"
151+
timezone="America/New_York"
152+
showVolume={true}
153+
showDrawingToolsBar={true}
154+
indicators={["relativeStrengthIndex", "bollingerBands"]}
155+
/>
52156
```
53157

54-
### Contributing
158+
### Color Format Support
159+
160+
Widgets support all CSS color formats:
161+
162+
- **Hex**: `#1a1a1a`, `#ff6b3580`
163+
- **RGB/RGBA**: `rgb(255, 107, 53)`, `rgba(41, 98, 255, 0.3)`
164+
- **HSL**: `hsl(210, 100%, 50%)`
165+
- **OKLCH**: `oklch(0.7 0.15 180)`
166+
167+
## 🌍 Multi-Language Support
168+
169+
The library supports 30+ languages:
170+
171+
```tsx
172+
<Screener
173+
exchange="germany"
174+
locale="de" // German
175+
colorTheme="light"
176+
/>
177+
178+
<EconomicCalendar
179+
locale="ja" // Japanese
180+
colorTheme="dark"
181+
/>
182+
```
183+
184+
## 📱 Responsive Design
185+
186+
Widgets automatically adapt to their containers:
187+
188+
```tsx
189+
{
190+
/* Full-width responsive chart */
191+
}
192+
<AdvancedChart
193+
symbol="FOREX:EURUSD"
194+
autosize={true} // Takes full container size
195+
/>;
196+
197+
{
198+
/* Fixed-size chart */
199+
}
200+
<AdvancedChart symbol="FOREX:EURUSD" width={600} height={400} autosize={false} />;
201+
```
202+
203+
## 🔧 iframe Architecture
204+
205+
These widgets are **embedded TradingView iframes**, which means:
206+
207+
-**Secure**: Sandboxed execution environment
208+
-**Reliable**: Direct data from TradingView servers
209+
-**Up-to-date**: Always latest TradingView features
210+
-**Performance**: Optimized by TradingView team
211+
- ⚠️ **Network Required**: Widgets need internet connectivity
212+
- ⚠️ **External Dependency**: Relies on TradingView's CDN
213+
214+
## 🔮 Upcoming Widgets
215+
216+
The following widget categories are planned for future releases:
217+
218+
### 📋 Watchlist/Ticker Widgets
219+
220+
- **Ticker**: Horizontal glance of instrument stats
221+
- **TickerTape**: Wall Street style scrolling ticker tape
222+
- **MarketOverview**: Market sector performance overview
223+
- **StockMarket**: Customizable stock market watchlists
224+
- **MarketData**: Real-time market data tables
225+
226+
### 🗺️ Heatmap Widgets
227+
228+
- **StockHeatmap**: Stock performance heatmaps
229+
- **CryptoCoinsHeatmap**: Cryptocurrency market heatmaps
230+
- **ForexCrossRates**: Currency cross-rates visualization
231+
- **ETFHeatmap**: ETF performance heatmaps
232+
- **ForexHeatmap**: Forex market strength visualization
233+
234+
_Stay tuned for these exciting additions in upcoming releases!_
235+
236+
## 📚 Documentation
237+
238+
### Widget Categories
239+
240+
- **[Charts](https://www.tradingview.com/widget-docs/widgets/charts/)**: Advanced charting capabilities
241+
- **[Symbol Details](https://www.tradingview.com/widget-docs/widgets/symbol-details/)**: Company and instrument data
242+
- **[Tickers](https://www.tradingview.com/widget-docs/widgets/tickers/)**: Price tickers and feeds
243+
- **[Screeners](https://www.tradingview.com/widget-docs/widgets/screeners/)**: Market screening tools
244+
- **[News](https://www.tradingview.com/widget-docs/widgets/news/)**: Market news tools
245+
- **[Calendars](https://www.tradingview.com/widget-docs/widgets/calendars/)**: Market economic calendars
246+
247+
### API Reference
248+
249+
Each widget comes with comprehensive TypeScript definitions and JSDoc documentation. Check your IDE's IntelliSense for detailed prop descriptions and examples.
250+
251+
## 🤝 Contributing
252+
253+
We welcome contributions! Please follow these guidelines:
254+
255+
- **Clean Git History**: Rebase instead of merge commits
256+
- **Conventional Commits**: Follow [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/)
257+
- **CI Checks**: Ensure all tests and linting pass
258+
- **TypeScript**: Maintain type safety
259+
- **Documentation**: Update JSDoc and README as needed
55260

56-
The only requirements when contributing are:
261+
## 📄 License
57262

58-
- You keep a clean git history in your branch
59-
- rebasing `main` instead of making merge commits.
60-
- Using proper commit message formats that adhere to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
61-
- Additionally, squashing (via rebase) commits that are not [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
62-
- CI checks pass before merging into `main`
263+
MIT License - see [LICENSE](./LICENSE) file for details.

assets/playground_snap.png

491 KB
Loading

bun.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "template-solidjs-library",
2+
"name": "@dschz/solid-tradingview-widgets",
33
"version": "0.0.0",
44
"license": "MIT",
55
"exports": "./src/index.tsx",

package.json

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
{
2-
"name": "template-solidjs-library",
2+
"name": "@dschz/solid-tradingview-widgets",
33
"version": "0.0.0",
4-
"description": "Template for SolidJS library using tsup for bundling. Configured with Bun, NVM, TypeScript, ESLint, Prettier, Vitest, and GHA",
4+
"description": "SolidJS bindings for TradingView Widgets — ready-to-use financial tools you can embed into your website to display market data.",
55
"type": "module",
66
"author": "Daniel Sanchez <[email protected]>",
77
"license": "MIT",
8-
"homepage": "https://github.com/thedanchez/template-solidjs-library#readme",
8+
"homepage": "https://github.com/dsnchz/solid-tradingview-widgets#readme",
99
"repository": {
1010
"type": "git",
11-
"url": "https://github.com/thedanchez/template-solidjs-library.git"
11+
"url": "https://github.com/dsnchz/solid-tradingview-widgets.git"
1212
},
1313
"bugs": {
14-
"url": "https://github.com/thedanchez/template-solidjs-library/issues"
14+
"url": "https://github.com/dsnchz/solid-tradingview-widgets/issues"
1515
},
1616
"publishConfig": {
1717
"access": "public"
1818
},
1919
"files": [
2020
"dist"
2121
],
22+
"keywords": [
23+
"chart",
24+
"charts",
25+
"finance",
26+
"financial-data",
27+
"investment",
28+
"solid",
29+
"solid-component",
30+
"solid-js",
31+
"solidjs",
32+
"stocks",
33+
"trading",
34+
"trading-platform",
35+
"tradingview",
36+
"tradingview-api",
37+
"tradingview-chart",
38+
"tradingview-widgets",
39+
"typescript",
40+
"widget",
41+
"widgets"
42+
],
2243
"main": "./dist/index.js",
2344
"module": "./dist/index.js",
2445
"types": "./dist/index.d.ts",
@@ -78,5 +99,9 @@
7899
},
79100
"peerDependencies": {
80101
"solid-js": ">=1.6.0"
102+
},
103+
"dependencies": {
104+
"@dschz/load-script": "^1.0.7",
105+
"@dschz/try-catch": "^1.1.2"
81106
}
82107
}

0 commit comments

Comments
 (0)