viainti-chart 1.0.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/dist/index.cjs +438 -235
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +438 -235
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -66,11 +66,34 @@ export function Spark() {
|
|
|
66
66
|
}
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
### Compact chart (sin métricas)
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { TradingViewChart, OHLCData } from 'viainti-chart';
|
|
73
|
+
|
|
74
|
+
const cached: OHLCData[] = [...];
|
|
75
|
+
|
|
76
|
+
export function InlineCard() {
|
|
77
|
+
return (
|
|
78
|
+
<TradingViewChart
|
|
79
|
+
data={cached}
|
|
80
|
+
symbol="BTC/USDT"
|
|
81
|
+
showStats={false}
|
|
82
|
+
showHeaderStats={false}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`showStats={false}` elimina las tarjetas de “Trading range / Avg volume / Volatility” y `showHeaderStats={false}` oculta la banda superior (símbolo + O/H/L/C/V) y el footer “Feed Binance Composite”. Para verlo en vivo ejecuta `npm run dev` y abre `http://localhost:5173?mode=simple`; cambia a `?mode=advanced` para volver al layout completo.
|
|
89
|
+
|
|
69
90
|
## API
|
|
70
91
|
|
|
71
92
|
### `<TradingViewChart />`
|
|
72
93
|
- `data: OHLCData[]` – candles with `open`, `high`, `low`, `close`, optional `volume` & `timestamp`.
|
|
73
94
|
- `symbol?: string` – label displayed in the header (default `VIA/USDT`).
|
|
95
|
+
- `showStats?: boolean` – toggle the lower metric cards (defaults to `true`).
|
|
96
|
+
- `showHeaderStats?: boolean` – hides the hero ribbon/footer for an ultra-compact mode when set to `false`.
|
|
74
97
|
|
|
75
98
|
### `<Chart />`
|
|
76
99
|
- `data: OHLCData[]`
|
|
@@ -123,13 +146,19 @@ npm run dev # launches the Vite example in /example
|
|
|
123
146
|
|
|
124
147
|
## Publishing a new version
|
|
125
148
|
|
|
149
|
+
1. Actualiza la versión en `package.json` (o ejecuta `npm version <patch|minor|major>` para crear la etiqueta automáticamente).
|
|
150
|
+
2. Ejecuta `npm install` (si es la primera vez en esa máquina) y luego `npm run build` para regenerar `dist/`.
|
|
151
|
+
3. Revisa el README / changelog y confirma que todo lo documentado corresponde a la versión que vas a subir.
|
|
152
|
+
4. Publica el paquete:
|
|
153
|
+
|
|
126
154
|
```bash
|
|
127
|
-
npm run build #
|
|
128
|
-
npm version patch # or minor/major as needed
|
|
155
|
+
npm run build # asegúrate de que dist/ está actualizado
|
|
129
156
|
npm publish --access public
|
|
130
157
|
```
|
|
131
158
|
|
|
132
159
|
> If `npm publish` returns `Access token expired or revoked`, run `npm logout`, then authenticate again with `npm login` (or `npm adduser`) before retrying. Use `npm whoami` to confirm the session is active and `npm config get registry` to ensure you're pushing to `https://registry.npmjs.org/`.
|
|
160
|
+
>
|
|
161
|
+
> Para etiquetar la build compacta, publica normalmente (tag `latest`) y luego añade un dist-tag separado, por ejemplo: `npm dist-tag add viainti-chart@1.0.3 simple`. Así podrás instalarla con `npm install viainti-chart@simple` en proyectos que necesiten el modo reducido por defecto.
|
|
133
162
|
|
|
134
163
|
## Credits
|
|
135
164
|
|