@i2analyze/notebook-sdk 1.9.0-dev.12 → 1.9.0-dev.14

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.
@@ -78,9 +78,11 @@ export declare namespace app {
78
78
  * @param mutationHandler - A function that performs one or more tracked mutations and reports on their success as a whole.
79
79
  * @param responseHandler - A callback that receives the changes caused by the mutations.
80
80
  * @param options - An object that can control the transaction.
81
+ * @returns A promise that is fulfilled with the result of the mutations if they complete successfully, or rejected if there is a problem performing them.
81
82
  * @i2since 1.1
83
+ * @deprecated Use the options-only overload and await the returned Promise instead.
82
84
  */
83
- runTrackedMutations(mutationHandler: TrackedMutationHandler, responseHandler?: MutationResponseHandler, options?: ITransactionOptions): void;
85
+ runTrackedMutations(mutationHandler: TrackedMutationHandler, responseHandler: MutationResponseHandler, options?: ITransactionOptions): Promise<IMutationResult>;
84
86
  /**
85
87
  * Queues a function that performs tracked mutations on the application contents at the next available opportunity.
86
88
  *
@@ -90,9 +92,10 @@ export declare namespace app {
90
92
  *
91
93
  * @param mutationHandler - A function that performs one or more tracked mutations and reports on their success as a whole.
92
94
  * @param options - An object that can control the transaction.
95
+ * @returns A promise that is fulfilled with the result of the mutations if they complete successfully, or rejected if there is a problem performing them.
93
96
  * @i2since 1.1
94
97
  */
95
- runTrackedMutations(mutationHandler: TrackedMutationHandler, options?: ITransactionOptions): void;
98
+ runTrackedMutations(mutationHandler: TrackedMutationHandler, options?: ITransactionOptions): Promise<IMutationResult>;
96
99
  /**
97
100
  * Queues a function that performs untracked mutations on the application contents at the next available opportunity,
98
101
  * and can respond to the changes that the mutations cause.
@@ -104,9 +107,11 @@ export declare namespace app {
104
107
  * @param mutationHandler - A function that performs one or more untracked mutations and reports on their success as a whole.
105
108
  * @param responseHandler - A callback that receives the changes produced by the mutations.
106
109
  * @param options - An object that can control the transaction.
110
+ * @returns A promise that is fulfilled with the result of the mutations if they complete successfully, or rejected if there is a problem performing them.
107
111
  * @i2since 1.1
112
+ * @deprecated Use the options-only overload and await the returned Promise instead.
108
113
  */
109
- runUntrackedMutations(mutationHandler: UntrackedMutationHandler, responseHandler?: MutationResponseHandler, options?: ITransactionOptions): void;
114
+ runUntrackedMutations(mutationHandler: UntrackedMutationHandler, responseHandler: MutationResponseHandler, options?: ITransactionOptions): Promise<IMutationResult>;
110
115
  /**
111
116
  * Queues a function that performs untracked mutations on the application contents at the next available opportunity.
112
117
  *
@@ -116,9 +121,10 @@ export declare namespace app {
116
121
  *
117
122
  * @param mutationHandler - A function that performs one or more untracked mutations and reports on their success as a whole.
118
123
  * @param options - An object that can control the transaction.
124
+ * @returns A promise that is fulfilled with the result of the mutations if they complete successfully, or rejected if there is a problem performing them.
119
125
  * @i2since 1.1
120
126
  */
121
- runUntrackedMutations(mutationHandler: UntrackedMutationHandler, options?: ITransactionOptions): void;
127
+ runUntrackedMutations(mutationHandler: UntrackedMutationHandler, options?: ITransactionOptions): Promise<IMutationResult>;
122
128
  /**
123
129
  * Gets the identifiers of the system dialog actions.
124
130
  * @i2since 1.4
@@ -129,6 +135,11 @@ export declare namespace app {
129
135
  * @i2since 1.9
130
136
  */
131
137
  readonly brushSets: visual.IBrushSetsManager;
138
+ /**
139
+ * Gets a library of functions for creating objects to use in mutations.
140
+ * @i2since 1.9
141
+ */
142
+ readonly valueFactory: IValueFactory;
132
143
  }
133
144
  /**
134
145
  * A report on the result of one or more mutations.
@@ -1085,6 +1096,23 @@ export declare namespace app {
1085
1096
  * @i2since 1.1
1086
1097
  */
1087
1098
  createGeoPoint(data: data.IGeoPointData): data.IGeoPoint;
