local-operator-ui 0.9.2 → 0.10.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.
Files changed (50) hide show
  1. package/out/main/index.jsc +0 -0
  2. package/out/preload/index.jsc +0 -0
  3. package/out/renderer/assets/_basePickBy-BJo5TtXZ.js +195 -0
  4. package/out/renderer/assets/_baseUniq-DChptfgP.js +835 -0
  5. package/out/renderer/assets/arc-DX1E3h9F.js +131 -0
  6. package/out/renderer/assets/architectureDiagram-IEHRJDOE-mNLa7bzo.js +8653 -0
  7. package/out/renderer/assets/blockDiagram-JOT3LUYC-CFXQFQqH.js +3585 -0
  8. package/out/renderer/assets/c4Diagram-VJAJSXHY-B5VrPZYL.js +2487 -0
  9. package/out/renderer/assets/channel-CoNRRPF4.js +7 -0
  10. package/out/renderer/assets/chunk-4BMEZGHF-rxEBPFA3.js +16 -0
  11. package/out/renderer/assets/chunk-A2AXSNBT-HqweOv4t.js +1827 -0
  12. package/out/renderer/assets/chunk-AEK57VVT-Bi5ch9d5.js +1953 -0
  13. package/out/renderer/assets/chunk-D6G4REZN-B3A-ILe9.js +108 -0
  14. package/out/renderer/assets/chunk-RZ5BOZE2-BVX34Tni.js +34 -0
  15. package/out/renderer/assets/chunk-XZIHB7SX-ywEQj9yW.js +19 -0
  16. package/out/renderer/assets/classDiagram-GIVACNV2-DMn8pk7x.js +21 -0
  17. package/out/renderer/assets/classDiagram-v2-COTLJTTW-DMn8pk7x.js +21 -0
  18. package/out/renderer/assets/clone-za200Y1v.js +8 -0
  19. package/out/renderer/assets/cytoscape.esm-C0AOj4uS.js +30062 -0
  20. package/out/renderer/assets/dagre-OKDRZEBW-D4IEt0nK.js +695 -0
  21. package/out/renderer/assets/diagram-SSKATNLV-CKwTmUPI.js +304 -0
  22. package/out/renderer/assets/diagram-VNBRO52H-B1g8mjNA.js +193 -0
  23. package/out/renderer/assets/erDiagram-Q7BY3M3F-DugxQiOz.js +1160 -0
  24. package/out/renderer/assets/flowDiagram-4HSFHLVR-e25PmCoL.js +2324 -0
  25. package/out/renderer/assets/{fonts-Bx8fKQfu.js → fonts-DrtyYWn4.js} +177 -178
  26. package/out/renderer/assets/ganttDiagram-APWFNJXF-CffOoRih.js +2500 -0
  27. package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-CzBJNIqf.js +1204 -0
  28. package/out/renderer/assets/graph-BM-Fbuwu.js +424 -0
  29. package/out/renderer/assets/{index-DtFlp8rf.js → index-CLDHeUsn.js} +2 -2
  30. package/out/renderer/assets/{index-Cf8ixUbJ.js → index-Dpjcu7Ux.js} +99144 -75522
  31. package/out/renderer/assets/{index-n_d5-ePx.js → index-Dzn44e_b.js} +2 -2
  32. package/out/renderer/assets/infoDiagram-PH2N3AL5-DsUIwRuF.js +33 -0
  33. package/out/renderer/assets/{installer-Cn81GyOR.js → installer-JGj_vW61.js} +1 -1
  34. package/out/renderer/assets/journeyDiagram-U35MCT3I-CGwuYi5x.js +1199 -0
  35. package/out/renderer/assets/kanban-definition-NDS4AKOZ-DZEB2jhI.js +1046 -0
  36. package/out/renderer/assets/layout-DgKkvpjr.js +2060 -0
  37. package/out/renderer/assets/mindmap-definition-ALO5MXBD-B9Qyvo51.js +5836 -0
  38. package/out/renderer/assets/pieDiagram-IB7DONF6-CWVIIzbP.js +239 -0
  39. package/out/renderer/assets/quadrantDiagram-7GDLP6J5-DXuKt2Bl.js +1340 -0
  40. package/out/renderer/assets/radar-MK3ICKWK-5vdES7mG.js +16935 -0
  41. package/out/renderer/assets/requirementDiagram-KVF5MWMF-CAqaeybl.js +1163 -0
  42. package/out/renderer/assets/sankeyDiagram-QLVOVGJD-Cg0cLJAO.js +1201 -0
  43. package/out/renderer/assets/sequenceDiagram-X6HHIX6F-BxenFsrt.js +3415 -0
  44. package/out/renderer/assets/stateDiagram-DGXRK772-CobhNycm.js +467 -0
  45. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-D7nd37b5.js +21 -0
  46. package/out/renderer/assets/timeline-definition-BDJGKUSR-Dj0FLvqa.js +1223 -0
  47. package/out/renderer/assets/xychartDiagram-VJFVF3MP-DuyOBFpM.js +1800 -0
  48. package/out/renderer/index.html +4 -4
  49. package/out/renderer/installer.html +2 -2
  50. package/package.json +2 -1
