mermaid 10.4.0 → 10.5.0-alpha.1
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/LICENSE +21 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/Diagram.d.ts +5 -3
- package/dist/__mocks__/mermaidAPI.d.ts +0 -1
- package/dist/arc-a8bfee7a.js +84 -0
- package/dist/{arc-eae95b9d.js → arc-f6765cc2.js} +1 -1
- package/dist/{c4Diagram-01b08bdc.js → c4Diagram-2531a439.js} +560 -584
- package/dist/{c4Diagram-c0b17d02.js → c4Diagram-cac6c446.js} +213 -244
- package/dist/{c4Diagram-ae26940c.js → c4Diagram-cb9bf81d.js} +213 -244
- package/dist/classDiagram-a1d94167.js +362 -0
- package/dist/classDiagram-abf9ce4d.js +354 -0
- package/dist/classDiagram-e8645087.js +218 -0
- package/dist/{classDiagram-v2-115132f8.js → classDiagram-v2-259d8364.js} +7 -8
- package/dist/{classDiagram-v2-802a48d3.js → classDiagram-v2-26382e74.js} +5 -6
- package/dist/{classDiagram-v2-441552b7.js → classDiagram-v2-ef709a1e.js} +30 -31
- package/dist/config.type.d.ts +1 -1
- package/dist/{createText-3b1f58a4.js → createText-37adbdb6.js} +1 -1
- package/dist/{createText-98e4790d.js → createText-4209acc9.js} +50 -50
- package/dist/{createText-6836bc4a.js → createText-62610a0f.js} +1 -1
- package/dist/diagram-api/diagramAPI.d.ts +1 -2
- package/dist/diagram-api/frontmatter.d.ts +11 -4
- package/dist/diagram-api/types.d.ts +19 -11
- package/dist/diagrams/c4/c4Db.d.ts +4 -6
- package/dist/diagrams/class/classDb.d.ts +0 -2
- package/dist/diagrams/class/classRenderer-v2.d.ts +1 -1
- package/dist/diagrams/class/classTypes.d.ts +36 -2
- package/dist/diagrams/class/svgDraw.d.ts +0 -5
- package/dist/diagrams/common/common.d.ts +2 -1
- package/dist/{commonDb.d.ts → diagrams/common/commonDb.d.ts} +0 -10
- package/dist/diagrams/er/erDb.d.ts +7 -9
- package/dist/diagrams/er/erDiagram.d.ts +1 -2
- package/dist/diagrams/flowchart/elk/flowRenderer-elk.d.ts +1 -1
- package/dist/diagrams/flowchart/elk/flowchart-elk-definition.d.ts +1 -1
- package/dist/diagrams/flowchart/flowDb.d.ts +6 -8
- package/dist/diagrams/flowchart/flowDiagram-v2.d.ts +1 -2
- package/dist/diagrams/flowchart/flowDiagram.d.ts +1 -2
- package/dist/diagrams/flowchart/flowRenderer-v2.d.ts +1 -1
- package/dist/diagrams/flowchart/flowRenderer.d.ts +1 -1
- package/dist/diagrams/gantt/ganttDb.d.ts +6 -8
- package/dist/diagrams/git/gitGraphAst.d.ts +6 -8
- package/dist/diagrams/pie/pieTypes.d.ts +1 -2
- package/dist/diagrams/quadrant-chart/quadrantDb.d.ts +0 -2
- package/dist/diagrams/requirement/requirementDb.d.ts +4 -6
- package/dist/diagrams/sequence/sequenceDb.d.ts +37 -10
- package/dist/diagrams/state/stateDb.d.ts +6 -8
- package/dist/diagrams/state/stateRenderer-v2.d.ts +1 -1
- package/dist/diagrams/timeline/timelineDb.d.ts +1 -3
- package/dist/diagrams/user-journey/journeyDb.d.ts +6 -8
- package/dist/{edges-ecd2ecb8.js → edges-083732fe.js} +63 -28
- package/dist/edges-4eab8f28.js +935 -0
- package/dist/{edges-0005682e.js → edges-93436f21.js} +63 -28
- package/dist/erDiagram-6658a9c0.js +930 -0
- package/dist/{erDiagram-dedf2781.js → erDiagram-71d2e454.js} +109 -125
- package/dist/{erDiagram-98d114f5.js → erDiagram-cb70da08.js} +111 -127
- package/dist/flowDb-20d6d7d4.js +1113 -0
- package/dist/{flowDb-3647b264.js → flowDb-5eabb736.js} +265 -299
- package/dist/{flowDb-ff651a22.js → flowDb-d9d46b9c.js} +265 -299
- package/dist/{flowDiagram-791cd6ce.js → flowDiagram-77d3dd52.js} +8 -9
- package/dist/{flowDiagram-5d2b0cd4.js → flowDiagram-bb6ec1b1.js} +44 -45
- package/dist/{flowDiagram-d6f8fe3a.js → flowDiagram-ede492c1.js} +6 -7
- package/dist/{flowDiagram-v2-ba221793.js → flowDiagram-v2-0fdba623.js} +8 -9
- package/dist/{flowDiagram-v2-58f49b84.js → flowDiagram-v2-74b16bfa.js} +6 -7
- package/dist/{flowDiagram-v2-c8096018.js → flowDiagram-v2-8a567a8b.js} +8 -9
- package/dist/{flowchart-elk-definition-56584a6c.js → flowchart-elk-definition-1a23fbf8.js} +4 -6
- package/dist/{flowchart-elk-definition-32a627c1.js → flowchart-elk-definition-207fc264.js} +7 -8
- package/dist/{flowchart-elk-definition-b51952f5.js → flowchart-elk-definition-38b1f607.js} +5 -6
- package/dist/ganttDiagram-65686237.js +2537 -0
- package/dist/{ganttDiagram-2f2b3e35.js → ganttDiagram-7cec6153.js} +121 -139
- package/dist/{ganttDiagram-088dbd90.js → ganttDiagram-821a1f55.js} +113 -131
- package/dist/{gitGraphDiagram-2a92ed83.js → gitGraphDiagram-8500a308.js} +159 -192
- package/dist/gitGraphDiagram-e9d54714.js +1223 -0
- package/dist/{gitGraphDiagram-e0ffc2d1.js → gitGraphDiagram-fa93f3b8.js} +159 -192
- package/dist/{index-c449e2c7.js → index-31824900.js} +20 -20
- package/dist/{index-f58d48f9.js → index-780f9f24.js} +7 -7
- package/dist/{index-1bb7dfb9.js → index-b037782b.js} +8 -8
- package/dist/{infoDiagram-6cbe7c6f.js → infoDiagram-899ea892.js} +14 -14
- package/dist/{infoDiagram-64895a6e.js → infoDiagram-dea288bc.js} +1 -1
- package/dist/{infoDiagram-71364981.js → infoDiagram-e9a38232.js} +1 -1
- package/dist/journeyDiagram-5fc46bc2.js +804 -0
- package/dist/{journeyDiagram-adaa34f8.js → journeyDiagram-aa5186d2.js} +45 -78
- package/dist/{journeyDiagram-a9730694.js → journeyDiagram-d7becdb5.js} +46 -79
- package/dist/{layout-7899ed33.js → layout-23e7182d.js} +1 -1
- package/dist/{layout-df07420e.js → layout-5e3bc0fc.js} +1 -1
- package/dist/{line-eb9172ee.js → line-e35b108b.js} +1 -1
- package/dist/{line-b0ce4b23.js → line-f7faaa1a.js} +1 -1
- package/dist/{linear-7aa3c424.js → linear-56194a76.js} +1 -1
- package/dist/{linear-50d4520f.js → linear-f4c4fd9f.js} +1 -1
- package/dist/{mermaid-d733041c.js → mermaid-2aa9f9d3.js} +2485 -2514
- package/dist/{mermaid-f185fde2.js → mermaid-5a2ef2e7.js} +511 -518
- package/dist/{mermaid-768dc893.js → mermaid-9bbc6d78.js} +353 -360
- package/dist/mermaid.core.mjs +2 -2
- package/dist/mermaid.esm.min.mjs +1 -1
- package/dist/mermaid.esm.mjs +2 -2
- package/dist/mermaid.js +2505 -2833
- package/dist/mermaid.min.js +204 -204
- package/dist/mermaidAPI.d.ts +4 -10
- package/dist/{mindmap-definition-57868176.js → mindmap-definition-47b62175.js} +2 -2
- package/dist/{mindmap-definition-6b172555.js → mindmap-definition-67cb3144.js} +2 -2
- package/dist/{mindmap-definition-6e51e9e7.js → mindmap-definition-c8422a2e.js} +2 -2
- package/dist/{pieDiagram-62059850.js → pieDiagram-1055a969.js} +51 -84
- package/dist/pieDiagram-71505cfd.js +501 -0
- package/dist/{pieDiagram-3fca7ce7.js → pieDiagram-e40690ed.js} +50 -83
- package/dist/preprocess.d.ts +10 -0
- package/dist/{quadrantDiagram-eefba29b.js → quadrantDiagram-8782ff25.js} +92 -125
- package/dist/quadrantDiagram-a37efcb6.js +904 -0
- package/dist/{quadrantDiagram-0ca4be02.js → quadrantDiagram-d344989a.js} +91 -124
- package/dist/{requirementDiagram-e13af0f0.js → requirementDiagram-2679202e.js} +95 -128
- package/dist/{requirementDiagram-6a2e589f.js → requirementDiagram-30636aa5.js} +97 -130
- package/dist/requirementDiagram-a6ae6aeb.js +768 -0
- package/dist/{sankeyDiagram-a7f8e230.js → sankeyDiagram-4c8dae24.js} +1 -1
- package/dist/{sankeyDiagram-081bcda6.js → sankeyDiagram-52e59e97.js} +1 -1
- package/dist/{sankeyDiagram-80078f5f.js → sankeyDiagram-5879b1b8.js} +36 -36
- package/dist/sequenceDiagram-1f91a235.js +2192 -0
- package/dist/{sequenceDiagram-415e57eb.js → sequenceDiagram-8707e92c.js} +194 -216
- package/dist/{sequenceDiagram-84aa38e3.js → sequenceDiagram-c4365ac5.js} +194 -216
- package/dist/{stateDiagram-956145d5.js → stateDiagram-1026a798.js} +4 -4
- package/dist/{stateDiagram-c6f77c62.js → stateDiagram-aa4ad835.js} +4 -4
- package/dist/{stateDiagram-9a586ac6.js → stateDiagram-cec3cbff.js} +2 -2
- package/dist/{stateDiagram-v2-e78ef88c.js → stateDiagram-v2-043da644.js} +7 -8
- package/dist/{stateDiagram-v2-96f2b9df.js → stateDiagram-v2-4d25d097.js} +5 -6
- package/dist/{stateDiagram-v2-7af7da00.js → stateDiagram-v2-aa82a403.js} +14 -15
- package/dist/{styles-a1a6e33f.js → styles-0d8aaace.js} +147 -180
- package/dist/{styles-6e9ebeb4.js → styles-1af72d42.js} +3 -3
- package/dist/{styles-622362e4.js → styles-67632a24.js} +281 -239
- package/dist/{styles-1b0c237a.js → styles-92b6f0e9.js} +2 -2
- package/dist/styles-985a3d1e.js +960 -0
- package/dist/styles-a446d2b5.js +1055 -0
- package/dist/{styles-91b2881f.js → styles-aadfe2a3.js} +147 -180
- package/dist/{styles-472dd00e.js → styles-d31f2c67.js} +3 -3
- package/dist/{styles-f1c03133.js → styles-dbf6e1f4.js} +281 -239
- package/dist/{svgDrawCommon-5f2bf747.js → svgDrawCommon-161f79fd.js} +1 -1
- package/dist/{svgDrawCommon-05124e63.js → svgDrawCommon-2a973dce.js} +1 -1
- package/dist/{svgDrawCommon-42e92da3.js → svgDrawCommon-4062cc86.js} +1 -1
- package/dist/{timeline-definition-8fc01fef.js → timeline-definition-405e0eb3.js} +46 -80
- package/dist/{timeline-definition-1a90b03d.js → timeline-definition-ac82d08c.js} +45 -79
- package/dist/timeline-definition-dad4606b.js +795 -0
- package/dist/utils/sanitizeDirective.d.ts +7 -0
- package/dist/utils.d.ts +1 -9
- package/package.json +22 -23
- package/dist/arc-1026bbaf.js +0 -84
- package/dist/classDiagram-09b02f81.js +0 -91
- package/dist/classDiagram-a8cc8886.js +0 -145
- package/dist/classDiagram-aa2e62c5.js +0 -137
- package/dist/directiveUtils.d.ts +0 -1
- package/dist/edges-6be02a86.js +0 -902
- package/dist/erDiagram-9aadf2be.js +0 -942
- package/dist/flowDb-1d600296.js +0 -1139
- package/dist/ganttDiagram-3d9d1ab4.js +0 -2548
- package/dist/gitGraphDiagram-4c126424.js +0 -1249
- package/dist/journeyDiagram-f3c7ca51.js +0 -829
- package/dist/pieDiagram-16330908.js +0 -528
- package/dist/quadrantDiagram-6f203608.js +0 -929
- package/dist/requirementDiagram-e64784ea.js +0 -793
- package/dist/sequenceDiagram-b5c34a98.js +0 -2210
- package/dist/styles-04cc473c.js +0 -1032
- package/dist/styles-91bd061f.js +0 -985
- package/dist/svgDraw-092a0897.js +0 -272
- package/dist/svgDraw-70101091.js +0 -272
- package/dist/svgDraw-8c7d5329.js +0 -159
- package/dist/timeline-definition-e6c31e7d.js +0 -821
- /package/dist/diagrams/class/{classParser.spec.d.ts → classTypes.spec.d.ts} +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 - 2022 Knut Sveidqvist
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ Use Mermaid with your favorite applications, check out the list of [Integrations
|
|
|
60
60
|
|
|
61
61
|
You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) as well many of your other favorite applications—check out the list of [Integrations and Usages of Mermaid](./docs/ecosystem/integrations.md).
|
|
62
62
|
|
|
63
|
-
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/intro/
|
|
63
|
+
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/intro/getting-started.md), [Usage](./docs/config/usage.md) and [Tutorials](./docs/config/Tutorials.md).
|
|
64
64
|
|
|
65
65
|
In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests.
|
|
66
66
|
|
package/README.zh-CN.md
CHANGED
|
@@ -55,7 +55,7 @@ Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它
|
|
|
55
55
|
Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://mermaid.live/) 轻松创建详细的图表。<br/>
|
|
56
56
|
你可以访问 [教程](./docs/config/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/ecosystem/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
|
57
57
|
|
|
58
|
-
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/intro/
|
|
58
|
+
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/intro/getting-started.md), [用法](./docs/config/usage.md) 和 [教程](./docs/config/Tutorials.md).
|
|
59
59
|
|
|
60
60
|
<!-- </Main description> -->
|
|
61
61
|
|
package/dist/Diagram.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DetailedError } from './utils.js';
|
|
2
|
-
import type { DiagramDefinition } from './diagram-api/types.js';
|
|
2
|
+
import type { DiagramDefinition, DiagramMetadata } from './diagram-api/types.js';
|
|
3
3
|
export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;
|
|
4
4
|
/**
|
|
5
5
|
* An object representing a parsed mermaid diagram definition.
|
|
@@ -7,13 +7,14 @@ export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?:
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class Diagram {
|
|
9
9
|
text: string;
|
|
10
|
+
metadata: Pick<DiagramMetadata, 'title'>;
|
|
10
11
|
type: string;
|
|
11
12
|
parser: DiagramDefinition['parser'];
|
|
12
13
|
renderer: DiagramDefinition['renderer'];
|
|
13
14
|
db: DiagramDefinition['db'];
|
|
14
15
|
private init?;
|
|
15
16
|
private detectError?;
|
|
16
|
-
constructor(text: string);
|
|
17
|
+
constructor(text: string, metadata?: Pick<DiagramMetadata, 'title'>);
|
|
17
18
|
parse(): void;
|
|
18
19
|
render(id: string, version: string): Promise<void>;
|
|
19
20
|
getParser(): import("./diagram-api/types.js").ParserDefinition;
|
|
@@ -24,8 +25,9 @@ export declare class Diagram {
|
|
|
24
25
|
* **Warning:** This function may be changed in the future.
|
|
25
26
|
* @alpha
|
|
26
27
|
* @param text - The mermaid diagram definition.
|
|
28
|
+
* @param metadata - Diagram metadata, defined in YAML.
|
|
27
29
|
* @returns A the Promise of a Diagram object.
|
|
28
30
|
* @throws {@link UnknownDiagramError} if the diagram type can not be found.
|
|
29
31
|
* @privateRemarks This is exported as part of the public mermaidAPI.
|
|
30
32
|
*/
|
|
31
|
-
export declare const getDiagramFromText: (text: string) => Promise<Diagram>;
|
|
33
|
+
export declare const getDiagramFromText: (text: string, metadata?: Pick<DiagramMetadata, 'title'>) => Promise<Diagram>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const mermaidAPI: {
|
|
2
2
|
render: import("@vitest/spy").Mock<any, any>;
|
|
3
3
|
parse: (text: string, parseOptions?: import("../mermaidAPI.js").ParseOptions | undefined) => Promise<boolean>;
|
|
4
|
-
parseDirective: import("@vitest/spy").Mock<any, any>;
|
|
5
4
|
initialize: import("@vitest/spy").Mock<any, any>;
|
|
6
5
|
getConfig: () => import("../config.type.js").MermaidConfig;
|
|
7
6
|
setConfig: (conf: import("../config.type.js").MermaidConfig) => import("../config.type.js").MermaidConfig;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { c as X, p as sn } from "./constant-2fe7eae5.js";
|
|
2
|
+
import { aW as en, aX as j, aY as P, aZ as an, a_ as y, W as ln, a$ as C, b0 as k, b1 as rn, b2 as t, b3 as un, b4 as on, b5 as tn } from "./mermaid-2aa9f9d3.js";
|
|
3
|
+
function fn(l) {
|
|
4
|
+
return l.innerRadius;
|
|
5
|
+
}
|
|
6
|
+
function cn(l) {
|
|
7
|
+
return l.outerRadius;
|
|
8
|
+
}
|
|
9
|
+
function yn(l) {
|
|
10
|
+
return l.startAngle;
|
|
11
|
+
}
|
|
12
|
+
function gn(l) {
|
|
13
|
+
return l.endAngle;
|
|
14
|
+
}
|
|
15
|
+
function mn(l) {
|
|
16
|
+
return l && l.padAngle;
|
|
17
|
+
}
|
|
18
|
+
function pn(l, x, w, W, h, v, Y, a) {
|
|
19
|
+
var s = w - l, n = W - x, m = Y - h, i = a - v, r = i * s - m * n;
|
|
20
|
+
if (!(r * r < y))
|
|
21
|
+
return r = (m * (x - v) - i * (l - h)) / r, [l + r * s, x + r * n];
|
|
22
|
+
}
|
|
23
|
+
function K(l, x, w, W, h, v, Y) {
|
|
24
|
+
var a = l - w, s = x - W, n = (Y ? v : -v) / C(a * a + s * s), m = n * s, i = -n * a, r = l + m, f = x + i, c = w + m, D = W + i, o = (r + c) / 2, E = (f + D) / 2, p = c - r, g = D - f, A = p * p + g * g, I = h - v, b = r * D - c * f, O = (g < 0 ? -1 : 1) * C(tn(0, I * I * A - b * b)), S = (b * g - p * O) / A, d = (-b * p - g * O) / A, R = (b * g + p * O) / A, T = (-b * p + g * O) / A, e = S - o, u = d - E, Z = R - o, $ = T - E;
|
|
25
|
+
return e * e + u * u > Z * Z + $ * $ && (S = R, d = T), {
|
|
26
|
+
cx: S,
|
|
27
|
+
cy: d,
|
|
28
|
+
x01: -m,
|
|
29
|
+
y01: -i,
|
|
30
|
+
x11: S * (h / I - 1),
|
|
31
|
+
y11: d * (h / I - 1)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function hn() {
|
|
35
|
+
var l = fn, x = cn, w = X(0), W = null, h = yn, v = gn, Y = mn, a = null;
|
|
36
|
+
function s() {
|
|
37
|
+
var n, m, i = +l.apply(this, arguments), r = +x.apply(this, arguments), f = h.apply(this, arguments) - an, c = v.apply(this, arguments) - an, D = rn(c - f), o = c > f;
|
|
38
|
+
if (a || (a = n = sn()), r < i && (m = r, r = i, i = m), !(r > y))
|
|
39
|
+
a.moveTo(0, 0);
|
|
40
|
+
else if (D > ln - y)
|
|
41
|
+
a.moveTo(r * j(f), r * P(f)), a.arc(0, 0, r, f, c, !o), i > y && (a.moveTo(i * j(c), i * P(c)), a.arc(0, 0, i, c, f, o));
|
|
42
|
+
else {
|
|
43
|
+
var E = f, p = c, g = f, A = c, I = D, b = D, O = Y.apply(this, arguments) / 2, S = O > y && (W ? +W.apply(this, arguments) : C(i * i + r * r)), d = k(rn(r - i) / 2, +w.apply(this, arguments)), R = d, T = d, e, u;
|
|
44
|
+
if (S > y) {
|
|
45
|
+
var Z = un(S / i * P(O)), $ = un(S / r * P(O));
|
|
46
|
+
(I -= Z * 2) > y ? (Z *= o ? 1 : -1, g += Z, A -= Z) : (I = 0, g = A = (f + c) / 2), (b -= $ * 2) > y ? ($ *= o ? 1 : -1, E += $, p -= $) : (b = 0, E = p = (f + c) / 2);
|
|
47
|
+
}
|
|
48
|
+
var z = r * j(E), B = r * P(E), F = i * j(A), G = i * P(A);
|
|
49
|
+
if (d > y) {
|
|
50
|
+
var H = r * j(p), J = r * P(p), L = i * j(g), M = i * P(g), q;
|
|
51
|
+
if (D < en && (q = pn(z, B, L, M, H, J, F, G))) {
|
|
52
|
+
var N = z - q[0], Q = B - q[1], U = H - q[0], V = J - q[1], _ = 1 / P(on((N * U + Q * V) / (C(N * N + Q * Q) * C(U * U + V * V))) / 2), nn = C(q[0] * q[0] + q[1] * q[1]);
|
|
53
|
+
R = k(d, (i - nn) / (_ - 1)), T = k(d, (r - nn) / (_ + 1));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
b > y ? T > y ? (e = K(L, M, z, B, r, T, o), u = K(H, J, F, G, r, T, o), a.moveTo(e.cx + e.x01, e.cy + e.y01), T < d ? a.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, r, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), !o), a.arc(u.cx, u.cy, T, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : (a.moveTo(z, B), a.arc(0, 0, r, E, p, !o)) : a.moveTo(z, B), !(i > y) || !(I > y) ? a.lineTo(F, G) : R > y ? (e = K(F, G, H, J, i, -R, o), u = K(z, B, L, M, i, -R, o), a.lineTo(e.cx + e.x01, e.cy + e.y01), R < d ? a.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, i, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), o), a.arc(u.cx, u.cy, R, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : a.arc(0, 0, i, A, g, o);
|
|
57
|
+
}
|
|
58
|
+
if (a.closePath(), n)
|
|
59
|
+
return a = null, n + "" || null;
|
|
60
|
+
}
|
|
61
|
+
return s.centroid = function() {
|
|
62
|
+
var n = (+l.apply(this, arguments) + +x.apply(this, arguments)) / 2, m = (+h.apply(this, arguments) + +v.apply(this, arguments)) / 2 - en / 2;
|
|
63
|
+
return [j(m) * n, P(m) * n];
|
|
64
|
+
}, s.innerRadius = function(n) {
|
|
65
|
+
return arguments.length ? (l = typeof n == "function" ? n : X(+n), s) : l;
|
|
66
|
+
}, s.outerRadius = function(n) {
|
|
67
|
+
return arguments.length ? (x = typeof n == "function" ? n : X(+n), s) : x;
|
|
68
|
+
}, s.cornerRadius = function(n) {
|
|
69
|
+
return arguments.length ? (w = typeof n == "function" ? n : X(+n), s) : w;
|
|
70
|
+
}, s.padRadius = function(n) {
|
|
71
|
+
return arguments.length ? (W = n == null ? null : typeof n == "function" ? n : X(+n), s) : W;
|
|
72
|
+
}, s.startAngle = function(n) {
|
|
73
|
+
return arguments.length ? (h = typeof n == "function" ? n : X(+n), s) : h;
|
|
74
|
+
}, s.endAngle = function(n) {
|
|
75
|
+
return arguments.length ? (v = typeof n == "function" ? n : X(+n), s) : v;
|
|
76
|
+
}, s.padAngle = function(n) {
|
|
77
|
+
return arguments.length ? (Y = typeof n == "function" ? n : X(+n), s) : Y;
|
|
78
|
+
}, s.context = function(n) {
|
|
79
|
+
return arguments.length ? (a = n ?? null, s) : a;
|
|
80
|
+
}, s;
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
hn as d
|
|
84
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as constant, p as path } from "./constant-b644328d.js";
|
|
2
|
-
import {
|
|
2
|
+
import { aW as pi, aX as cos, aY as sin, aZ as halfPi, a_ as epsilon, W as tau, a$ as sqrt, b0 as min, b1 as abs, b2 as atan2, b3 as asin, b4 as acos, b5 as max } from "./mermaid-5a2ef2e7.js";
|
|
3
3
|
function arcInnerRadius(d) {
|
|
4
4
|
return d.innerRadius;
|
|
5
5
|
}
|