@fintatech/fintachart 3.1.4 → 3.1.6

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.
@@ -2047,6 +2047,20 @@ declare module FintaChart {
2047
2047
  */
2048
2048
  formatRealtime(data: any): ITick;
2049
2049
  }
2050
+ /**
2051
+ * Configuration shape accepted by the generic `Datafeed` wrapper.
2052
+ */
2053
+ interface IGenericDatafeedConfig {
2054
+ /**
2055
+ * Base URI of the REST data source.
2056
+ */
2057
+ url: string;
2058
+ /**
2059
+ * Polling interval for realtime updates, in milliseconds.
2060
+ * Defaults to 5000 ms when omitted.
2061
+ */
2062
+ realtimeUpdateInterval?: number;
2063
+ }
2050
2064
  /**
2051
2065
  * Provides rest data feed
2052
2066
  *
@@ -2095,6 +2109,21 @@ declare module FintaChart {
2095
2109
  private onSubscribe;
2096
2110
  private onUnsubscribe;
2097
2111
  }
2112
+ /**
2113
+ * Generic options-object datafeed used by the quick-start examples:
2114
+ *
2115
+ * ```javascript
2116
+ * new FintaChart.Datafeed({ url: '/api/bars' });
2117
+ * ```
2118
+ *
2119
+ * Thin wrapper over `RestDatafeed` that accepts a configuration
2120
+ * object rather than positional arguments. The two-string positional
2121
+ * form (`new Datafeed('/api', 5000)`) is also supported for parity
2122
+ * with `RestDatafeed`.
2123
+ */
2124
+ class Datafeed extends RestDatafeed {
2125
+ constructor(config: IGenericDatafeedConfig | string, realtimeUpdateInterval?: number);
2126
+ }
2098
2127
  }