1099
+ /**
1100
+ * Creates a color range from a configuration that maps brush indices to CSS color strings.
1101
+ *
1102
+ * @remarks
1103
+ * The returned color range resolves colors for any index within the range of the provided keys.
1104
+ * If an index matches a key exactly, its color is returned directly. If an index falls between
1105
+ * two keys, the color is interpolated linearly between the colors of the two nearest keys.
1106
+ *
1107
+ * This supports both discrete and continuous (gradient) color ranges, depending on the
1108
+ * configuration you provide. See {@link visual.ColorRangeConfig} for details.
1109
+ *
1110
+ * @param config - A mapping of brush indices to CSS color strings.
1111
+ * @returns A new color range.
1112
+ * @throws `Error` if the configuration is empty or contains invalid color strings.
1113
+ * @i2since 1.9
1114
+ */
1115
+ createBrushColorRange(config: visual.ColorRangeConfig): visual.IBrushColorRange;
1088
1116
  }
1089
1117
  /**
1090
1118
  * A set of methods for performing tracked mutations, which require an entry in the undo stack.
@@ -4350,7 +4378,7 @@ export declare namespace dialog {
4350
4378
  *
4351
4379
  * @i2since 1.4
4352
4380
  */
4353
- export interface IDialogApi extends app.IApplication {
4381
+ export interface IDialogApi extends app.IApplication, app.IApplicationContents {
4354
4382
  /**
4355
4383
  * Updates the label or the enabled state of the specified dialog action.
4356
4384
  *
@@ -4494,15 +4522,18 @@ export declare function getToolViewApi(): Promise<toolview.IToolViewApi>;
4494
4522
  * @public
4495
4523
  * @i2since 1.0
4496
4524
  */
4497
- export declare interface IEntryPointApi extends app.IApplication {
4525
+ export declare interface IEntryPointApi extends app.IApplication, app.IApplicationContents {
4498
4526
  /**
4499
4527
  * Allows plug-ins to indicate when their registrations are complete, so that the i2 Notebook user interface can start.
4500
4528
  *
4501
4529
  * @remarks
4502
4530
  * If a plug-in does not call this method after completing registration, i2 Notebook abandons its attempt to load it.
4531
+ *
4532
+ * When the plug-in awaits the returned promise, the `chart` and `view` properties become available.
4533
+ * @returns A promise that resolves when the application has finished loading.
4503
4534
  * @i2since 1.0
4504
4535
  */
4505
- initializationComplete(): void;
4536
+ initializationComplete(): Promise<void>;
4506
4537
  /**
4507
4538
  * Gets an object that can be used to perform plug-in logging operations.
4508
4539
  * @i2since 1.0
@@ -5995,7 +6026,7 @@ export declare namespace toolview {
5995
6026
  * A collection of methods and properties that allow plug-in tool views to interact with i2 Notebook.
5996
6027
  * @i2since 1.0
5997
6028
  */
5998
- export interface IToolViewApi extends IToolView, app.IApplication {
6029
+ export interface IToolViewApi extends IToolView, app.IApplication, app.IApplicationContents {
5999
6030
  /**
6000
6031
  * Gets an object that can be used to perform plug-in logging operations.
6001
6032
  * @i2since 1.0
@@ -6496,12 +6527,35 @@ export declare namespace visual {
6496
6527
  /**
6497
6528
  * Returns the CSS color string for the given brush index.
6498
6529
  *
6530
+ * @remarks
6531
+ * The behavior of this method depends on the implementation. For color ranges created with
6532
+ * `app.IValueFactory.createBrushColorRange`, if the index matches a key exactly, the corresponding
6533
+ * color is returned; if it falls between two keys, the color is interpolated linearly between
6534
+ * the colors of the two nearest keys; and if it is outside the range of defined keys, an `Error`
6535
+ * is thrown.
6536
+ *
6499
6537
  * @param index - The brush index to get the color for.
6500
6538
  * @returns A CSS color string (for example, '#FF0000', 'rgb(255, 0, 0)', 'red').
6501
6539
  * @i2since 1.9
6502
6540
  */
6503
6541
  getColor(index: BrushIndex): string;
6504
6542
  }
6543
+ /**
6544
+ * A configuration for creating a color range, specified as a mapping of brush indices to CSS color strings.
6545
+ *
6546
+ * @remarks
6547
+ * The keys are brush indices and the values are CSS color strings. You must provide at least one entry.
6548
+ *
6549
+ * For a **discrete** color range, provide a color for every index you intend to use.
6550
+ * For example, `{ 0: '#FF0000', 1: '#00FF00', 2: '#0000FF' }` maps index 0 to red, 1 to green, and 2 to blue.
6551
+ *
6552
+ * For a **continuous** (gradient) color range, provide colors only at key indices.
6553
+ * For example, `{ 0: '#FF0000', 100: '#0000FF' }` maps index 0 to red and index 100 to blue;
6554
+ * intermediate indices are interpolated linearly between the two colors.
6555
+ *
6556
+ * @i2since 1.9
6557
+ */
6558
+ export type ColorRangeConfig = Record<BrushIndex, string>;
6505
6559
  /**
6506
6560
  * A brush set that maps records to brush indices and applies colors based on a color range.
6507
6561
  * @i2since 1.9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i2analyze/notebook-sdk",
3
- "version": "1.9.0-dev.12",
3
+ "version": "1.9.0-dev.14",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {