tickup 1.0.34 → 1.0.37

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.
Files changed (33) hide show
  1. package/README.md +52 -31
  2. package/dist/components/Canvas/ChartCanvas.d.ts +0 -2
  3. package/dist/components/Canvas/TickUpStage.d.ts +1 -1
  4. package/dist/hooks/useChartData.d.ts +8 -2
  5. package/dist/tickup-full.cjs.js +7 -4
  6. package/dist/tickup-full.cjs.js.map +1 -1
  7. package/dist/tickup-full.es.js +91 -88
  8. package/dist/tickup-full.es.js.map +1 -1
  9. package/dist/tickup.cjs.js +6 -3
  10. package/dist/tickup.cjs.js.map +1 -1
  11. package/dist/tickup.es.js +86 -83
  12. package/dist/tickup.es.js.map +1 -1
  13. package/documentation/00-getting-started.md +130 -0
  14. package/documentation/01-glossary.md +53 -33
  15. package/documentation/01-introduction.md +39 -7
  16. package/documentation/02-installation.md +16 -14
  17. package/documentation/03-quick-start.md +13 -21
  18. package/documentation/04-products-and-layout.md +10 -16
  19. package/documentation/05-props-and-chart-options.md +41 -51
  20. package/documentation/06-imperative-api.md +40 -66
  21. package/documentation/07-data-and-live-updates.md +40 -28
  22. package/documentation/08-drawings-and-shapes.md +30 -76
  23. package/documentation/09-settings-modal.md +17 -26
  24. package/documentation/10-toolbar-and-interactions.md +80 -49
  25. package/documentation/11-exports-and-advanced.md +48 -106
  26. package/documentation/12-overlays-and-indicators.md +27 -28
  27. package/documentation/13-internationalization-and-axes.md +23 -33
  28. package/documentation/14-legal-and-policies.md +13 -15
  29. package/documentation/16-api-reference.md +422 -0
  30. package/documentation/17-interval-schema-and-debugging.md +86 -0
  31. package/documentation/18-comparison-showcase.md +56 -0
  32. package/documentation/README.md +48 -30
  33. package/package.json +3 -2
@@ -1,10 +1,10 @@
1
1
  # Legal and policies
2
2
 
3
- TickUp ships as **open-source software** (see the **LICENSE** file in the repository root when present) and may also be described, demoed, or offered through **websites, accounts, or hosted services**. **Legal terms for those offerings**—including intellectual property, acceptable use, suspension or termination of access, privacy, and standard limitations of liability—are maintained as **templates** in the repository for you to customize with your lawyer.
3
+ **TickUp Core** is **open-source software** (see the **LICENSE** file in the repository root). Hosted demos or commercial offerings may use separate terms.
4
4
 
5
5
  ## Where to read the documents
6
6
 
7
- Policy templates ship **next to** this folder in the npm package (`node_modules/tickup/legal/`) and in the Git clone. All files live under **[`../legal/`](../legal/)**:
7
+ Policy templates ship next to this folder in the npm package (`node_modules/tickup/legal/`) and in the Git clone under **[`../legal/`](../legal/)**:
8
8
 
9
9
  | Document | File |
10
10
  |----------|------|
