@umami/shiso 1.11.0 → 1.13.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/bin/shiso.mjs +20 -1
- package/dist/chunks/App.js +412 -51
- package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
- package/dist/chunks/arc.js +130 -0
- package/dist/chunks/architecture-7GRP2DOG.js +4 -0
- package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
- package/dist/chunks/array.js +8 -0
- package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
- package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
- package/dist/chunks/channel.js +9 -0
- package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
- package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
- package/dist/chunks/chunk-5VM5RSS4.js +21 -0
- package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
- package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
- package/dist/chunks/chunk-F27PBJKO.js +95 -0
- package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
- package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
- package/dist/chunks/chunk-GVQU2GXP.js +58 -0
- package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
- package/dist/chunks/chunk-JWPE2WC7.js +12 -0
- package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
- package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
- package/dist/chunks/chunk-P2QGCYS3.js +95 -0
- package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
- package/dist/chunks/chunk-PWAF6VOD.js +467 -0
- package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
- package/dist/chunks/chunk-SVP7TREG.js +686 -0
- package/dist/chunks/chunk-TICWLB2K.js +3800 -0
- package/dist/chunks/chunk-XXDRQBXY.js +12 -0
- package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
- package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
- package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
- package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
- package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
- package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
- package/dist/chunks/cytoscape.esm.js +28282 -0
- package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
- package/dist/chunks/dagre.js +4235 -0
- package/dist/chunks/defaultLocale.js +246 -0
- package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
- package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
- package/dist/chunks/diagram-VSXAHHWV.js +553 -0
- package/dist/chunks/diagram-VX7I27RA.js +798 -0
- package/dist/chunks/diagram-Z3DM3KII.js +186 -0
- package/dist/chunks/dist.js +92 -0
- package/dist/chunks/docs.js +989 -93
- package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
- package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
- package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
- package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
- package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
- package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
- package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
- package/dist/chunks/graphlib.js +4194 -0
- package/dist/chunks/info-A6RAGUB7.js +4 -0
- package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
- package/dist/chunks/init.js +14 -0
- package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
- package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
- package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
- package/dist/chunks/katex.js +26463 -0
- package/dist/chunks/line.js +48 -0
- package/dist/chunks/linear.js +391 -0
- package/dist/chunks/mermaid-parser.core.js +754 -0
- package/dist/chunks/mermaid.core.js +4898 -0
- package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
- package/dist/chunks/ordinal.js +84 -0
- package/dist/chunks/packet-AYTQ26CC.js +4 -0
- package/dist/chunks/path.js +106 -0
- package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
- package/dist/chunks/pie-WAS4IAKB.js +4 -0
- package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
- package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
- package/dist/chunks/radar-RG4KPBEZ.js +4 -0
- package/dist/chunks/railroad-74A4TZTK.js +4 -0
- package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
- package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
- package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
- package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
- package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
- package/dist/chunks/rough.esm.js +1396 -0
- package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
- package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
- package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
- package/dist/chunks/src.js +2653 -0
- package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
- package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
- package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
- package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
- package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
- package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
- package/dist/chunks/treemap-WGGIJYW6.js +4 -0
- package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
- package/dist/chunks/wardley-WFR3VGLG.js +4 -0
- package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
- package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
- package/dist/components.js +2 -2
- package/dist/entry-client.js +2 -2
- package/dist/entry-server.js +31 -3
- package/docs.schema.json +90 -0
- package/mdx.config.ts +13 -97
- package/package.json +6 -4
- package/scripts/build-runtime.mjs +1 -0
- package/scripts/check-content.mjs +358 -0
- package/scripts/expand-navigation-globs.mjs +277 -0
- package/scripts/expand-openapi-navigation.mjs +94 -0
- package/scripts/generate-openapi.mjs +117 -0
- package/scripts/generate-search-index.mjs +31 -1
- package/scripts/lib/openapi.mjs +653 -0
- package/scripts/load-docs-config.mjs +52 -6
- package/scripts/load-shiso-config.mjs +45 -3
- package/scripts/prerender.mjs +83 -3
- package/scripts/vite-docs-config.mjs +27 -6
- package/src/App.tsx +0 -1
- package/src/components/CodeBlock.tsx +108 -8
- package/src/components/DocContent.tsx +18 -0
- package/src/components/Docs.tsx +45 -17
- package/src/components/OpenApiOperation.tsx +205 -0
- package/src/components/SideNav.tsx +13 -2
- package/src/components/docs/Changelog.tsx +163 -0
- package/src/components/docs/CodeGroup.tsx +6 -2
- package/src/components/docs/Mermaid.tsx +164 -0
- package/src/components/docs/Panel.tsx +23 -0
- package/src/components/docs/ParamField.tsx +17 -5
- package/src/components/docs/PropertiesTable.tsx +2 -2
- package/src/components/docs/ResponseField.tsx +17 -5
- package/src/components/docs/Tiles.tsx +59 -0
- package/src/components/docs/Tree.tsx +359 -0
- package/src/components/docs/Update.tsx +72 -0
- package/src/components/docs/index.ts +7 -0
- package/src/components/docs/panel-context.tsx +25 -0
- package/src/components/docs/styles.ts +49 -0
- package/src/components/icons/index.ts +4 -0
- package/src/entry-server.tsx +50 -0
- package/src/lib/code-blocks.ts +18 -0
- package/src/lib/code-meta.ts +87 -0
- package/src/lib/docs-config.ts +4 -1
- package/src/lib/openapi.generated.ts +4 -0
- package/src/lib/openapi.ts +63 -0
- package/src/lib/rehype-shiki.ts +213 -0
- package/src/lib/site-model.ts +2 -0
- package/src/lib/types.ts +116 -2
- package/src/styles/global.css +63 -73
- package/types/components.d.ts +79 -0
- package/types/config.d.ts +11 -4
- package/vite.config.ts +49 -3
- package/CHANGELOG.md +0 -171
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { n as parse } from "./mermaid-parser.core.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY.js";
|
|
3
|
+
import { m as log } from "./src.js";
|
|
4
|
+
import { D as getThemeVariables3, H as setAccDescription, K as setDiagramTitle, U as setAccTitle, a as clear, b as getConfig, c as configureSvgSize, f as defaultConfig_default, v as getAccDescription, w as getDiagramTitle, y as getAccTitle } from "./chunk-DU6HZSFF.js";
|
|
5
|
+
import { i as cleanAndMerge } from "./chunk-75Z2AOVW.js";
|
|
6
|
+
import { t as populateCommonDb } from "./chunk-JWPE2WC7.js";
|
|
7
|
+
import { f as selectSvgElement } from "./mermaid.core.js";
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/diagram-UQ7AKVKN.mjs
|
|
10
|
+
var defaultOptions = {
|
|
11
|
+
showLegend: true,
|
|
12
|
+
ticks: 5,
|
|
13
|
+
max: null,
|
|
14
|
+
min: 0,
|
|
15
|
+
graticule: "circle"
|
|
16
|
+
};
|
|
17
|
+
var MAX_TICKS = 32;
|
|
18
|
+
var defaultRadarData = {
|
|
19
|
+
axes: [],
|
|
20
|
+
curves: [],
|
|
21
|
+
options: defaultOptions
|
|
22
|
+
};
|
|
23
|
+
var data = structuredClone(defaultRadarData);
|
|
24
|
+
var DEFAULT_RADAR_CONFIG = defaultConfig_default.radar;
|
|
25
|
+
var getConfig2 = /* @__PURE__ */ __name(() => {
|
|
26
|
+
return cleanAndMerge({
|
|
27
|
+
...DEFAULT_RADAR_CONFIG,
|
|
28
|
+
...getConfig().radar
|
|
29
|
+
});
|
|
30
|
+
}, "getConfig");
|
|
31
|
+
var getAxes = /* @__PURE__ */ __name(() => data.axes, "getAxes");
|
|
32
|
+
var getCurves = /* @__PURE__ */ __name(() => data.curves, "getCurves");
|
|
33
|
+
var getOptions = /* @__PURE__ */ __name(() => data.options, "getOptions");
|
|
34
|
+
var setAxes = /* @__PURE__ */ __name((axes) => {
|
|
35
|
+
data.axes = axes.map((axis) => {
|
|
36
|
+
return {
|
|
37
|
+
name: axis.name,
|
|
38
|
+
label: axis.label ?? axis.name
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}, "setAxes");
|
|
42
|
+
var setCurves = /* @__PURE__ */ __name((curves) => {
|
|
43
|
+
data.curves = curves.map((curve) => {
|
|
44
|
+
return {
|
|
45
|
+
name: curve.name,
|
|
46
|
+
label: curve.label ?? curve.name,
|
|
47
|
+
entries: computeCurveEntries(curve.entries)
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}, "setCurves");
|
|
51
|
+
var computeCurveEntries = /* @__PURE__ */ __name((entries) => {
|
|
52
|
+
if (entries[0].axis == void 0) return entries.map((entry) => entry.value);
|
|
53
|
+
const axes = getAxes();
|
|
54
|
+
if (axes.length === 0) throw new Error("Axes must be populated before curves for reference entries");
|
|
55
|
+
return axes.map((axis) => {
|
|
56
|
+
const entry = entries.find((entry2) => entry2.axis?.$refText === axis.name);
|
|
57
|
+
if (entry === void 0) throw new Error("Missing entry for axis " + axis.label);
|
|
58
|
+
return entry.value;
|
|
59
|
+
});
|
|
60
|
+
}, "computeCurveEntries");
|
|
61
|
+
var db = {
|
|
62
|
+
getAxes,
|
|
63
|
+
getCurves,
|
|
64
|
+
getOptions,
|
|
65
|
+
setAxes,
|
|
66
|
+
setCurves,
|
|
67
|
+
setOptions: /* @__PURE__ */ __name((options) => {
|
|
68
|
+
const optionMap = options.reduce((acc, option) => {
|
|
69
|
+
acc[option.name] = option;
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
data.options = {
|
|
73
|
+
showLegend: optionMap.showLegend?.value ?? defaultOptions.showLegend,
|
|
74
|
+
ticks: optionMap.ticks?.value ?? defaultOptions.ticks,
|
|
75
|
+
max: optionMap.max?.value ?? defaultOptions.max,
|
|
76
|
+
min: optionMap.min?.value ?? defaultOptions.min,
|
|
77
|
+
graticule: optionMap.graticule?.value ?? defaultOptions.graticule
|
|
78
|
+
};
|
|
79
|
+
if (data.options.ticks > MAX_TICKS) {
|
|
80
|
+
log.warn(`Radar diagram ticks (${data.options.ticks}) exceeds maximum allowed (${MAX_TICKS}). Using ${MAX_TICKS} instead.`);
|
|
81
|
+
data.options.ticks = MAX_TICKS;
|
|
82
|
+
}
|
|
83
|
+
}, "setOptions"),
|
|
84
|
+
getConfig: getConfig2,
|
|
85
|
+
clear: /* @__PURE__ */ __name(() => {
|
|
86
|
+
clear();
|
|
87
|
+
data = structuredClone(defaultRadarData);
|
|
88
|
+
}, "clear"),
|
|
89
|
+
setAccTitle,
|
|
90
|
+
getAccTitle,
|
|
91
|
+
setDiagramTitle,
|
|
92
|
+
getDiagramTitle,
|
|
93
|
+
getAccDescription,
|
|
94
|
+
setAccDescription
|
|
95
|
+
};
|
|
96
|
+
var populate = /* @__PURE__ */ __name((ast) => {
|
|
97
|
+
populateCommonDb(ast, db);
|
|
98
|
+
const { axes, curves, options } = ast;
|
|
99
|
+
db.setAxes(axes);
|
|
100
|
+
db.setCurves(curves);
|
|
101
|
+
db.setOptions(options);
|
|
102
|
+
}, "populate");
|
|
103
|
+
var parser = { parse: /* @__PURE__ */ __name(async (input) => {
|
|
104
|
+
const ast = await parse("radar", input);
|
|
105
|
+
log.debug(ast);
|
|
106
|
+
populate(ast);
|
|
107
|
+
}, "parse") };
|
|
108
|
+
var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
|
|
109
|
+
const db2 = diagram2.db;
|
|
110
|
+
const axes = db2.getAxes();
|
|
111
|
+
const curves = db2.getCurves();
|
|
112
|
+
const options = db2.getOptions();
|
|
113
|
+
const config = db2.getConfig();
|
|
114
|
+
const title = db2.getDiagramTitle();
|
|
115
|
+
const g = drawFrame(selectSvgElement(id), config);
|
|
116
|
+
const maxValue = options.max ?? Math.max(...curves.map((curve) => Math.max(...curve.entries)));
|
|
117
|
+
const minValue = options.min;
|
|
118
|
+
const radius = Math.min(config.width, config.height) / 2;
|
|
119
|
+
drawGraticule(g, axes, radius, options.ticks, options.graticule);
|
|
120
|
+
drawAxes(g, axes, radius, config);
|
|
121
|
+
drawCurves(g, axes, curves, minValue, maxValue, options.graticule, config);
|
|
122
|
+
drawLegend(g, curves, options.showLegend, config);
|
|
123
|
+
g.append("text").attr("class", "radarTitle").text(title).attr("x", 0).attr("y", -config.height / 2 - config.marginTop);
|
|
124
|
+
}, "draw");
|
|
125
|
+
var drawFrame = /* @__PURE__ */ __name((svg, config) => {
|
|
126
|
+
const totalWidth = config.width + config.marginLeft + config.marginRight;
|
|
127
|
+
const totalHeight = config.height + config.marginTop + config.marginBottom;
|
|
128
|
+
const center = {
|
|
129
|
+
x: config.marginLeft + config.width / 2,
|
|
130
|
+
y: config.marginTop + config.height / 2
|
|
131
|
+
};
|
|
132
|
+
configureSvgSize(svg, totalHeight, totalWidth, config.useMaxWidth ?? true);
|
|
133
|
+
svg.attr("viewBox", `0 0 ${totalWidth} ${totalHeight}`).attr("overflow", "visible");
|
|
134
|
+
return svg.append("g").attr("transform", `translate(${center.x}, ${center.y})`);
|
|
135
|
+
}, "drawFrame");
|
|
136
|
+
var drawGraticule = /* @__PURE__ */ __name((g, axes, radius, ticks, graticule) => {
|
|
137
|
+
if (graticule === "circle") for (let i = 0; i < ticks; i++) {
|
|
138
|
+
const r = radius * (i + 1) / ticks;
|
|
139
|
+
g.append("circle").attr("r", r).attr("class", "radarGraticule");
|
|
140
|
+
}
|
|
141
|
+
else if (graticule === "polygon") {
|
|
142
|
+
const numAxes = axes.length;
|
|
143
|
+
for (let i = 0; i < ticks; i++) {
|
|
144
|
+
const r = radius * (i + 1) / ticks;
|
|
145
|
+
const points = axes.map((_, j) => {
|
|
146
|
+
const angle = 2 * j * Math.PI / numAxes - Math.PI / 2;
|
|
147
|
+
return `${r * Math.cos(angle)},${r * Math.sin(angle)}`;
|
|
148
|
+
}).join(" ");
|
|
149
|
+
g.append("polygon").attr("points", points).attr("class", "radarGraticule");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, "drawGraticule");
|
|
153
|
+
var drawAxes = /* @__PURE__ */ __name((g, axes, radius, config) => {
|
|
154
|
+
const numAxes = axes.length;
|
|
155
|
+
for (let i = 0; i < numAxes; i++) {
|
|
156
|
+
const label = axes[i].label;
|
|
157
|
+
const angle = 2 * i * Math.PI / numAxes - Math.PI / 2;
|
|
158
|
+
const cosA = Math.cos(angle);
|
|
159
|
+
const sinA = Math.sin(angle);
|
|
160
|
+
g.append("line").attr("x1", 0).attr("y1", 0).attr("x2", radius * config.axisScaleFactor * cosA).attr("y2", radius * config.axisScaleFactor * sinA).attr("class", "radarAxisLine");
|
|
161
|
+
const textAnchor = cosA > .01 ? "start" : cosA < -.01 ? "end" : "middle";
|
|
162
|
+
const dominantBaseline = sinA > .01 ? "hanging" : sinA < -.01 ? "auto" : "central";
|
|
163
|
+
const labelPad = 4;
|
|
164
|
+
g.append("text").text(label).attr("x", radius * config.axisLabelFactor * cosA + labelPad * cosA).attr("y", radius * config.axisLabelFactor * sinA + labelPad * sinA).attr("text-anchor", textAnchor).attr("dominant-baseline", dominantBaseline).attr("class", "radarAxisLabel");
|
|
165
|
+
}
|
|
166
|
+
}, "drawAxes");
|
|
167
|
+
function drawCurves(g, axes, curves, minValue, maxValue, graticule, config) {
|
|
168
|
+
const numAxes = axes.length;
|
|
169
|
+
const radius = Math.min(config.width, config.height) / 2;
|
|
170
|
+
curves.forEach((curve, index) => {
|
|
171
|
+
if (curve.entries.length !== numAxes) return;
|
|
172
|
+
const points = curve.entries.map((entry, i) => {
|
|
173
|
+
const angle = 2 * Math.PI * i / numAxes - Math.PI / 2;
|
|
174
|
+
const r = relativeRadius(entry, minValue, maxValue, radius);
|
|
175
|
+
return {
|
|
176
|
+
x: r * Math.cos(angle),
|
|
177
|
+
y: r * Math.sin(angle)
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
if (graticule === "circle") g.append("path").attr("d", closedRoundCurve(points, config.curveTension)).attr("class", `radarCurve-${index}`);
|
|
181
|
+
else if (graticule === "polygon") g.append("polygon").attr("points", points.map((p) => `${p.x},${p.y}`).join(" ")).attr("class", `radarCurve-${index}`);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
__name(drawCurves, "drawCurves");
|
|
185
|
+
function relativeRadius(value, minValue, maxValue, radius) {
|
|
186
|
+
return radius * (Math.min(Math.max(value, minValue), maxValue) - minValue) / (maxValue - minValue);
|
|
187
|
+
}
|
|
188
|
+
__name(relativeRadius, "relativeRadius");
|
|
189
|
+
function closedRoundCurve(points, tension) {
|
|
190
|
+
const numPoints = points.length;
|
|
191
|
+
let d = `M${points[0].x},${points[0].y}`;
|
|
192
|
+
for (let i = 0; i < numPoints; i++) {
|
|
193
|
+
const p0 = points[(i - 1 + numPoints) % numPoints];
|
|
194
|
+
const p1 = points[i];
|
|
195
|
+
const p2 = points[(i + 1) % numPoints];
|
|
196
|
+
const p3 = points[(i + 2) % numPoints];
|
|
197
|
+
const cp1 = {
|
|
198
|
+
x: p1.x + (p2.x - p0.x) * tension,
|
|
199
|
+
y: p1.y + (p2.y - p0.y) * tension
|
|
200
|
+
};
|
|
201
|
+
const cp2 = {
|
|
202
|
+
x: p2.x - (p3.x - p1.x) * tension,
|
|
203
|
+
y: p2.y - (p3.y - p1.y) * tension
|
|
204
|
+
};
|
|
205
|
+
d += ` C${cp1.x},${cp1.y} ${cp2.x},${cp2.y} ${p2.x},${p2.y}`;
|
|
206
|
+
}
|
|
207
|
+
return `${d} Z`;
|
|
208
|
+
}
|
|
209
|
+
__name(closedRoundCurve, "closedRoundCurve");
|
|
210
|
+
function drawLegend(g, curves, showLegend, config) {
|
|
211
|
+
if (!showLegend) return;
|
|
212
|
+
const legendX = (config.width / 2 + config.marginRight) * 3 / 4;
|
|
213
|
+
const legendY = -(config.height / 2 + config.marginTop) * 3 / 4;
|
|
214
|
+
const lineHeight = 20;
|
|
215
|
+
curves.forEach((curve, index) => {
|
|
216
|
+
const itemGroup = g.append("g").attr("transform", `translate(${legendX}, ${legendY + index * lineHeight})`);
|
|
217
|
+
itemGroup.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${index}`);
|
|
218
|
+
itemGroup.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(curve.label);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
__name(drawLegend, "drawLegend");
|
|
222
|
+
var renderer = { draw };
|
|
223
|
+
var genIndexStyles = /* @__PURE__ */ __name((themeVariables, radarOptions) => {
|
|
224
|
+
let sections = "";
|
|
225
|
+
for (let i = 0; i < themeVariables.THEME_COLOR_LIMIT; i++) {
|
|
226
|
+
const indexColor = themeVariables[`cScale${i}`];
|
|
227
|
+
sections += `
|
|
228
|
+
.radarCurve-${i} {
|
|
229
|
+
color: ${indexColor};
|
|
230
|
+
fill: ${indexColor};
|
|
231
|
+
fill-opacity: ${radarOptions.curveOpacity};
|
|
232
|
+
stroke: ${indexColor};
|
|
233
|
+
stroke-width: ${radarOptions.curveStrokeWidth};
|
|
234
|
+
}
|
|
235
|
+
.radarLegendBox-${i} {
|
|
236
|
+
fill: ${indexColor};
|
|
237
|
+
fill-opacity: ${radarOptions.curveOpacity};
|
|
238
|
+
stroke: ${indexColor};
|
|
239
|
+
}
|
|
240
|
+
`;
|
|
241
|
+
}
|
|
242
|
+
return sections;
|
|
243
|
+
}, "genIndexStyles");
|
|
244
|
+
var buildRadarStyleOptions = /* @__PURE__ */ __name((radar) => {
|
|
245
|
+
const defaultThemeVariables = getThemeVariables3();
|
|
246
|
+
const currentConfig = getConfig();
|
|
247
|
+
const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);
|
|
248
|
+
return {
|
|
249
|
+
themeVariables,
|
|
250
|
+
radarOptions: cleanAndMerge(themeVariables.radar, radar)
|
|
251
|
+
};
|
|
252
|
+
}, "buildRadarStyleOptions");
|
|
253
|
+
var diagram = {
|
|
254
|
+
parser,
|
|
255
|
+
db,
|
|
256
|
+
renderer,
|
|
257
|
+
styles: /* @__PURE__ */ __name(({ radar } = {}) => {
|
|
258
|
+
const { themeVariables, radarOptions } = buildRadarStyleOptions(radar);
|
|
259
|
+
return `
|
|
260
|
+
.radarTitle {
|
|
261
|
+
font-size: ${themeVariables.fontSize};
|
|
262
|
+
color: ${themeVariables.titleColor};
|
|
263
|
+
dominant-baseline: hanging;
|
|
264
|
+
text-anchor: middle;
|
|
265
|
+
}
|
|
266
|
+
.radarAxisLine {
|
|
267
|
+
stroke: ${radarOptions.axisColor};
|
|
268
|
+
stroke-width: ${radarOptions.axisStrokeWidth};
|
|
269
|
+
}
|
|
270
|
+
.radarAxisLabel {
|
|
271
|
+
font-size: ${radarOptions.axisLabelFontSize}px;
|
|
272
|
+
color: ${radarOptions.axisColor};
|
|
273
|
+
}
|
|
274
|
+
.radarGraticule {
|
|
275
|
+
fill: ${radarOptions.graticuleColor};
|
|
276
|
+
fill-opacity: ${radarOptions.graticuleOpacity};
|
|
277
|
+
stroke: ${radarOptions.graticuleColor};
|
|
278
|
+
stroke-width: ${radarOptions.graticuleStrokeWidth};
|
|
279
|
+
}
|
|
280
|
+
.radarLegendText {
|
|
281
|
+
text-anchor: start;
|
|
282
|
+
font-size: ${radarOptions.legendFontSize}px;
|
|
283
|
+
dominant-baseline: hanging;
|
|
284
|
+
}
|
|
285
|
+
${genIndexStyles(themeVariables, radarOptions)}
|
|
286
|
+
`;
|
|
287
|
+
}, "styles")
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
//#endregion
|
|
291
|
+
export { diagram };
|