tsichart-core 2.1.6 → 2.1.9

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;
@@ -423,6 +489,7 @@ declare class TemporalXAxisComponent extends ChartVisualizationComponent {
423
489
  private labelFormatUsesSeconds;
424
490
  private labelFormatUsesMillis;
425
491
  updateXAxis(forceFirst?: boolean, forceLast?: boolean): void;
492
+ private keepLastTickLabelInView;
426
493
  private updateAxisText;
427
494
  protected drawXAxis(yOffset: any, snapFirst?: boolean, snapLast?: boolean): void;
428
495
  private isSameDate;
@@ -441,40 +508,6 @@ declare class LineChartData extends ChartComponentData {
441
508
  mergeDataToDisplayStateAndTimeArrays(data: any, aggregateExpressionOptions?: any): void;
442
509
  }
443
510
 
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
511
  declare class LineChart extends TemporalXAxisComponent {
479
512
  private targetElement;
480
513
  private focus;
@@ -530,6 +563,7 @@ declare class LineChart extends TemporalXAxisComponent {
530
563
  private plotComponents;
531
564
  private isFirstMarkerDrop;
532
565
  private xOffset;
566
+ private xAxisRightPadding;
533
567
  private swimlaneYExtents;
534
568
  private swimLaneContents;
535
569
  private originalSwimLanes;
@@ -537,6 +571,16 @@ declare class LineChart extends TemporalXAxisComponent {
537
571
  private _playbackMarker;
538
572
  constructor(renderTarget: Element);
539
573
  LineChart(): void;
574
+ /**
575
+ * Render colored horizontal background bands behind chart data, strictly between horizontal marker values.
576
+ * @param bands Array of BackgroundBand objects
577
+ * @param markers Array of horizontal marker objects (must be sorted by value ascending)
578
+ */
579
+ private ensureBackgroundBandsGroup;
580
+ private createAutoBandsFromMarkers;
581
+ private createBandFromCondition;
582
+ private drawBackgroundBands;
583
+ private renderSwimLaneBackgroundBands;
540
584
  getBrushPositions(): {
541
585
  leftPos: any;
542
586
  rightPos: any;
@@ -592,6 +636,7 @@ declare class LineChart extends TemporalXAxisComponent {
592
636
  private filteredValueExist;
593
637
  addMarker: () => void;
594
638
  private voronoiExists;
639
+ private focusVoronoiSite;
595
640
  private voronoiMousemove;
596
641
  private voronoiContextMenu;
597
642
  private voronoiClick;