2099
2128
  declare module FintaChart {
2100
2129
  /**
@@ -2199,12 +2228,10 @@ declare module FintaChart {
2199
2228
  }
2200
2229
  }
2201
2230
  declare module FintaChart {
2202
- /**
2203
- * Represents extension event
2204
- */
2205
2231
  abstract class Eventable {
2206
2232
  private _preventPropagation;
2207
2233
  private _chart;
2234
+ private _targetSubscriptions;
2208
2235
  /**
2209
2236
  * Chart
2210
2237
  */
@@ -2224,6 +2251,25 @@ declare module FintaChart {
2224
2251
  * @return
2225
2252
  */
2226
2253
  preventPropagation(preventEvents?: boolean): boolean;
2254
+ /**
2255
+ * Subscribes to events fired with this object as their target.
2256
+ *
2257
+ * Routes through the chart's event emitter and filters to events
2258
+ * whose `target === this`, so multiple instances of the same class
2259
+ * (e.g. several shapes) each receive only their own events.
2260
+ *
2261
+ * @param events Space-delimited event name(s).
2262
+ * @param handler Listener invoked with the matching event.
2263
+ * @return This instance for chaining.
2264
+ */
2265
+ on(events: string, handler: IEventHandler): Eventable;
2266
+ /**
2267
+ * Unsubscribes from events previously registered via `on`.
2268
+ *
2269
+ * Omitting `handler` removes every listener for `events`; omitting
2270
+ * both removes every listener registered through this `Eventable`.
2271
+ */
2272
+ off(events?: string, handler?: IEventHandler): Eventable;
2227
2273
  }
2228
2274
  }
2229
2275
  declare module FintaChart {
@@ -3082,6 +3128,42 @@ declare module FintaChart {
3082
3128
  readonly purple: any;
3083
3129
  readonly sky: any;
3084
3130
  readonly teal: any;
3131
+ /**
3132
+ * Look up a built-in theme by string name (case-insensitive).
3133
+ * Returns `null` if the name is unknown.
3134
+ */
3135
+ byName(name: string): any;
3136
+ /**
3137
+ * Sets the default theme applied to subsequent `new Chart(...)`
3138
+ * instances that don't pass an explicit `theme` option. Accepts
3139
+ * either a string name (`'Dark'`, `'Light'`, …) or a theme object.
3140
+ */
3141
+ use(theme: any): void;
3142
+ /**
3143
+ * @internal Returns the theme previously selected via `use()`,
3144
+ * or `null` if no global override is set.
3145
+ */
3146
+ readonly currentDefault: any;
3147
+ };
3148
+ /**
3149
+ * Capitalised alias surface — `FintaChart.Theme.Dark`,
3150
+ * `FintaChart.Theme.Light`, `FintaChart.Theme.use('Dark')`.
3151
+ * Resolves to the same theme objects as `FintaChart.Themes`.
3152
+ */
3153
+ const Theme: {
3154
+ readonly Default: any;
3155
+ readonly Light: any;
3156
+ readonly Dark: any;
3157
+ readonly FintatechDark: any;
3158
+ readonly Beet: any;
3159
+ readonly Gray: any;
3160
+ readonly Olive: any;
3161
+ readonly Orange: any;
3162
+ readonly Purple: any;
3163
+ readonly Sky: any;
3164
+ readonly Teal: any;
3165
+ byName(name: string): any;
3166
+ use(theme: any): void;
3085
3167
  };
3086
3168
  /**
3087
3169
  * Represents stroke theme
@@ -3346,6 +3428,12 @@ declare module FintaChart {
3346
3428
  private onFullScreenChange;
3347
3429
  private onFullWindowChange;
3348
3430
  }
3431
+ /**
3432
+ * Alias for `ChartContainer`. Both names appear in the public guides
3433
+ * (`FintaChart.ChartContainer` and `FintaChart.ChartsContainer`); both
3434
+ * resolve to the same class on the runtime.
3435
+ */
3436
+ const ChartsContainer: typeof ChartContainer;
3349
3437
  }
3350
3438
  declare module FintaChart {
3351
3439
  }
@@ -5179,6 +5267,10 @@ declare module FintaChart {
5179
5267
  */
5180
5268
  class ColorPicker {
5181
5269
  private _picker;
5270
+ private _initialized;
5271
+ private _pendingConfig?;
5272
+ private _pendingColor?;
5273
+ private _observer?;
5182
5274
  /**
5183
5275
  * Retrieves Control Color Picker's color
5184
5276
  *
@@ -5198,6 +5290,9 @@ declare module FintaChart {
5198
5290
  static hide(control: HTMLElement): void;
5199
5291
  static enable(control: HTMLElement, enable: boolean): void;
5200
5292
  enable(value?: boolean): void;
5293
+ private static isElementReady;
5294
+ private initSpectrum;
5295
+ private waitForAttach;
5201
5296
  private static initParams;
5202
5297
  private static palette;
5203
5298
  private static adopt;
@@ -9074,6 +9169,21 @@ declare module FintaChart {
9074
9169
  * get pane height ratio
9075
9170
  */
9076
9171
  get paneHeightRatio(): number;
9172
+ /**
9173
+ * Pins the indicator to an explicit pane before it is attached to
9174
+ * a chart via `chart.addIndicators(...)`.
9175
+ *
9176
+ * Suppresses the default routing (which uses `isOverlay` to decide
9177
+ * between the primary pane and a freshly-created pane) and aligns
9178
+ * `isOverlay` with the chosen pane so subsequent layout / merge
9179
+ * behaviour remains consistent.
9180
+ *
9181
+ * Used internally by `Pane.addIndicator(...)` and
9182
+ * `Chart.addIndicatorInNewPane(...)`; rarely needed directly.
9183
+ *
9184
+ * @param pane The pane this indicator should live on.
9185
+ */
9186
+ placeOnPane(pane: Pane): void;
9077
9187
  /**
9078
9188
  * Get indicator parameters
9079
9189
  */
@@ -9160,6 +9270,12 @@ declare module FintaChart {
9160
9270
  * @param belowColor
9161
9271
  */
9162
9272
  addPlotArea(name: string, name2: string, aboveColor: string, belowColor: string): void;
9273
+ /**
9274
+ * Bind indicator to a vertical scale
9275
+ *
9276
+ * @param verticalScale
9277
+ */
9278
+ bindToVerticalScale(verticalScale: VerticalScale): this;
9163
9279
  dispose(): void;
9164
9280
  /**
9165
9281
  * Paint indicator
@@ -9381,11 +9497,19 @@ declare module FintaChart {
9381
9497
  /**
9382
9498
  * Creates new indicator instance of specified type name.
9383
9499
  *
9500
+ * The second argument is overloaded: pass a `Chart` to attach the
9501
+ * indicator to it immediately, or pass a plain object to seed
9502
+ * parameter values (`{ period: 20, source: 'close' }`). Both forms
9503
+ * may be combined via the three-argument variant.
9504
+ *
9384
9505
  * @param typeName The type name of indicator.
9385
- * @param chart The chart to add indicator to.
9506
+ * @param chartOrParameters Either the chart instance, or a
9507
+ * parameters object applied via `updateParameters` after construction.
9508
+ * @param parameters Optional parameters when the second argument
9509
+ * already specifies a chart.
9386
9510
  * @return Indicator instance of given type.
9387
9511
  */
9388
- static create(typeName: string, chart: Chart): Indicator;
9512
+ static create(typeName: string, chartOrParameters?: Chart | Record<string, unknown>, parameters?: Record<string, unknown>): Indicator;
9389
9513
  /**
9390
9514
  * Restores chart type from a previously saved state.
9391
9515
  *
@@ -13093,6 +13217,7 @@ declare module FintaChart {
13093
13217
  private _settings;
13094
13218
  private _titleNeedsUpdate;
13095
13219
  private _toggleIndicatorTitles;
13220
+ private _targetSubscriptions;
13096
13221
  private _optimizeRefresh;
13097
13222
  private _watermark;
13098
13223
  private chartContextMenu;
@@ -13258,6 +13383,26 @@ declare module FintaChart {
13258
13383
  * @param objects
13259
13384
  */
13260
13385
  addObjects(objects: IPaneObject | IPaneObject[]): any;
13386
+ /**
13387
+ * Attaches an indicator to this specific pane.
13388
+ *
13389
+ * Pins the indicator's pane before `chart.addIndicators(...)` runs
13390
+ * the auto-routing, so the indicator lands here regardless of its
13391
+ * `isOverlay` declaration. Use to force an overlay-style indicator
13392
+ * onto a separate pane, or to drop an oscillator-style one onto
13393
+ * the price pane.
13394
+ *
13395
+ * @param indicator Indicator instance to add.
13396
+ * @return The added indicator.
13397
+ */
13398
+ addIndicator(indicator: Indicator): Indicator;
13399
+ /**
13400
+ * Adds a single shape to the pane (convenience alias for
13401
+ * `addShapes` when working with one shape at a time).
13402
+ *
13403
+ * @param shape Shape instance to add.
13404
+ */
13405
+ addShape(shape: Shape): void;
13261
13406
  /**
13262
13407
  * Adds plots
13263
13408
  *
@@ -13464,6 +13609,21 @@ declare module FintaChart {
13464
13609
  private setupLayoutTheme;
13465
13610
  private paintGridLines;
13466
13611
  private invoke;
13612
+ /**
13613
+ * Subscribes to events fired with this pane as their target
13614
+ * (e.g. `PaneEvent.PLOT_ADDED` from this specific pane, not any).
13615
+ *
13616
+ * Routes through the chart's event emitter and filters by
13617
+ * `event.target === this`.
13618
+ *
13619
+ * @param events Space-delimited event name(s).
13620
+ * @param handler Listener invoked with the matching event.
13621
+ */
13622
+ on(events: string, handler: IEventHandler): Pane;
13623
+ /**
13624
+ * Unsubscribes from events previously registered via `on`.
13625
+ */
13626
+ off(events?: string, handler?: IEventHandler): Pane;
13467
13627
  private getHeight;
13468
13628
  private getWidth;
13469
13629
  private onClick;
@@ -15082,6 +15242,7 @@ declare module FintaChart {
15082
15242
  private _isSelfRaisedEvent;
15083
15243
  private _mode;
15084
15244
  private _preFullWindowSize;
15245
+ private _preFullWindowOffset;
15085
15246
  private _prevMode;
15086
15247
  private _boundOnFullScreenChanged;
15087
15248
  private _boundOnWindowResize;
@@ -15098,7 +15259,6 @@ declare module FintaChart {
15098
15259
  private enterFullScreen;
15099
15260
  private exitFullScreen;
15100
15261
  private onFullScreenChange;
15101
- private static updateDropDownItemIcon;
15102
15262
  private updateDropdown;
15103
15263
  private toggleWindowMode;
15104
15264
  }
@@ -16129,6 +16289,21 @@ declare module FintaChart {
16129
16289
  */
16130
16290
  minWidth: number;
16131
16291
  }
16292
+ enum PlotHistogramStyle {
16293
+ LINE = "line",
16294
+ COLORED_LINE = "coloredLine",
16295
+ COLORED_BAR_LINE = "coloredBarLine",
16296
+ COLORED_MEAN_BAR_LINE = "coloredMeanBarLine",
16297
+ COLUMN = "column",
16298
+ COLORED_COLUMN = "coloredColumn",
16299
+ BYDATES = "bydates"
16300
+ }
16301
+ /**
16302
+ * Public alias matching the name used in documentation
16303
+ * (`FintaChart.HistogramPlotStyle.COLORED_COLUMN`). Resolves to the
16304
+ * same enum values as `PlotHistogramStyle` and `HistogramPlot.Style`.
16305
+ */
16306
+ const HistogramPlotStyle: typeof PlotHistogramStyle;
16132
16307
  /**
16133
16308
  * Represents plot histogram
16134
16309
  *
@@ -19834,6 +20009,18 @@ declare module FintaChart {
19834
20009
  paintVerticalAxisLabels(): void;
19835
20010
  hitTest(point: IPoint): boolean;
19836
20011
  }
20012
+ /**
20013
+ * Convenience constructor for a horizontal price line.
20014
+ *
20015
+ * Accepts the shorthand `{ value, stroke: { color, width } }` form
20016
+ * documented in the quick-start guide and translates it into the
20017
+ * canonical Shape config (`{ point: { value }, theme: { line: ... } }`).
20018
+ * Falls through unchanged for already-canonical configs.
20019
+ */
20020
+ class HorizontalLine extends HorizontalLineShape {
20021
+ constructor(config?: any);
20022
+ private static normalize;
20023
+ }
19837
20024
  }
19838
20025
  declare module FintaChart {
19839
20026
  /**
@@ -23909,6 +24096,11 @@ declare module FintaChart {
23909
24096
  * Get chart primary pane
23910
24097
  */
23911
24098
  get primaryPane(): Pane;
24099
+ /**
24100
+ * Alias for `primaryPane`. Both names appear across the public
24101
+ * documentation, so both are supported on the runtime.
24102
+ */
24103
+ get mainPane(): Pane;
23912
24104
  /**
23913
24105
  * Get chart mouse events enabled
23914
24106
  */
@@ -24124,6 +24316,16 @@ declare module FintaChart {
24124
24316
  * @return Added chart pane
24125
24317
  */
24126
24318
  addPane(index?: number, heightRatio?: number, reducePrimaryPane?: boolean): Pane;
24319
+ /**
24320
+ * Creates a fresh pane below the existing ones and attaches the
24321
+ * given indicator to it, ignoring the indicator's `isOverlay`
24322
+ * preference. Convenience wrapper around `addPane` +
24323
+ * `Pane.addIndicator`.
24324
+ *
24325
+ * @param indicator The indicator instance to add.
24326
+ * @return The added indicator.
24327
+ */
24328
+ addIndicatorInNewPane(indicator: Indicator): Indicator;
24127
24329
  /**
24128
24330
  * Adds vertical scale
24129
24331
  *
@@ -24192,6 +24394,11 @@ declare module FintaChart {
24192
24394
  * @return Data range
24193
24395
  */
24194
24396
  dateRange(startDate?: Date, endDate?: Date): any;
24397
+ /**
24398
+ * Alias for `dispose()`. Both names are documented across the
24399
+ * public guides; both are supported on the runtime.
24400
+ */
24401
+ destroy(removeContainer?: boolean): void;
24195
24402
  /**
24196
24403
  * Destroys container
24197
24404
  *
@@ -24501,6 +24708,17 @@ declare module FintaChart {
24501
24708
  * @param updateInstruments
24502
24709
  */
24503
24710
  refresh(updateInstruments?: boolean): void;
24711
+ /**
24712
+ * Triggers a repaint after direct property mutations (theme,
24713
+ * options, etc.) that don't go through their own setters.
24714
+ * Alias for `refresh()`.
24715
+ */
24716
+ setNeedsUpdate(): void;
24717
+ /**
24718
+ * Alias for `refresh()`. Intended for resize / orientation-change
24719
+ * handlers in mobile and responsive embeddings.
24720
+ */
24721
+ update(updateInstruments?: boolean): void;
24504
24722
  /**
24505
24723
  * refreshes indicators
24506
24724
  */
@@ -451,7 +451,8 @@
451
451
  "fullWindow": "Full Window",
452
452
  "fullScreen": "Full Screen",
453
453
  "defaultScreen": "Default Screen",
454
- "defaultWindow": "Default Window"
454
+ "defaultWindow": "Default Window",
455
+ "defaultMode": "Default Mode"
455
456
  },
456
457
  "templates": {
457
458
  "create": "Create Template",
@@ -444,7 +444,8 @@
444
444
  "fullWindow": "Повне вікно",
445
445
  "fullScreen": "Повний екран",
446
446
  "defaultScreen": "Стандартний екран",
447
- "defaultWindow": "Стандартне вікно"
447
+ "defaultWindow": "Стандартне вікно",
448
+ "defaultMode": "Стандартний режим"
448
449
  },
449
450
  "templates": {
450
451
  "create": "Створити шаблон",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fintatech/fintachart",
3
3
  "description": "FintaChart financial charting component",
4
4
  "homepage": "https://fintatech.com",
5
- "version": "3.1.4",
5
+ "version": "3.1.6",
6
6
  "types": "./d.ts/FintaChart.d.ts",
7
7
  "license": "SEE LICENSE IN LICENSE.md",
8
8
  "repository": {
@@ -39,6 +39,7 @@
39
39
  "gulp-if": "~3.0.0",
40
40
  "gulp-inject": "~5.0.5",
41
41
  "gulp-javascript-obfuscator": "^1.1.6",
42
+ "gulp-postcss": "^10.0.0",
42
43
  "gulp-preprocess": "~4.0.2",
43
44
  "gulp-rename": "~2.0.0",
44
45
  "gulp-replace": "~1.1.3",
@@ -50,6 +51,7 @@
50
51
  "gulp-util": "~3.0.8",
51
52
  "lazypipe": "~1.0.2",
52
53
  "merge-stream": "~2.0.0",
54
+ "postcss-prefix-selector": "^2.1.1",
53
55
  "run-sequence": "~2.2.1",
54
56
  "sass": "~1.54.9",
55
57
  "serve-static": "~1.15.0",
@@ -59,4 +61,4 @@
59
61
  "typedoc-plugin-merge-modules": "~4.0.1",
60
62
  "typescript": "~4.8.3"
61
63
  }
62
- }
64
+ }