@wick-charts/vue 0.2.1 → 0.2.3

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 CHANGED
@@ -1,8 +1,8 @@
1
- <!-- Generated from README.tmpl.md — edit the template, not this file. -->
2
-
3
1
  # Wick Charts
4
2
 
5
- High-performance timeseries charts for **React**, **Vue**, and **Svelte**. Canvas-rendered, tree-shakeable, ~25KB gzipped.
3
+ <!-- Generated from README.tmpl.md — edit the template, not this file. -->
4
+
5
+ High-performance timeseries charts for **React**, **Vue**, and **Svelte**. Canvas-rendered, tree-shakeable, ~36KB gzipped when tree-shaken.
6
6
 
7
7
  [Live Demo](https://mo4islona.github.io/wick-charts/)
8
8
 
@@ -72,8 +72,6 @@ Every DOM overlay ships a default UI **and** a scoped slot / render-prop so you
72
72
  | `PieTooltip` | Tooltip for pie/donut hover | `{ info, format }` |
73
73
  | `PieLegend` | Slice labels with values or percentages | `{ slices, mode, format }` |
74
74
 
75
- > `TooltipLegend` is the former name of `InfoBar` and is still exported as a deprecated alias.
76
-
77
75
  ## Custom render (slots / render-props)
78
76
 
79
77
  ```vue
@@ -102,7 +100,7 @@ Each overlay has its own slot context (see the Slot ctx column above); the shape
102
100
  Every numeric overlay accepts a `format` prop so you can override the default label rendering. Two shared helpers ship in each framework package (`@wick-charts/react`, `@wick-charts/vue`, `@wick-charts/svelte`):
103
101
 
104
102
  - `formatCompact(v)` — K/M/B/T suffixes with adaptive precision. Default for `YAxis` (at ranges ≥ 1e6), `PieLegend`, `PieTooltip`, `Sparkline`.
105
- - `formatPriceAdaptive(v)` — full-precision display that scales decimals to the value's magnitude. Default for `Tooltip` / `TooltipLegend` OHLC and line-value cells. Handles sub-cent prices (`0.00001234` → `"0.00001234"`, not `"0.00"`).
103
+ - `formatPriceAdaptive(v)` — full-precision display that scales decimals to the value's magnitude. Default for `Tooltip` / `InfoBar` OHLC and line-value cells. Handles sub-cent prices (`0.00001234` → `"0.00001234"`, not `"0.00"`).
106
104
 
107
105
  ```vue
108
106
  <script setup>
@@ -118,7 +116,7 @@ const tipFormat = (v, field) => (field === 'volume' ? formatCompact(v) : v.toFix
118
116
  </template>
119
117
  ```
120
118
 
121
- Tooltip / TooltipLegend pass a `field` arg (`'open' | 'high' | 'low' | 'close' | 'volume' | 'value'`) so you can branch on which cell you're formatting. All other overlays receive a single `value: number`.
119
+ Tooltip / InfoBar pass a `field` arg (`'open' | 'high' | 'low' | 'close' | 'volume' | 'value'`) so you can branch on which cell you're formatting. All other overlays receive a single `value: number`.
122
120
 
123
121
  ## Themes
124
122
 
@@ -189,7 +187,7 @@ Full `dist/index.js` (minified + gzipped):
189
187
 
190
188
  | Package | Raw | Gzip |
191
189
  |---|---|---|
192
- | `@wick-charts/vue` | 176 KB | 44.2 KB |
190
+ | `@wick-charts/vue` | 219 KB | 57.3 KB |
193
191
 
194
192
  ## Migration
195
193
 
@@ -197,4 +195,4 @@ Upgrading across versions? See [MIGRATION.md](https://github.com/mo4islona/wick-
197
195
 
198
196
  ## License
199
197
 
200
- MIT
198
+ MIT
package/dist/index.d.ts CHANGED
@@ -38,9 +38,7 @@ declare const __VLS_component_7: DefineComponent<__VLS_Props_12, {}, {}, {}, {},
38
38
  containerRef: HTMLDivElement;
39
39
  }, any>;
40
40
 
41
- declare const __VLS_component_8: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
42
-
43
- declare const __VLS_component_9: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
41
+ declare const __VLS_component_8: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
44
42
 
45
43
  declare type __VLS_Props = {
46
44
  data: TimePoint[][];
@@ -264,25 +262,6 @@ declare function __VLS_template_7(): {
264
262
  };
265
263
 
266
264
  declare function __VLS_template_8(): {
267
- attrs: Partial<{}>;
268
- slots: Readonly<{
269
- default?(ctx: {
270
- snapshots: readonly SeriesSnapshot[];
271
- time: number;
272
- isHover: boolean;
273
- }): unknown;
274
- }> & {
275
- default?(ctx: {
276
- snapshots: readonly SeriesSnapshot[];
277
- time: number;
278
- isHover: boolean;
279
- }): unknown;
280
- };
281
- refs: {};
282
- rootEl: any;
283
- };
284
-
285
- declare function __VLS_template_9(): {
286
265
  attrs: Partial<{}>;
287
266
  slots: Readonly<{
288
267
  default?(ctx: {
@@ -323,8 +302,6 @@ declare type __VLS_TemplateResult_7 = ReturnType<typeof __VLS_template_7>;
323
302
 
324
303
  declare type __VLS_TemplateResult_8 = ReturnType<typeof __VLS_template_8>;
325
304
 
326
- declare type __VLS_TemplateResult_9 = ReturnType<typeof __VLS_template_9>;
327
-
328
305
  declare type __VLS_WithTemplateSlots<T, S> = T & {
329
306
  new (): {
330
307
  $slots: S;
@@ -373,12 +350,6 @@ declare type __VLS_WithTemplateSlots_8<T, S> = T & {
373
350
  };
374
351
  };
375
352
 
376
- declare type __VLS_WithTemplateSlots_9<T, S> = T & {
377
- new (): {
378
- $slots: S;
379
- };
380
- };
381
-
382
353
  export declare const andromeda: ThemePreset;
383
354
 
384
355
  /**
@@ -833,7 +804,7 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> {
833
804
  * — vertical padding only affects the Y-range computation, so touching it
834
805
  * shouldn't reset the user's zoom / auto-scroll state. This matters when
835
806
  * a wrapper re-applies padding reactively (e.g. in response to a Title /
836
- * TooltipLegend ResizeObserver).
807
+ * InfoBar ResizeObserver).
837
808
  */
838
809
  setPadding(padding: ChartOptions['padding']): void;
839
810
  /** Show or hide the background grid. Takes effect on the next render frame. */
@@ -1685,14 +1656,12 @@ export declare const Title: __VLS_WithTemplateSlots_6<typeof __VLS_component_6,
1685
1656
 
1686
1657
  export declare const Tooltip: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
1687
1658
 
1688
- /** Fields surfaced to a `Tooltip` / `TooltipLegend` formatter. */
1659
+ /** Fields surfaced to a `Tooltip` / `InfoBar` formatter. */
1689
1660
  export declare type TooltipField = 'open' | 'high' | 'low' | 'close' | 'volume' | 'value';
1690
1661
 
1691
1662
  /** Signature for the tooltip formatter — single prop, field hint. */
1692
1663
  export declare type TooltipFormatter = (value: number, field: TooltipField) => string;
1693
1664
 
1694
- export declare const TooltipLegend: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
1695
-
1696
1665
  export declare interface TooltipPosition {
1697
1666
  left: number;
1698
1667
  top: number;
@@ -1770,7 +1739,7 @@ export declare function useYRange(chart: ChartInstance): Ref<YRange>;
1770
1739
  * - Number.MAX_SAFE_INTEGER falls back to scientific notation (>= 1e15)
1771
1740
  *
1772
1741
  * Consumers can import these directly, or swap them in per-component via the
1773
- * `format` prop on Tooltip/TooltipLegend/YAxis/etc. (see framework wrappers).
1742
+ * `format` prop on Tooltip/InfoBar/YAxis/etc. (see framework wrappers).
1774
1743
  */
1775
1744
  /** Signature for a value-to-string formatter (YAxis, YLabel, Pie, Sparkline, NumberFlow). */
1776
1745
  export declare type ValueFormatter = (value: number) => string;
@@ -1803,7 +1772,7 @@ export declare interface YAxisConfig {
1803
1772
  visible?: boolean;
1804
1773
  }
1805
1774
 
1806
- export declare const YLabel: __VLS_WithTemplateSlots_9<typeof __VLS_component_9, __VLS_TemplateResult_9["slots"]>;
1775
+ export declare const YLabel: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
1807
1776
 
1808
1777
  /** Direction of the current value vs. previous close. Drives the badge color in the default UI. */
1809
1778
  declare type YLabelDirection = 'up' | 'down' | 'neutral';