@i2analyze/notebook-sdk 1.9.0-dev.10 → 1.9.0-dev.11
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/lib/gen/notebook-sdk-public.d.ts +232 -0
- package/package.json +1 -1
|
@@ -124,6 +124,11 @@ export declare namespace app {
|
|
|
124
124
|
* @i2since 1.4
|
|
125
125
|
*/
|
|
126
126
|
readonly systemActions: dialog.ISystemDialogActions;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the brush sets manager for controlling chart brushing.
|
|
129
|
+
* @i2since 1.9
|
|
130
|
+
*/
|
|
131
|
+
readonly brushSets: visual.IBrushSetsManager;
|
|
127
132
|
}
|
|
128
133
|
/**
|
|
129
134
|
* A report on the result of one or more mutations.
|
|
@@ -6459,6 +6464,233 @@ export declare namespace visual {
|
|
|
6459
6464
|
*/
|
|
6460
6465
|
readonly borderStyle: IElementSetting<LineStyle | null>;
|
|
6461
6466
|
}
|
|
6467
|
+
/**
|
|
6468
|
+
* An index that represents the priority or importance of a record in a brush set.
|
|
6469
|
+
* Higher values indicate higher importance.
|
|
6470
|
+
* @i2since 1.9
|
|
6471
|
+
*/
|
|
6472
|
+
export type BrushIndex = number;
|
|
6473
|
+
/**
|
|
6474
|
+
* A color range that maps brush indices to CSS color strings.
|
|
6475
|
+
* @i2since 1.9
|
|
6476
|
+
*/
|
|
6477
|
+
export interface IBrushColorRange {
|
|
6478
|
+
/**
|
|
6479
|
+
* Returns the CSS color string for the given brush index.
|
|
6480
|
+
*
|
|
6481
|
+
* @param index - The brush index to get the color for.
|
|
6482
|
+
* @returns A CSS color string (for example, '#FF0000', 'rgb(255, 0, 0)', 'red').
|
|
6483
|
+
* @i2since 1.9
|
|
6484
|
+
*/
|
|
6485
|
+
getColor(index: BrushIndex): string;
|
|
6486
|
+
}
|
|
6487
|
+
/**
|
|
6488
|
+
* A brush set that maps records to brush indices and applies colors based on a color range.
|
|
6489
|
+
* @i2since 1.9
|
|
6490
|
+
*/
|
|
6491
|
+
export interface IBrushSet {
|
|
6492
|
+
/**
|
|
6493
|
+
* Gets the unique identifier of the brush set.
|
|
6494
|
+
* @i2since 1.9
|
|
6495
|
+
*/
|
|
6496
|
+
readonly id: string;
|
|
6497
|
+
/**
|
|
6498
|
+
* Indicates whether the brush set is currently active.
|
|
6499
|
+
*
|
|
6500
|
+
* @remarks
|
|
6501
|
+
* Only one plug-in-owned brush set can be active at a time.
|
|
6502
|
+
* @i2since 1.9
|
|
6503
|
+
*/
|
|
6504
|
+
readonly isActive: boolean;
|
|
6505
|
+
/**
|
|
6506
|
+
* Gets the current color range for this brush set, or `null` if no color range is set.
|
|
6507
|
+
* @i2since 1.9
|
|
6508
|
+
*/
|
|
6509
|
+
readonly colorRange: IBrushColorRange | null;
|
|
6510
|
+
/**
|
|
6511
|
+
* Sets the color range for this brush set.
|
|
6512
|
+
*
|
|
6513
|
+
* @param range - The color range to use for mapping brush indices to colors.
|
|
6514
|
+
* @i2since 1.9
|
|
6515
|
+
*/
|
|
6516
|
+
setColorRange(range: IBrushColorRange): void;
|
|
6517
|
+
/**
|
|
6518
|
+
* Sets the brush index for a single record.
|
|
6519
|
+
*
|
|
6520
|
+
* @param recordId - The identifier of the record.
|
|
6521
|
+
* @param index - The brush index to assign to the record.
|
|
6522
|
+
* @i2since 1.9
|
|
6523
|
+
*/
|
|
6524
|
+
set(recordId: records.AnalyzeRecordId, index: BrushIndex): void;
|
|
6525
|
+
/**
|
|
6526
|
+
* Sets the brush index for multiple records.
|
|
6527
|
+
*
|
|
6528
|
+
* @param entries - An iterable of `[recordId, index]` tuples for multiple records.
|
|
6529
|
+
* @i2since 1.9
|
|
6530
|
+
*/
|
|
6531
|
+
set(entries: Iterable<[records.AnalyzeRecordId, BrushIndex]>): void;
|
|
6532
|
+
/**
|
|
6533
|
+
* Removes specific records from the brush set.
|
|
6534
|
+
*
|
|
6535
|
+
* @param recordIds - An iterable of record identifiers to remove.
|
|
6536
|
+
* @i2since 1.9
|
|
6537
|
+
*/
|
|
6538
|
+
remove(recordIds: Iterable<records.AnalyzeRecordId>): void;
|
|
6539
|
+
/**
|
|
6540
|
+
* Gets the brush index for a record, or `undefined` if the record is not in the brush set.
|
|
6541
|
+
*
|
|
6542
|
+
* @param recordId - The identifier of the record.
|
|
6543
|
+
* @returns The brush index, or `undefined` if the record is not brushed.
|
|
6544
|
+
* @i2since 1.9
|
|
6545
|
+
*/
|
|
6546
|
+
getBrushIndex(recordId: records.AnalyzeRecordId): BrushIndex | undefined;
|
|
6547
|
+
/**
|
|
6548
|
+
* Removes all record mappings from the brush set.
|
|
6549
|
+
* @i2since 1.9
|
|
6550
|
+
*/
|
|
6551
|
+
clear(): void;
|
|
6552
|
+
}
|
|
6553
|
+
/**
|
|
6554
|
+
* An event that is fired when a brush set changes.
|
|
6555
|
+
* @i2since 1.9
|
|
6556
|
+
*/
|
|
6557
|
+
export interface IBrushSetChangeEvent {
|
|
6558
|
+
/**
|
|
6559
|
+
* Gets the brush set that changed.
|
|
6560
|
+
* @i2since 1.9
|
|
6561
|
+
*/
|
|
6562
|
+
readonly brushSet: IBrushSet;
|
|
6563
|
+
}
|
|
6564
|
+
/**
|
|
6565
|
+
* A listener for brush set change events.
|
|
6566
|
+
* @i2since 1.9
|
|
6567
|
+
*/
|
|
6568
|
+
export type BrushSetChangeListener = (event: IBrushSetChangeEvent) => void;
|
|
6569
|
+
/**
|
|
6570
|
+
* Options for adding a brush set change event listener.
|
|
6571
|
+
* @i2since 1.9
|
|
6572
|
+
*/
|
|
6573
|
+
export interface IBrushSetEventOptions {
|
|
6574
|
+
/**
|
|
6575
|
+
* Gets the brush set to listen to changes for. If not specified, listens to all brush sets.
|
|
6576
|
+
* @i2since 1.9
|
|
6577
|
+
*/
|
|
6578
|
+
readonly brushSet?: IBrushSet;
|
|
6579
|
+
}
|
|
6580
|
+
/**
|
|
6581
|
+
* A map of brush sets event types to their listener functions.
|
|
6582
|
+
* @i2since 1.9
|
|
6583
|
+
*/
|
|
6584
|
+
export interface BrushSetsEventMap {
|
|
6585
|
+
/**
|
|
6586
|
+
* Gets the listener function for brush set change events.
|
|
6587
|
+
* @i2since 1.9
|
|
6588
|
+
*/
|
|
6589
|
+
brushsetchange: BrushSetChangeListener;
|
|
6590
|
+
}
|
|
6591
|
+
/**
|
|
6592
|
+
* A map of brush sets event types to their options.
|
|
6593
|
+
* @i2since 1.9
|
|
6594
|
+
*/
|
|
6595
|
+
export interface BrushSetsEventOptionsMap {
|
|
6596
|
+
/**
|
|
6597
|
+
* Gets the options for the `brushsetchange` event.
|
|
6598
|
+
* @i2since 1.9
|
|
6599
|
+
*/
|
|
6600
|
+
brushsetchange: IBrushSetEventOptions;
|
|
6601
|
+
}
|
|
6602
|
+
/**
|
|
6603
|
+
* A manager for brush sets that controls their lifecycle and provides color resolution.
|
|
6604
|
+
* @i2since 1.9
|
|
6605
|
+
*/
|
|
6606
|
+
export interface IBrushSetsManager {
|
|
6607
|
+
/**
|
|
6608
|
+
* Creates a new brush set.
|
|
6609
|
+
*
|
|
6610
|
+
* @returns The newly created brush set.
|
|
6611
|
+
* @i2since 1.9
|
|
6612
|
+
*/
|
|
6613
|
+
create(): IBrushSet;
|
|
6614
|
+
/**
|
|
6615
|
+
* Activates a brush set, making it the active brush set and deactivating any other plug-in-owned brush sets.
|
|
6616
|
+
*
|
|
6617
|
+
* @remarks
|
|
6618
|
+
* Only one plug-in-owned brush set can be active at a time. Activating a brush set automatically
|
|
6619
|
+
* deactivates the previously active plug-in brush set.
|
|
6620
|
+
*
|
|
6621
|
+
* @param brushSet - The brush set to activate.
|
|
6622
|
+
* @throws `Error` if the brush set does not have a color range set.
|
|
6623
|
+
* @i2since 1.9
|
|
6624
|
+
*/
|
|
6625
|
+
activate(brushSet: IBrushSet): void;
|
|
6626
|
+
/**
|
|
6627
|
+
* Deactivates a brush set.
|
|
6628
|
+
*
|
|
6629
|
+
* @param brushSet - The brush set to deactivate.
|
|
6630
|
+
* @i2since 1.9
|
|
6631
|
+
*/
|
|
6632
|
+
deactivate(brushSet: IBrushSet): void;
|
|
6633
|
+
/**
|
|
6634
|
+
* Deletes a brush set, removing it from the manager.
|
|
6635
|
+
*
|
|
6636
|
+
* @param brushSet - The brush set to delete.
|
|
6637
|
+
* @i2since 1.9
|
|
6638
|
+
*/
|
|
6639
|
+
delete(brushSet: IBrushSet): void;
|
|
6640
|
+
/**
|
|
6641
|
+
* Gets the currently active plug-in-owned brush set, or `null` if no plug-in brush set is active.
|
|
6642
|
+
*
|
|
6643
|
+
* @remarks
|
|
6644
|
+
* This property only returns plug-in-owned brush sets. System-owned overlay brush sets
|
|
6645
|
+
* (used internally by features like Find-on-Chart) are not exposed through this property.
|
|
6646
|
+
* @i2since 1.9
|
|
6647
|
+
*/
|
|
6648
|
+
readonly activeBrushSet: IBrushSet | null;
|
|
6649
|
+
/**
|
|
6650
|
+
* Gets the CSS color string for a record based on the active brush sets.
|
|
6651
|
+
*
|
|
6652
|
+
* @remarks
|
|
6653
|
+
* This method resolves colors using a two-layer precedence system:
|
|
6654
|
+
*
|
|
6655
|
+
* 1. System overlay brush sets (for example, Find-on-Chart) take precedence
|
|
6656
|
+
* 2. Falls back to the active plug-in-owned brush set
|
|
6657
|
+
* 3. Returns `null` if the record is not brushed in any active set.
|
|
6658
|
+
*
|
|
6659
|
+
* @param recordId - The identifier of the record.
|
|
6660
|
+
* @returns The CSS color string for the record, or `null` if the record is not brushed.
|
|
6661
|
+
* @i2since 1.9
|
|
6662
|
+
*/
|
|
6663
|
+
getColorForRecord(recordId: records.AnalyzeRecordId): string | null;
|
|
6664
|
+
/**
|
|
6665
|
+
* Gets the CSS color string for a chart element based on the active brush sets.
|
|
6666
|
+
*
|
|
6667
|
+
* @remarks
|
|
6668
|
+
* For elements that represent multiple records, this method uses the maximum brush index
|
|
6669
|
+
* across all constituent records. Higher brush indices represent higher importance.
|
|
6670
|
+
*
|
|
6671
|
+
* Color resolution uses a two-layer precedence system:
|
|
6672
|
+
*
|
|
6673
|
+
* 1. System overlay brush sets (for example, Find-on-Chart) take precedence
|
|
6674
|
+
* 2. Falls back to the active plug-in-owned brush set
|
|
6675
|
+
* 3. Returns `null` if no constituent records are brushed in any active set.
|
|
6676
|
+
*
|
|
6677
|
+
* @param elementId - The identifier of the chart element.
|
|
6678
|
+
* @returns The CSS color string for the element, or `null` if the element is not brushed.
|
|
6679
|
+
* @i2since 1.9
|
|
6680
|
+
*/
|
|
6681
|
+
getColorForElement(elementId: ElementId): string | null;
|
|
6682
|
+
/**
|
|
6683
|
+
* Adds an event listener for brush set events.
|
|
6684
|
+
*
|
|
6685
|
+
* @typeParam K - The type of event to listen for.
|
|
6686
|
+
* @param type - The type of event to listen for.
|
|
6687
|
+
* @param listener - The function to call when the event is fired.
|
|
6688
|
+
* @param options - An optional configuration for the event listener.
|
|
6689
|
+
* @returns A function that removes the event listener when called.
|
|
6690
|
+
* @i2since 1.9
|
|
6691
|
+
*/
|
|
6692
|
+
addEventListener<K extends keyof BrushSetsEventMap>(type: K, listener: BrushSetsEventMap[K], options?: BrushSetsEventOptionsMap[K]): () => void;
|
|
6693
|
+
}
|
|
6462
6694
|
}
|
|
6463
6695
|
|
|
6464
6696
|
export { }
|