tsichart-core 2.1.5 → 2.1.7

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/index.d.ts CHANGED
@@ -21,8 +21,71 @@ declare class Strings {
21
21
  }
22
22
 
23
23
  interface HorizontalMarker {
24
- color: string;
25
24
  value: number;
25
+ color: string;
26
+ condition?: 'Greater Than' | 'Less Than';
27
+ opacity?: number;
28
+ label?: string;
29
+ }
30
+
31
+ /**
32
+ * Configuration options for the LineChart component.
33
+ *
34
+ * Provides type safety for LineChart-specific configuration with all properties being optional.
35
+ * Based on ChartOptions class, allowing partial configuration where defaults are applied internally.
36
+ *
37
+ * @remarks
38
+ * This type includes all properties from ChartOptions as optional fields:
39
+ * - **Appearance**: theme, color, legend, tooltip, grid, isArea, interpolationFunction
40
+ * - **Axis Configuration**: xAxisHidden, yAxisHidden, yAxisState, yExtent, aggTopMargin
41
+ * - **Brush Settings**: brushMoveAction, brushMoveEndAction, brushContextMenuActions, brushHandlesVisible,
42
+ * brushRangeVisible, snapBrush, minBrushWidth, keepBrush, brushClearable, autoTriggerBrushContextMenu
43
+ * - **Interaction**: focusHidden, onMouseover, onMouseout, onSticky, onUnsticky, shouldSticky
44
+ * - **Markers**: markers, onMarkersChange, labelSeriesWithMarker
45
+ * - **Swim Lanes**: swimLaneOptions (for stacked charts with multiple y-axes)
46
+ * - **Time Configuration**: timeFrame, offset, is24HourTime, dateLocale, xAxisTimeFormat
47
+ * - **UI Controls**: hideChartControlPanel, suppressResizeListener
48
+ * - **Data Display**: includeEnvelope, includeDots
49
+ * - **Styling**: strings (for i18n), noAnimate
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const lineChartOptions: ILineChartOptions = {
54
+ * theme: 'dark',
55
+ * legend: 'shown',
56
+ * yAxisState: 'stacked',
57
+ * brushHandlesVisible: true,
58
+ * interpolationFunction: 'curveMonotoneX',
59
+ * labelSeriesWithMarker: true
60
+ * };
61
+ * ```
62
+ */
63
+ interface BackgroundBand {
64
+ y0: number;
65
+ y1: number;
66
+ color: string;
67
+ opacity?: number;
68
+ label?: string;
69
+ }
70
+ type ILineChartOptions = Partial<Omit<ChartOptions, 'onSelect' | 'onInput' | 'onKeydown' | 'onInstanceClick' | 'hierarchyOptions' | 'withContextMenu' | 'timeSeriesIdProperties' | 'isTemporal' | 'spMeasures' | 'scatterPlotRadius' | 'spAxisLabels'>> & {
71
+ backgroundBands?: BackgroundBand[];
72
+ horizontalMarkers?: HorizontalMarker[];
73
+ swimLaneOptions?: {
74
+ [laneIdx: number]: {
75
+ showBackgroundBands?: boolean;
76
+ backgroundBands?: BackgroundBand[];
77
+ horizontalMarkers?: HorizontalMarker[];
78
+ backgroundBandCondition?: BackgroundBandCondition;
79
+ };
80
+ };
81
+ };
82
+
83
+ interface BackgroundBandCondition {
84
+ condition: 'Greater Than' | 'Less Than';
85
+ thresholdValue: number;
86
+ color: string;
87
+ opacity?: number;
88
+ label?: string;
26
89
  }
27
90
 
