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

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,22 @@ 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;
1038
+ /**
1039
+ * Removes nodes from their node group. If the group is empty after the mutation is committed, the group itself is removed.
1040
+ *
1041
+ * @param nodes - The node or nodes to be removed.
1042
+ * @returns `true` if one or more nodes were successfully removed from the group; `false` if none of the nodes existed.
1043
+ * @i2since 1.8
1044
+ */
1045
+ removeFromNodeGroup(nodes: NodeSpecifier | Iterable<NodeSpecifier>): boolean;
976
1046
  /**
977
1047
  * Removes the currently selected records from the chart.
978
1048
  * @i2since 1.1
@@ -1404,6 +1474,11 @@ export declare namespace chart {
1404
1474
  * @i2since 1.6
1405
1475
  */
1406
1476
  readonly edgeSummaries: data.IKeyedReadOnlyCollection<visual.ElementId, visual.IEdgeSummary>;
1477
+ /**
1478
+ * Gets all the node groups in the chart.
1479
+ * @i2since 1.8
1480
+ */
1481
+ readonly nodeGroups: data.IKeyedReadOnlyCollection<visual.ElementId, visual.INodeGroup>;
1407
1482
  /**
1408
1483
  * Gets all the records in the chart.
1409
1484
  * @i2since 1.0
@@ -1564,6 +1639,27 @@ export declare namespace chart {
1564
1639
  */
1565
1640
  readonly removed: data.IReadOnlyCollection<visual.ElementId>;
1566
1641
  };
1642
+ /**
1643
+ * Gets the {@link visual.INodeGroup | node groups} that changed.
1644
+ * @i2since 1.8
1645
+ */
1646
+ readonly nodeGroups: {
1647
+ /**
1648
+ * Gets the node groups that were added.
1649
+ * @i2since 1.8
1650
+ */
1651
+ readonly added: data.IKeyedReadOnlyCollection<visual.ElementId, visual.INodeGroup>;
1652
+ /**
1653
+ * Gets the node groups that were changed.
1654
+ * @i2since 1.8
1655
+ */
1656
+ readonly changed: data.IKeyedReadOnlyCollection<visual.ElementId, visual.INodeGroup>;
1657
+ /**
1658
+ * Gets the identifiers of the node groups that were removed.
1659
+ * @i2since 1.8
1660
+ */
1661
+ readonly removed: data.IReadOnlyCollection<visual.ElementId>;
1662
+ };
1567
1663
  }
1568
1664
  /**
1569
1665
  * A change to the data in a chart in i2 Notebook.
@@ -5575,6 +5671,22 @@ export declare namespace visual {
5575
5671
  */
5576
5672
  readonly edges: data.IKeyedReadOnlyCollection<ElementId, IEdge>;
5577
5673
  }
5674
+ /**
5675
+ * A node group, which is a collection of nodes that can be moved and selected together.
5676
+ * @i2since 1.8
5677
+ */
5678
+ export interface INodeGroup {
5679
+ /**
5680
+ * Gets the identifier of the node group.
5681
+ * @i2since 1.8
5682
+ */
5683
+ readonly id: ElementId;
5684
+ /**
5685
+ * Gets the nodes in the node group.
5686
+ * @i2since 1.8
5687
+ */
5688
+ readonly nodes: data.IKeyedReadOnlyCollection<ElementId, INode>;
5689
+ }
5578
5690
  }
5579
5691
 
5580
5692
  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.2",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {