@infinilabs/ai-chat 0.0.0 → 0.0.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.
- package/README.md +310 -56
- package/dist/_baseUniq-BFn6cCm9.js +152 -0
- package/dist/_baseUniq-nfJyj2zU.cjs +151 -0
- package/dist/arc-BWSMkwk2.cjs +130 -0
- package/dist/arc-DODeX7B9.js +131 -0
- package/dist/architecture-U656AL7Q-B4C0nw6C.js +5 -0
- package/dist/architecture-U656AL7Q-CVURQXwt.cjs +5 -0
- package/dist/architectureDiagram-VXUJARFQ-2UbdzpNz.cjs +8681 -0
- package/dist/architectureDiagram-VXUJARFQ-NCVmzKuE.js +8681 -0
- package/dist/blockDiagram-VD42YOAC-B3yCPK1N.cjs +3606 -0
- package/dist/blockDiagram-VD42YOAC-C4FsmQfk.js +3606 -0
- package/dist/c4Diagram-YG6GDRKO-ATyoKzFV.js +2481 -0
- package/dist/c4Diagram-YG6GDRKO-COwVcHWj.cjs +2481 -0
- package/dist/channel-2Y73gsu9.cjs +6 -0
- package/dist/channel-oB8MffQV.js +7 -0
- package/dist/chunk-4BX2VUAB-C3diNHZw.cjs +15 -0
- package/dist/chunk-4BX2VUAB-sd2zFBFz.js +16 -0
- package/dist/chunk-55IACEB6-6ohTnYE3.js +13 -0
- package/dist/chunk-55IACEB6-T-CzlJke.cjs +12 -0
- package/dist/chunk-B4BG7PRW-B1zqG62l.cjs +1825 -0
- package/dist/chunk-B4BG7PRW-E1dti26Y.js +1826 -0
- package/dist/chunk-DI55MBZ5-Dk0kfYBV.cjs +1914 -0
- package/dist/chunk-DI55MBZ5-DpHw-vMw.js +1915 -0
- package/dist/chunk-FMBD7UC4-B1vXpasq.js +19 -0
- package/dist/chunk-FMBD7UC4-CShN9-qf.cjs +18 -0
- package/dist/chunk-QN33PNHL-Cw7FG91D.js +24 -0
- package/dist/chunk-QN33PNHL-DJi1fhak.cjs +23 -0
- package/dist/chunk-QZHKN3VN-BweiBR9P.js +17 -0
- package/dist/chunk-QZHKN3VN-DfUW_gDw.cjs +16 -0
- package/dist/chunk-TZMSLE5B-DY2Kbag4.cjs +107 -0
- package/dist/chunk-TZMSLE5B-ZQ2Esoix.js +108 -0
- package/dist/classDiagram-2ON5EDUG-D2tIbkjc.js +19 -0
- package/dist/classDiagram-2ON5EDUG-DRhRmkUb.cjs +19 -0
- package/dist/classDiagram-v2-WZHVMYZB-D2tIbkjc.js +19 -0
- package/dist/classDiagram-v2-WZHVMYZB-DRhRmkUb.cjs +19 -0
- package/dist/clone-BMkj3yun.cjs +7 -0
- package/dist/clone-ChHXIoR6.js +8 -0
- package/dist/cose-bilkent-S5V4N54A-BXnWH5Od.cjs +4942 -0
- package/dist/cose-bilkent-S5V4N54A-D15BmpCb.js +4942 -0
- package/dist/cytoscape.esm-BfvZ3QT_.js +30239 -0
- package/dist/cytoscape.esm-D8IBYQeQ.cjs +30238 -0
- package/dist/dagre-6UL2VRFP-DGQ6TW_g.cjs +693 -0
- package/dist/dagre-6UL2VRFP-WmhUYWg8.js +693 -0
- package/dist/defaultLocale-DVr69WTU.js +206 -0
- package/dist/defaultLocale-DwYGIg9G.cjs +203 -0
- package/dist/diagram-PSM6KHXK-DSfHBoUT.js +845 -0
- package/dist/diagram-PSM6KHXK-J4qyGeN7.cjs +845 -0
- package/dist/diagram-QEK2KX5R-D96wT5cH.cjs +300 -0
- package/dist/diagram-QEK2KX5R-I_nyexpY.js +300 -0
- package/dist/diagram-S2PKOQOG-BC_WyKEe.cjs +210 -0
- package/dist/diagram-S2PKOQOG-aooXSMNo.js +210 -0
- package/dist/erDiagram-Q2GNP2WA-DQ8Lquay.cjs +1158 -0
- package/dist/erDiagram-Q2GNP2WA-DWF8e6EL.js +1158 -0
- package/dist/flowDiagram-NV44I4VS-CM9c4F1o.js +2331 -0
- package/dist/flowDiagram-NV44I4VS-DpYNkyM2.cjs +2331 -0
- package/dist/ganttDiagram-JELNMOA3-CAsoD6rZ.js +3679 -0
- package/dist/ganttDiagram-JELNMOA3-DfKahpj4.cjs +3679 -0
- package/dist/gitGraph-F6HP7TQM-BX2fz4_i.js +5 -0
- package/dist/gitGraph-F6HP7TQM-DRkGg4T1.cjs +5 -0
- package/dist/gitGraphDiagram-NY62KEGX-PXpI94u6.js +1203 -0
- package/dist/gitGraphDiagram-NY62KEGX-YhnKpooH.cjs +1203 -0
- package/dist/graph-BvxpI7Xc.js +596 -0
- package/dist/graph-CI_TWBSn.cjs +595 -0
- package/dist/index-BctLGjTK.cjs +120500 -0
- package/dist/index-CjSgoo1P.js +120485 -0
- package/dist/index.cjs +19 -0
- package/dist/index.js +12 -19961
- package/dist/info-NVLQJR56-BGbTE7dw.cjs +5 -0
- package/dist/info-NVLQJR56-DRxIh-N8.js +5 -0
- package/dist/infoDiagram-WHAUD3N6-BB2Bnbnh.cjs +31 -0
- package/dist/infoDiagram-WHAUD3N6-D_RrgwxS.js +31 -0
- package/dist/init-DevvdK2U.cjs +15 -0
- package/dist/init-ZxktEp_H.js +16 -0
- package/dist/journeyDiagram-XKPGCS4Q-BJjXlMIj.js +1254 -0
- package/dist/journeyDiagram-XKPGCS4Q-BcBLsfI9.cjs +1254 -0
- package/dist/kanban-definition-3W4ZIXB7-0wwNBZ93.js +1047 -0
- package/dist/kanban-definition-3W4ZIXB7-CaY0q4j9.cjs +1047 -0
- package/dist/katex-BhpYeT3b.cjs +14523 -0
- package/dist/katex-ei8sH3Uy.js +14524 -0
- package/dist/layout-CcghncRv.js +2183 -0
- package/dist/layout-CvwzED_C.cjs +2182 -0
- package/dist/linear-CYow-mAK.cjs +339 -0
- package/dist/linear-D_gKQzVp.js +340 -0
- package/dist/mermaid-parser.core-CzmkR-3i.cjs +18703 -0
- package/dist/mermaid-parser.core-DCMDT-Cp.js +18704 -0
- package/dist/min-BBp7Smma.js +41 -0
- package/dist/min-Gu1I_bJ9.cjs +40 -0
- package/dist/mindmap-definition-VGOIOE7T-D16Pp1u5.cjs +1126 -0
- package/dist/mindmap-definition-VGOIOE7T-PjSLRtz4.js +1126 -0
- package/dist/ordinal-CxptdPJm.js +76 -0
- package/dist/ordinal-D7sQNqXZ.cjs +75 -0
- package/dist/packet-BFZMPI3H-BvdogPiS.js +5 -0
- package/dist/packet-BFZMPI3H-C7pOHUWY.cjs +5 -0
- package/dist/pie-7BOR55EZ-D-DxSHbP.cjs +5 -0
- package/dist/pie-7BOR55EZ-DEWJe4Xn.js +5 -0
- package/dist/pieDiagram-ADFJNKIX-CoDddKZl.js +237 -0
- package/dist/pieDiagram-ADFJNKIX-DjN4DU9l.cjs +237 -0
- package/dist/quadrantDiagram-AYHSOK5B-BZOg0JMm.js +1335 -0
- package/dist/quadrantDiagram-AYHSOK5B-DXjTSOL4.cjs +1335 -0
- package/dist/radar-NHE76QYJ-BrnDXy9q.cjs +5 -0
- package/dist/radar-NHE76QYJ-C2WmPmJ4.js +5 -0
- package/dist/requirementDiagram-UZGBJVZJ-CCW1O1xH.js +1161 -0
- package/dist/requirementDiagram-UZGBJVZJ-e5F3-dDI.cjs +1161 -0
- package/dist/sankeyDiagram-TZEHDZUN-BaGzCxTp.js +1193 -0
- package/dist/sankeyDiagram-TZEHDZUN-DtIvOvVI.cjs +1193 -0
- package/dist/sequenceDiagram-WL72ISMW-0vFhYnxn.cjs +3874 -0
- package/dist/sequenceDiagram-WL72ISMW-DL3B7U56.js +3874 -0
- package/dist/stateDiagram-FKZM4ZOC-CXW608BR.cjs +447 -0
- package/dist/stateDiagram-FKZM4ZOC-Ddw6HxPD.js +447 -0
- package/dist/stateDiagram-v2-4FDKWEC3-DZCkQKmp.js +19 -0
- package/dist/stateDiagram-v2-4FDKWEC3-DefWUbvq.cjs +19 -0
- package/dist/timeline-definition-IT6M3QCI-C3TfA9lE.cjs +1222 -0
- package/dist/timeline-definition-IT6M3QCI-DiS88lUo.js +1222 -0
- package/dist/treemap-KMMF4GRG-Bl-H6j2c.cjs +5 -0
- package/dist/treemap-KMMF4GRG-DGGr_R9A.js +5 -0
- package/dist/xychartDiagram-PRI3JC2R-BrOwRjfF.js +1886 -0
- package/dist/xychartDiagram-PRI3JC2R-CM06DttH.cjs +1886 -0
- package/package.json +22 -11
- package/dist/index.css +0 -1582
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const index = require("./index-BctLGjTK.cjs");
|
|
3
|
+
function arcInnerRadius(d) {
|
|
4
|
+
return d.innerRadius;
|
|
5
|
+
}
|
|
6
|
+
function arcOuterRadius(d) {
|
|
7
|
+
return d.outerRadius;
|
|
8
|
+
}
|
|
9
|
+
function arcStartAngle(d) {
|
|
10
|
+
return d.startAngle;
|
|
11
|
+
}
|
|
12
|
+
function arcEndAngle(d) {
|
|
13
|
+
return d.endAngle;
|
|
14
|
+
}
|
|
15
|
+
function arcPadAngle(d) {
|
|
16
|
+
return d && d.padAngle;
|
|
17
|
+
}
|
|
18
|
+
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
19
|
+
var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
|
|
20
|
+
if (t * t < index.epsilon) return;
|
|
21
|
+
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
22
|
+
return [x0 + t * x10, y0 + t * y10];
|
|
23
|
+
}
|
|
24
|
+
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
25
|
+
var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / index.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * index.sqrt(index.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
|
|
26
|
+
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
|
27
|
+
return {
|
|
28
|
+
cx: cx0,
|
|
29
|
+
cy: cy0,
|
|
30
|
+
x01: -ox,
|
|
31
|
+
y01: -oy,
|
|
32
|
+
x11: cx0 * (r1 / r - 1),
|
|
33
|
+
y11: cy0 * (r1 / r - 1)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function d3arc() {
|
|
37
|
+
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = index.constant(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path = index.withPath(arc);
|
|
38
|
+
function arc() {
|
|
39
|
+
var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - index.halfPi, a1 = endAngle.apply(this, arguments) - index.halfPi, da = index.abs(a1 - a0), cw = a1 > a0;
|
|
40
|
+
if (!context) context = buffer = path();
|
|
41
|
+
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
|
42
|
+
if (!(r1 > index.epsilon)) context.moveTo(0, 0);
|
|
43
|
+
else if (da > index.tau - index.epsilon) {
|
|
44
|
+
context.moveTo(r1 * index.cos(a0), r1 * index.sin(a0));
|
|
45
|
+
context.arc(0, 0, r1, a0, a1, !cw);
|
|
46
|
+
if (r0 > index.epsilon) {
|
|
47
|
+
context.moveTo(r0 * index.cos(a1), r0 * index.sin(a1));
|
|
48
|
+
context.arc(0, 0, r0, a1, a0, cw);
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > index.epsilon && (padRadius ? +padRadius.apply(this, arguments) : index.sqrt(r0 * r0 + r1 * r1)), rc = index.min(index.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t0, t1;
|
|
52
|
+
if (rp > index.epsilon) {
|
|
53
|
+
var p0 = index.asin(rp / r0 * index.sin(ap)), p1 = index.asin(rp / r1 * index.sin(ap));
|
|
54
|
+
if ((da0 -= p0 * 2) > index.epsilon) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
|
|
55
|
+
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
|
56
|
+
if ((da1 -= p1 * 2) > index.epsilon) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
|
|
57
|
+
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
|
58
|
+
}
|
|
59
|
+
var x01 = r1 * index.cos(a01), y01 = r1 * index.sin(a01), x10 = r0 * index.cos(a10), y10 = r0 * index.sin(a10);
|
|
60
|
+
if (rc > index.epsilon) {
|
|
61
|
+
var x11 = r1 * index.cos(a11), y11 = r1 * index.sin(a11), x00 = r0 * index.cos(a00), y00 = r0 * index.sin(a00), oc;
|
|
62
|
+
if (da < index.pi) {
|
|
63
|
+
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
|
|
64
|
+
var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / index.sin(index.acos((ax * bx + ay * by) / (index.sqrt(ax * ax + ay * ay) * index.sqrt(bx * bx + by * by))) / 2), lc = index.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
65
|
+
rc0 = index.min(rc, (r0 - lc) / (kc - 1));
|
|
66
|
+
rc1 = index.min(rc, (r1 - lc) / (kc + 1));
|
|
67
|
+
} else {
|
|
68
|
+
rc0 = rc1 = 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!(da1 > index.epsilon)) context.moveTo(x01, y01);
|
|
73
|
+
else if (rc1 > index.epsilon) {
|
|
74
|
+
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
75
|
+
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
76
|
+
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
77
|
+
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, index.atan2(t0.y01, t0.x01), index.atan2(t1.y01, t1.x01), !cw);
|
|
78
|
+
else {
|
|
79
|
+
context.arc(t0.cx, t0.cy, rc1, index.atan2(t0.y01, t0.x01), index.atan2(t0.y11, t0.x11), !cw);
|
|
80
|
+
context.arc(0, 0, r1, index.atan2(t0.cy + t0.y11, t0.cx + t0.x11), index.atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
|
81
|
+
context.arc(t1.cx, t1.cy, rc1, index.atan2(t1.y11, t1.x11), index.atan2(t1.y01, t1.x01), !cw);
|
|
82
|
+
}
|
|
83
|
+
} else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
|
84
|
+
if (!(r0 > index.epsilon) || !(da0 > index.epsilon)) context.lineTo(x10, y10);
|
|
85
|
+
else if (rc0 > index.epsilon) {
|
|
86
|
+
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
87
|
+
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
88
|
+
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
89
|
+
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, index.atan2(t0.y01, t0.x01), index.atan2(t1.y01, t1.x01), !cw);
|
|
90
|
+
else {
|
|
91
|
+
context.arc(t0.cx, t0.cy, rc0, index.atan2(t0.y01, t0.x01), index.atan2(t0.y11, t0.x11), !cw);
|
|
92
|
+
context.arc(0, 0, r0, index.atan2(t0.cy + t0.y11, t0.cx + t0.x11), index.atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
|
93
|
+
context.arc(t1.cx, t1.cy, rc0, index.atan2(t1.y11, t1.x11), index.atan2(t1.y01, t1.x01), !cw);
|
|
94
|
+
}
|
|
95
|
+
} else context.arc(0, 0, r0, a10, a00, cw);
|
|
96
|
+
}
|
|
97
|
+
context.closePath();
|
|
98
|
+
if (buffer) return context = null, buffer + "" || null;
|
|
99
|
+
}
|
|
100
|
+
arc.centroid = function() {
|
|
101
|
+
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - index.pi / 2;
|
|
102
|
+
return [index.cos(a) * r, index.sin(a) * r];
|
|
103
|
+
};
|
|
104
|
+
arc.innerRadius = function(_) {
|
|
105
|
+
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : innerRadius;
|
|
106
|
+
};
|
|
107
|
+
arc.outerRadius = function(_) {
|
|
108
|
+
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : outerRadius;
|
|
109
|
+
};
|
|
110
|
+
arc.cornerRadius = function(_) {
|
|
111
|
+
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : cornerRadius;
|
|
112
|
+
};
|
|
113
|
+
arc.padRadius = function(_) {
|
|
114
|
+
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : index.constant(+_), arc) : padRadius;
|
|
115
|
+
};
|
|
116
|
+
arc.startAngle = function(_) {
|
|
117
|
+
return arguments.length ? (startAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : startAngle;
|
|
118
|
+
};
|
|
119
|
+
arc.endAngle = function(_) {
|
|
120
|
+
return arguments.length ? (endAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : endAngle;
|
|
121
|
+
};
|
|
122
|
+
arc.padAngle = function(_) {
|
|
123
|
+
return arguments.length ? (padAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : padAngle;
|
|
124
|
+
};
|
|
125
|
+
arc.context = function(_) {
|
|
126
|
+
return arguments.length ? (context = _ == null ? null : _, arc) : context;
|
|
127
|
+
};
|
|
128
|
+
return arc;
|
|
129
|
+
}
|
|
130
|
+
exports.d3arc = d3arc;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { a0 as withPath, a1 as pi, a2 as cos, a3 as sin, a4 as constant, a5 as halfPi, a6 as epsilon, a7 as tau, a8 as sqrt, a9 as min, aa as abs, ab as atan2, ac as asin, ad as max, ae as acos } from "./index-CjSgoo1P.js";
|
|
2
|
+
function arcInnerRadius(d) {
|
|
3
|
+
return d.innerRadius;
|
|
4
|
+
}
|
|
5
|
+
function arcOuterRadius(d) {
|
|
6
|
+
return d.outerRadius;
|
|
7
|
+
}
|
|
8
|
+
function arcStartAngle(d) {
|
|
9
|
+
return d.startAngle;
|
|
10
|
+
}
|
|
11
|
+
function arcEndAngle(d) {
|
|
12
|
+
return d.endAngle;
|
|
13
|
+
}
|
|
14
|
+
function arcPadAngle(d) {
|
|
15
|
+
return d && d.padAngle;
|
|
16
|
+
}
|
|
17
|
+
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
18
|
+
var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
|
|
19
|
+
if (t * t < epsilon) return;
|
|
20
|
+
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
21
|
+
return [x0 + t * x10, y0 + t * y10];
|
|
22
|
+
}
|
|
23
|
+
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
24
|
+
var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
|
|
25
|
+
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
|
26
|
+
return {
|
|
27
|
+
cx: cx0,
|
|
28
|
+
cy: cy0,
|
|
29
|
+
x01: -ox,
|
|
30
|
+
y01: -oy,
|
|
31
|
+
x11: cx0 * (r1 / r - 1),
|
|
32
|
+
y11: cy0 * (r1 / r - 1)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function d3arc() {
|
|
36
|
+
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path = withPath(arc);
|
|
37
|
+
function arc() {
|
|
38
|
+
var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0;
|
|
39
|
+
if (!context) context = buffer = path();
|
|
40
|
+
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
|
41
|
+
if (!(r1 > epsilon)) context.moveTo(0, 0);
|
|
42
|
+
else if (da > tau - epsilon) {
|
|
43
|
+
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
|
44
|
+
context.arc(0, 0, r1, a0, a1, !cw);
|
|
45
|
+
if (r0 > epsilon) {
|
|
46
|
+
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
|
47
|
+
context.arc(0, 0, r0, a1, a0, cw);
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t0, t1;
|
|
51
|
+
if (rp > epsilon) {
|
|
52
|
+
var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
|
|
53
|
+
if ((da0 -= p0 * 2) > epsilon) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
|
|
54
|
+
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
|
55
|
+
if ((da1 -= p1 * 2) > epsilon) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
|
|
56
|
+
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
|
57
|
+
}
|
|
58
|
+
var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
|
|
59
|
+
if (rc > epsilon) {
|
|
60
|
+
var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
|
|
61
|
+
if (da < pi) {
|
|
62
|
+
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
|
|
63
|
+
var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
64
|
+
rc0 = min(rc, (r0 - lc) / (kc - 1));
|
|
65
|
+
rc1 = min(rc, (r1 - lc) / (kc + 1));
|
|
66
|
+
} else {
|
|
67
|
+
rc0 = rc1 = 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (!(da1 > epsilon)) context.moveTo(x01, y01);
|
|
72
|
+
else if (rc1 > epsilon) {
|
|
73
|
+
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
74
|
+
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
75
|
+
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
76
|
+
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
77
|
+
else {
|
|
78
|
+
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
79
|
+
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
|
80
|
+
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
81
|
+
}
|
|
82
|
+
} else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
|
83
|
+
if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
|
|
84
|
+
else if (rc0 > epsilon) {
|
|
85
|
+
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
86
|
+
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
87
|
+
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
88
|
+
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
89
|
+
else {
|
|
90
|
+
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
91
|
+
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
|
92
|
+
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
93
|
+
}
|
|
94
|
+
} else context.arc(0, 0, r0, a10, a00, cw);
|
|
95
|
+
}
|
|
96
|
+
context.closePath();
|
|
97
|
+
if (buffer) return context = null, buffer + "" || null;
|
|
98
|
+
}
|
|
99
|
+
arc.centroid = function() {
|
|
100
|
+
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
|
101
|
+
return [cos(a) * r, sin(a) * r];
|
|
102
|
+
};
|
|
103
|
+
arc.innerRadius = function(_) {
|
|
104
|
+
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
|
|
105
|
+
};
|
|
106
|
+
arc.outerRadius = function(_) {
|
|
107
|
+
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
|
|
108
|
+
};
|
|
109
|
+
arc.cornerRadius = function(_) {
|
|
110
|
+
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
|
|
111
|
+
};
|
|
112
|
+
arc.padRadius = function(_) {
|
|
113
|
+
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
|
|
114
|
+
};
|
|
115
|
+
arc.startAngle = function(_) {
|
|
116
|
+
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
|
|
117
|
+
};
|
|
118
|
+
arc.endAngle = function(_) {
|
|
119
|
+
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
|
|
120
|
+
};
|
|
121
|
+
arc.padAngle = function(_) {
|
|
122
|
+
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
|
|
123
|
+
};
|
|
124
|
+
arc.context = function(_) {
|
|
125
|
+
return arguments.length ? (context = _ == null ? null : _, arc) : context;
|
|
126
|
+
};
|
|
127
|
+
return arc;
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
d3arc as d
|
|
131
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const mermaidParser_core = require("./mermaid-parser.core-CzmkR-3i.cjs");
|
|
4
|
+
exports.ArchitectureModule = mermaidParser_core.ArchitectureModule;
|
|
5
|
+
exports.createArchitectureServices = mermaidParser_core.createArchitectureServices;
|