tsichart-core 2.1.4 → 2.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.
package/dist/index.d.ts CHANGED
@@ -126,6 +126,29 @@ declare class ChartOptions {
126
126
  }>;
127
127
  stringsInstance: Strings;
128
128
  private getInterpolationFunction;
129
+ /**
130
+ * Apply adaptive heuristics to adjust chart options based on data characteristics.
131
+ * This method is called by chart components after data is available to optimize UX.
132
+ *
133
+ * @param dataContext - Information about the data being visualized
134
+ * @param dataContext.seriesCount - Number of series/aggregates in the data
135
+ * @param dataContext.totalDataPoints - Total number of data points across all series
136
+ * @param dataContext.hasEnvelope - Whether data contains min/max envelope information
137
+ * @param dataContext.hasUniformInterval - Whether timestamps are uniformly spaced
138
+ * @param dataContext.chartType - Type of chart ('line', 'bar', 'scatter', etc.)
139
+ */
140
+ applyAdaptiveHeuristics(dataContext?: {
141
+ seriesCount?: number;
142
+ totalDataPoints?: number;
143
+ hasEnvelope?: boolean;
144
+ hasUniformInterval?: boolean;
145
+ chartType?: string;
146
+ }): void;
147
+ /**
148
+ * Derive 24-hour time format preference from locale.
149
+ * Used internally when is24HourTime is not explicitly set.
150
+ */
151
+ private deriveTimeFormatFromLocale;
129
152
  setOptions(chartOptionsObj: any): void;
130
153
  private mergeStrings;
131
154
  private mergeValue;