28
91
  interface swimLaneOption {
@@ -31,6 +94,9 @@ interface swimLaneOption {
31
94
  onClick?: (lane: number) => any;
32
95
  collapseEvents?: string;
33
96
  horizontalMarkers?: Array<HorizontalMarker>;
97
+ showBackgroundBands?: boolean;
98
+ backgroundBands?: BackgroundBand[];
99
+ backgroundBandCondition?: BackgroundBandCondition;
34
100
  }
35
101
  declare class ChartOptions {
36
102
  aggTopMargin: number;
@@ -441,40 +507,6 @@ declare class LineChartData extends ChartComponentData {
441
507
  mergeDataToDisplayStateAndTimeArrays(data: any, aggregateExpressionOptions?: any): void;
442
508
  }
443
509
 
444
- /**
445
- * Configuration options for the LineChart component.
446
- *
447
- * Provides type safety for LineChart-specific configuration with all properties being optional.
448
- * Based on ChartOptions class, allowing partial configuration where defaults are applied internally.
449
- *
450
- * @remarks
451
- * This type includes all properties from ChartOptions as optional fields:
452
- * - **Appearance**: theme, color, legend, tooltip, grid, isArea, interpolationFunction
453
- * - **Axis Configuration**: xAxisHidden, yAxisHidden, yAxisState, yExtent, aggTopMargin
454
- * - **Brush Settings**: brushMoveAction, brushMoveEndAction, brushContextMenuActions, brushHandlesVisible,
455
- * brushRangeVisible, snapBrush, minBrushWidth, keepBrush, brushClearable, autoTriggerBrushContextMenu
456
- * - **Interaction**: focusHidden, onMouseover, onMouseout, onSticky, onUnsticky, shouldSticky
457
- * - **Markers**: markers, onMarkersChange, labelSeriesWithMarker
458
- * - **Swim Lanes**: swimLaneOptions (for stacked charts with multiple y-axes)
459
- * - **Time Configuration**: timeFrame, offset, is24HourTime, dateLocale, xAxisTimeFormat
460
- * - **UI Controls**: hideChartControlPanel, suppressResizeListener
461
- * - **Data Display**: includeEnvelope, includeDots
462
- * - **Styling**: strings (for i18n), noAnimate
463
- *
464
- * @example
465
- * ```typescript
466
- * const lineChartOptions: ILineChartOptions = {
467
- * theme: 'dark',
468
- * legend: 'shown',
469
- * yAxisState: 'stacked',
470
- * brushHandlesVisible: true,
471
- * interpolationFunction: 'curveMonotoneX',
472
- * labelSeriesWithMarker: true
473
- * };
474
- * ```
475
- */
476
- type ILineChartOptions = Partial<Omit<ChartOptions, 'onSelect' | 'onInput' | 'onKeydown' | 'onInstanceClick' | 'hierarchyOptions' | 'withContextMenu' | 'timeSeriesIdProperties' | 'isTemporal' | 'spMeasures' | 'scatterPlotRadius' | 'spAxisLabels'>>;
477
-
478
510
  declare class LineChart extends TemporalXAxisComponent {
479
511
  private targetElement;
480
512
  private focus;
@@ -534,8 +566,19 @@ declare class LineChart extends TemporalXAxisComponent {
534
566
  private swimLaneContents;
535
567
  private originalSwimLanes;
536
568
  private originalSwimLaneOptions;
569
+ private _playbackMarker;
537
570
  constructor(renderTarget: Element);
538
571
  LineChart(): void;
572
+ /**
573
+ * Render colored horizontal background bands behind chart data, strictly between horizontal marker values.
574
+ * @param bands Array of BackgroundBand objects
575
+ * @param markers Array of horizontal marker objects (must be sorted by value ascending)
576
+ */
577
+ private ensureBackgroundBandsGroup;
578
+ private createAutoBandsFromMarkers;
579
+ private createBandFromCondition;
580
+ private drawBackgroundBands;
581
+ private renderSwimLaneBackgroundBands;
539
582
  getBrushPositions(): {
540
583
  leftPos: any;
541
584
  rightPos: any;
@@ -573,6 +616,14 @@ declare class LineChart extends TemporalXAxisComponent {
573
616
  exportMarkers(): void;
574
617
  private createOnMarkerChange;
575
618
  private renderMarker;
619
+ /**
620
+ * Moves or creates a persistent playback marker at the given time.
621
+ * Call this on each playback tick for smooth marker movement.
622
+ * @param millis The timestamp (in ms) to move the marker to.
623
+ * @param label Optional label for the marker.
624
+ */
625
+ updatePlaybackMarker(millis: number, label?: string): void;
626
+ removePlaybackMarker(): void;
576
627
  private sortMarkers;
577
628
  private getAllLinesTransitionsComplete;
578
629
  private importMarkers;
@@ -583,6 +634,7 @@ declare class LineChart extends TemporalXAxisComponent {
583
634
  private filteredValueExist;
584
635
  addMarker: () => void;
585
636
  private voronoiExists;
637
+ private focusVoronoiSite;
586
638
  private voronoiMousemove;
587
639
  private voronoiContextMenu;
588
640
  private voronoiClick;
@@ -1019,7 +1071,7 @@ declare class ModelSearch extends Component {
1019
1071
  private currentResultIndex;
1020
1072
  constructor(renderTarget: Element);
1021
1073
  ModelSearch(): void;
1022
- render(environmentFqdn: string, getToken: any, hierarchyData: any, chartOptions: any): void;
1074
+ render(hierarchyData: any, chartOptions: any): void;
1023
1075
  handleKeydown(event: any, ap: any): void;
1024
1076
  private closeContextMenu;
1025
1077
  private stripHits;
@@ -2594,6 +2646,8 @@ declare class PlaybackControls extends Component {
2594
2646
  private playbackInterval;
2595
2647
  private playButton;
2596
2648
  private handleElement;
2649
+ private decreasePlaybackSpeedButton;
2650
+ private increasePlaybackSpeedButton;
2597
2651
  private controlsContainer;
2598
2652
  private track;
2599
2653
  private trackXOffset;
@@ -2678,6 +2732,7 @@ declare abstract class HistoryPlayback extends Component {
2678
2732
  protected renderBase(data: Array<TsqExpression>, chartOptions: any): void;
2679
2733
  pauseAvailabilityUpdates(): void;
2680
2734
  private onSelecTimestamp;
2735
+ protected getMockDataForTimestamp(timeStamp: Date): Array<any>;
2681
2736
  private calcQueryWindow;
2682
2737
  protected drawBase(): void;
2683
2738
  private updateAvailability;
@@ -2686,7 +2741,14 @@ declare abstract class HistoryPlayback extends Component {
2686
2741
  declare class ProcessGraphic extends HistoryPlayback {
2687
2742
  private graphicSrc;
2688
2743
  constructor(renderTarget: Element);
2689
- render(environmentFqdn: string, getToken: () => Promise<string>, graphicSrc: string, data: Array<TsqExpression>, chartOptions: any): void;
2744
+ render(graphicSrc: string, data: Array<TsqExpression>, chartOptions: any): void;
2745
+ private externalOnSelectTimeStamp;
2746
+ onReady: (() => void) | null;
2747
+ private cleanup;
2748
+ private initializeComponent;
2749
+ private showErrorMessage;
2750
+ private onSelectTimestamp;
2751
+ setDataForTimestamp(data: Array<any>): void;
2690
2752
  protected loadResources(): Promise<GraphicInfo>;
2691
2753
  protected draw(): void;
2692
2754
  private getResizedImageDimensions;