@i2analyze/notebook-sdk 1.7.2-dev.0 → 1.8.0-dev.1

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.
@@ -385,6 +385,11 @@ export declare namespace app {
385
385
  * @i2since 1.6
386
386
  */
387
387
  export type EdgeSummarySpecifier = visual.ElementId | visual.IEdgeSummary;
388
+ /**
389
+ * A common specifier for a node group, for use in mutation APIs.
390
+ * @i2since 1.8
391
+ */
392
+ export type NodeGroupSpecifier = visual.ElementId | visual.INodeGroup;
388
393
  /**
389
394
  * The identifier of a record group.
390
395
  * @i2since 1.1
@@ -685,15 +690,47 @@ export declare namespace app {
685
690
  export interface IEdgeEditor extends IElementEditorBase {
686
691
  }
687
692
  /**
688
- * A record that has been created in a transaction handler, but has not yet been added to a chart.
693
+ * A set of methods for modifying the contents and position of a node group.
694
+ * @i2since 1.8
695
+ */
696
+ export interface INodeGroupEditor {
697
+ /**
698
+ * Adds nodes to the group.
699
+ * @param nodes - The nodes to add to the group.
700
+ * @throws `Error` if any of the nodes are not on the chart.
701
+ * @returns The node group, with the specified nodes added.
702
+ * @i2since 1.8
703
+ */
704
+ addNodes(nodes: NodeSpecifier | Iterable<NodeSpecifier>): this;
705
+ /**
706
+ * Removes nodes from the group. If the group is empty after the mutation is committed, the group itself is removed.
707
+ * @param nodes - The nodes to remove from the group.
708
+ * @returns The node group, with the specified nodes removed.
709
+ * @i2since 1.8
710
+ */
711
+ removeNodes(nodes: NodeSpecifier | Iterable<NodeSpecifier>): this;
712
+ }
713
+ /**
714
+ * A record that has been created in a mutation handler, but has not yet been added to a chart.
689
715
  * @i2since 1.1
690
716
  */
691
717
  export interface IPendingRecord extends IRecordEditor {
692
718
  /**
693
- * Gets or sets the identifier of the record.
719
+ * Gets the identifier of the record.
694
720
  * @i2since 1.1
695
721
  */
696
- recordId: records.AnalyzeRecordId;
722
+ readonly recordId: records.AnalyzeRecordId;
723
+ }
724
+ /**
725
+ * A node group that has been created in a mutation handler, but has not yet been added to a chart.
726
+ * @i2since 1.8
727
+ */
728
+ export interface IPendingNodeGroup extends INodeGroupEditor {
729
+ /**
730
+ * Gets the identifier of the node group.
731
+ * @i2since 1.8
732
+ */
733
+ readonly id: visual.ElementId;
697
734
  }
698
735
  /**
699
736
  * A set of utility functions for creating property and other values that can be reused across records.
@@ -913,6 +950,15 @@ export declare namespace app {
913
950
  * @i2since 1.1
914
951
  */
915
952
  addRecordGroup(recordGroupId: AnalyzeRecordGroupId, selectionOption: SelectionOption): void;
953
+ /**
954
+ * Creates a node group from the specified nodes.
955
+ *
956
+ * @param nodes - The nodes to add to the group.
957
+ * @throws `Error` if any of the nodes are not on the chart.
958
+ * @returns The node group, with the specified nodes added.
959
+ * @i2since 1.8
960
+ */
961
+ addNodeGroup(nodes: Iterable<NodeSpecifier>): IPendingNodeGroup;
916
962
  /**
917
963
  * Gets an object with methods for editing a record.
918
964
  *
@@ -937,6 +983,14 @@ export declare namespace app {
937
983
  * @i2since 1.2
938
984
  */
939
985
  editEdge(edge: EdgeSpecifier): IEdgeEditor;
986
+ /**
987
+ * Gets an object with methods for editing a node group.
988
+ *
989
+ * @param nodeGroup - The node group to be edited.
990
+ * @returns The node-group-editing object.
991
+ * @i2since 1.8
992
+ */
993
+ editNodeGroup(nodeGroup: NodeGroupSpecifier): INodeGroupEditor;
940
994
  /**
941
995
  * Moves a node to a particular location on the chart.
942
996
  *
@@ -973,6 +1027,14 @@ export declare namespace app {
973
1027
  * @i2since 1.1
974
1028
  */
975
1029
  removeElements(elements: ElementSpecifier | Iterable<ElementSpecifier>): boolean;
1030
+ /**
1031
+ * Removes node groups from the chart. Removing a node group does not remove the nodes that were part of it.
1032
+ *
1033
+ * @param nodeGroups - The node group or groups to be removed.
1034
+ * @returns `true` if one or more node groups were successfully removed from the chart; `false` if none of the node groups existed.
1035
+ * @i2since 1.8
1036
+ */
1037
+ removeNodeGroups(nodeGroups: NodeGroupSpecifier | Iterable<NodeGroupSpecifier>): boolean;
976
1038
  /**
977
1039
  * Removes the currently selected records from the chart.
978
1040
  * @i2since 1.1
@@ -1404,6 +1466,11 @@ export declare namespace chart {
1404
1466
  * @i2since 1.6
1405
1467
  */
1406
1468
  readonly edgeSummaries: data.IKeyedReadOnlyCollection<visual.ElementId, visual.IEdgeSummary>;
1469
+ /**
1470
+ * Gets all the node groups in the chart.
1471
+ * @i2since 1.8
1472
+ */
1473
+ readonly nodeGroups: data.IKeyedReadOnlyCollection<visual.ElementId, visual.INodeGroup>;
1407
1474
  /**
1408
1475
  * Gets all the records in the chart.
1409
1476
  * @i2since 1.0
@@ -1564,6 +1631,27 @@ export declare namespace chart {
1564
1631
  */
1565
1632
  readonly removed: data.IReadOnlyCollection<visual.ElementId>;
1566
1633
  };