@@ -174,7 +197,7 @@ declare class ChartOptions {
174
197
  brushHandlesVisible: boolean;
175
198
  hideChartControlPanel: boolean;
176
199
  offset: any;
177
- is24HourTime: () => boolean;
200
+ is24HourTime: boolean;
178
201
  includeTimezones: boolean;
179
202
  availabilityLeftMargin: number;
180
203
  onInstanceClick: (instance: any) => any;
@@ -511,6 +534,7 @@ declare class LineChart extends TemporalXAxisComponent {
511
534
  private swimLaneContents;
512
535
  private originalSwimLanes;
513
536
  private originalSwimLaneOptions;
537
+ private _playbackMarker;
514
538
  constructor(renderTarget: Element);
515
539
  LineChart(): void;
516
540
  getBrushPositions(): {
@@ -550,6 +574,14 @@ declare class LineChart extends TemporalXAxisComponent {
550
574
  exportMarkers(): void;
551
575
  private createOnMarkerChange;
552
576
  private renderMarker;
577
+ /**
578
+ * Moves or creates a persistent playback marker at the given time.
579
+ * Call this on each playback tick for smooth marker movement.
580
+ * @param millis The timestamp (in ms) to move the marker to.
581
+ * @param label Optional label for the marker.
582
+ */
583
+ updatePlaybackMarker(millis: number, label?: string): void;
584
+ removePlaybackMarker(): void;
553
585
  private sortMarkers;
554
586
  private getAllLinesTransitionsComplete;
555
587
  private importMarkers;
@@ -588,6 +620,11 @@ declare class LineChart extends TemporalXAxisComponent {
588
620
  private overwriteSwimLanes;
589
621
  private getHorizontalMarkersWithYScales;
590
622
  private getAdditionalOffsetFromHorizontalMargin;
623
+ /**
624
+ * Calculate data context for adaptive heuristics.
625
+ * Analyzes current data to determine series count, data point density, and other characteristics.
626
+ */
627
+ private calculateDataContext;
591
628
  private drawHorizontalMarkers;
592
629
  private createSwimlaneLabels;
593
630
  render(data: any, options: ILineChartOptions, aggregateExpressionOptions: any): void;
@@ -620,8 +657,6 @@ declare class AvailabilityChart extends ChartComponent {
620
657
  private rawAvailability;
621
658
  private maxBuckets;
622
659
  private bucketSize;
623
- private dateTimePickerContainer;
624
- private dateTimePicker;
625
660
  constructor(renderTarget: Element);
626
661
  private getMinZoomedRange;
627
662
  private zoom;
@@ -796,17 +831,14 @@ declare class GroupedBarChart extends ChartVisualizationComponent {
796
831
  }
797
832
 
798
833
  declare class Grid extends Component {
834
+ private static readonly KEYS;
799
835
  private gridComponent;
800
- private rowLabelKey;
801
- private colorKey;
802
- private aggIndexKey;
803
836
  private chartComponentData;
804
- private draw;
805
837
  private closeButton;
806
838
  private filteredTimestamps;
839
+ private timestampCache;
807
840
  private table;
808
841
  private tableHeaderRow;
809
- private tableContentRows;
810
842
  usesSeconds: boolean;
811
843
  usesMillis: boolean;
812
844
  constructor(renderTarget: Element);
@@ -818,15 +850,17 @@ declare class Grid extends Component {
818
850
  action: () => void;
819
851
  description: string;
820
852
  };
821
- Grid(): void;
822
853
  private cellClass;
823
- focus: (rowIdx: any, colIdx: any) => void;
824
- renderFromAggregates(data: any, options: any, aggregateExpressionOptions: any, chartComponentData: any): void;
854
+ focus: (rowIdx: number, colIdx: number) => void;
855
+ renderFromAggregates(data: any, options: any, aggregateExpressionOptions: any, chartComponentData: ChartComponentData): void;
825
856
  private getRowData;
826
857
  private convertSeriesToGridData;
827
858
  private getFormattedDate;
859
+ private getRowColor;
828
860
  private setFilteredTimestamps;
829
861
  private addHeaderCells;
862
+ private renderRowHeader;
863
+ private renderValueCells;
830
864
  private addValueCells;
831
865
  render(data: any, options: any, aggregateExpressionOptions: any, chartComponentData?: ChartComponentData): void;
832
866
  private arrowNavigate;
@@ -994,13 +1028,15 @@ declare class ModelSearch extends Component {
994
1028
  private currentResultIndex;
995
1029
  constructor(renderTarget: Element);
996
1030
  ModelSearch(): void;
997
- render(environmentFqdn: string, getToken: any, hierarchyData: any, chartOptions: any): void;
1031
+ render(hierarchyData: any, chartOptions: any): void;
998
1032
  handleKeydown(event: any, ap: any): void;
999
1033
  private closeContextMenu;
1000
1034
  private stripHits;
1001
1035
  private getInstanceHtml;
1002
1036
  }
1003
1037
 
1038
+ type OnSetCallback$4 = (fromMillis: number, toMillis: number, offset: string, isRelative: boolean, quickTime: number) => void;
1039
+ type OnCancelCallback$1 = () => void;
1004
1040
  declare class DateTimePicker extends ChartComponent {
1005
1041
  private calendar;
1006
1042
  private calendarPicker;
@@ -1024,16 +1060,38 @@ declare class DateTimePicker extends ChartComponent {
1024
1060
  private endRange;
1025
1061
  private anchorDate;
1026
1062
  private offsetName;
1063
+ private dateFormatter;
1027
1064
  private fromInput;
1028
1065
  private toInput;
1029
1066
  private quickTimeArray;
1030
1067
  constructor(renderTarget: Element);
1068
+ /**
1069
+ * Get the currently selected quick time value
1070
+ * @returns The quick time in milliseconds, or -1 if not a quick time selection
1071
+ * @private
1072
+ */
1031
1073
  private getCurrentQuickTime;
1032
- getQuickTimeText(quickTimeMillis: any): any;
1074
+ /**
1075
+ * Get the display text for a quick time selection
1076
+ * @param quickTimeMillis - The quick time value in milliseconds
1077
+ * @returns The display text, or null if not found
1078
+ */
1079
+ getQuickTimeText(quickTimeMillis: number): string | null;
1033
1080
  private convertToCalendarDate;
1034
1081
  private setNewOffset;
1035
1082
  private onSaveOrCancel;
1036
- render(chartOptions: any, minMillis: number, maxMillis: number, fromMillis?: number, toMillis?: number, onSet?: any, onCancel?: any): void;
1083
+ /**
1084
+ * Render the date/time picker with range selection
1085
+ *
1086
+ * @param chartOptions - Configuration options
1087
+ * @param minMillis - Minimum selectable time
1088
+ * @param maxMillis - Maximum selectable time
1089
+ * @param fromMillis - Start time of range (defaults to 24 hours before maxMillis)
1090
+ * @param toMillis - End time of range (defaults to maxMillis)
1091
+ * @param onSet - Callback when user saves selection
1092
+ * @param onCancel - Callback when user cancels
1093
+ */
1094
+ render(chartOptions: any, minMillis: number, maxMillis: number, fromMillis?: number, toMillis?: number, onSet?: OnSetCallback$4, onCancel?: OnCancelCallback$1): void;
1037
1095
  private updateDisplayedDateTimes;
1038
1096
  private setFromQuickTimes;
1039
1097
  private buildQuickTimesPanel;
@@ -1043,6 +1101,11 @@ declare class DateTimePicker extends ChartComponent {
1043
1101
  private createTimezonePicker;
1044
1102
  private roundDay;
1045
1103
  private setTimeRange;
1104
+ /**
1105
+ * Create and configure the Pikaday calendar component
1106
+ * Uses the DateFormatter utility to generate locale-specific month and weekday names
1107
+ * @private
1108
+ */
1046
1109
  private createCalendar;
1047
1110
  private setSelectedQuickTimes;
1048
1111
  private setFromDate;
@@ -2358,28 +2421,88 @@ declare class HierarchyNavigation extends Component {
2358
2421
  return Pikaday;
2359
2422
  }));
2360
2423
 
2361
- declare class SingleDateTimePicker extends ChartComponent {
2424
+ type OnSetCallback$3 = (fromMillis: number, toMillis?: number, offset?: string, isRelative?: boolean, quickTime?: number) => void;
2425
+ declare class DateTimeButton extends ChartComponent {
2426
+ protected dateTimePicker: DateTimePicker;
2427
+ protected minMillis: number;
2428
+ protected maxMillis: number;
2429
+ protected onSet: OnSetCallback$3;
2430
+ protected dateTimeButton: d3.Selection<HTMLButtonElement, unknown, null, undefined>;
2431
+ protected dateTimePickerContainer: d3.Selection<HTMLDivElement, unknown, null, undefined>;
2432
+ constructor(renderTarget: Element);
2433
+ protected buttonDateTimeFormat(millis: number): string;
2434
+ protected initializeDateTimeButton(chartOptions: any, minMillis: number, maxMillis: number, onSet?: OnSetCallback$3): void;
2435
+ private getTimezoneFromOffset;
2436
+ }
2437
+
2438
+ type OnSetCallback$2 = (millis: number) => void;
2439
+ declare class SingleDateTimePicker extends DateTimeButton {
2362
2440
  private calendar;
2363
2441
  private calendarPicker;
2364
2442
  private timeControls;
2365
- private minMillis;
2366
- private maxMillis;
2443
+ protected minMillis: number;
2444
+ protected maxMillis: number;
2367
2445
  private millis;
2368
2446
  private minutes;
2369
2447
  private hours;
2370
- private onSet;
2448
+ protected onSet: OnSetCallback$2 | null;
2371
2449
  private targetElement;
2372
2450
  private isValid;
2373
2451
  private offsetName;
2374
2452
  private date;
2375
2453
  private timeInput;
2376
2454
  private saveButton;
2455
+ private dateFormatter;
2377
2456
  constructor(renderTarget: Element);
2457
+ /**
2458
+ * Get the currently selected time in milliseconds
2459
+ * @returns The selected time in milliseconds since epoch
2460
+ */
2378
2461
  getMillis(): number;
2379
- render(chartOptions: any, minMillis: number, maxMillis: number, millis?: number, onSet?: any): void;
2462
+ /**
2463
+ * Render the single date/time picker component
2464
+ *
2465
+ * @param chartOptions - Configuration options for the component
2466
+ * @param minMillis - Minimum selectable time in milliseconds
2467
+ * @param maxMillis - Maximum selectable time in milliseconds
2468
+ * @param millis - Initially selected time (defaults to maxMillis if null)
2469
+ * @param onSet - Callback function invoked when user saves a selection
2470
+ */
2471
+ render(chartOptions: any, minMillis: number, maxMillis: number, millis?: number, onSet?: OnSetCallback$2): void;
2472
+ /**
2473
+ * Set up keyboard event handlers for the component
2474
+ * Handles arrow keys and escape key navigation
2475
+ * @private
2476
+ */
2477
+ private _setupEventHandlers;
2478
+ /**
2479
+ * Create the DOM structure for the date/time picker
2480
+ * Includes time controls, calendar container, save button, and error message container
2481
+ * @private
2482
+ */
2483
+ private _createDOM;
2484
+ /**
2485
+ * Round a date to midnight (zero out hours, minutes, seconds, milliseconds)
2486
+ * Takes timezone offset into account
2487
+ *
2488
+ * @param d - The date to round
2489
+ * @returns A new date at midnight in the specified timezone
2490
+ * @private
2491
+ */
2380
2492
  private roundDay;
2493
+ /**
2494
+ * Update the calendar and time input to reflect a newly selected date
2495
+ *
2496
+ * @param d - The selected date
2497
+ * @private
2498
+ */
2381
2499
  private setSelectedDate;
2382
- private createCalendar;
2500
+ /**
2501
+ * Create and configure the Pikaday calendar component
2502
+ * Uses the DateFormatter utility to generate locale-specific month and weekday names
2503
+ * @private
2504
+ */
2505
+ private _createCalendar;
2383
2506
  private setDate;
2384
2507
  private setIsValid;
2385
2508
  private setMillis;
@@ -2393,22 +2516,10 @@ declare class SingleDateTimePicker extends ChartComponent {
2393
2516
  private createTimeString;
2394
2517
  private convertToLocal;
2395
2518
  private createTimePicker;
2519
+ private _createTimePicker;
2396
2520
  }
2397
2521
 
2398
- declare class DateTimeButton extends ChartComponent {
2399
- protected dateTimePicker: any;
2400
- private pickerIsVisible;
2401
- protected minMillis: number;
2402
- protected maxMillis: number;
2403
- protected onSet: any;
2404
- protected dateTimeButton: any;
2405
- protected dateTimePickerContainer: any;
2406
- constructor(renderTarget: Element);
2407
- protected buttonDateTimeFormat(millis: any): string;
2408
- render(chartOptions: any, minMillis: any, maxMillis: any, onSet?: any): void;
2409
- private getTimezoneFromOffset;
2410
- }
2411
-
2522
+ type OnSetCallback$1 = (millis: number) => void;
2412
2523
  declare class DateTimeButtonSingle extends DateTimeButton {
2413
2524
  private selectedMillis;
2414
2525
  private clickOutsideHandler;
@@ -2417,20 +2528,63 @@ declare class DateTimeButtonSingle extends DateTimeButton {
2417
2528
  private removeClickOutsideHandler;
2418
2529
  private setupClickOutsideHandler;
2419
2530
  private sDTPOnSet;
2420
- render(chartOptions: any, minMillis: number, maxMillis: number, selectedMillis?: number, onSet?: any): void;
2531
+ render(chartOptions: any, minMillis: number, maxMillis: number, selectedMillis?: number, onSet?: OnSetCallback$1): void;
2421
2532
  }
2422
2533
 
2534
+ type OnSetCallback = (fromMillis: number, toMillis?: number, offset?: string, isRelative?: boolean, quickTime?: number) => void;
2535
+ type OnCancelCallback = () => void;
2423
2536
  declare class DateTimeButtonRange extends DateTimeButton {
2424
2537
  private onCancel;
2425
2538
  private fromMillis;
2426
2539
  private toMillis;
2427
2540
  private clickOutsideHandler;
2428
2541
  constructor(renderTarget: Element);
2542
+ /**
2543
+ * Set the button text to display the selected date/time range
2544
+ *
2545
+ * @param fromMillis - Start time in milliseconds
2546
+ * @param toMillis - End time in milliseconds
2547
+ * @param isRelative - Whether this is a relative time range (e.g., "Last 24 Hours")
2548
+ * @param quickTime - Quick time selection in milliseconds (if applicable)
2549
+ * @private
2550
+ */
2429
2551
  private setButtonText;
2552
+ /**
2553
+ * Close the date/time picker and return focus to the button
2554
+ * @private
2555
+ */
2430
2556
  private onClose;
2557
+ /**
2558
+ * Remove the click outside event handler if it exists
2559
+ * @private
2560
+ */
2431
2561
  private removeClickOutsideHandler;
2562
+ /**
2563
+ * Set up click outside handler to close the picker when clicking outside
2564
+ * Uses a small delay to prevent the opening click from immediately closing the picker
2565
+ * @private
2566
+ */
2432
2567
  private setupClickOutsideHandler;
2433
- render(chartOptions: any, minMillis: number, maxMillis: number, fromMillis?: number, toMillis?: number, onSet?: any, onCancel?: any): void;
2568
+ /**
2569
+ * Render the date/time button with range selection
2570
+ *
2571
+ * @param chartOptions - Configuration options for the component
2572
+ * @param minMillis - Minimum selectable time in milliseconds
2573
+ * @param maxMillis - Maximum selectable time in milliseconds
2574
+ * @param fromMillis - Start time of the range (defaults to 24 hours before maxMillis)
2575
+ * @param toMillis - End time of the range (defaults to maxMillis)
2576
+ * @param onSet - Callback invoked when user saves a selection
2577
+ * @param onCancel - Callback invoked when user cancels
2578
+ */
2579
+ render(chartOptions: any, minMillis: number, maxMillis: number, fromMillis?: number, toMillis?: number, onSet?: OnSetCallback, onCancel?: OnCancelCallback): void;
2580
+ /**
2581
+ * Open the date/time picker in modal mode
2582
+ *
2583
+ * @param minMillis - Minimum selectable time
2584
+ * @param maxMillis - Maximum selectable time
2585
+ * @private
2586
+ */
2587
+ private _openPicker;
2434
2588
  }
2435
2589
 
2436
2590
  interface IPlaybackSettings {
@@ -2449,6 +2603,8 @@ declare class PlaybackControls extends Component {
2449
2603
  private playbackInterval;
2450
2604
  private playButton;
2451
2605
  private handleElement;
2606
+ private decreasePlaybackSpeedButton;
2607
+ private increasePlaybackSpeedButton;
2452
2608
  private controlsContainer;
2453
2609
  private track;
2454
2610
  private trackXOffset;
@@ -2517,25 +2673,23 @@ declare abstract class HistoryPlayback extends Component {
2517
2673
  protected graphicOriginalHeight: number;
2518
2674
  protected currentCancelTrigger: Function;
2519
2675
  protected availabilityInterval: number;
2520
- protected environmentFqdn: string;
2521
2676
  protected availability: TsqRange;
2522
- protected getAuthToken: () => Promise<string>;
2523
2677
  protected playbackRate: number;
2524
2678
  protected graphic: any;
2525
2679
  readonly numberOfBuckets = 1000;
2526
2680
  readonly defaultPlaybackRate = 3000;
2527
2681
  readonly fetchAvailabilityFrequency = 30000;
2528
2682
  readonly playbackSliderHeight = 88;
2529
- readonly previewApiFlag = "?api-version=2018-11-01-preview";
2530
2683
  constructor(renderTarget: Element);
2531
2684
  protected abstract loadResources(): Promise<any>;
2532
2685
  protected abstract draw(): any;
2533
2686
  protected abstract updateDataMarkers(data: Array<any>): void;
2534
2687
  protected abstract getDataPoints(data: Array<any>): void;
2535
2688
  protected onGraphicLoaded(): void;
2536
- protected renderBase(environmentFqdn: string, getToken: () => Promise<string>, data: Array<TsqExpression>, chartOptions: any): void;
2689
+ protected renderBase(data: Array<TsqExpression>, chartOptions: any): void;
2537
2690
  pauseAvailabilityUpdates(): void;
2538
2691
  private onSelecTimestamp;
2692
+ protected getMockDataForTimestamp(timeStamp: Date): Array<any>;
2539
2693
  private calcQueryWindow;
2540
2694
  protected drawBase(): void;
2541
2695
  private updateAvailability;
@@ -2544,7 +2698,14 @@ declare abstract class HistoryPlayback extends Component {
2544
2698
  declare class ProcessGraphic extends HistoryPlayback {
2545
2699
  private graphicSrc;
2546
2700
  constructor(renderTarget: Element);
2547
- render(environmentFqdn: string, getToken: () => Promise<string>, graphicSrc: string, data: Array<TsqExpression>, chartOptions: any): void;
2701
+ render(graphicSrc: string, data: Array<TsqExpression>, chartOptions: any): void;
2702
+ private externalOnSelectTimeStamp;
2703
+ onReady: (() => void) | null;
2704
+ private cleanup;
2705
+ private initializeComponent;
2706
+ private showErrorMessage;
2707
+ private onSelectTimestamp;
2708
+ setDataForTimestamp(data: Array<any>): void;
2548
2709
  protected loadResources(): Promise<GraphicInfo>;
2549
2710
  protected draw(): void;
2550
2711
  private getResizedImageDimensions;
@@ -2586,6 +2747,7 @@ declare class ColorPicker extends Component {
2586
2747
  }
2587
2748
 
2588
2749
  declare class GeoProcessGraphic extends HistoryPlayback {
2750
+ private dataSource;
2589
2751
  private azureMapsSubscriptionKey;
2590
2752
  private zoom;
2591
2753
  private width;
@@ -2597,14 +2759,29 @@ declare class GeoProcessGraphic extends HistoryPlayback {
2597
2759
  private maxZoom;
2598
2760
  private minZoom;
2599
2761
  private duration;
2762
+ private map;
2763
+ private tilesetId;
2764
+ private mapContainer;
2600
2765
  constructor(renderTarget: Element);
2601
- render(environmentFqdn: string, getToken: () => Promise<string>, data: Array<TsqExpression>, chartOptions: any): void;
2766
+ render(data: Array<TsqExpression>, chartOptions: any): void;
2767
+ protected renderBase(data: Array<TsqExpression>, chartOptions: any): void;
2768
+ private initializeAvaibility;
2769
+ private cleanup;
2770
+ private initializeComponent;
2602
2771
  protected loadResources(): Promise<any>;
2603
- protected draw(): void;
2772
+ private loadAzureMapsScript;
2773
+ private initializeMap;
2774
+ private initializeMapFeatures;
2775
+ private applyMapStyle;
2776
+ private createVehicleMarker;
2777
+ private getMapStyleForTileset;
2778
+ private createMarkerHtml;
2779
+ private renderFallback;
2780
+ protected draw(): Promise<any>;
2604
2781
  protected getDataPoints(results: Array<IGeoProcessGraphicLabelInfo>): void;
2605
- protected parseTsqResponse(response: any): {};
2782
+ protected parseTsqResponse(response: any): any;
2606
2783
  protected updateDataMarkers(dataPoints: Array<any>): void;
2607
- protected createTable(dataPointArr: any, idx: any): HTMLDivElement;
2784
+ private createPopupContent;
2608
2785
  }
2609
2786
  interface IGeoProcessGraphicLabelInfo {
2610
2787
  }