@i2analyze/notebook-sdk 1.1.0-dev.3 → 1.1.0-dev.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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @i2analyze/notebook-sdk
2
2
 
3
+ ## 1.1.0-dev.7
4
+
5
+ ### Minor Changes
6
+
7
+ - Add options to fit commands.
8
+
9
+ ## 1.1.0-dev.6
10
+
11
+ ### Minor Changes
12
+
13
+ - Split records + elements in fitToItems API.
14
+
15
+ ### Patch Changes
16
+
17
+ - Add an example of specifying several servers in a CSP directive
18
+ - Small changes to source code links
19
+
20
+ ## 1.1.0-dev.5
21
+
22
+ ### Minor Changes
23
+
24
+ - Correct the details type from 'string' to string
25
+ - Add code sample links to the tutorials documentation.
26
+
27
+ ## 1.1.0-dev.4
28
+
29
+ ### Minor Changes
30
+
31
+ - Change the report interfaces so that you can provide both details and title in some mutation reports
32
+
3
33
  ## 1.1.0-dev.3
4
34
 
5
35
  ### Minor Changes
@@ -75,6 +75,16 @@ export declare namespace app {
75
75
  runMutation(mutationListener: TrackedMutationListener): void;
76
76
  runUntrackedMutation(mutationListener: UntrackedMutationListener): void;
77
77
  }
78
+ export type IMutationReport = ISuccessReport | IDetailedReport;
79
+ export interface ISuccessReport {
80
+ type: 'success';
81
+ details: string;
82
+ }
83
+ export interface IDetailedReport {
84
+ type: 'information' | 'warning' | 'error';
85
+ title: string;
86
+ details: string;
87
+ }
78
88
  export interface IMutationCommit {
79
89
  type: 'commit';
80
90
  report?: IMutationReport;
@@ -90,10 +100,6 @@ export declare namespace app {
90
100
  type: 'rollback';
91
101
  report?: IMutationReport;
92
102
  }
93
- export interface IMutationReport {
94
- type: 'success' | 'info' | 'warn' | 'error';
95
- text: string;
96
- }
97
103
  export type ITrackedMutationInfo = ITrackedMutationCommit | IMutationRollback;
98
104
  export type IMutationInfo = IMutationCommit | IMutationRollback;
99
105
  export type UntrackedMutationListener = (application: IApplicationContents, mutations: IUntrackedMutations, cancelation: ICancelation) => IMutationInfo | Promise<IMutationInfo>;
@@ -400,14 +406,47 @@ export declare namespace app {
400
406
  dimension: schema.SecurityDimensionId | schema.ISecurityDimension;
401
407
  values: readonly (schema.SecurityDimensionValueId | schema.ISecurityDimensionValue)[];
402
408
  }
409
+ export interface IElementsAndRecords {
410
+ records?: Iterable<RecordSpecifier>;
411
+ elements?: Iterable<visual.ElementId | visual.IElement>;
412
+ }
413
+ /**
414
+ * Constraints that control a view-fitting operation.
415
+ * @remarks
416
+ * Fitting the view to a collection of items will ordinarily zoom in or out to make those
417
+ * items fill the viewport. Sometimes, however, you may wish to limit this behavior to prevent
418
+ * zooming in or out beyond a particular level.
419
+ *
420
+ * Examples:
421
+ *
422
+ * You may not want a single element to fill the entire viewport, so if you want to focus
423
+ * attention on a single element without making it large, you may want to limit the `maximumZoom` level to
424
+ * `1`.
425
+ *
426
+ * You may wish to pan the chart to show a particular element but not change the zoom level _at all_: set
427
+ * both `minimumZoom` and `maximumZoom` to `current`.
428
+ *
429
+ * @i2since 1.1
430
+ */
431
+ export interface IFitConstraints {
432
+ /**
433
+ * Gets a value that controls the minimum zoom level that may be applied when performing a fit operation.
434
+ * @i2since 1.1
435
+ */
436
+ minimumZoom?: number | 'current';
437
+ /**
438
+ * Gets a value that controls the maximum zoom level that may be applied when performing a fit operation.
439
+ * @i2since 1.1
440
+ */
441
+ maximumZoom?: number | 'current';
442
+ }
403
443
  export interface IViewMutations {
404
444
  setCenter(): void;
405
445
  setZoom(): void;
406
- fitToChart(): void;
407
- fitToHeight(): void;
408
- fitToSelection(): void;
409
- fitToItems(items: Iterable<RecordSpecifier | visual.ElementId | visual.IElement>): void;
410
- fitToItems(...items: readonly (RecordSpecifier | visual.ElementId | visual.IElement)[]): void;
446
+ fitToChart(options?: IFitConstraints): void;
447
+ fitToHeight(options?: IFitConstraints): void;
448
+ fitToSelection(options?: IFitConstraints): void;
449
+ fitToItems(items: IElementsAndRecords, options?: IFitConstraints): void;
411
450
  }
412
451
  export interface ISelectionMutations {
413
452
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i2analyze/notebook-sdk",
3
- "version": "1.1.0-dev.3",
3
+ "version": "1.1.0-dev.7",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {