|
1 | 1 | <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"> |
3 | 3 | </p> |
4 | 4 |
|
5 | | -# Template: SolidJS Library |
| 5 | +# @dschz/solid-tradingview-widgets |
6 | 6 |
|
7 | | -Template for [SolidJS](https://www.solidjs.com/) library package. Bundling of the library is managed by [tsup](https://tsup.egoist.dev/). |
| 7 | +[](LICENSE) |
| 8 | +[](https://www.npmjs.com/package/@dschz/solid-tradingview-widgets) |
| 9 | +[](https://bundlephobia.com/package/@dschz/solid-tradingview-widgets) |
| 10 | +[](https://github.com/dsnchz/solid-tradingview-widgets/actions/workflows/ci.yaml) |
8 | 11 |
|
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. |
10 | 13 |
|
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 |
17 | 15 |
|
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 |
19 | 24 |
|
20 | | -Some pre-requisites before install dependencies: |
| 25 | +## 🎮 Interactive Playground |
21 | 26 |
|
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 | + |
30 | 28 |
|
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: |
32 | 45 |
|
33 | 46 | ```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 |
35 | 52 | 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 |
36 | 60 | ``` |
37 | 61 |
|
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 |
39 | 108 |
|
40 | 109 | ```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 |
42 | 117 | ``` |
43 | 118 |
|
44 | | -### Linting & Formatting |
| 119 | +### Basic Usage |
45 | 120 |
|
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: |
49 | 143 |
|
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 | +/> |
52 | 156 | ``` |
53 | 157 |
|
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 |
55 | 260 |
|
56 | | -The only requirements when contributing are: |
| 261 | +## 📄 License |
57 | 262 |
|
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. |
0 commit comments