@@ -0,0 +1,239 @@
1
+ import { p as populateCommonDb } from "./chunk-4BMEZGHF-rxEBPFA3.js";
2
+ import { V as constant, P as tau, b0 as array, _ as __name, g as getAccDescription, s as setAccDescription, a as getAccTitle, b as setAccTitle, t as getDiagramTitle, q as setDiagramTitle, l as log, c as getConfig2$1, F as cleanAndMerge, K as selectSvgElement, a8 as parseFontSize, b1 as ordinal, e as configureSvgSize, z as clear, H as defaultConfig_default } from "./index-Dpjcu7Ux.js";
3
+ import { p as parse } from "./radar-MK3ICKWK-5vdES7mG.js";
4
+ import { d as d3arc } from "./arc-DX1E3h9F.js";
5
+ import "./fonts-DrtyYWn4.js";
6
+ import "./_baseUniq-DChptfgP.js";
7
+ import "./_basePickBy-BJo5TtXZ.js";
8
+ import "./clone-za200Y1v.js";
9
+ function descending(a, b) {
10
+ return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
11
+ }
12
+ function identity(d) {
13
+ return d;
14
+ }
15
+ function d3pie() {
16
+ var value = identity, sortValues = descending, sort = null, startAngle = constant(0), endAngle = constant(tau), padAngle = constant(0);
17
+ function pie(data) {
18
+ var i, n = (data = array(data)).length, j, k, sum = 0, index = new Array(n), arcs = new Array(n), a0 = +startAngle.apply(this, arguments), da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)), a1, p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), pa = p * (da < 0 ? -1 : 1), v;
19
+ for (i = 0; i < n; ++i) {
20
+ if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
21
+ sum += v;
22
+ }
23
+ }
24
+ if (sortValues != null) index.sort(function(i2, j2) {
25
+ return sortValues(arcs[i2], arcs[j2]);
26
+ });
27
+ else if (sort != null) index.sort(function(i2, j2) {
28
+ return sort(data[i2], data[j2]);
29
+ });
30
+ for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {
31
+ j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {
32
+ data: data[j],
33
+ index: i,
34
+ value: v,
35
+ startAngle: a0,
36
+ endAngle: a1,
37
+ padAngle: p
38
+ };
39
+ }
40
+ return arcs;
41
+ }
42
+ pie.value = function(_) {
43
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value;
44
+ };
45
+ pie.sortValues = function(_) {
46
+ return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
47
+ };
48
+ pie.sort = function(_) {
49
+ return arguments.length ? (sort = _, sortValues = null, pie) : sort;
50
+ };
51
+ pie.startAngle = function(_) {
52
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle;
53
+ };
54
+ pie.endAngle = function(_) {
55
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle;
56
+ };
57
+ pie.padAngle = function(_) {
58
+ return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle;
59
+ };
60
+ return pie;
61
+ }
62
+ var DEFAULT_PIE_CONFIG = defaultConfig_default.pie;
63
+ var DEFAULT_PIE_DB = {
64
+ sections: /* @__PURE__ */ new Map(),
65
+ showData: false
66
+ };
67
+ var sections = DEFAULT_PIE_DB.sections;
68
+ var showData = DEFAULT_PIE_DB.showData;
69
+ var config = structuredClone(DEFAULT_PIE_CONFIG);
70
+ var getConfig2 = /* @__PURE__ */ __name(() => structuredClone(config), "getConfig");
71
+ var clear2 = /* @__PURE__ */ __name(() => {
72
+ sections = /* @__PURE__ */ new Map();
73
+ showData = DEFAULT_PIE_DB.showData;
74
+ clear();
75
+ }, "clear");
76
+ var addSection = /* @__PURE__ */ __name(({ label, value }) => {
77
+ if (!sections.has(label)) {
78
+ sections.set(label, value);
79
+ log.debug(`added new section: ${label}, with value: ${value}`);
80
+ }
81
+ }, "addSection");
82
+ var getSections = /* @__PURE__ */ __name(() => sections, "getSections");
83
+ var setShowData = /* @__PURE__ */ __name((toggle) => {
84
+ showData = toggle;
85
+ }, "setShowData");
86
+ var getShowData = /* @__PURE__ */ __name(() => showData, "getShowData");
87
+ var db = {
88
+ getConfig: getConfig2,
89
+ clear: clear2,
90
+ setDiagramTitle,
91
+ getDiagramTitle,
92
+ setAccTitle,
93
+ getAccTitle,
94
+ setAccDescription,
95
+ getAccDescription,
96
+ addSection,
97
+ getSections,
98
+ setShowData,
99
+ getShowData
100
+ };
101
+ var populateDb = /* @__PURE__ */ __name((ast, db2) => {
102
+ populateCommonDb(ast, db2);
103
+ db2.setShowData(ast.showData);
104
+ ast.sections.map(db2.addSection);
105
+ }, "populateDb");
106
+ var parser = {
107
+ parse: /* @__PURE__ */ __name(async (input) => {
108
+ const ast = await parse("pie", input);
109
+ log.debug(ast);
110
+ populateDb(ast, db);
111
+ }, "parse")
112
+ };
113
+ var getStyles = /* @__PURE__ */ __name((options) => `
114
+ .pieCircle{
115
+ stroke: ${options.pieStrokeColor};
116
+ stroke-width : ${options.pieStrokeWidth};
117
+ opacity : ${options.pieOpacity};
118
+ }
119
+ .pieOuterCircle{
120
+ stroke: ${options.pieOuterStrokeColor};
121
+ stroke-width: ${options.pieOuterStrokeWidth};
122
+ fill: none;
123
+ }
124
+ .pieTitleText {
125
+ text-anchor: middle;
126
+ font-size: ${options.pieTitleTextSize};
127
+ fill: ${options.pieTitleTextColor};
128
+ font-family: ${options.fontFamily};
129
+ }
130
+ .slice {
131
+ font-family: ${options.fontFamily};
132
+ fill: ${options.pieSectionTextColor};
133
+ font-size:${options.pieSectionTextSize};
134
+ // fill: white;
135
+ }
136
+ .legend text {
137
+ fill: ${options.pieLegendTextColor};
138
+ font-family: ${options.fontFamily};
139
+ font-size: ${options.pieLegendTextSize};
140
+ }
141
+ `, "getStyles");
142
+ var pieStyles_default = getStyles;
143
+ var createPieArcs = /* @__PURE__ */ __name((sections2) => {
144
+ const pieData = [...sections2.entries()].map((element) => {
145
+ return {
146
+ label: element[0],
147
+ value: element[1]
148
+ };
149
+ }).sort((a, b) => {
150
+ return b.value - a.value;
151
+ });
152
+ const pie = d3pie().value(
153
+ (d3Section) => d3Section.value
154
+ );
155
+ return pie(pieData);
156
+ }, "createPieArcs");
157
+ var draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {
158
+ log.debug("rendering pie chart\n" + text);
159
+ const db2 = diagObj.db;
160
+ const globalConfig = getConfig2$1();
161
+ const pieConfig = cleanAndMerge(db2.getConfig(), globalConfig.pie);
162
+ const MARGIN = 40;
163
+ const LEGEND_RECT_SIZE = 18;
164
+ const LEGEND_SPACING = 4;
165
+ const height = 450;
166
+ const pieWidth = height;
167
+ const svg = selectSvgElement(id);
168
+ const group = svg.append("g");
169
+ group.attr("transform", "translate(" + pieWidth / 2 + "," + height / 2 + ")");
170
+ const { themeVariables } = globalConfig;
171
+ let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth);
172
+ outerStrokeWidth ??= 2;
173
+ const textPosition = pieConfig.textPosition;
174
+ const radius = Math.min(pieWidth, height) / 2 - MARGIN;
175
+ const arcGenerator = d3arc().innerRadius(0).outerRadius(radius);
176
+ const labelArcGenerator = d3arc().innerRadius(radius * textPosition).outerRadius(radius * textPosition);
177
+ group.append("circle").attr("cx", 0).attr("cy", 0).attr("r", radius + outerStrokeWidth / 2).attr("class", "pieOuterCircle");
178
+ const sections2 = db2.getSections();
179
+ const arcs = createPieArcs(sections2);
180
+ const myGeneratedColors = [
181
+ themeVariables.pie1,
182
+ themeVariables.pie2,
183
+ themeVariables.pie3,
184
+ themeVariables.pie4,
185
+ themeVariables.pie5,
186
+ themeVariables.pie6,
187
+ themeVariables.pie7,
188
+ themeVariables.pie8,
189
+ themeVariables.pie9,
190
+ themeVariables.pie10,
191
+ themeVariables.pie11,
192
+ themeVariables.pie12
193
+ ];
194
+ const color = ordinal(myGeneratedColors);
195
+ group.selectAll("mySlices").data(arcs).enter().append("path").attr("d", arcGenerator).attr("fill", (datum) => {
196
+ return color(datum.data.label);
197
+ }).attr("class", "pieCircle");
198
+ let sum = 0;
199
+ sections2.forEach((section) => {
200
+ sum += section;
201
+ });
202
+ group.selectAll("mySlices").data(arcs).enter().append("text").text((datum) => {
203
+ return (datum.data.value / sum * 100).toFixed(0) + "%";
204
+ }).attr("transform", (datum) => {
205
+ return "translate(" + labelArcGenerator.centroid(datum) + ")";
206
+ }).style("text-anchor", "middle").attr("class", "slice");
207
+ group.append("text").text(db2.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText");
208
+ const legend = group.selectAll(".legend").data(color.domain()).enter().append("g").attr("class", "legend").attr("transform", (_datum, index) => {
209
+ const height2 = LEGEND_RECT_SIZE + LEGEND_SPACING;
210
+ const offset = height2 * color.domain().length / 2;
211
+ const horizontal = 12 * LEGEND_RECT_SIZE;
212
+ const vertical = index * height2 - offset;
213
+ return "translate(" + horizontal + "," + vertical + ")";
214
+ });
215
+ legend.append("rect").attr("width", LEGEND_RECT_SIZE).attr("height", LEGEND_RECT_SIZE).style("fill", color).style("stroke", color);
216
+ legend.data(arcs).append("text").attr("x", LEGEND_RECT_SIZE + LEGEND_SPACING).attr("y", LEGEND_RECT_SIZE - LEGEND_SPACING).text((datum) => {
217
+ const { label, value } = datum.data;
218
+ if (db2.getShowData()) {
219
+ return `${label} [${value}]`;
220
+ }
221
+ return label;
222
+ });
223
+ const longestTextWidth = Math.max(
224
+ ...legend.selectAll("text").nodes().map((node) => node?.getBoundingClientRect().width ?? 0)
225
+ );
226
+ const totalWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;
227
+ svg.attr("viewBox", `0 0 ${totalWidth} ${height}`);
228
+ configureSvgSize(svg, height, totalWidth, pieConfig.useMaxWidth);
229
+ }, "draw");
230
+ var renderer = { draw };
231
+ var diagram = {
232
+ parser,
233
+ db,
234
+ renderer,
235
+ styles: pieStyles_default
236
+ };
237
+ export {
238
+ diagram
239
+ };