@univerjs-pro/engine-shape 0.15.3-insiders.20260131-cbd5fac
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/README.md +232 -0
- package/lib/cjs/index.js +1 -0
- package/lib/es/index.js +1 -0
- package/lib/index.js +1 -0
- package/lib/types/index.d.ts +200 -0
- package/lib/types/model/group-shape-model.d.ts +0 -0
- package/lib/types/model/shape-model.d.ts +107 -0
- package/lib/types/perset-shape-config.d.ts +2 -0
- package/lib/types/render-engine/base-shape-context.d.ts +9 -0
- package/lib/types/render-engine/bent-connector-router-util.d.ts +48 -0
- package/lib/types/render-engine/connector-points-util.d.ts +44 -0
- package/lib/types/render-engine/line-shape-render-model.d.ts +135 -0
- package/lib/types/render-engine/point-to-shape-transform.d.ts +13 -0
- package/lib/types/render-engine/shape-context-operator.d.ts +19 -0
- package/lib/types/render-engine/shape-render-model.d.ts +96 -0
- package/lib/types/shape-default.d.ts +27 -0
- package/lib/types/shape-enum.d.ts +314 -0
- package/lib/types/shape-type.d.ts +836 -0
- package/lib/types/shapes/accent-border-callout1-shape.d.ts +6 -0
- package/lib/types/shapes/accent-border-callout2-shape.d.ts +6 -0
- package/lib/types/shapes/accent-border-callout3-shape.d.ts +6 -0
- package/lib/types/shapes/accent-callout1-shape.d.ts +6 -0
- package/lib/types/shapes/accent-callout2-shape.d.ts +6 -0
- package/lib/types/shapes/accent-callout3-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-back-previous-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-beginning-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-blank-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-document-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-end-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-forward-next-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-help-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-home-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-information-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-movie-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-return-shape.d.ts +6 -0
- package/lib/types/shapes/action-button-sound-shape.d.ts +6 -0
- package/lib/types/shapes/arc-shape.d.ts +6 -0
- package/lib/types/shapes/bent-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/bent-connector2-shape.d.ts +7 -0
- package/lib/types/shapes/bent-connector3-shape.d.ts +7 -0
- package/lib/types/shapes/bent-connector4-shape.d.ts +7 -0
- package/lib/types/shapes/bent-connector5-shape.d.ts +7 -0
- package/lib/types/shapes/bent-up-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/bevel-shape.d.ts +6 -0
- package/lib/types/shapes/block-arc-shape.d.ts +6 -0
- package/lib/types/shapes/border-callout1-shape.d.ts +6 -0
- package/lib/types/shapes/border-callout2-shape.d.ts +6 -0
- package/lib/types/shapes/border-callout3-shape.d.ts +6 -0
- package/lib/types/shapes/brace-pair-shape.d.ts +6 -0
- package/lib/types/shapes/bracket-pair-shape.d.ts +6 -0
- package/lib/types/shapes/callout1-shape.d.ts +6 -0
- package/lib/types/shapes/callout2-shape.d.ts +6 -0
- package/lib/types/shapes/callout3-shape.d.ts +6 -0
- package/lib/types/shapes/can-shape.d.ts +6 -0
- package/lib/types/shapes/chart-plus-shape.d.ts +6 -0
- package/lib/types/shapes/chart-star-shape.d.ts +6 -0
- package/lib/types/shapes/chart-x-shape.d.ts +6 -0
- package/lib/types/shapes/chevron-shape.d.ts +6 -0
- package/lib/types/shapes/chord-shape.d.ts +6 -0
- package/lib/types/shapes/circle-shape.d.ts +6 -0
- package/lib/types/shapes/circular-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/cloud-callout-shape.d.ts +6 -0
- package/lib/types/shapes/cloud-callout1-shape.d.ts +6 -0
- package/lib/types/shapes/cloud-shape.d.ts +6 -0
- package/lib/types/shapes/corner-shape.d.ts +6 -0
- package/lib/types/shapes/corner-tabs-shape.d.ts +6 -0
- package/lib/types/shapes/cube-shape.d.ts +6 -0
- package/lib/types/shapes/curved-connector2-shape.d.ts +7 -0
- package/lib/types/shapes/curved-connector3-shape.d.ts +7 -0
- package/lib/types/shapes/curved-connector4-shape.d.ts +7 -0
- package/lib/types/shapes/curved-connector5-shape.d.ts +7 -0
- package/lib/types/shapes/curved-down-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/curved-left-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/curved-right-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/curved-up-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/decagon-shape.d.ts +6 -0
- package/lib/types/shapes/diagonal-stripe-shape.d.ts +6 -0
- package/lib/types/shapes/diamond-shape.d.ts +6 -0
- package/lib/types/shapes/dodecagon-shape.d.ts +6 -0
- package/lib/types/shapes/donut-shape.d.ts +6 -0
- package/lib/types/shapes/double-wave-shape.d.ts +6 -0
- package/lib/types/shapes/down-arrow-callout-shape.d.ts +6 -0
- package/lib/types/shapes/down-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/ellipse-ribbon-shape.d.ts +6 -0
- package/lib/types/shapes/ellipse-ribbon2-shape.d.ts +6 -0
- package/lib/types/shapes/ellipse-shape.d.ts +6 -0
- package/lib/types/shapes/flow-chart-offline-storage-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-alternate-process-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-collate-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-connector-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-data-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-decision-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-delay-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-display-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-document-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-extract-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-internal-storage-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-magnetic-disk-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-magnetic-drum-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-magnetic-tape-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-manual-input-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-manual-operation-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-merge-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-multidocument-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-offpage-connector-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-online-storage-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-or-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-predefined-process-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-preparation-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-process-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-punched-card-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-punched-tape-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-sort-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-summing-junction-shape.d.ts +6 -0
- package/lib/types/shapes/flowchart-terminator-shape.d.ts +6 -0
- package/lib/types/shapes/folded-corner-shape.d.ts +6 -0
- package/lib/types/shapes/frame-shape.d.ts +6 -0
- package/lib/types/shapes/frame2-shape.d.ts +6 -0
- package/lib/types/shapes/funnel-shape.d.ts +6 -0
- package/lib/types/shapes/gear6-shape.d.ts +6 -0
- package/lib/types/shapes/gear9-shape.d.ts +6 -0
- package/lib/types/shapes/half-frame-shape.d.ts +6 -0
- package/lib/types/shapes/heart-shape.d.ts +6 -0
- package/lib/types/shapes/heptagon-shape.d.ts +6 -0
- package/lib/types/shapes/hexagon-shape.d.ts +6 -0
- package/lib/types/shapes/home-plate-shape.d.ts +6 -0
- package/lib/types/shapes/horizontal-scroll-shape.d.ts +6 -0
- package/lib/types/shapes/index.d.ts +3 -0
- package/lib/types/shapes/irregular-seal1-shape.d.ts +6 -0
- package/lib/types/shapes/irregular-seal2-shape.d.ts +6 -0
- package/lib/types/shapes/left-arrow-callout-shape.d.ts +6 -0
- package/lib/types/shapes/left-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/left-brace-shape.d.ts +6 -0
- package/lib/types/shapes/left-bracket-shape.d.ts +6 -0
- package/lib/types/shapes/left-circular-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/left-right-arrow-callout-shape.d.ts +6 -0
- package/lib/types/shapes/left-right-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/left-right-circular-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/left-right-ribbon-shape.d.ts +6 -0
- package/lib/types/shapes/left-right-up-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/left-up-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/lightning-bolt-shape.d.ts +6 -0
- package/lib/types/shapes/line-lnv-shape.d.ts +6 -0
- package/lib/types/shapes/line-shape.d.ts +7 -0
- package/lib/types/shapes/math-divide-shape.d.ts +6 -0
- package/lib/types/shapes/math-equal-shape.d.ts +6 -0
- package/lib/types/shapes/math-minus-shape.d.ts +6 -0
- package/lib/types/shapes/math-multiply-shape.d.ts +6 -0
- package/lib/types/shapes/math-not-equal-shape.d.ts +6 -0
- package/lib/types/shapes/math-plus-shape.d.ts +6 -0
- package/lib/types/shapes/moon-shape.d.ts +6 -0
- package/lib/types/shapes/no-smoking-shape.d.ts +6 -0
- package/lib/types/shapes/non-isosceles-trapezoid.d.ts +6 -0
- package/lib/types/shapes/notched-right-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/octagon-shape.d.ts +6 -0
- package/lib/types/shapes/oval-callout1-shape.d.ts +6 -0
- package/lib/types/shapes/parallelogram-shape.d.ts +6 -0
- package/lib/types/shapes/pentagon-shape.d.ts +6 -0
- package/lib/types/shapes/pie-shape.d.ts +6 -0
- package/lib/types/shapes/pie-wedge-shape.d.ts +6 -0
- package/lib/types/shapes/plaque-shape.d.ts +6 -0
- package/lib/types/shapes/plaque-tabs-shape.d.ts +6 -0
- package/lib/types/shapes/plus-shape.d.ts +6 -0
- package/lib/types/shapes/quad-arrow-callout-shape.d.ts +6 -0
- package/lib/types/shapes/quad-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/rectangle-callout1-shape.d.ts +6 -0
- package/lib/types/shapes/rectangle-shape.d.ts +6 -0
- package/lib/types/shapes/ribbon-shape.d.ts +6 -0
- package/lib/types/shapes/ribbon2-shape.d.ts +6 -0
- package/lib/types/shapes/right-arrow-callout-shape.d.ts +6 -0
- package/lib/types/shapes/right-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/right-brace-shape.d.ts +6 -0
- package/lib/types/shapes/right-bracket-shape.d.ts +6 -0
- package/lib/types/shapes/right-triangle-shape.d.ts +6 -0
- package/lib/types/shapes/round-rectangle-shape.d.ts +6 -0
- package/lib/types/shapes/round-rectangle1-shape.d.ts +6 -0
- package/lib/types/shapes/round-rectangle2-diagonal-shape.d.ts +6 -0
- package/lib/types/shapes/round-rectangle2-shape.d.ts +6 -0
- package/lib/types/shapes/rounded-rectangular-callout1-shape.d.ts +6 -0
- package/lib/types/shapes/smiley-face-shape.d.ts +6 -0
- package/lib/types/shapes/snip-rectangle1-shape.d.ts +6 -0
- package/lib/types/shapes/snip-rectangle2-diagonal-shape.d.ts +6 -0
- package/lib/types/shapes/snip-rectangle2-same-shape.d.ts +6 -0
- package/lib/types/shapes/snip-round-rectangle1-shape.d.ts +6 -0
- package/lib/types/shapes/square-tabs-shape.d.ts +6 -0
- package/lib/types/shapes/star10-shape.d.ts +6 -0
- package/lib/types/shapes/star12-shape.d.ts +6 -0
- package/lib/types/shapes/star16-shape.d.ts +6 -0
- package/lib/types/shapes/star24-shape.d.ts +6 -0
- package/lib/types/shapes/star32-shape.d.ts +6 -0
- package/lib/types/shapes/star4-shape.d.ts +6 -0
- package/lib/types/shapes/star5-shape.d.ts +6 -0
- package/lib/types/shapes/star6-shape.d.ts +6 -0
- package/lib/types/shapes/star7-shape.d.ts +6 -0
- package/lib/types/shapes/star8-shape.d.ts +6 -0
- package/lib/types/shapes/straight-connector1-shape.d.ts +7 -0
- package/lib/types/shapes/striped-right-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/sun-shape.d.ts +6 -0
- package/lib/types/shapes/swoosh-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/teardrop-shape.d.ts +6 -0
- package/lib/types/shapes/text-box-shape.d.ts +6 -0
- package/lib/types/shapes/trapezoid-shape.d.ts +6 -0
- package/lib/types/shapes/triangle-shape.d.ts +6 -0
- package/lib/types/shapes/up-arrow-callout-shape.d.ts +6 -0
- package/lib/types/shapes/up-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/up-down-arrow-callout-shape.d.ts +6 -0
- package/lib/types/shapes/up-down-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/uturn-arrow-shape.d.ts +6 -0
- package/lib/types/shapes/vertical-scroll-shape.d.ts +6 -0
- package/lib/types/shapes/wave-shape.d.ts +6 -0
- package/lib/types/shapes/wedge-ellipse-callout-shape.d.ts +6 -0
- package/lib/types/shapes/wedge-rect-callout-shape.d.ts +6 -0
- package/lib/types/shapes/wedge-round-rect-callout-shape.d.ts +6 -0
- package/lib/types/util/color-util.d.ts +12 -0
- package/lib/types/util/connector-points-util.d.ts +56 -0
- package/lib/types/util/connector-transform.d.ts +119 -0
- package/lib/types/util/shape-util.d.ts +8 -0
- package/lib/umd/index.js +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export { BasicShapeModel as ShapeModel } from '../src/model/shape-model';
|
|
2
|
+
export { LineShapeRenderModel } from '../src/render-engine/line-shape-render-model';
|
|
3
|
+
export { BaseShapeRenderModel } from '../src/render-engine/shape-render-model';
|
|
4
|
+
export { BasicShapeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, ShapeRenderModeEnum, ShapeTypeEnum } from '../src/shape-enum';
|
|
5
|
+
export type { IConnectorLayoutResult, IConnectorRouteLayoutResult, IConnectPointInfo, ICustomShapeTextData, ICxnShapeData, IDrawingRect, IGdContext, IGdContextBase, ILineType, IPathCommand, IPresetShapeConfig, IShapeAdjustItem, IShapeAdjustItemResolved, IShapeContextOptions, IBasicShapeData as IShapeData, IShapeHitTestResult, IShapeJSONData, IShapeLineStyle, IShapeModel, IShapePath, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeRenderParameters, IShapeText, ShapeAdjustHandleTypeEnum, ShapeHitTestHitTypeEnum, } from '../src/shape-type';
|
|
6
|
+
export { AccentBorderCallout1Shape } from '../src/shapes/accent-border-callout1-shape';
|
|
7
|
+
export { AccentBorderCallout2Shape } from '../src/shapes/accent-border-callout2-shape';
|
|
8
|
+
export { AccentBorderCallout3Shape } from '../src/shapes/accent-border-callout3-shape';
|
|
9
|
+
export { AccentCallout1Shape } from '../src/shapes/accent-callout1-shape';
|
|
10
|
+
export { AccentCallout2Shape } from '../src/shapes/accent-callout2-shape';
|
|
11
|
+
export { AccentCallout3Shape } from '../src/shapes/accent-callout3-shape';
|
|
12
|
+
export { ActionButtonBackPreviousShape } from '../src/shapes/action-button-back-previous-shape';
|
|
13
|
+
export { ActionButtonBeginningShape } from '../src/shapes/action-button-beginning-shape';
|
|
14
|
+
export { ActionButtonBlankShape } from '../src/shapes/action-button-blank-shape';
|
|
15
|
+
export { ActionButtonDocumentShape } from '../src/shapes/action-button-document-shape';
|
|
16
|
+
export { ActionButtonEndShape } from '../src/shapes/action-button-end-shape';
|
|
17
|
+
export { ActionButtonForwardNextShape } from '../src/shapes/action-button-forward-next-shape';
|
|
18
|
+
export { ActionButtonHelpShape } from '../src/shapes/action-button-help-shape';
|
|
19
|
+
export { ActionButtonHomeShape } from '../src/shapes/action-button-home-shape';
|
|
20
|
+
export { ActionButtonInformationShape } from '../src/shapes/action-button-information-shape';
|
|
21
|
+
export { ActionButtonMovieShape } from '../src/shapes/action-button-movie-shape';
|
|
22
|
+
export { ActionButtonReturnShape } from '../src/shapes/action-button-return-shape';
|
|
23
|
+
export { ActionButtonSoundShape } from '../src/shapes/action-button-sound-shape';
|
|
24
|
+
export { ArcShape } from '../src/shapes/arc-shape';
|
|
25
|
+
export { BentArrowShape } from '../src/shapes/bent-arrow-shape';
|
|
26
|
+
export { BentConnector2Shape } from '../src/shapes/bent-connector2-shape';
|
|
27
|
+
export { BentConnector3Shape } from '../src/shapes/bent-connector3-shape';
|
|
28
|
+
export { BentConnector4Shape } from '../src/shapes/bent-connector4-shape';
|
|
29
|
+
export { BentConnector5Shape } from '../src/shapes/bent-connector5-shape';
|
|
30
|
+
export { BentUpArrowShape } from '../src/shapes/bent-up-arrow-shape';
|
|
31
|
+
export { BevelShape } from '../src/shapes/bevel-shape';
|
|
32
|
+
export { BlockArcShape } from '../src/shapes/block-arc-shape';
|
|
33
|
+
export { BorderCallout1Shape } from '../src/shapes/border-callout1-shape';
|
|
34
|
+
export { BorderCallout2Shape } from '../src/shapes/border-callout2-shape';
|
|
35
|
+
export { BorderCallout3Shape } from '../src/shapes/border-callout3-shape';
|
|
36
|
+
export { BracePairShape } from '../src/shapes/brace-pair-shape';
|
|
37
|
+
export { BracketPairShape } from '../src/shapes/bracket-pair-shape';
|
|
38
|
+
export { Callout1Shape } from '../src/shapes/callout1-shape';
|
|
39
|
+
export { Callout2Shape } from '../src/shapes/callout2-shape';
|
|
40
|
+
export { Callout3Shape } from '../src/shapes/callout3-shape';
|
|
41
|
+
export { CanShape } from '../src/shapes/can-shape';
|
|
42
|
+
export { ChartPlusShape } from '../src/shapes/chart-plus-shape';
|
|
43
|
+
export { ChartStarShape } from '../src/shapes/chart-star-shape';
|
|
44
|
+
export { ChartXShape } from '../src/shapes/chart-x-shape';
|
|
45
|
+
export { ChevronShape } from '../src/shapes/chevron-shape';
|
|
46
|
+
export { ChordShape } from '../src/shapes/chord-shape';
|
|
47
|
+
export { CircleShape } from '../src/shapes/circle-shape';
|
|
48
|
+
export { CircularArrowShape } from '../src/shapes/circular-arrow-shape';
|
|
49
|
+
export { CloudCalloutShape } from '../src/shapes/cloud-callout-shape';
|
|
50
|
+
export { CloudShape } from '../src/shapes/cloud-shape';
|
|
51
|
+
export { CornerShape } from '../src/shapes/corner-shape';
|
|
52
|
+
export { CornerTabsShape } from '../src/shapes/corner-tabs-shape';
|
|
53
|
+
export { CubeShape } from '../src/shapes/cube-shape';
|
|
54
|
+
export { CurvedConnector2Shape } from '../src/shapes/curved-connector2-shape';
|
|
55
|
+
export { CurvedConnector3Shape } from '../src/shapes/curved-connector3-shape';
|
|
56
|
+
export { CurvedConnector4Shape } from '../src/shapes/curved-connector4-shape';
|
|
57
|
+
export { CurvedConnector5Shape } from '../src/shapes/curved-connector5-shape';
|
|
58
|
+
export { CurvedDownArrowShape } from '../src/shapes/curved-down-arrow-shape';
|
|
59
|
+
export { CurvedLeftArrowShape } from '../src/shapes/curved-left-arrow-shape';
|
|
60
|
+
export { CurvedRightArrowShape } from '../src/shapes/curved-right-arrow-shape';
|
|
61
|
+
export { CurvedUpArrowShape } from '../src/shapes/curved-up-arrow-shape';
|
|
62
|
+
export { DecagonShape } from '../src/shapes/decagon-shape';
|
|
63
|
+
export { DiagStripeShape } from '../src/shapes/diagonal-stripe-shape';
|
|
64
|
+
export { DiamondShape } from '../src/shapes/diamond-shape';
|
|
65
|
+
export { DodecagonShape } from '../src/shapes/dodecagon-shape';
|
|
66
|
+
export { DonutShape } from '../src/shapes/donut-shape';
|
|
67
|
+
export { DoubleWaveShape } from '../src/shapes/double-wave-shape';
|
|
68
|
+
export { DownArrowCalloutShape } from '../src/shapes/down-arrow-callout-shape';
|
|
69
|
+
export { DownArrowShape } from '../src/shapes/down-arrow-shape';
|
|
70
|
+
export { EllipseRibbon2Shape } from '../src/shapes/ellipse-ribbon2-shape';
|
|
71
|
+
export { EllipseRibbonShape } from '../src/shapes/ellipse-ribbon-shape';
|
|
72
|
+
export { EllipseShape } from '../src/shapes/ellipse-shape';
|
|
73
|
+
export { FlowChartOfflineStorageShape } from '../src/shapes/flow-chart-offline-storage-shape';
|
|
74
|
+
export { FlowchartAlternateProcessShape } from '../src/shapes/flowchart-alternate-process-shape';
|
|
75
|
+
export { FlowchartCollateShape } from '../src/shapes/flowchart-collate-shape';
|
|
76
|
+
export { FlowchartConnectorShape } from '../src/shapes/flowchart-connector-shape';
|
|
77
|
+
export { FlowChartInputOutputShape } from '../src/shapes/flowchart-data-shape';
|
|
78
|
+
export { FlowchartDecisionShape } from '../src/shapes/flowchart-decision-shape';
|
|
79
|
+
export { FlowchartDelayShape } from '../src/shapes/flowchart-delay-shape';
|
|
80
|
+
export { FlowchartDisplayShape } from '../src/shapes/flowchart-display-shape';
|
|
81
|
+
export { FlowchartDocumentShape } from '../src/shapes/flowchart-document-shape';
|
|
82
|
+
export { FlowchartExtractShape } from '../src/shapes/flowchart-extract-shape';
|
|
83
|
+
export { FlowchartInternalStorageShape } from '../src/shapes/flowchart-internal-storage-shape';
|
|
84
|
+
export { FlowchartMagneticDiskShape } from '../src/shapes/flowchart-magnetic-disk-shape';
|
|
85
|
+
export { FlowchartMagneticDrumShape } from '../src/shapes/flowchart-magnetic-drum-shape';
|
|
86
|
+
export { FlowchartMagneticTapeShape } from '../src/shapes/flowchart-magnetic-tape-shape';
|
|
87
|
+
export { FlowchartManualInputShape } from '../src/shapes/flowchart-manual-input-shape';
|
|
88
|
+
export { FlowchartManualOperationShape } from '../src/shapes/flowchart-manual-operation-shape';
|
|
89
|
+
export { FlowchartMergeShape } from '../src/shapes/flowchart-merge-shape';
|
|
90
|
+
export { FlowchartMultiDocumentShape } from '../src/shapes/flowchart-multidocument-shape';
|
|
91
|
+
export { FlowchartOffPageConnectorShape } from '../src/shapes/flowchart-offpage-connector-shape';
|
|
92
|
+
export { FlowchartOnlineStorageShape } from '../src/shapes/flowchart-online-storage-shape';
|
|
93
|
+
export { FlowchartOrShape } from '../src/shapes/flowchart-or-shape';
|
|
94
|
+
export { FlowchartPredefinedProcessShape } from '../src/shapes/flowchart-predefined-process-shape';
|
|
95
|
+
export { FlowchartPreparationShape } from '../src/shapes/flowchart-preparation-shape';
|
|
96
|
+
export { FlowchartProcessShape } from '../src/shapes/flowchart-process-shape';
|
|
97
|
+
export { FlowchartPunchedCardShape } from '../src/shapes/flowchart-punched-card-shape';
|
|
98
|
+
export { FlowchartPunchedTapeShape } from '../src/shapes/flowchart-punched-tape-shape';
|
|
99
|
+
export { FlowchartSortShape } from '../src/shapes/flowchart-sort-shape';
|
|
100
|
+
export { FlowchartSummingJunctionShape } from '../src/shapes/flowchart-summing-junction-shape';
|
|
101
|
+
export { FlowchartTerminatorShape } from '../src/shapes/flowchart-terminator-shape';
|
|
102
|
+
export { FoldedCornerShape } from '../src/shapes/folded-corner-shape';
|
|
103
|
+
export { FrameShape } from '../src/shapes/frame-shape';
|
|
104
|
+
export { FunnelShape } from '../src/shapes/funnel-shape';
|
|
105
|
+
export { Gear6Shape } from '../src/shapes/gear6-shape';
|
|
106
|
+
export { Gear9Shape } from '../src/shapes/gear9-shape';
|
|
107
|
+
export { HalfFrameShape } from '../src/shapes/half-frame-shape';
|
|
108
|
+
export { HeartShape } from '../src/shapes/heart-shape';
|
|
109
|
+
export { HeptagonShape } from '../src/shapes/heptagon-shape';
|
|
110
|
+
export { HexagonShape } from '../src/shapes/hexagon-shape';
|
|
111
|
+
export { HomePlateShape } from '../src/shapes/home-plate-shape';
|
|
112
|
+
export { HorizontalScrollShape } from '../src/shapes/horizontal-scroll-shape';
|
|
113
|
+
export { IrregularSeal1Shape } from '../src/shapes/irregular-seal1-shape';
|
|
114
|
+
export { IrregularSeal2Shape } from '../src/shapes/irregular-seal2-shape';
|
|
115
|
+
export { LeftArrowCalloutShape } from '../src/shapes/left-arrow-callout-shape';
|
|
116
|
+
export { LeftArrowShape } from '../src/shapes/left-arrow-shape';
|
|
117
|
+
export { LeftBraceShape } from '../src/shapes/left-brace-shape';
|
|
118
|
+
export { LeftBracketShape } from '../src/shapes/left-bracket-shape';
|
|
119
|
+
export { LeftCircularArrowShape } from '../src/shapes/left-circular-arrow-shape';
|
|
120
|
+
export { LeftRightArrowCalloutShape } from '../src/shapes/left-right-arrow-callout-shape';
|
|
121
|
+
export { LeftRightArrowShape } from '../src/shapes/left-right-arrow-shape';
|
|
122
|
+
export { LeftRightCircularArrowShape } from '../src/shapes/left-right-circular-arrow-shape';
|
|
123
|
+
export { LeftRightRibbonShape } from '../src/shapes/left-right-ribbon-shape';
|
|
124
|
+
export { LeftRightUpArrowShape } from '../src/shapes/left-right-up-arrow-shape';
|
|
125
|
+
export { LeftUpArrowShape } from '../src/shapes/left-up-arrow-shape';
|
|
126
|
+
export { LightningBoltShape } from '../src/shapes/lightning-bolt-shape';
|
|
127
|
+
export { LineInvShape } from '../src/shapes/line-lnv-shape';
|
|
128
|
+
export { LineShape } from '../src/shapes/line-shape';
|
|
129
|
+
export { MathDivideShape } from '../src/shapes/math-divide-shape';
|
|
130
|
+
export { MathEqualShape } from '../src/shapes/math-equal-shape';
|
|
131
|
+
export { MathMinusShape } from '../src/shapes/math-minus-shape';
|
|
132
|
+
export { MathMultiplyShape } from '../src/shapes/math-multiply-shape';
|
|
133
|
+
export { MathNotEqualShape } from '../src/shapes/math-not-equal-shape';
|
|
134
|
+
export { MathPlusShape } from '../src/shapes/math-plus-shape';
|
|
135
|
+
export { MoonShape } from '../src/shapes/moon-shape';
|
|
136
|
+
export { NoSmokingShape } from '../src/shapes/no-smoking-shape';
|
|
137
|
+
export { NonIsoscelesTrapezoidShape } from '../src/shapes/non-isosceles-trapezoid';
|
|
138
|
+
export { NotchedRightArrowShape } from '../src/shapes/notched-right-arrow-shape';
|
|
139
|
+
export { OctagonShape } from '../src/shapes/octagon-shape';
|
|
140
|
+
export { ParallelogramShape } from '../src/shapes/parallelogram-shape';
|
|
141
|
+
export { PentagonShape } from '../src/shapes/pentagon-shape';
|
|
142
|
+
export { PieShape } from '../src/shapes/pie-shape';
|
|
143
|
+
export { PieWedgeShape } from '../src/shapes/pie-wedge-shape';
|
|
144
|
+
export { PlaqueShape } from '../src/shapes/plaque-shape';
|
|
145
|
+
export { PlaqueTabsShape } from '../src/shapes/plaque-tabs-shape';
|
|
146
|
+
export { PlusShape } from '../src/shapes/plus-shape';
|
|
147
|
+
export { QuadArrowCalloutShape } from '../src/shapes/quad-arrow-callout-shape';
|
|
148
|
+
export { QuadArrowShape } from '../src/shapes/quad-arrow-shape';
|
|
149
|
+
export { RectangleShape } from '../src/shapes/rectangle-shape';
|
|
150
|
+
export { Ribbon2Shape } from '../src/shapes/ribbon2-shape';
|
|
151
|
+
export { RibbonShape } from '../src/shapes/ribbon-shape';
|
|
152
|
+
export { RightArrowCalloutShape } from '../src/shapes/right-arrow-callout-shape';
|
|
153
|
+
export { RightArrowShape } from '../src/shapes/right-arrow-shape';
|
|
154
|
+
export { RightBraceShape } from '../src/shapes/right-brace-shape';
|
|
155
|
+
export { RightBracketShape } from '../src/shapes/right-bracket-shape';
|
|
156
|
+
export { RightTriangleShape } from '../src/shapes/right-triangle-shape';
|
|
157
|
+
export { Round1RectShape } from '../src/shapes/round-rectangle1-shape';
|
|
158
|
+
export { Round2DiagRectShape } from '../src/shapes/round-rectangle2-diagonal-shape';
|
|
159
|
+
export { Round2SameRectShape } from '../src/shapes/round-rectangle2-shape';
|
|
160
|
+
export { RoundRectangleShape } from '../src/shapes/round-rectangle-shape';
|
|
161
|
+
export { SmileyFaceShape } from '../src/shapes/smiley-face-shape';
|
|
162
|
+
export { SnipRectangle1Shape } from '../src/shapes/snip-rectangle1-shape';
|
|
163
|
+
export { SnipRectangle2DiagonalShape } from '../src/shapes/snip-rectangle2-diagonal-shape';
|
|
164
|
+
export { SnipRectangle2SameShape } from '../src/shapes/snip-rectangle2-same-shape';
|
|
165
|
+
export { SnipRoundRectangle1Shape } from '../src/shapes/snip-round-rectangle1-shape';
|
|
166
|
+
export { SquareTabsShape } from '../src/shapes/square-tabs-shape';
|
|
167
|
+
export { Star4Shape } from '../src/shapes/star4-shape';
|
|
168
|
+
export { Star5Shape } from '../src/shapes/star5-shape';
|
|
169
|
+
export { Star6Shape } from '../src/shapes/star6-shape';
|
|
170
|
+
export { Star7Shape } from '../src/shapes/star7-shape';
|
|
171
|
+
export { Star8Shape } from '../src/shapes/star8-shape';
|
|
172
|
+
export { Star10Shape } from '../src/shapes/star10-shape';
|
|
173
|
+
export { Star12Shape } from '../src/shapes/star12-shape';
|
|
174
|
+
export { Star16Shape } from '../src/shapes/star16-shape';
|
|
175
|
+
export { Star24Shape } from '../src/shapes/star24-shape';
|
|
176
|
+
export { Star32Shape } from '../src/shapes/star32-shape';
|
|
177
|
+
export { StraightConnector1Shape } from '../src/shapes/straight-connector1-shape';
|
|
178
|
+
export { StripedRightArrowShape } from '../src/shapes/striped-right-arrow-shape';
|
|
179
|
+
export { SunShape } from '../src/shapes/sun-shape';
|
|
180
|
+
export { SwooshArrowShape } from '../src/shapes/swoosh-arrow-shape';
|
|
181
|
+
export { TeardropShape } from '../src/shapes/teardrop-shape';
|
|
182
|
+
export { TextBoxShape } from '../src/shapes/text-box-shape';
|
|
183
|
+
export { TrapezoidShape } from '../src/shapes/trapezoid-shape';
|
|
184
|
+
export { TriangleShape } from '../src/shapes/triangle-shape';
|
|
185
|
+
export { UpArrowCalloutShape } from '../src/shapes/up-arrow-callout-shape';
|
|
186
|
+
export { UpArrowShape } from '../src/shapes/up-arrow-shape';
|
|
187
|
+
export { UpDownArrowCalloutShape } from '../src/shapes/up-down-arrow-callout-shape';
|
|
188
|
+
export { UpDownArrowShape } from '../src/shapes/up-down-arrow-shape';
|
|
189
|
+
export { UturnArrowShape } from '../src/shapes/uturn-arrow-shape';
|
|
190
|
+
export { VerticalScrollShape } from '../src/shapes/vertical-scroll-shape';
|
|
191
|
+
export { WaveShape } from '../src/shapes/wave-shape';
|
|
192
|
+
export { WedgeEllipseCalloutShape } from '../src/shapes/wedge-ellipse-callout-shape';
|
|
193
|
+
export { WedgeRectCalloutShape } from '../src/shapes/wedge-rect-callout-shape';
|
|
194
|
+
export { WedgeRoundRectCalloutShape } from '../src/shapes/wedge-round-rect-callout-shape';
|
|
195
|
+
export { computeConnectorRouteLayout, getBasicShapeRotateBound, rotatePointAroundCenter, routeConnectorLineShape } from './render-engine/connector-points-util';
|
|
196
|
+
export { ShapeDefaultConfig } from './shape-default';
|
|
197
|
+
export { freeRouteBentConnectorLinePoints } from './util/connector-points-util';
|
|
198
|
+
export type { IBentConnectorResult } from './util/connector-points-util';
|
|
199
|
+
export { ConnectorCoordinateTransform } from './util/connector-transform';
|
|
200
|
+
export { isConnectorShape, isCurvedConnectorShape } from './util/shape-util';
|
|
File without changes
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ShapeTypeEnum, BasicShapeEnum } from '../shape-enum';
|
|
2
|
+
import { IBasicShapeData, ICustomShapeTextData, IGdContext, IPresetShapeConfig, IShapeAdjustItemResolved, IShapeContextOptions, IShapeJSONData, IShapeModel, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeRenderParameters, IShapeText } from '../shape-type';
|
|
3
|
+
export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: Partial<T>[]): T;
|
|
4
|
+
export declare class BasicShapeModel implements IShapeModel {
|
|
5
|
+
protected _shapeType: ShapeTypeEnum;
|
|
6
|
+
private readonly _id;
|
|
7
|
+
protected _shapeData: IBasicShapeData;
|
|
8
|
+
/**
|
|
9
|
+
* this property is only used for LineShapeRenderModel to indicate whether to render line points for routing
|
|
10
|
+
*/
|
|
11
|
+
private _isRenderLinePointsMode;
|
|
12
|
+
private _context;
|
|
13
|
+
private _renderModel;
|
|
14
|
+
private _adjustNameMap;
|
|
15
|
+
constructor(shapeType: ShapeTypeEnum, id: string, shapeData?: IBasicShapeData);
|
|
16
|
+
changeShapeType(shapeType: ShapeTypeEnum, shapeData?: IBasicShapeData): void;
|
|
17
|
+
getShapeType(): ShapeTypeEnum;
|
|
18
|
+
getShapeRelation(): IShapeRelation | undefined;
|
|
19
|
+
getBasicShapeType(): BasicShapeEnum;
|
|
20
|
+
getId(): string;
|
|
21
|
+
/**
|
|
22
|
+
* get shape text data
|
|
23
|
+
* @returns The shape text data
|
|
24
|
+
*/
|
|
25
|
+
getShapeTextData(): IShapeText | ICustomShapeTextData;
|
|
26
|
+
/**
|
|
27
|
+
* set shape text data
|
|
28
|
+
* @param shapeText The shape text data
|
|
29
|
+
*/
|
|
30
|
+
setShapeTextData(shapeText: IShapeText | ICustomShapeTextData): void;
|
|
31
|
+
/**
|
|
32
|
+
* get shape text rect, the shape text rect is defined in shape preset config, if not exist, return the whole shape rect, we will add padding in render model
|
|
33
|
+
* @param rect The drawing rect, define the position and size of the shape
|
|
34
|
+
* @returns {IShapeRect} The shape text rect, the position is relative to the shape rect
|
|
35
|
+
*/
|
|
36
|
+
getShapeTextRect(rect: IShapeRect): IShapeRect;
|
|
37
|
+
setShapeType(shapeType: ShapeTypeEnum, shapeData?: IBasicShapeData): void;
|
|
38
|
+
getShapeData(): IBasicShapeData;
|
|
39
|
+
setShapeData(shapeData: IBasicShapeData, merge?: boolean): void;
|
|
40
|
+
getPresetShapeConfig(): IPresetShapeConfig;
|
|
41
|
+
getAdjustNames(): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Only for connector shape, get the start connection info
|
|
44
|
+
* @returns {IShapeRelationItem | undefined} The start connection info
|
|
45
|
+
*/
|
|
46
|
+
getStartConnectInfo(): IShapeRelationItem | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Only for connector shape, get the end connection info
|
|
49
|
+
* @returns {IShapeRelationItem | undefined} The end connection info
|
|
50
|
+
*/
|
|
51
|
+
getEndConnectInfo(): IShapeRelationItem | undefined;
|
|
52
|
+
getConnectorLinePoints(): IShapePoint[];
|
|
53
|
+
/**
|
|
54
|
+
* Get all connection sites (cxnLst) for this shape.
|
|
55
|
+
* Connection sites are the points where connectors can attach to the shape.
|
|
56
|
+
* @returns Array of connection site points with their index and resolved coordinates
|
|
57
|
+
*/
|
|
58
|
+
getConnectionSiteList(): Array<{
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
index: number;
|
|
62
|
+
ang: number;
|
|
63
|
+
}>;
|
|
64
|
+
getAdjustInfoByName(adjName: string): IShapeAdjustItemResolved | undefined;
|
|
65
|
+
getAdjustInfo(index: number): IShapeAdjustItemResolved | undefined;
|
|
66
|
+
private _getAdjustIndexByName;
|
|
67
|
+
private _getAdjScope;
|
|
68
|
+
private _setAdjustValue;
|
|
69
|
+
clearAdjustValue(): void;
|
|
70
|
+
/**
|
|
71
|
+
* et adjust value by adj name
|
|
72
|
+
* @param {string} adjName The name of adj point
|
|
73
|
+
* @param {number} value The set val of adj point
|
|
74
|
+
* @returns {number} The actual set val of adj point, it will consider about max min value
|
|
75
|
+
*/
|
|
76
|
+
setAdjustValueByName(adjName: string, value: number): number;
|
|
77
|
+
getAdjustValueByName(adjName: string): number | undefined;
|
|
78
|
+
updateContext(options: IShapeContextOptions): void;
|
|
79
|
+
getGdRecord(): Partial<IGdContext>;
|
|
80
|
+
updateLinePoints(points: IShapePoint[]): void;
|
|
81
|
+
get isRenderLinePointsMode(): boolean;
|
|
82
|
+
removeLinePoints(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Check if this is a line shape.
|
|
85
|
+
* @returns true if this is a line shape (connector, line, etc.)
|
|
86
|
+
*/
|
|
87
|
+
isLineShape(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Test if a point hits the line shape.
|
|
90
|
+
* This method should only be called for line shapes.
|
|
91
|
+
* It checks if the point is within the hit tolerance of any line segment or curve.
|
|
92
|
+
*
|
|
93
|
+
* @param pointX The x-coordinate of the point to test (in local coordinates, centered)
|
|
94
|
+
* @param pointY The y-coordinate of the point to test (in local coordinates, centered)
|
|
95
|
+
* @param width The width of the shape
|
|
96
|
+
* @param height The height of the shape
|
|
97
|
+
* @param tolerance The hit tolerance in pixels (default: 8)
|
|
98
|
+
* @returns true if the point hits the line shape
|
|
99
|
+
*/
|
|
100
|
+
isHitLine(pointX: number, pointY: number, width: number, height: number, tolerance?: number): boolean;
|
|
101
|
+
render(canvasContext: CanvasRenderingContext2D, rect: IShapeRect, renderOption: IShapeRenderParameters): void;
|
|
102
|
+
getDrawingPoints(): IShapePointWithAdjName[];
|
|
103
|
+
calcAdjValue(rect: IShapeRect, point: IShapePoint, adjustInfo: IShapeAdjustItemResolved, isFlipH: boolean, isFlipV: boolean): number;
|
|
104
|
+
dispose(): void;
|
|
105
|
+
toJSON(): IShapeJSONData;
|
|
106
|
+
fromJSON(json: IShapeJSONData): void;
|
|
107
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IBasicShapeData, IGdContext, IPresetShapeConfig, IShapeContextOptions } from '../shape-type';
|
|
2
|
+
export declare class BaseShapeContext {
|
|
3
|
+
private _gdRecord;
|
|
4
|
+
getGdRecord(): Partial<IGdContext>;
|
|
5
|
+
reset(): void;
|
|
6
|
+
private _transformAgValueToNumber;
|
|
7
|
+
private _calcAdValueByOperator;
|
|
8
|
+
buildGdRecord(options: IShapeContextOptions, presetShapeConfig: IPresetShapeConfig, shapeDataConfig?: IBasicShapeData): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IBentConnectorResult, IShapePoint, IShapeRect } from '../shape-type';
|
|
2
|
+
import { ShapeDirectionEnum } from '../shape-enum';
|
|
3
|
+
/**
|
|
4
|
+
* Route a free-free bent connector line (Excel-like behavior).
|
|
5
|
+
*
|
|
6
|
+
* 根据 Excel 的行为,对首尾都为自由点的 bent 连接线进行布点计算。
|
|
7
|
+
* 该方法不涉及自动 routing、障碍规避或连接点约束,
|
|
8
|
+
* 仅依据 start / end 构成的矩形关系生成折线路径。
|
|
9
|
+
*
|
|
10
|
+
* Core rules / 核心规则:
|
|
11
|
+
*
|
|
12
|
+
* 1. Start point and end point define a local bounding rectangle.
|
|
13
|
+
* If the width (end.x - start.x) is negative, the width is stored
|
|
14
|
+
* as an absolute value and flipH is set to true.
|
|
15
|
+
* The same rule applies to height (flipV) in the vertical direction.
|
|
16
|
+
*
|
|
17
|
+
* 起点和终点共同定义一个局部矩形。
|
|
18
|
+
* 如果 end.x - start.x < 0,则使用 width = abs(width),
|
|
19
|
+
* 同时记录 flipH = true。
|
|
20
|
+
* 垂直方向同理,记录 flipV。
|
|
21
|
+
*
|
|
22
|
+
* 2. The absolute width and height determine the bend orientation.
|
|
23
|
+
* If |width| >= |height|, points are generated in
|
|
24
|
+
* horizontal-first then vertical order (H → V).
|
|
25
|
+
* Otherwise, points are generated in vertical-first
|
|
26
|
+
* then horizontal order (V → H).
|
|
27
|
+
*
|
|
28
|
+
* 通过宽高绝对值决定折线方向:
|
|
29
|
+
* - |width| >= |height|:先横后竖
|
|
30
|
+
* - |width| < |height|:先竖后横
|
|
31
|
+
*
|
|
32
|
+
* 3. The returned points are always generated in a normalized
|
|
33
|
+
* (non-flipped) coordinate space. The actual visual direction
|
|
34
|
+
* is determined by flipH / flipV.
|
|
35
|
+
*
|
|
36
|
+
* 返回的点始终基于“未翻转”的规范坐标系生成,
|
|
37
|
+
* 实际方向由 flipH / flipV 决定。
|
|
38
|
+
*/
|
|
39
|
+
export declare function freeRouteBentConnectorLinePoints(startPoint: IShapePoint, endPoint: IShapePoint): IBentConnectorResult;
|
|
40
|
+
/**
|
|
41
|
+
* Simplified route connector for normalized inputs.
|
|
42
|
+
* Assumes: logicalStart.x <= logicalEnd.x (start is to the left or same x as end)
|
|
43
|
+
* This reduces the number of cases we need to handle.
|
|
44
|
+
*
|
|
45
|
+
* startDir: direction we're going OUT from start (0=right, 90=down, 180=left, 270=up)
|
|
46
|
+
* endDir: direction we need to ENTER end from (0=right means line approaches from right)
|
|
47
|
+
*/
|
|
48
|
+
export declare function routeByDirectionsNormalized(points: IShapePoint[], exitPoint: IShapePoint, approachPoint: IShapePoint, startDir: ShapeDirectionEnum, endDir: ShapeDirectionEnum, startBounds: IShapeRect, endBounds: IShapeRect): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IConnectorRouteLayoutResult, IConnectPointInfo, ILineType, IShapePoint, IShapeRect } from '../shape-type';
|
|
2
|
+
export declare const BENT_CONNECTOR_HANDLE_OFFSET = 40;
|
|
3
|
+
export declare function routeConnectorLineShape(startInfo: IConnectPointInfo, endInfo: IConnectPointInfo, lineType: ILineType): IShapePoint[];
|
|
4
|
+
/**
|
|
5
|
+
* Rotate a point around a center point by a given angle.
|
|
6
|
+
* Positive angle = counter-clockwise rotation.
|
|
7
|
+
* Used to de-rotate points before calculating adjust values.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rotatePointAroundCenter(point: IShapePoint, center: IShapePoint, angleInDegrees: number): IShapePoint;
|
|
10
|
+
/**
|
|
11
|
+
* In excel, the basic shape with rotate bound use major axis switch, xis-aligned bound will bu used.
|
|
12
|
+
* 在excel中,基本形状的旋转边界使用主轴切换,将使用轴对齐边界。也就是说,一个shape旋转了44度的时候,接近他的是0度,因此他的bound也是0度的bound
|
|
13
|
+
* 如果旋转到了45度,则接近他的就是90度,因此他的bound就是90度的bound
|
|
14
|
+
* [-45°, 45°) -> 0° 横向
|
|
15
|
+
* [45°, 135°) -> 90° 纵向
|
|
16
|
+
* [135°, 225°) -> 180° 横向
|
|
17
|
+
* [225°, 315°) -> 270° 纵向
|
|
18
|
+
* @param bound The original axis-aligned bound
|
|
19
|
+
* @param angle The rotation angle in degrees
|
|
20
|
+
* @return {IShapeRect} The axis-aligned bound after rotation
|
|
21
|
+
*/
|
|
22
|
+
export declare function getBasicShapeRotateBound(bound: IShapeRect, angle: number): IShapeRect;
|
|
23
|
+
export declare function computeStraightConnectorRouteLayout(routedPoints: IShapePoint[], originalLineType: ILineType): IConnectorRouteLayoutResult;
|
|
24
|
+
export declare function computeConnectorRouteLayout(routedPoints: IShapePoint[], originalLineType: ILineType): IConnectorRouteLayoutResult;
|
|
25
|
+
/**
|
|
26
|
+
* Route a bent connector line between two connected shapes.
|
|
27
|
+
*
|
|
28
|
+
* This algorithm generates a polyline path that:
|
|
29
|
+
* 1. Exits the start shape in the direction specified by startInfo.angle
|
|
30
|
+
* 2. Routes around shapes to avoid overlap
|
|
31
|
+
* 3. Enters the end shape from the direction specified by endInfo.angle
|
|
32
|
+
*
|
|
33
|
+
* Optimization: To reduce complexity, we normalize the input so that the
|
|
34
|
+
* "logical start" is always at the top-left relative to the "logical end".
|
|
35
|
+
* If needed, we swap the inputs and reverse the result at the end.
|
|
36
|
+
*
|
|
37
|
+
* The algorithm considers all 16 combinations of the 4 cardinal directions:
|
|
38
|
+
* - 0° = right, 90° = down, 180° = left, 270° = up
|
|
39
|
+
*
|
|
40
|
+
* @param startInfo - Connection point info for the start shape
|
|
41
|
+
* @param endInfo - Connection point info for the end shape
|
|
42
|
+
* @returns Array of points forming the bent connector path
|
|
43
|
+
*/
|
|
44
|
+
export declare function routeBentConnectorLineShape(startInfo: IConnectPointInfo, endInfo: IConnectPointInfo): IShapePoint[];
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { IShapeData, IShapePoint, IShapeRect, IShapeRenderParameters } from '../shape-type';
|
|
2
|
+
import { BaseShapeContext } from './base-shape-context';
|
|
3
|
+
import { BaseShapeRenderModel } from './shape-render-model';
|
|
4
|
+
/**
|
|
5
|
+
* Base class for line-type shapes (connectors, lines).
|
|
6
|
+
*
|
|
7
|
+
* This class provides specialized hit testing for line shapes.
|
|
8
|
+
* Instead of using the bounding rectangle for hit detection,
|
|
9
|
+
* it checks if the point is within a certain distance of the actual line segments.
|
|
10
|
+
*
|
|
11
|
+
* All connector shapes (BentConnector2-5, CurvedConnector2-5, StraightConnector1, Line)
|
|
12
|
+
* should extend this class to get proper line hit testing behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class LineShapeRenderModel extends BaseShapeRenderModel {
|
|
15
|
+
protected _isLineShape: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check if a point is near a line segment.
|
|
18
|
+
*
|
|
19
|
+
* @param point The point to test
|
|
20
|
+
* @param lineStart Start point of the line segment
|
|
21
|
+
* @param lineEnd End point of the line segment
|
|
22
|
+
* @param tolerance Maximum distance from the line to be considered "near"
|
|
23
|
+
* @returns true if the point is within tolerance distance of the line segment
|
|
24
|
+
*/
|
|
25
|
+
protected _isPointNearLineSegment(point: IShapePoint, lineStart: IShapePoint, lineEnd: IShapePoint, tolerance?: number): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a point is near a quadratic Bezier curve.
|
|
28
|
+
*
|
|
29
|
+
* @param point The point to test
|
|
30
|
+
* @param p0 Start point
|
|
31
|
+
* @param p1 Control point
|
|
32
|
+
* @param p2 End point
|
|
33
|
+
* @param tolerance Maximum distance from the curve to be considered "near"
|
|
34
|
+
* @param samples Number of samples to take along the curve
|
|
35
|
+
* @returns true if the point is within tolerance distance of the curve
|
|
36
|
+
*/
|
|
37
|
+
protected _isPointNearQuadraticBezier(point: IShapePoint, p0: IShapePoint, p1: IShapePoint, p2: IShapePoint, tolerance?: number, samples?: number): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a point is near a cubic Bezier curve.
|
|
40
|
+
*
|
|
41
|
+
* @param point The point to test
|
|
42
|
+
* @param p0 Start point
|
|
43
|
+
* @param p1 First control point
|
|
44
|
+
* @param p2 Second control point
|
|
45
|
+
* @param p3 End point
|
|
46
|
+
* @param tolerance Maximum distance from the curve to be considered "near"
|
|
47
|
+
* @param samples Number of samples to take along the curve
|
|
48
|
+
* @returns true if the point is within tolerance distance of the curve
|
|
49
|
+
*/
|
|
50
|
+
protected _isPointNearCubicBezier(point: IShapePoint, p0: IShapePoint, p1: IShapePoint, p2: IShapePoint, p3: IShapePoint, tolerance?: number, samples?: number): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Process a single path command and check if the point is near it.
|
|
53
|
+
*
|
|
54
|
+
* @returns Object with hit result and updated current/start points
|
|
55
|
+
*/
|
|
56
|
+
private _processPathCommand;
|
|
57
|
+
private _handleMoveTo;
|
|
58
|
+
private _handleLineTo;
|
|
59
|
+
private _handleQuadraticBezier;
|
|
60
|
+
private _handleCubicBezier;
|
|
61
|
+
private _handleClosePath;
|
|
62
|
+
/**
|
|
63
|
+
* Test if a point hits the line shape.
|
|
64
|
+
*
|
|
65
|
+
* This method checks if the point is within the hit tolerance of any
|
|
66
|
+
* line segment or curve in the shape's path.
|
|
67
|
+
*
|
|
68
|
+
* @param pointX The x-coordinate of the point to test (in local coordinates)
|
|
69
|
+
* @param pointY The y-coordinate of the point to test (in local coordinates)
|
|
70
|
+
* @param shapeContext The shape context containing gd values
|
|
71
|
+
* @param tolerance The hit tolerance in pixels
|
|
72
|
+
* @returns true if the point hits the line shape
|
|
73
|
+
*/
|
|
74
|
+
isHitLine(pointX: number, pointY: number, shapeContext: BaseShapeContext, tolerance?: number): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Get a value from the gdRecord, handling both number and string keys.
|
|
77
|
+
*/
|
|
78
|
+
private _getGdValue;
|
|
79
|
+
renderWithPoints(canvasContext: CanvasRenderingContext2D, shapeContext: BaseShapeContext, shapeData: IShapeData, renderOption: IShapeRenderParameters): void;
|
|
80
|
+
/**
|
|
81
|
+
* Override render method to handle line shapes with arrows
|
|
82
|
+
* This preserves bezier curve structure when adjusting endpoints for arrows
|
|
83
|
+
*/
|
|
84
|
+
render(canvasContext: CanvasRenderingContext2D, rect: IShapeRect, shapeContext: BaseShapeContext, shapeData: IShapeData, renderOption: IShapeRenderParameters): void;
|
|
85
|
+
private _scalePoints;
|
|
86
|
+
private _executePathCommand;
|
|
87
|
+
private _applyFill;
|
|
88
|
+
private _applyStrokeWithArrows;
|
|
89
|
+
/**
|
|
90
|
+
* Extract start and end points with tangent direction points for arrow rendering
|
|
91
|
+
* For bezier curves, uses control points to get correct tangent direction
|
|
92
|
+
*/
|
|
93
|
+
private _extractEndpointsWithTangents;
|
|
94
|
+
/**
|
|
95
|
+
* Get the end point coordinates from a path command
|
|
96
|
+
*/
|
|
97
|
+
private _getCommandEndPoint;
|
|
98
|
+
/**
|
|
99
|
+
* Get the first control/target point from a path command for direction calculation
|
|
100
|
+
*/
|
|
101
|
+
private _getCommandFirstPoint;
|
|
102
|
+
/**
|
|
103
|
+
* Adjust start point of path commands for arrow
|
|
104
|
+
*/
|
|
105
|
+
private _adjustStartPointForArrow;
|
|
106
|
+
/**
|
|
107
|
+
* Adjust end point of path commands for arrow
|
|
108
|
+
*/
|
|
109
|
+
private _adjustEndPointForArrow;
|
|
110
|
+
private _adjustEndPointByCommand;
|
|
111
|
+
private _adjustCubicBezierEndPoint;
|
|
112
|
+
private _adjustQuadraticBezierEndPoint;
|
|
113
|
+
private _adjustLineEndPoint;
|
|
114
|
+
/**
|
|
115
|
+
* Get adjusted line path commands with endpoints moved inward to avoid overlap with arrows
|
|
116
|
+
*/
|
|
117
|
+
private _getAdjustedLinePathCommands;
|
|
118
|
+
private _drawLineExtends;
|
|
119
|
+
private _calculateAngle;
|
|
120
|
+
private _getArrowDimensions;
|
|
121
|
+
private _drawArrow;
|
|
122
|
+
private _drawFilledArrow;
|
|
123
|
+
private _drawOpenArrow;
|
|
124
|
+
private _drawDiamondArrow;
|
|
125
|
+
private _drawStealthArrow;
|
|
126
|
+
private _drawOvalArrow;
|
|
127
|
+
private _getLineFillStyle;
|
|
128
|
+
private _getLineStrokeStyle;
|
|
129
|
+
private _getLineDashType;
|
|
130
|
+
private _getLineCapType;
|
|
131
|
+
private _getLineJoinType;
|
|
132
|
+
private _createLineGradient;
|
|
133
|
+
private _renderCxnPointsForLine;
|
|
134
|
+
private _renderAdjustHandlesForLine;
|
|
135
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IShapePoint } from '../shape-type';
|
|
2
|
+
interface Point {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
interface TransformResult {
|
|
7
|
+
rotation: 0 | 90 | 180 | 270;
|
|
8
|
+
flipH: boolean;
|
|
9
|
+
flipV: boolean;
|
|
10
|
+
restorePoints: IShapePoint[];
|
|
11
|
+
}
|
|
12
|
+
export declare function resolveTransform(points: Point[]): TransformResult;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class ShapeContextStaticOperator {
|
|
2
|
+
static val(value: number): number;
|
|
3
|
+
static pin(value: number, min: number, max: number): number;
|
|
4
|
+
static addSub(a: number, b: number, c: number): number;
|
|
5
|
+
static mulDiv(a: number, b: number, c: number): number;
|
|
6
|
+
static addDiv(a: number, b: number, c: number): number;
|
|
7
|
+
static abs(value: number): number;
|
|
8
|
+
static max(a: number, b: number): number;
|
|
9
|
+
static min(a: number, b: number): number;
|
|
10
|
+
static ifelse(condition: boolean, trueValue: number, falseValue: number): number;
|
|
11
|
+
static sin(yr: number, ang: number): number;
|
|
12
|
+
static cos(xr: number, ang: number): number;
|
|
13
|
+
static tan(xr: number, ang: number): number;
|
|
14
|
+
static mod(a: number, b: number, c: number): number;
|
|
15
|
+
static sqrt(value: number): number;
|
|
16
|
+
static atan2(x: number, y: number): number;
|
|
17
|
+
static cat2(x: number, y: number, z: number): number;
|
|
18
|
+
static sat2(x: number, y: number, z: number): number;
|
|
19
|
+
}
|