@markerjs/markerjs3 3.0.0 → 3.1.0

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/markerjs3.d.ts CHANGED
@@ -703,6 +703,18 @@ declare class LinearMarkerBase extends MarkerBase {
703
703
  * Visible visual of the marker.
704
704
  */
705
705
  protected visibleVisual: SVGGraphicsElement | undefined;
706
+ /**
707
+ * Line visual of the marker.
708
+ */
709
+ protected lineVisual: SVGGraphicsElement | undefined;
710
+ /**
711
+ * Start terminator (ending) visual of the marker.
712
+ */
713
+ protected startTerminatorVisual: SVGGraphicsElement | undefined;
714
+ /**
715
+ * End terminator (ending) visual of the marker.
716
+ */
717
+ protected endTerminatorVisual: SVGGraphicsElement | undefined;
706
718
  protected applyStrokeColor(): void;
707
719
  protected applyStrokeWidth(): void;
708
720
  protected applyStrokeDasharray(): void;
@@ -710,13 +722,23 @@ declare class LinearMarkerBase extends MarkerBase {
710
722
  constructor(container: SVGGElement);
711
723
  ownsTarget(el: EventTarget): boolean;
712
724
  /**
713
- * The path representing the marker visual.
725
+ * The path representing the line part of the marker visual.
714
726
  *
715
727
  * When implemented in derived class should return SVG path for the marker.
716
728
  *
717
729
  * @returns SVG path for the marker.
718
730
  */
719
731
  protected getPath(): string;
732
+ /**
733
+ * The path representing the start terminator (ending) part of the marker visual.
734
+ * @returns SVG path
735
+ */
736
+ protected getStartTerminatorPath(): string;
737
+ /**
738
+ * The path representing the end terminator (ending) part of the marker visual.
739
+ * @returns SVG path
740
+ */
741
+ protected getEndTerminatorPath(): string;
720
742
  /**
721
743
  * Creates marker's visual.
722
744
  */
@@ -775,7 +797,9 @@ declare class ArrowMarker extends LineMarker {
775
797
  get arrowType(): ArrowType;
776
798
  set arrowType(value: ArrowType);
777
799
  constructor(container: SVGGElement);
778
- protected getPath(): string;
800
+ private getArrowProperties;
801
+ protected getStartTerminatorPath(): string;
802
+ protected getEndTerminatorPath(): string;
779
803
  protected applyStrokeWidth(): void;
780
804
  getState(): ArrowMarkerState;
781
805
  restoreState(state: MarkerBaseState): void;
@@ -793,7 +817,9 @@ declare class MeasurementMarker extends LineMarker {
793
817
  static typeName: string;
794
818
  static title: string;
795
819
  constructor(container: SVGGElement);
796
- protected getPath(): string;
820
+ protected getStartTerminatorPath(): string;
821
+ protected getEndTerminatorPath(): string;
822
+ private getTerminatorProperties;
797
823
  protected applyStrokeWidth(): void;
798
824
  }
799
825
 
@@ -1530,6 +1556,40 @@ declare class CaptionFrameMarker extends TextMarker {
1530
1556
  scale(scaleX: number, scaleY: number): void;
1531
1557
  }
1532
1558
 
1559
+ interface CurveMarkerState extends LinearMarkerBaseState {
1560
+ /**
1561
+ * x coordinate for the curve control point.
1562
+ */
1563
+ curveX: number;
1564
+ /**
1565
+ * y coordinate for the curve control point.
1566
+ */
1567
+ curveY: number;
1568
+ }
1569
+
1570
+ /**
1571
+ * Curve marker represents a curved line.
1572
+ *
1573
+ * @summary Curve marker.
1574
+ * @group Markers
1575
+ */
1576
+ declare class CurveMarker extends LineMarker {
1577
+ static typeName: string;
1578
+ static title: string;
1579
+ /**
1580
+ * x coordinate for the curve control point.
1581
+ */
1582
+ curveX: number;
1583
+ /**
1584
+ * y coordinate for the curve control point.
1585
+ */
1586
+ curveY: number;
1587
+ constructor(container: SVGGElement);
1588
+ protected getPath(): string;
1589
+ getState(): CurveMarkerState;
1590
+ restoreState(state: CurveMarkerState): void;
1591
+ }
1592
+
1533
1593
  /**
1534
1594
  * Properties for marker editor.
1535
1595
  */
@@ -2343,10 +2403,6 @@ declare class LinearMarkerEditor<TMarkerType extends LinearMarkerBase = LinearMa
2343
2403
  private manipulationStartY1;
2344
2404
  private manipulationStartX2;
2345
2405
  private manipulationStartY2;
2346
- /**
2347
- * Container for control elements.
2348
- */
2349
- protected controlBox: SVGGElement;
2350
2406
  /**
2351
2407
  * Container for manipulation grips.
2352
2408
  */
@@ -2744,6 +2800,25 @@ declare class CaptionFrameMarkerEditor<TMarkerType extends CaptionFrameMarker =
2744
2800
  protected setSize(): void;
2745
2801
  }
2746
2802
 
2803
+ declare class CurveMarkerEditor<TMarkerType extends CurveMarker = CurveMarker> extends LinearMarkerEditor<TMarkerType> {
2804
+ /**
2805
+ * Curve manipulation grip.
2806
+ */
2807
+ protected curveGrip?: ResizeGrip;
2808
+ private manipulationStartCurveX;
2809
+ private manipulationStartCurveY;
2810
+ private curveControlLine1?;
2811
+ private curveControlLine2?;
2812
+ ownsTarget(el: EventTarget): boolean;
2813
+ pointerDown(point: IPoint, target?: EventTarget): void;
2814
+ protected resize(point: IPoint): void;
2815
+ manipulate(point: IPoint): void;
2816
+ protected setupControlBox(): void;
2817
+ protected adjustControlBox(): void;
2818
+ protected addControlGrips(): void;
2819
+ protected positionGrips(): void;
2820
+ }
2821
+
2747
2822
  /**
2748
2823
  * Event map for {@link MarkerView}.
2749
2824
  */
@@ -3056,4 +3131,4 @@ declare class Renderer {
3056
3131
  rasterize(state: AnnotationState, targetCanvas?: HTMLCanvasElement): Promise<string>;
3057
3132
  }
3058
3133
 
3059
- export { Activator, type AnnotationState, ArrowMarker, ArrowMarkerEditor, type ArrowMarkerState, type ArrowType, type BlurHandler, CalloutMarker, CalloutMarkerEditor, type CalloutMarkerState, CaptionFrameMarker, CaptionFrameMarkerEditor, type CaptionFrameMarkerState, CheckImageMarker, CoverMarker, CustomImageMarker, EllipseFrameMarker, EllipseMarker, type FontSize, FrameMarker, FreehandMarker, FreehandMarkerEditor, type FreehandMarkerState, Grip, type GripLocation, HighlightMarker, type IPoint, type ISize, type ITransformMatrix, ImageMarkerBase, type ImageMarkerBaseState, ImageMarkerEditor, type ImageType, LineMarker, LinearMarkerBase, type LinearMarkerBaseState, LinearMarkerEditor, MarkerArea, type MarkerAreaEventData, type MarkerAreaEventMap, type MarkerAreaMode, MarkerBase, MarkerBaseEditor, type MarkerBaseState, type MarkerCreationStyle, type MarkerEditorEventData, type MarkerEditorProperties, type MarkerEditorState, type MarkerEventData, type MarkerStage, MarkerView, type MarkerViewEventData, type MarkerViewEventMap, MeasurementMarker, PolygonMarker, PolygonMarkerEditor, type PolygonMarkerState, RectangularBoxMarkerBase, type RectangularBoxMarkerBaseState, Renderer, ResizeGrip, RotateGrip, ShapeMarkerBase, type ShapeMarkerBaseState, ShapeMarkerEditor, ShapeOutlineMarkerBase, type ShapeOutlineMarkerBaseState, ShapeOutlineMarkerEditor, SvgHelper, TextBlock, TextBlockEditor, type TextChangedHandler, TextMarker, TextMarkerEditor, type TextMarkerState, XImageMarker };
3134
+ export { Activator, type AnnotationState, ArrowMarker, ArrowMarkerEditor, type ArrowMarkerState, type ArrowType, type BlurHandler, CalloutMarker, CalloutMarkerEditor, type CalloutMarkerState, CaptionFrameMarker, CaptionFrameMarkerEditor, type CaptionFrameMarkerState, CheckImageMarker, CoverMarker, CurveMarker, CurveMarkerEditor, type CurveMarkerState, CustomImageMarker, EllipseFrameMarker, EllipseMarker, type FontSize, FrameMarker, FreehandMarker, FreehandMarkerEditor, type FreehandMarkerState, Grip, type GripLocation, HighlightMarker, type IPoint, type ISize, type ITransformMatrix, ImageMarkerBase, type ImageMarkerBaseState, ImageMarkerEditor, type ImageType, LineMarker, LinearMarkerBase, type LinearMarkerBaseState, LinearMarkerEditor, MarkerArea, type MarkerAreaEventData, type MarkerAreaEventMap, type MarkerAreaMode, MarkerBase, MarkerBaseEditor, type MarkerBaseState, type MarkerCreationStyle, type MarkerEditorEventData, type MarkerEditorProperties, type MarkerEditorState, type MarkerEventData, type MarkerStage, MarkerView, type MarkerViewEventData, type MarkerViewEventMap, MeasurementMarker, PolygonMarker, PolygonMarkerEditor, type PolygonMarkerState, RectangularBoxMarkerBase, type RectangularBoxMarkerBaseState, Renderer, ResizeGrip, RotateGrip, ShapeMarkerBase, type ShapeMarkerBaseState, ShapeMarkerEditor, ShapeOutlineMarkerBase, type ShapeOutlineMarkerBaseState, ShapeOutlineMarkerEditor, SvgHelper, TextBlock, TextBlockEditor, type TextChangedHandler, TextMarker, TextMarkerEditor, type TextMarkerState, XImageMarker };