@pipsend/charts 2.3.19 → 2.3.20

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/dist/typings.d.ts CHANGED
@@ -1565,12 +1565,11 @@ export declare class TradingSessionsIndicator {
1565
1565
  private _highlightSessions;
1566
1566
  private _highlightSession;
1567
1567
  private _highlightOverlaps;
1568
- private _getSessionOverlap;
1569
- private _highlightOverlapPeriod;
1568
+ private _eachRun;
1569
+ private _inSession;
1570
+ private _hourIn;
1570
1571
  private _createSessionBox;
1571
1572
  private _createOverlapBox;
1572
- private _isTimeInSession;
1573
- private _getUTCHour;
1574
1573
  private _clearSessionBoxes;
1575
1574
  /**
1576
1575
  * Merge options into the running indicator and repaint.
@@ -2615,6 +2614,14 @@ export declare function setVolumeProfileData(indicator: VolumeProfileIndicator,
2615
2614
  * Time at a horizontal coordinate, extrapolated past the last bar.
2616
2615
  */
2617
2616
  export declare function timeFromCoordinate(chart: IChartApi, series: ISeriesApi<SeriesType>, x: number): Time | null;
2617
+ /**
2618
+ * Offset of `timeZone` from UTC at `time`, in seconds. Undefined, `'UTC'` and
2619
+ * unknown zones are 0.
2620
+ *
2621
+ * Resolved once per UTC day, and to the quarter hour only on days with a
2622
+ * transition: asking `Intl` for every bar is too slow for a whole series.
2623
+ */
2624
+ export declare function timeZoneOffset(timeZone: string | undefined, time: number): number;
2618
2625
  /**
2619
2626
  * Returns the current version as a string. For example `'1.0.0'`.
2620
2627
  */
@@ -4433,9 +4440,10 @@ export interface IHorzScaleBehavior<HorzScaleItem> {
4433
4440
  *
4434
4441
  * @param item - tickmark item
4435
4442
  * @param barsPerMark - how many bars apart marks must be at the current zoom
4443
+ * @param previous - the point before it on the scale, if any
4436
4444
  * @returns false to leave the tickmark out
4437
4445
  */
4438
- allowsTickMark?(item: TickMark, barsPerMark: number): boolean;
4446
+ allowsTickMark?(item: TickMark, barsPerMark: number, previous: TimeScalePoint | undefined): boolean;
4439
4447
  /**
4440
4448
  * Returns the maximum tickmark weight value for the specified tickmarks on the time scale.
4441
4449
  *
@@ -5872,6 +5880,15 @@ export interface LocalizationOptions<HorzScaleItem> extends LocalizationOptionsB
5872
5880
  * @defaultValue `'dd MMM \'yy'`
5873
5881
  */
5874
5882
  dateFormat: string;
5883
+ /**
5884
+ * IANA time zone of the time scale's tick marks and default labels, e.g. `'America/New_York'`.
5885
+ *
5886
+ * Data, and the times custom formatters and filters receive, stay in UTC; see {@link timeZoneOffset}.
5887
+ * Business-day data is never shifted. Unknown zones fall back to UTC.
5888
+ *
5889
+ * @defaultValue `undefined` (UTC)
5890
+ */
5891
+ timeZone?: string;
5875
5892
  }
5876
5893
  /**
5877
5894
  * Represents basic localization options
@@ -7453,9 +7470,12 @@ export interface TimeScaleOptions extends HorzScaleOptions {
7453
7470
  * their labels not to overlap, so a filter can pick a regular grid that fits,
7454
7471
  * e.g. every 10 minutes when every 2 would crowd the axis.
7455
7472
  *
7473
+ * `previousTime` is the point before it (null for the first), to tell whether a
7474
+ * boundary falls between the two when no bar opens exactly on it.
7475
+ *
7456
7476
  * @defaultValue `undefined`
7457
7477
  */
7458
- tickMarkFilter?: (time: Time, tickMarkType: TickMarkType, barsPerMark: number) => boolean;
7478
+ tickMarkFilter?: (time: Time, tickMarkType: TickMarkType, barsPerMark: number, previousTime: Time | null) => boolean;
7459
7479
  }
7460
7480
  /**
7461
7481
  * Represents a point on the time scale
@@ -7586,8 +7606,11 @@ export interface TradingPosition<TimeType> {
7586
7606
  }
7587
7607
  export interface TradingSession {
7588
7608
  name: string;
7609
+ /** Hour (0-23) in `timeZone`. */
7589
7610
  startHour: number;
7590
7611
  endHour: number;
7612
+ /** IANA zone the hours are in, so the session follows its city's daylight saving. UTC when absent. */
7613
+ timeZone?: string;
7591
7614
  color: string;
7592
7615
  opacity: number;
7593
7616
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "private": false,
3
- "version": "2.3.19",
3
+ "version": "2.3.20",
4
4
  "name": "@pipsend/charts",
5
5
  "author": "Pipsend",
6
6
  "license": "SEE LICENSE IN LICENSE",