@i2analyze/notebook-sdk 1.2.0-dev.5 → 1.2.0-dev.6

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.
@@ -353,6 +353,16 @@ export declare namespace app {
353
353
  * @i2since 1.1
354
354
  */
355
355
  export type SourceReferenceSpecifier = records.SourceReferenceId | records.ISourceReference;
356
+ /**
357
+ * A common specifier for a Node, for use in mutation APIs.
358
+ * @i2since 1.2
359
+ */
360
+ export type NodeSpecifier = visual.ElementId | visual.INode;
361
+ /**
362
+ * A common specifier for an Edge, for use in mutation APIs.
363
+ * @i2since 1.2
364
+ */
365
+ export type EdgeSpecifier = visual.ElementId | visual.IEdge;
356
366
  /**
357
367
  * The identifier of a record group.
358
368
  * @i2since 1.1
@@ -563,6 +573,47 @@ export declare namespace app {
563
573
  */
564
574
  setLinkDirection(linkDirection: data.LinkDirection): this;
565
575
  }
576
+ /**
577
+ * A set of methods for modifying the styles of an elements on an i2 Notebook chart.
578
+ * @i2since 1.2
579
+ */
580
+ export interface IElementEditorBase {
581
+ /**
582
+ * Sets or clears the color of the element.
583
+ *
584
+ * @param color - The Color to be set (or undefined resets to default color).
585
+ * @returns This editor, with the defined color in the elements.
586
+ * @throws `Error` if the given color is not a CSS color syntax such as Hex, RGB and color name.
587
+ * @i2since 1.2
588
+ */
589
+ setColor(color: string | undefined): this;
590
+ }
591
+ /**
592
+ * A set of styling methods that can be applied on nodes.
593
+ * @i2since 1.2
594
+ */
595
+ export interface INodeEditor extends IElementEditorBase {
596
+ /**
597
+ * Sets or clears the size of the node.
598
+ * @param size - The node size to be set (or undefined resets to default size 1).
599
+ * @returns This editor, with the defined size on the given node.
600
+ * @i2since 1.2
601
+ */
602
+ setSize(size: visual.NodeSize | undefined): this;
603
+ /**
604
+ * Moves a node to a particular location on the chart.
605
+ * @param position - The location to move the node to.
606
+ * @returns This editor, with the new position on the given node.
607
+ * @i2since 1.2
608
+ */
609
+ setCenter(position: visual.IPosition): this;
610
+ }
611
+ /**
612
+ * A set of styling methods that can be applied on edges.
613
+ * @i2since 1.2
614
+ */
615
+ export interface IEdgeEditor extends IElementEditorBase {
616
+ }
566
617
  /**
567
618
  * A record that has been created in a transaction handler, but has not yet been added to a chart.
568
619
  * @i2since 1.1
@@ -800,6 +851,22 @@ export declare namespace app {
800
851
  * @i2since 1.1
801
852
  */
802
853
  editRecord(record: RecordSpecifier): IRecordEditor;
854
+ /**
855
+ * Gets an object with methods for editing a node styles.
856
+ *
857
+ * @param node - The node to be edited.
858
+ * @returns The node-editing object.
859
+ * @i2since 1.2
860
+ */
861
+ editNode(node: NodeSpecifier): INodeEditor;
862
+ /**
863
+ * Gets an object with methods for editing an edge styles.
864
+ *
865
+ * @param edge - The edge to be edited.
866
+ * @returns The edge-editing object.
867
+ * @i2since 1.2
868
+ */
869
+ editEdge(edge: EdgeSpecifier): IEdgeEditor;
803
870
  /**
804
871
  * Moves a node to a particular location on the chart.
805
872
  *
@@ -807,6 +874,7 @@ export declare namespace app {
807
874
  * @param position - The location to move the node to.
808
875
  * @throws `Error` if the node is not on the chart, or if the x- or y-coordinate of the location is not a number.
809
876
  * @i2since 1.1
877
+ * @deprecated `app.setNodeCenter` is no longer used instead use {@link app.INodeEditor.setCenter}.
810
878
  */
811
879
  setNodeCenter(node: visual.INode | visual.ElementId, position: visual.IPosition): void;
812
880
  /**
@@ -4237,6 +4305,11 @@ export declare namespace visual {
4237
4305
  * @i2since 1.0
4238
4306
  */
4239
4307
  export type ElementId = string;
4308
+ /**
4309
+ * A set of values that represents the size of the Node.
4310
+ * @i2since 1.2
4311
+ */
4312
+ export type NodeSize = 0.5 | 1 | 2 | 3 | 4;
4240
4313
  /**
4241
4314
  * A set of information and functionality that is common to all elements on an i2 Notebook chart.
4242
4315
  * @i2since 1.0
@@ -4340,6 +4413,11 @@ export declare namespace visual {
4340
4413
  * @i2since 1.0
4341
4414
  */
4342
4415
  readonly direction: data.LinkDirection;
4416
+ /**
4417
+ * Gets the style of the edge.
4418
+ * @i2since 1.2
4419
+ */
4420
+ readonly style: IEdgeStyle;
4343
4421
  }
4344
4422
  /**
4345
4423
  * A position on a chart surface.
@@ -4360,16 +4438,47 @@ export declare namespace visual {
4360
4438
  */
4361
4439
  readonly y: number;
4362
4440
  }
4441
+ /**
4442
+ * Settings that affects the appearence of an element.
4443
+ * @typeParam T - The type of the settings value.
4444
+ * @i2since 1.2
4445
+ */
4446
+ export interface IInheritable<T> {
4447
+ isDefault: boolean;
4448
+ value: T;
4449
+ }
4450
+ /**
4451
+ * A style for an element, which controls its appearance.
4452
+ * @i2since 1.2
4453
+ */
4454
+ export interface IElementStyleBase {
4455
+ /**
4456
+ * Gets the color of the element.
4457
+ * @i2since 1.2
4458
+ */
4459
+ readonly color: IInheritable<string>;
4460
+ }
4363
4461
  /**
4364
4462
  * A style for a node, which controls its appearance.
4365
4463
  * @i2since 1.0
4366
4464
  */
4367
- export interface INodeStyle {
4465
+ export interface INodeStyle extends IElementStyleBase {
4368
4466
  /**
4369
4467
  * Gets the image to display for a node.
4370
4468
  * @i2since 1.0
4371
4469
  */
4372
4470
  readonly image: data.IImage;
4471
+ /**
4472
+ * Gets the size of the node.
4473
+ * @i2since 1.2
4474
+ */
4475
+ readonly size: IInheritable<NodeSize>;
4476
+ }
4477
+ /**
4478
+ * A style for an edge, which controls its appearance.
4479
+ * @i2since 1.2
4480
+ */
4481
+ export interface IEdgeStyle extends IElementStyleBase {
4373
4482
  }
4374
4483
  /**
4375
4484
  * A rectangular area, such as the boundary of the chart view.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i2analyze/notebook-sdk",
3
- "version": "1.2.0-dev.5",
3
+ "version": "1.2.0-dev.6",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {