@flowgram.ai/renderer 0.3.5 → 0.4.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/dist/esm/index.js +10 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/esm/index.js
CHANGED
|
@@ -843,7 +843,8 @@ var FlowRendererKey = /* @__PURE__ */ ((FlowRendererKey2) => {
|
|
|
843
843
|
FlowRendererKey2["CONTEXT_MENU_POPOVER"] = "context-menu-popover";
|
|
844
844
|
FlowRendererKey2["SUB_CANVAS"] = "sub-canvas";
|
|
845
845
|
FlowRendererKey2["SLOT_ADDER"] = "slot-adder";
|
|
846
|
-
FlowRendererKey2["
|
|
846
|
+
FlowRendererKey2["SLOT_LABEL"] = "slot-label";
|
|
847
|
+
FlowRendererKey2["SLOT_COLLAPSE"] = "slot-collapse";
|
|
847
848
|
FlowRendererKey2["ARROW_RENDERER"] = "arrow-renderer";
|
|
848
849
|
FlowRendererKey2["MARKER_ARROW"] = "marker-arrow";
|
|
849
850
|
FlowRendererKey2["MARKER_ACTIVATE_ARROW"] = "marker-active-arrow";
|
|
@@ -1194,6 +1195,10 @@ function RoundedTurningLine(props) {
|
|
|
1194
1195
|
const moveY = isNil2(point.moveY) ? ry : point.moveY;
|
|
1195
1196
|
outPoint.y += to.y < point.y ? -moveY : +moveY;
|
|
1196
1197
|
}
|
|
1198
|
+
if (point.radiusOverflow === "truncate") {
|
|
1199
|
+
rx = radiusX;
|
|
1200
|
+
ry = radiusY;
|
|
1201
|
+
}
|
|
1197
1202
|
const crossProduct = (point.x - inPoint.x) * (outPoint.y - inPoint.y) - (point.y - inPoint.y) * (outPoint.x - inPoint.x);
|
|
1198
1203
|
const isClockWise = crossProduct > 0;
|
|
1199
1204
|
return `L ${inPoint.x} ${inPoint.y} A ${rx} ${ry} 0 0 ${isClockWise ? 1 : 0} ${outPoint.x} ${outPoint.y}`;
|
|
@@ -1662,7 +1667,7 @@ function createLabels(labelProps) {
|
|
|
1662
1667
|
const { labels, renderData } = data || {};
|
|
1663
1668
|
const { activated } = renderData || {};
|
|
1664
1669
|
const renderLabel = (label, index) => {
|
|
1665
|
-
const { offset, renderKey, props, rotate, type } = label || {};
|
|
1670
|
+
const { offset, renderKey, props, rotate, origin, type } = label || {};
|
|
1666
1671
|
const offsetX = offset.x;
|
|
1667
1672
|
const offsetY = offset.y;
|
|
1668
1673
|
let child = null;
|
|
@@ -1752,6 +1757,8 @@ function createLabels(labelProps) {
|
|
|
1752
1757
|
default:
|
|
1753
1758
|
break;
|
|
1754
1759
|
}
|
|
1760
|
+
const originX = typeof origin?.[0] === "number" ? origin?.[0] : 0.5;
|
|
1761
|
+
const originY = typeof origin?.[1] === "number" ? origin?.[1] : 0.5;
|
|
1755
1762
|
return /* @__PURE__ */ React13.createElement(
|
|
1756
1763
|
"div",
|
|
1757
1764
|
{
|
|
@@ -1761,7 +1768,7 @@ function createLabels(labelProps) {
|
|
|
1761
1768
|
position: "absolute",
|
|
1762
1769
|
left: offsetX,
|
|
1763
1770
|
top: offsetY,
|
|
1764
|
-
transform:
|
|
1771
|
+
transform: `translate(-${originX * 100}%, -${originY * 100}%)`
|
|
1765
1772
|
}
|
|
1766
1773
|
},
|
|
1767
1774
|
child
|