@@ -13,28 +13,26 @@ Policy templates ship **next to** this folder in the npm package (`node_modules/
13
13
  | **Privacy Policy** | [`../legal/PRIVACY_POLICY.md`](../legal/PRIVACY_POLICY.md) |
14
14
  | **Acceptable Use Policy** | [`../legal/ACCEPTABLE_USE_POLICY.md`](../legal/ACCEPTABLE_USE_POLICY.md) |
15
15
 
16
- ## What the Terms of Service cover (summary)
16
+ ## Terms of Service (summary)
17
17
 
18
- The Terms of Service template is written so you can:
18
+ The Terms template helps you:
19
19
 
20
- - **Retain ownership** of TickUp branding, product, documentation, and proprietary parts of the Services.
21
- - **Suspend or terminate** user access, change or discontinue features, and refuse service where appropriate, subject to applicable law and any stricter promises you make elsewhere.
22
- - Use **standard protections**: disclaimers of warranty, caps on liability, indemnity where appropriate, governing law and venue placeholders, and rules for changes to the terms.
20
+ - **Retain ownership** of branding, product, and documentation.
21
+ - **Suspend or terminate** access where appropriate, subject to law.
22
+ - Use **standard protections**: warranty disclaimers, liability caps, indemnity, governing law placeholders.
23
23
 
24
- **Open-source code** released under the repo **LICENSE** is called out separately so the license for that code and the Terms for hosted products can coexist without confusion.
24
+ **Open-source code** under the repo **LICENSE** is called out separately from terms for hosted products.
25
25
 
26
26
  ## Not legal advice
27
27
 
28
- These markdown files are **starting points**, not a substitute for counsel. Replace all bracketed placeholders (`[Legal Entity Name]`, `[Contact Email]`, `[Jurisdiction]`, etc.) and adapt clauses for your entity, products, and regions before publication.
28
+ These files are **starting points**. Replace bracketed placeholders and adapt with qualified counsel before publication.
29
29
 
30
30
  ## Older stub
31
31
 
32
- A short legacy note lives in the repo under **`docs/Documentation/Terms_of_Use.md`** (that tree is **not** bundled on npm). [View on GitHub](https://github.com/BARDAMRI/TickUp/blob/main/docs/Documentation/Terms_of_Use.md) — it points here and to **`legal/`**.
32
+ A legacy note may live under **`docs/Documentation/Terms_of_Use.md`** (not bundled on npm).
33
33
 
34
- ### Pro Tip
34
+ ---
35
35
 
36
- Commercial Prime deployments should always pair technical rollout with the appropriate legal terms and policy templates for hosted services.
36
+ ## Tier comparison: TickUp Prime
37
37
 
38
- ### Prime Showcase
39
-
40
- [Explore the TickUp Prime Showcase](https://bardamri.github.io/tickup-charts/)
38
+ Commercial **TickUp Prime** subscriptions should use counsel-approved terms for billing and support. OSS **LICENSE** terms govern this Core package. **[TickUp Prime](https://github.com/BARDAMRI/tickup-prime)**
@@ -0,0 +1,422 @@
1
+ # API reference — TickUpHost, chart options & render engine
2
+
3
+ This page lists **host props** and **`chartOptions`** fields as implemented in **TickUp Core** (Standard Tier / Standard Edition). Types ship in **`dist/*.d.ts`** in the published package.
4
+
5
+ **Authoritative TypeScript sources:** `TickUpHostProps` in `src/components/TickUpHost.tsx`; `ChartOptions`, `StyleOptions`, and related enums in `src/types/chartOptions.ts`; `ChartTheme` in `src/types/types.ts`; overlay types in `src/types/overlay.ts`.
6
+
7
+ **Standard Tier guardrails** (apply unless you use a **licensed Prime-tier** deployment that opts out of throttling):
8
+
9
+ - **History:** at most **5,000** candles retained (`slice(-5000)` semantics).
10
+ - **Live path:** about **1 Hz** (1000 ms) throttle on merges for Standard shells.
11
+ - **Overlays:** at most **3** simultaneous studies from `overlays` / `overlayKinds`; extras are **capped** and a toast may appear.
12
+
13
+ For behavior and debugging, see [Data & live updates](./07-data-and-live-updates.md), [Interval schema & debugging](./17-interval-schema-and-debugging.md), and [Comparison showcase](./18-comparison-showcase.md).
14
+
15
+ **Pointer & wheel behavior** on the plot (pan, zoom, double-click, context menu) is documented in [Toolbar & interactions](./10-toolbar-and-interactions.md).
16
+
17
+ ---
18
+
19
+ ## `tickup` package — public exports (`src/index.ts`)
20
+
21
+ The default **`import … from 'tickup'`** entry re-exports the symbols below. **`tickup/full`** adds shells (`TickUpHost`, products, …); see [Exports & advanced](./11-exports-and-advanced.md).
22
+
23
+ ### Components, context, styling
24
+
25
+ | Export | Kind | Role |
26
+ |--------|------|------|
27
+ | `TickUpStage` | component | Canvas stage: chart, axes, optional chrome; **`TickUpStageProps`**, **`TickUpStageHandle`**. |
28
+ | `Mode` | enum | Drawing / navigation mode (`none`, draw tools, `select`, …). |
29
+ | `ModeProvider`, `useMode` | React | Context for active mode (required around `TickUpStage` when using toolbar drawing tools). |
30
+ | `GlobalStyle` | styled | Optional global CSS fragment used by full hosts. |
31
+
32
+ ### Branding
33
+
34
+ | Export | Kind | Role |
35
+ |--------|------|------|
36
+ | `TickUpMark` | component | DOM wordmark; **`TickUpThemeVariant`**. |
37
+ | `TickUpAttribution` | component | Footer attribution strip; **`TickUpAttributionProps`**. |
38
+ | `TickUpWatermarkPlacement` | enum | `center`, corners — placement key for bundled watermark assets (internal draw paths). |
39
+
40
+ ### Data, time, ranges
41
+
42
+ | Export | Kind | Role |
43
+ |--------|------|------|
44
+ | `Interval` | type | One OHLCV bar (`t` in unix **seconds**). |
45
+ | `TimeRange`, `VisibleViewRanges` | types | Visible time window; view snapshot types for ref APIs. |
46
+ | `ChartDimensionsData` | type | Layout metrics used during render. |
47
+ | `ChartContextInfo` | type | Introspection: symbol, theme, data window, etc. |
48
+
49
+ ### Live data
50
+
51
+ | Export | Kind | Role |
52
+ |--------|------|------|
53
+ | `LiveDataPlacement` | enum | `replace` \| `append` \| `prepend` \| `mergeByTime`. |
54
+ | `LiveDataApplyResult` | type | Result of merge helpers / `applyLiveData`. |
55
+ | `applyLiveDataMerge` | function | Merge intervals by placement (shared with host ref path). |
56
+ | `normalizeInterval`, `normalizeIntervals` | functions | Coerce / validate a bar shape. |
57
+ | `dedupeByTimePreferLast` | function | Sort + dedupe by `t`. |
58
+
59
+ ### Snapshots (PNG / metadata)
60
+
61
+ | Export | Kind | Role |
62
+ |--------|------|------|
63
+ | `captureChartRegionToPngDataUrl` | async function | Rasterize chart region to a data URL. |
64
+ | `buildChartSnapshotFileName`, `sanitizeChartSnapshotToken`, `contrastingFooterTextColor` | functions | Filename + token hygiene + readable footer text. |
65
+ | `ChartSnapshotMeta` | type | Metadata block (symbol, visible range, bar counts, …). |
66
+
67
+ ### Drawings
68
+
69
+ | Export | Kind | Role |
70
+ |--------|------|------|
71
+ | `ShapeType` | enum | Line, rectangle, circle, … |
72
+ | `DrawingSpec`, `DrawingPatch`, `DrawingInput` | types | Specs and patches for programmatic drawings. |
73
+ | `drawingFromSpec`, `applyDrawingPatch`, `isDrawingPatch` | functions | Build / update shapes. |
74
+ | `DrawingSnapshot`, `DrawingQuery`, `DrawingWithZIndex` | types | Query / export drawing state. |
75
+ | `shapeToSnapshot`, `filterDrawingsWithMeta`, `queryDrawingsToSnapshots`, `filterDrawingInstances` | functions | Snapshot and filter helpers. |
76
+ | `ShapeBaseArgs`, `Drawing` | types | Internal shape args / union. |
77
+ | `LineShapeArgs`, `RectangleShapeArgs`, … | types | Per-shape constructor args. |
78
+ | `DrawingStyleOptions`, `DrawingPoint`, `CanvasPoint` | types | Style and geometry primitives. |
79
+ | `IDrawingShape` | type | Instance interface for shapes on canvas. |
80
+ | `generateDrawingShapeId` | function | Stable id factory. |
81
+
82
+ ### Overlays
83
+
84
+ | Export | Kind | Role |
85
+ |--------|------|------|
86
+ | `OverlayWithCalc`, `OverlaySeries`, `OverlayOptions` | types | Styled calc rows and computed series. |
87
+ | `OverlayKind`, `OverlayPriceKey` | enums | Indicator / price field keys. |
88
+ | `StrokeLineStyle` | enum | `solid` \| `dashed` \| `dotted`. |
89
+ | `OverlaySpecs`, `withOverlayStyle`, `overlay` | functions | Build `OverlayWithCalc` trees (see [Overlays](./12-overlays-and-indicators.md)). |
90
+
91
+ ### Chart options — enums & types
92
+
93
+ | Export | Kind | Role |
94
+ |--------|------|------|
95
+ | `ChartOptions` | type | `base` + `axes` tree (merged with defaults in hosts). |
96
+ | `DeepRequired` | type | Utility: deep required mapped type. |
97
+ | `AxesPosition`, `ChartTheme` | enums | Y-axis side; `light` \| `dark` \| `grey`. |
98
+ | `AxesUnitPlacement` | enum | `prefix` \| `suffix` for unit strings. |
99
+ | `ChartType` | enum | `Candlestick`, `Line`, `Area`, `Bar`. |
100
+ | `CurrencyDisplay` | enum | How currency appears on ticks (`symbol`, `code`, …). |
101
+ | `NumberNotation` | enum | `standard` \| `scientific` \| `compact`. |
102
+ | **`PriceMetricKind`** | enum | Axis/tooltip **display modes** for special metrics: `basisPoints`, `pnl`, `yield`, `volatility` — used by formatting paths when set (advanced / internal chart labeling). |
103
+ | `TickUpRenderEngine` | enum | `standard` \| `prime` visual profile (see top of this page). |
104
+ | `TimeDetailLevel` | enum | `auto` \| `low` \| `medium` \| `high` time tick density. |
105
+
106
+ ### Engine helpers (optional Prime **styling** patch)
107
+
108
+ | Export | Kind | Role |
109
+ |--------|------|------|
110
+ | `TickUpChartEngine` | type | Engine profile interface for `setEngine` (full host). |
111
+ | `TickUpPrime`, `TickUpStandardEngine`, `createTickUpPrimeEngine`, `getTickUpPrimeThemePatch` | values | Prime **theme/style** patch builders; Standard Tier data limits still apply in Core. |
112
+ | `TICKUP_PRIME_PRIMARY`, `TICKUP_PRIME_SECONDARY`, `TICKUP_PRIME_TEXT` | constants | Brand palette strings for Prime-styled UI. |
113
+
114
+ ### Coordinate & series math (utilities)
115
+
116
+ | Export | Role |
117
+ |--------|------|
118
+ | `timeToX`, `xToTime` | Map unix time ↔ horizontal pixel in a visible range. |
119
+ | `priceToY`, `yToPrice` | Map price ↔ vertical pixel in a visible price band. |
120
+ | `xFromStart`, `xFromCenter` | Bar **left** vs **center** X placement for a bar’s `t`. |
121
+ | `lerp` | Linear interpolation between two numbers. |
122
+ | `interpolatedCloseAtTime` | Interpolated **close** along sorted intervals at arbitrary `timeSec`. |
123
+
124
+ ---
125
+
126
+ ## `TickUpRenderEngine`
127
+
128
+ **Type:** string enum (`'standard' | 'prime'`).
129
+
130
+ **Purpose:** Selects the **visual profile** for the plot (standard Canvas 2D look vs Prime-styled neon / glass accents in this package). **WebGL** throughput requires the separate **@tickup/prime** engine and license path.
131
+
132
+ | Value | Purpose | Default in merged options |
133
+ |-------|---------|---------------------------|
134
+ | `standard` | Default Canvas 2D presentation. | Yes (`DEFAULT_GRAPH_OPTIONS`) |
135
+ | `prime` | Prime **styling** profile in Core; pair with a Prime engine via ref `setEngine` for full WebGL. | No |
136
+
137
+ If **omitted** in `chartOptions`, the library merge supplies **`standard`**.
138
+
139
+ ---
140
+
141
+ ## `TickUpHost` props (and product wrappers)
142
+
143
+ These props apply to **`TickUpHost`** and tier components **`TickUpPulse`**, **`TickUpFlow`**, **`TickUpCommand`**, **`TickUpDesk`**, **`TickUpPrimeTier`** (some props omitted per product; see **Constraint**).
144
+
145
+ | Prop | Type | Purpose | Default if omitted | Constraint / notes |
146
+ |------|------|---------|-------------------|---------------------|
147
+ | `intervalsArray` | `Interval[]` | Series to plot (**OHLCV**). | `[]` (empty chart) | Clamped to **5,000** bars (Standard Tier). |
148
+ | `initialNumberOfYTicks` | `number` | Seeds `chartOptions.axes.numberOfYTicks` when that field is **not** set in `chartOptions`. | `5` | If you pass `chartOptions.axes.numberOfYTicks`, this prop is ignored. |
149
+ | `initialXAxisHeight` | `number` | Declared on the type; **not** read by `TickUpHost` today. | — | Layout uses internal constants (see `windowSpread` in `src/types/types.ts`). |
150
+ | `initialYAxisWidth` | `number` | Declared on the type; **not** read by `TickUpHost` today. | — | Same as `initialXAxisHeight`. |
151
+ | `initialTimeDetailLevel` | `TimeDetailLevel` | Time axis label density (`auto` / `low` / `medium` / `high`). | `Auto` | Passed through to the stage as `timeDetailLevel`. |
152
+ | `initialTimeFormat12h` | `boolean` | 12h vs 24h time labels. | `false` | Shell/settings time format. |
153
+ | `initialVisibleTimeRange` | `TimeRange` | Declared on the type; **not** wired into `TickUpStage` today. | — | Use imperative `fitVisibleRangeToData` / pan or load data first; visible range is derived after mount. |
154
+ | `chartOptions` | `DeepPartial<ChartOptions>` | Visual + behavior options (merged with defaults). | Internal empty stable ref | Partial deep merge. |
155
+ | `showSidebar` | `boolean` | Drawing tools sidebar. | Product default | **Ignored** when `productId` is set. |
156
+ | `showTopBar` | `boolean` | Top symbol/toolbar row. | Product default | **Ignored** when `productId` is set. |
157
+ | `showSettingsBar` | `boolean` | Settings gear entry. | Product default | **Ignored** when `productId` is set. |
158
+ | `onRefreshRequest` | `() => void \| Promise<void>` | User tapped Refresh in settings toolbar. | — | Hook your data reload. |
159
+ | `symbol` | `string` | Controlled toolbar symbol. | — | Pair with `onSymbolChange`. |
160
+ | `defaultSymbol` | `string` | Initial symbol if uncontrolled. | — | Shown in strip / top bar. |
161
+ | `onSymbolChange` | `(s: string) => void` | Symbol changed. | — | — |
162
+ | `onSymbolSearch` | `(s: string) => …` | User submitted search; return `false` to revert. | — | Async allowed. |
163
+ | `productId` | `TickUpProductId` | Locks layout: pulse / flow / command / desk / prime. | — | Omit for custom chrome flags. |
164
+ | `showAttribution` | `boolean` | In-chart “Powered by” watermark. | `true` (forced on Desk) | Branding policy. |
165
+ | `licenseKey` | `string \| null` | Prime tier license string. | `null` | **`TickUpPrimeTier` only** (evaluation strip if invalid). |
166
+ | `licenseUserIdentifier` | `string \| null` | User id for license pairing. | `null` | Prime tier. |
167
+ | `licenseValidationOverride` | `boolean` | Skip/fake validation (testing). | — | Use only in controlled tests. |
168
+ | `themeVariant` | `ChartTheme` | Controlled shell light / dark / grey. | — | Must update when `onThemeVariantChange` fires. |
169
+ | `defaultThemeVariant` | `ChartTheme` | Uncontrolled initial shell theme. | **`light`** | — |
170
+ | `onThemeVariantChange` | `(v: ChartTheme) => void` | Toolbar theme toggle. | — | — |
171
+ | `interval` | `string` | Controlled timeframe (e.g. `5m`). | — | — |
172
+ | `onIntervalChange` | `(tf: string) => void` | Timeframe changed. | — | — |
173
+ | `onIntervalSearch` | `(tf: string) => …` | Load data for new TF; return `false` on failure. | — | — |
174
+ | `range` | `RangeKey` (see `tickup/full`) | Controlled range key (`1D`, `5D`, `1M`, …). | — | Host typings may use `any`; prefer `RangeKey` in your app. |
175
+ | `onRangeChange` | `(r: RangeKey) => void` | Range changed. | — | — |
176
+ | `initialRange` | `RangeKey` | Initial range if uncontrolled. | — | — |
177
+
178
+ ---
179
+
180
+ ## `ChartTheme`: shell vs plot
181
+
182
+ **Enum:** `light` \| `dark` \| `grey` (`src/types/types.ts`).
183
+
184
+ | Where | What it controls |
185
+ |-------|------------------|
186
+ | **`themeVariant` / `defaultThemeVariant` (host props)** | **Shell:** `GlobalStyle` page background, settings modal chrome, toolbar sun/moon toggle, prime evaluation strip styling. **`dark`** uses a dark page background; **`grey`** and **`light`** use a light page background in the current host. |
187
+ | **`chartOptions.base.theme`** | **Plot intent:** merged into `finalStyleOptions` as the chart’s nominal theme key. User-defined `base.style` colors (candles, grid, axes, …) define what is actually painted on the canvas when the shell is **`light`**. |
188
+ | **Shell not `light`** | **Plot override:** when `themeVariant` is **`dark`** or **`grey`**, `TickUpHost` **deep-merges** a dark palette over `chartOptions` before passing options to the stage (dark canvas background, lighter axis text, adjusted grid/candle border). So non-light shells force a **dark chart surface** even if `base.theme` was `light`. |
189
+
190
+ Use **`chartOptions.base.style`** to fine-tune the canvas after you understand the shell merge above.
191
+
192
+ ---
193
+
194
+ ## `chartOptions.base`
195
+
196
+ Merged onto **`DEFAULT_GRAPH_OPTIONS.base`**. **Omitted** fields keep library defaults.
197
+
198
+ | Field | Type | Purpose | Default (merged) | Standard Tier |
199
+ |-------|------|---------|------------------|---------------|
200
+ | `chartType` | `ChartType` enum | `Candlestick` \| `Line` \| `Area` \| `Bar`. | `Candlestick` | — |
201
+ | `engine` | `TickUpRenderEngine` | Render **style** profile. | `standard` | Does not remove data caps by itself. |
202
+ | `theme` | `ChartTheme` | Plot theme key carried in options; interacts with shell as above. | `light` | — |
203
+ | `showOverlayLine` | `boolean` | Draw indicator overlay lines. | `false` | Max **3** studies. |
204
+ | `showHistogram` | `boolean` | Volume histogram pane under the main plot. | `true` | — |
205
+ | `showCrosshair` | `boolean` | Crosshair lines on hover. | `true` | — |
206
+ | `showCrosshairValues` | `boolean` | Numeric labels on crosshair. | `false` | — |
207
+ | `showCandleTooltip` | `boolean` | OHLC tooltip on hover. | `true` | — |
208
+ | `style` | `StyleOptions` (partial) | Colors, fonts, grid, overlay/drawing styles. | See below | — |
209
+ | `overlays` | `OverlayWithCalc[]` | Fully specified overlay series + style. | `[]` | Max **3** entries; uses **5,000**-bar window. |
210
+ | `overlayKinds` | `(OverlayKind \| OverlayCalcSpec)[]` | Declarative indicators (SMA, EMA, VWAP, …). | `[]` | Max **3** entries. |
211
+
212
+ ---
213
+
214
+ ## `chartOptions.axes`
215
+
216
+ | Field | Type | Purpose | Default (merged) | Notes |
217
+ |-------|------|---------|------------------|-------|
218
+ | `yAxisPosition` | `AxesPosition` | `left` \| `right`. | `left` | Price axis side. |
219
+ | `currency` | `string` | Default currency code for formatting. | `'USD'` | — |
220
+ | `numberOfYTicks` | `number` | How many **horizontal price grid lines** (and matching Y tick labels) the layout targets. | `5` | Does not include axis padding lines; engine may nudge for readability. |
221
+
222
+ ---
223
+
224
+ ## `chartOptions.base.style` — top level
225
+
226
+ | Field | Type | What it paints | Default (merged) |
227
+ |-------|------|----------------|------------------|
228
+ | `showGrid` | `boolean` | Master switch for **price/time grid lines** drawn across the main plot (independent of histogram). | `true` |
229
+ | `backgroundColor` | `string` | **Main plot + histogram** canvas fill behind candles/lines/drawings. | `#ffffff` |
230
+ | `candles` | `CandleStyleOptions` | **Candlestick** bodies, wicks, and horizontal spacing in the slot. | See table below |
231
+ | `line` | `LineStyleOptions` | **Line chart** mode: stroke of the closing-price polyline. | Blue defaults |
232
+ | `area` | `AreaStyleOptions` | **Area chart** mode: fill under the line + outline stroke. | Blue defaults |
233
+ | `histogram` | `HistogramStyleOptions` | **Volume pane** columns (height, color by direction, opacity). | Green/red defaults |
234
+ | `bar` | `BarStyleOptions` | **OHLC bar** mode: vertical segments and colors per direction. | Green/red defaults |
235
+ | `grid` | `GridStyleOptions` | **Grid line** appearance (color, thickness, dash, nominal pixel spacing between lines). | Light grey |
236
+ | `overlay` | `OverlayOptions` | **Default stroke** for computed indicators when a row does not override style. | Orange solid |
237
+ | `axes` | `AxesStyleOptions` | **X/Y tick labels**, axis baseline strokes, number/time formatting, sessions. | See table below |
238
+ | `drawings` | `DrawingStyleOptions` | **User shapes** (lines, fibs, …) and **selection halo**. | Blue / orange selection |
239
+
240
+ ---
241
+
242
+ ## `style.axes` (`AxesStyleOptions`)
243
+
244
+ | Field | Type | What it paints | Default |
245
+ |-------|------|----------------|---------|
246
+ | `axisPosition` | `AxesPosition` | Internal mirror of price axis side (kept in sync with `chartOptions.axes`). | `left` |
247
+ | `textColor` | `string` | **Numeric date/price labels** on both axes. | `#424242` |
248
+ | `font` | `string` | **Font** for those labels (CSS shorthand). | `12px Arial` |
249
+ | `lineColor` | `string` | **Baseline** of X and Y axes (the rules at the plot edge). | `#9e9e9e` |
250
+ | `lineWidth` | `number` | **Stroke width** of those axis baselines. | `1` |
251
+ | `locale` | `string` | **Intl** locale for numbers/dates. | `en-US` |
252
+ | `language` | `string` | Language tag for higher-level formatting. | `en` |
253
+ | `numberFractionDigits` | `number` | Default **decimal places** on price ticks. | `2` |
254
+ | `decimalSeparator` | `string` | **Decimal** character in prices. | `.` |
255
+ | `thousandsSeparator` | `string` | **Grouping** character in prices. | `,` |
256
+ | `dateFormat` | `string` | **Time axis** label pattern. | `MMM d` |
257
+ | `numberNotation` | `NumberNotation` | `standard` \| `scientific` \| `compact` for large/small magnitudes. | `standard` |
258
+ | `currency` | `string` | **ISO currency** when currency display is on. | `USD` |
259
+ | `useCurrency` | `boolean` | Whether to **prefix/suffix** currency on axis prices. | `false` |
260
+ | `currencyDisplay` | `CurrencyDisplay` | **Symbol vs code vs name** for currency. | `symbol` |
261
+ | `minimumFractionDigits` | `number` | **Floor** on decimal digits. | `2` |
262
+ | `maximumFractionDigits` | `number` | **Ceiling** on decimal digits. | `8` |
263
+ | `maximumSignificantDigits` | `number` | **Cap** on significant figures. | `21` |
264
+ | `tickSize` | `number` | **Price step** hint for snapping/labeling. | `0.01` |
265
+ | `autoPrecision` | `boolean` | Let the formatter **expand precision** when needed. | `false` |
266
+ | `unit` | `string` | **Arbitrary suffix/prefix** (e.g. `%`, `bps`) via `unitPlacement`. | `''` |
267
+ | `unitPlacement` | `AxesUnitPlacement` | **Before or after** the numeric tick text. | `suffix` |
268
+ | `timezone` | `string` | **IANA TZ** for session shading and tooltips. | `UTC` |
269
+ | `exchange` | `string` | **Display-only** venue label in chrome/tooltip contexts. | `''` |
270
+ | `tradingSessions` | `TradingSession[]` | **Weekly windows** used when shading session hours on the time axis. | `[]` |
271
+ | `holidays` | `string[]` | **ISO dates** skipped or styled as closed. | `[]` |
272
+ | `displayCurrency` | `string` | **Secondary currency** label path when converting display. | `USD` |
273
+ | `conversionRate` | `number` | **Rate** applied for display conversion. | `1` |
274
+
275
+ *(If a field is absent in your partial `chartOptions`, the merged default from `DefaultData` applies.)*
276
+
277
+ ---
278
+
279
+ ## `style.candles` (`CandleStyleOptions`)
280
+
281
+ | Field | Type | What it paints | Default |
282
+ |-------|------|----------------|---------|
283
+ | `bullColor` | `string` | **Body fill** when close ≥ open (bullish). | `#26a69a` |
284
+ | `bearColor` | `string` | **Body fill** when close < open (bearish). | `#ef5350` |
285
+ | `upColor` | `string` | **Alias** for bullish tone (some code paths use `bullColor` / `upColor` together). | `#26a69a` |
286
+ | `downColor` | `string` | **Alias** for bearish tone. | `#ef5350` |
287
+ | `borderColor` | `string` | **Wick and body outline** stroke. | `#333333` |
288
+ | `borderWidth` | `number` | **Outline width** in pixels for wick/body edges. | `1` |
289
+ | `bodyWidthFactor` | `number` | **Body width** as a fraction of the bar slot (0–1 scale); lower = thinner candle. | `0.6` |
290
+ | `spacingFactor` | `number` | **Gap** between adjacent candles as a fraction of the slot; higher = more air between bodies. | `0.2` |
291
+
292
+ ---
293
+
294
+ ## `style.line` (`LineStyleOptions`)
295
+
296
+ | Field | Type | What it paints | Default |
297
+ |-------|------|----------------|---------|
298
+ | `color` | `string` | **Stroke color** of the line series through `(time, close)` points. | `#2962ff` |
299
+ | `lineWidth` | `number` | **Stroke width** of that polyline in pixels. | `2` |
300
+
301
+ ---
302
+
303
+ ## `style.area` (`AreaStyleOptions`)
304
+
305
+ | Field | Type | What it paints | Default |
306
+ |-------|------|----------------|---------|
307
+ | `fillColor` | `string` | **Interior fill** from the line down to the bottom of the plot. | `rgba(41, 98, 255, 0.2)` |
308
+ | `strokeColor` | `string` | **Top edge** stroke along the same path as the line series. | `rgba(41, 98, 255, 1)` |
309
+ | `lineWidth` | `number` | **Width** of that top edge stroke. | `2` |
310
+
311
+ ---
312
+
313
+ ## `style.histogram` (`HistogramStyleOptions`)
314
+
315
+ | Field | Type | What it paints | Default |
316
+ |-------|------|----------------|---------|
317
+ | `bullColor` | `string` | **Volume bar fill** when close ≥ open. | `#26a69a` |
318
+ | `bearColor` | `string` | **Volume bar fill** when close < open. | `#ef5350` |
319
+ | `opacity` | `number` | **Alpha** of histogram columns (0–1). | `0.5` |
320
+ | `heightRatio` | `number` | **Max column height** as a fraction of the histogram pane height. | `0.3` |
321
+
322
+ ---
323
+
324
+ ## `style.bar` (`BarStyleOptions`)
325
+
326
+ | Field | Type | What it paints | Default |
327
+ |-------|------|----------------|---------|
328
+ | `bullColor` | `string` | **OHLC bar** color when close ≥ open. | `#26a69a` |
329
+ | `bearColor` | `string` | **OHLC bar** color when close < open. | `#ef5350` |
330
+ | `opacity` | `number` | **Alpha** for bar segments. | `0.7` |
331
+
332
+ ---
333
+
334
+ ## `style.grid` (`GridStyleOptions`)
335
+
336
+ | Field | Type | What it paints | Default |
337
+ |-------|------|----------------|---------|
338
+ | `color` | `string` | **Legacy** grid stroke color (still honored where readers fall back to it). | `#e0e0e0` |
339
+ | `lineWidth` | `number` | **Thickness** of horizontal and vertical grid rules. | `1` |
340
+ | `gridSpacing` | `number` | **Target pixel spacing** between adjacent grid lines; the engine snaps to “nice” values from this hint. | `50` |
341
+ | `lineColor` | `string` | **Preferred** grid line color on new drawing paths. | `#e0e0e0` |
342
+ | `lineDash` | `number[]` | **Canvas `setLineDash`** pattern; empty = solid lines. | `[]` |
343
+
344
+ ---
345
+
346
+ ## `style.overlay` (`OverlayOptions`)
347
+
348
+ Default **indicator line** stroke when an `OverlayWithCalc` row does not specify its own options.
349
+
350
+ | Field | Type | What it paints | Default |
351
+ |-------|------|----------------|---------|
352
+ | `lineColor` | `string` | **Stroke** of SMA/EMA/Bollinger/price overlays. | `#ff9800` |
353
+ | `lineWidth` | `number` | **Width** of those strokes. | `1` |
354
+ | `lineStyle` | `StrokeLineStyle` | `solid` \| `dashed` \| `dotted` canvas dash style. | `solid` |
355
+
356
+ ---
357
+
358
+ ## `style.drawings` (`DrawingStyleOptions`)
359
+
360
+ | Field | Type | What it paints |
361
+ |-------|------|----------------|
362
+ | `lineColor` | `string` | **Default stroke** for new user drawings (trend lines, channels, …). |
363
+ | `lineWidth` | `number` | **Default stroke width** for new shapes. |
364
+ | `lineStyle` | `StrokeLineStyle` | **Dash style** for new shapes. |
365
+ | `fillColor` | `string` | **Default fill** for closed shapes (rectangles, circles) where applicable. |
366
+ | `selected` | `object` | **Highlight** when a shape is active: `lineColor` (accent outline), `lineWidthAdd` (extra px on top of base width), `lineStyle`, optional `fillColor`. |
367
+
368
+ ---
369
+
370
+ ## Overlays: `OverlayKind`, `OverlayPriceKey`, and `OverlayCalcSpec`
371
+
372
+ **Price source enum `OverlayPriceKey`:** `close` \| `open` \| `high` \| `low` — which OHLC field feeds the calculation.
373
+
374
+ **Indicator enum `OverlayKind`:** `sma` \| `ema` \| `wma` \| `vwap` \| `bbands_mid` \| `bbands_upper` \| `bbands_lower`.
375
+
376
+ ### `OverlayCalcSpec` (discriminated union on `kind`)
377
+
378
+ | `kind` | Configurable parameters | What it computes |
379
+ |--------|-------------------------|------------------|
380
+ | `close`, `open`, `high`, `low` | None (the kind **is** the price field). | **Raw price series** for that field, aligned 1:1 with bars. |
381
+ | `sma`, `ema`, `wma` | **`period`** (number of bars). **`price`** optional — defaults to **`close`**. | **Moving average** over `price` with the given length. |
382
+ | `vwap` | None. | In **TickUp Core**, VWAP is a **placeholder** (no computed line in Standard Tier); use Prime or external series if you need VWAP. |
383
+ | `bbands_mid` | **`period`**. **`price`** optional — defaults to **`close`**. | **Middle band** = SMA(`period`, `price`). |
384
+ | `bbands_upper` | **`period`**. **`stddev`** optional — defaults to **`2`**. **`price`** optional — defaults to **`close`**. | **Upper band** = mid + `stddev` × rolling standard deviation. |
385
+ | `bbands_lower` | Same as upper. | **Lower band** = mid − `stddev` × rolling standard deviation. |
386
+
387
+ **`overlayKinds` shorthand defaults** (when you pass a string kind without a full spec): SMA/EMA/WMA use **`period: 20`**, **`price: close`**. Bollinger rows use **`period: 20`**, **`stddev: 2`**, **`price: close`**.
388
+
389
+ ### `OverlayWithCalc` (entries in `base.overlays`)
390
+
391
+ | Field | Type | Role |
392
+ |-------|------|------|
393
+ | `calc` | `OverlayCalcSpec` | **Math** for the series (see table above). |
394
+ | `lineColor`, `lineWidth`, `lineStyle` | overlay style | **Stroke** for this series (override `style.overlay`). |
395
+ | `connectNulls` | `boolean` optional | If true, **bridge across `null`** samples with a line; if false, gaps break the stroke. |
396
+ | `useCenterX` | `boolean` optional | If true, plot points at **bar center**; if false, use the **leading edge** convention. |
397
+
398
+ All overlays consume the same **5,000**-bar window as the chart. Live updates on Standard shells are still subject to the **~1 Hz** merge throttle (see [Data & live updates](./07-data-and-live-updates.md)).
399
+
400
+ ---
401
+
402
+ ## Imperative handle (`TickUpHostHandle`)
403
+
404
+ Not **props**, but the **`ref`** API: `addShape`, `applyLiveData`, `getViewInfo`, `setEngine`, etc. **`applyLiveData`** respects Standard Tier **clamping** and **throttling**. See [Imperative API](./06-imperative-api.md).
405
+
406
+ ---
407
+
408
+ ## Performance & troubleshooting (Standard Tier)
409
+
410
+ | Symptom | Likely cause |
411
+ |---------|----------------|
412
+ | Series length never exceeds **5,000** | **Expected:** Standard Tier trims history client-side. |
413
+ | Live updates “stutter” or arrive ~once per second | **Expected:** **~1 Hz** throttle on Standard shells; Prime license can opt out. |
414
+ | Indicators disappear after adding a fourth | **Expected:** **3** overlay cap; extras dropped with toast. |
415
+
416
+ More: [Interval schema & debugging](./17-interval-schema-and-debugging.md), [Comparison showcase](./18-comparison-showcase.md).
417
+
418
+ ---
419
+
420
+ ## Tier comparison: TickUp Prime
421
+
422
+ For WebGL throughput, deep history, and unlimited overlays, see **[TickUp Prime](https://github.com/BARDAMRI/tickup-prime)** and the **[showcase](https://bardamri.github.io/tickup-charts/)**.
@@ -0,0 +1,86 @@
1
+ # Interval schema, OHLC meaning & debugging
2
+
3
+ TickUp charts consume an array of **`Interval`** objects (often named **`intervalsArray`**). Each object is one **bar** or **candle** in time.
4
+
5
+ ---
6
+
7
+ ## What is OHLCV?
8
+
9
+ Financial software often summarizes trading in fixed **time buckets** (e.g. one bar per **5 minutes**). For each bucket you store:
10
+
11
+ | Field | Name | Meaning |
12
+ |-------|------|---------|
13
+ | **`t`** | Time | **Start** of the bar as **Unix time in seconds** (not milliseconds). |
14
+ | **`o`** | Open | First traded price (or official session open) in the bucket. |
15
+ | **`h`** | High | Highest price during the bucket. |
16
+ | **`l`** | Low | Lowest price during the bucket. |
17
+ | **`c`** | Close | Last traded price when the bucket ends (or official close). |
18
+ | **`v`** | Volume | Optional. Total traded **size** in the bucket (shares, contracts, etc.). |
19
+
20
+ **Invariants** (your data should satisfy these):
21
+
22
+ - `l <= min(o, c)` and `h >= max(o, c)` (low is the minimum of the bar, high the maximum).
23
+ - Bars are usually **ordered by increasing `t`**.
24
+ - **`t`** steps should match your **timeframe** (e.g. +300 seconds for 5-minute bars).
25
+
26
+ If **`h` < `l`** or **`o`/`c`** fall outside **[`l`, `h`]**, rendering may look wrong or behave oddly.
27
+
28
+ ---
29
+
30
+ ## TypeScript shape
31
+
32
+ ```ts
33
+ interface Interval {
34
+ t: number; // unix seconds
35
+ o: number;
36
+ h: number;
37
+ l: number;
38
+ c: number;
39
+ v?: number;
40
+ }
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Standard Tier: data, performance & limits
46
+
47
+ **Data:** Only the **last 5,000** intervals are kept in the internal series. Feeding 100,000 rows still results in a **5,000-bar window** for drawing and overlays.
48
+
49
+ **Performance:** Streaming via **`applyLiveData`** (and rapid prop updates) is **throttled** to about **1 Hz** on Standard product shells so the UI stays stable. Licensed Prime-tier hosts may opt out of this throttle; the **5,000**-bar cap remains the **TickUp Core** baseline for in-package data paths.
50
+
51
+ ---
52
+
53
+ ## Debugging: chart is blank or “does nothing”
54
+
55
+ | Symptom | Likely cause | What to check |
56
+ |---------|----------------|----------------|
57
+ | **Empty canvas** | No data or zero-height parent | `intervalsArray.length`, wrapper **`height`** / flex layout. |
58
+ | **Flat line or dot** | All `o,h,l,c` identical or one bar only | Log `intervalsArray` length and price spread. |
59
+ | **Nothing updates live** | Throttle or wrong placement | Expect ~1s between applied merges on Standard; check `LiveDataPlacement`. |
60
+ | **Wrong time axis** | `t` in milliseconds | Divide by **1000** or fix upstream (TickUp expects **seconds**). |
61
+ | **Bars out of order** | Unsorted `t` | Sort by `t` ascending before passing. |
62
+ | **Indicators missing** | More than 3 overlays | Standard Tier caps at **3**; see toast / [Overlays](./12-overlays-and-indicators.md). |
63
+ | **NaN / Infinity** | Bad feed math | Filter or fix non-finite numbers before passing to TickUp. |
64
+
65
+ ### Minimal console checks
66
+
67
+ ```ts
68
+ const rows = intervalsArray ?? [];
69
+ console.log('bars', rows.length, 'first', rows[0], 'last', rows[rows.length - 1]);
70
+ ```
71
+
72
+ Confirm **`rows[0].t`** is a plausible **second** timestamp (e.g. 10 digits, not 13).
73
+
74
+ ---
75
+
76
+ ## Related guides
77
+
78
+ - [Data & live updates](./07-data-and-live-updates.md) — `applyLiveData`, placements, clamping.
79
+ - [API reference](./16-api-reference.md) — `intervalsArray` and options.
80
+ - [Getting started](./00-getting-started.md) — Hello World sample.
81
+
82
+ ---
83
+
84
+ ## Tier comparison: TickUp Prime
85
+
86
+ For higher throughput and larger histories on supported deployments, evaluate **[TickUp Prime](https://github.com/BARDAMRI/tickup-prime)** and the **[showcase](https://bardamri.github.io/tickup-charts/)**.
@@ -0,0 +1,56 @@
1
+ # Comparison showcase — audit Core vs Prime
2
+
3
+ The **TickUp Charts** example app (in this repo under **`example/`**) includes a **Live Comparison** view so you can **audit performance and tier limits** before choosing **Standard (Core)** vs **Prime**.
4
+
5
+ ---
6
+
7
+ ## How to open it
8
+
9
+ When running the showcase locally or on the hosted site:
10
+
11
+ - Use the navigation control **“Core vs Prime”**, or
12
+ - Open the URL fragment **`#/compare`** (hash route), e.g.
13
+ `https://<host>/<base>/#/compare`
14
+
15
+ Some deployments also honor a pathname ending in **`/compare`** when the server is configured for SPA fallback.
16
+
17
+ ---
18
+
19
+ ## What you see
20
+
21
+ | Column | What it represents |
22
+ |--------|--------------------|
23
+ | **Left — TickUp Core (Standard)** | **Canvas 2D**, **5,000-bar** cap, **~1 Hz** live-update behavior on Standard shells, standard attribution. |
24
+ | **Right — TickUp Prime** | **Prime product shell** with licensed/eval features when **`@tickup/prime`** is linked; **WebGL** path when the real Prime bundle is present and **`setEngine`** is applied. |
25
+
26
+ The page loads a **high-volume mock stream** (thousands of bars) so the **Standard cap** is visible next to Prime’s presentation.
27
+
28
+ **Performance & troubleshooting:** If you are evaluating **TickUp Core** (Standard Tier), assume **5,000** bars max and **~1 Hz** live merge cadence on Standard shells — the comparison view is meant to make those limits obvious. See [Data & live updates](./07-data-and-live-updates.md) and [API reference](./16-api-reference.md).
29
+
30
+ **Telemetry** on the page shows:
31
+
32
+ - Mock **feed size** vs **rendered series length** (you should see Core clamp at **5,000**).
33
+ - **~1 Hz** heartbeat messaging on Core vs higher **FPS-style** telemetry on Prime when the real engine is active.
34
+
35
+ ---
36
+
37
+ ## Why this matters for product decisions
38
+
39
+ - **Capacity planning:** If you need **more than 5,000** visible bars or **faster than ~1 Hz** merge cadence on Standard shells, you are outside **Standard Tier** comfort zone.
40
+ - **Visual & UX expectations:** Prime adds **premium chrome**, **VWAP** and other pro overlays in the demo, and (with license) **evaluation watermark** removal.
41
+ - **Technical proof:** The showcase can be configured so the comparison view resolves **published `dist/` bundles** (not TypeScript sources), matching what integrators ship.
42
+
43
+ ---
44
+
45
+ ## Related links
46
+
47
+ - [Getting started](./00-getting-started.md) — first integration.
48
+ - [Data & live updates](./07-data-and-live-updates.md) — guardrails in depth.
49
+ - [API reference](./16-api-reference.md) — props and `chartOptions`.
50
+ - **Live site:** [TickUp Charts showcase](https://bardamri.github.io/tickup-charts/).
51
+
52
+ ---
53
+
54
+ ## Tier comparison: TickUp Prime
55
+
56
+ Commercial **TickUp Prime** details: **[TickUp Prime repository](https://github.com/BARDAMRI/tickup-prime)**.