1634
+ /**
1635
+ * Gets the {@link visual.INodeGroup | node groups} that changed.
1636
+ * @i2since 1.8
1637
+ */
1638
+ readonly nodeGroups: {
1639
+ /**
1640
+ * Gets the node groups that were added.
1641
+ * @i2since 1.8
1642
+ */
1643
+ readonly added: data.IKeyedReadOnlyCollection<visual.ElementId, visual.INodeGroup>;
1644
+ /**
1645
+ * Gets the node groups that were changed.
1646
+ * @i2since 1.8
1647
+ */
1648
+ readonly changed: data.IKeyedReadOnlyCollection<visual.ElementId, visual.INodeGroup>;
1649
+ /**
1650
+ * Gets the identifiers of the node groups that were removed.
1651
+ * @i2since 1.8
1652
+ */
1653
+ readonly removed: data.IReadOnlyCollection<visual.ElementId>;
1654
+ };
1567
1655
  }
1568
1656
  /**
1569
1657
  * A change to the data in a chart in i2 Notebook.
@@ -5575,6 +5663,22 @@ export declare namespace visual {
5575
5663
  */
5576
5664
  readonly edges: data.IKeyedReadOnlyCollection<ElementId, IEdge>;
5577
5665
  }
5666
+ /**
5667
+ * A node group, which is a collection of nodes that can be moved and selected together.
5668
+ * @i2since 1.8
5669
+ */
5670
+ export interface INodeGroup {
5671
+ /**
5672
+ * Gets the identifier of the node group.
5673
+ * @i2since 1.8
5674
+ */
5675
+ readonly id: ElementId;
5676
+ /**
5677
+ * Gets the nodes in the node group.
5678
+ * @i2since 1.8
5679
+ */
5680
+ readonly nodes: data.IKeyedReadOnlyCollection<ElementId, INode>;
5681
+ }
5578
5682
  }
5579
5683
 
5580
5684
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i2analyze/notebook-sdk",
3
- "version": "1.7.2-dev.0",
3
+ "version": "1.8.0-dev.1",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {