@webskill/sdk 0.21.0 → 0.23.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/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +1174 -169
- package/dist/{approval-DwN2o2QG.js → approval-7CuZS3Z4.js} +104 -18
- package/dist/arc-8U_6NQWm.js +130 -0
- package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
- package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
- package/dist/array-DQfpQNY8.js +8 -0
- package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
- package/dist/browser.d.ts +455 -49
- package/dist/browser.js +2134 -138
- package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
- package/dist/channel-CZxxLrG7.js +9 -0
- package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
- package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
- package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
- package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
- package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
- package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
- package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
- package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
- package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
- package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
- package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
- package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
- package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
- package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
- package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
- package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
- package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
- package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
- package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
- package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
- package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
- package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
- package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
- package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
- package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
- package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
- package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
- package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
- package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
- package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
- package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
- package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
- package/dist/defaultLocale-B_EoOkSF.js +249 -0
- package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
- package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
- package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
- package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
- package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
- package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
- package/dist/dist-UajCDt3n.js +92 -0
- package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
- package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
- package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
- package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
- package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
- package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
- package/dist/{toolSource-C9oNuKmr.js → geometry-CRhuySKV.js} +169 -12
- package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
- package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
- package/dist/governance.d.ts +22 -4
- package/dist/governance.js +100 -10
- package/dist/graphlib-tk9gQYuN.js +4194 -0
- package/dist/{index-DHopiH_m.d.ts → index-7No55dRb.d.ts} +161 -11
- package/dist/{index-B8Tgmpwh.d.ts → index-ShvCB5I9.d.ts} +2 -2
- package/dist/{index-CYLt5u4L.d.ts → index-V76_OFj2.d.ts} +789 -21
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -9
- package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
- package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
- package/dist/init-CMOIWdg-.js +16 -0
- package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
- package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
- package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
- package/dist/katex-BcRRvyh_.js +26465 -0
- package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
- package/dist/line-LgV8iVMV.js +48 -0
- package/dist/linear-BWKR0Tqd.js +393 -0
- package/dist/linkedDocument-CZZOl9cO.js +456 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
- package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
- package/dist/mermaid.core-DMtwGCHy.js +1756 -0
- package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
- package/dist/node.d.ts +3 -3
- package/dist/node.js +12 -5
- package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
- package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
- package/dist/ordinal-CxA6GHQS.js +84 -0
- package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
- package/dist/path-C27Z2Bjv.js +106 -0
- package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
- package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
- package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
- package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
- package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
- package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
- package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
- package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
- package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
- package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
- package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
- package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
- package/dist/rough.cjs-AmDd_NQk.js +1395 -0
- package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
- package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
- package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
- package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
- package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-S4_HJ_Fl-Cvy9LqVu.d.ts} +35 -4
- package/dist/src-NkhI3UMl.js +2653 -0
- package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
- package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
- package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
- package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
- package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
- package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BiZBXGm4.d.ts} +66 -8
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +3746 -96
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
- package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
- package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
- package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
- package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-D5VMUnrv.js} +2 -2
- package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
- package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
- package/package.json +1 -1
- package/dist/linkedDocument-C0gj1sMq.js +0 -245
|
@@ -22,30 +22,77 @@ const TEXT_EXTENSIONS = [
|
|
|
22
22
|
/** 非文本非图片但仍可整体外发的类型(provider 的 file 分片) @experimental */
|
|
23
23
|
const FILE_MIME_TYPES = ["application/pdf"];
|
|
24
24
|
/**
|
|
25
|
-
* 需要**客户端先抽取成文本**才能外发的类型(FR-23.9 / 0.13.0 FR-12.5)。
|
|
26
|
-
* 不走直通的 `file`:docx / xlsx 发给 provider 会被当成二进制垃圾。
|
|
25
|
+
* 需要**客户端先抽取成文本**才能外发的类型(FR-23.9 / 0.13.0 FR-12.5 / 0.22.0 分册 18)。
|
|
26
|
+
* 不走直通的 `file`:docx / xlsx / pptx 发给 provider 会被当成二进制垃圾。
|
|
27
27
|
*/
|
|
28
28
|
const DOCX_MIME = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
29
29
|
const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
30
|
+
const PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
30
31
|
/** 文本类附件进模型上下文的字符上限(0.6.0) @experimental */
|
|
31
32
|
const ATTACHMENT_TEXT_LIMIT = 32 * 1024;
|
|
33
|
+
/**
|
|
34
|
+
* DWG 图纸的 MIME。没有官方注册值,各家各发一套,浏览器上传时更常见的是空串。
|
|
35
|
+
* @experimental
|
|
36
|
+
*/
|
|
37
|
+
const DWG_MIME_TYPES = [
|
|
38
|
+
"image/vnd.dwg",
|
|
39
|
+
"application/acad",
|
|
40
|
+
"application/x-acad",
|
|
41
|
+
"application/dwg",
|
|
42
|
+
"application/x-dwg",
|
|
43
|
+
"drawing/dwg"
|
|
44
|
+
];
|
|
45
|
+
/**
|
|
46
|
+
* 只存字节、不进上下文的扩展名。仍然是**白名单制**:
|
|
47
|
+
* 新增 `binary` 类别不等于任意二进制放行(AC-19.18)。
|
|
48
|
+
* @experimental
|
|
49
|
+
*/
|
|
50
|
+
const BINARY_EXTENSIONS = ["dwg"];
|
|
32
51
|
const TEXT_EXTENSION_SET = new Set(TEXT_EXTENSIONS);
|
|
33
52
|
const IMAGE_MIME_SET = new Set(IMAGE_MIME_TYPES);
|
|
34
53
|
const FILE_MIME_SET = new Set(FILE_MIME_TYPES);
|
|
35
|
-
const EXTRACTED_MIME_SET = /* @__PURE__ */ new Set([
|
|
36
|
-
|
|
54
|
+
const EXTRACTED_MIME_SET = /* @__PURE__ */ new Set([
|
|
55
|
+
DOCX_MIME,
|
|
56
|
+
XLSX_MIME,
|
|
57
|
+
PPTX_MIME
|
|
58
|
+
]);
|
|
59
|
+
const EXTRACTED_EXTENSION_SET = /* @__PURE__ */ new Set([
|
|
60
|
+
"docx",
|
|
61
|
+
"xlsx",
|
|
62
|
+
"pptx"
|
|
63
|
+
]);
|
|
64
|
+
const BINARY_MIME_SET = new Set(DWG_MIME_TYPES);
|
|
65
|
+
const BINARY_EXTENSION_SET = new Set(BINARY_EXTENSIONS);
|
|
66
|
+
/** 下载与上传都常把认不出的类型标成它,此时只能看扩展名 */
|
|
67
|
+
const OPAQUE_MIME = "application/octet-stream";
|
|
37
68
|
function extensionOf(fileName) {
|
|
38
69
|
return fileName.split(".").pop()?.toLowerCase() ?? "";
|
|
39
70
|
}
|
|
40
|
-
/**
|
|
41
|
-
|
|
71
|
+
/**
|
|
72
|
+
* 三种待抽取格式共用 `document-text` 这一种 kind,选抽取器时要按格式再分一次。
|
|
73
|
+
* 下载列表与上传入口必须得出同一结论(AC-20.17),所以只能在这里一份。
|
|
74
|
+
* @experimental
|
|
75
|
+
*/
|
|
76
|
+
function extractedDocumentFormat(contentType, fileName) {
|
|
77
|
+
const type = contentType.toLowerCase();
|
|
78
|
+
if (type !== "") {
|
|
79
|
+
if (type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") return "xlsx";
|
|
80
|
+
if (type === "application/vnd.openxmlformats-officedocument.presentationml.presentation") return "pptx";
|
|
81
|
+
return "docx";
|
|
82
|
+
}
|
|
83
|
+
const ext = extensionOf(fileName);
|
|
84
|
+
return ext === "xlsx" ? "xlsx" : ext === "pptx" ? "pptx" : "docx";
|
|
85
|
+
}
|
|
86
|
+
/** 分类集中一处,不散落在各 UI 分支里 @experimental */ function classifyAttachment(contentType, fileName) {
|
|
42
87
|
const type = contentType.toLowerCase();
|
|
43
88
|
if (IMAGE_MIME_SET.has(type)) return "image";
|
|
89
|
+
if (BINARY_MIME_SET.has(type)) return "binary";
|
|
44
90
|
if (EXTRACTED_MIME_SET.has(type)) return "document-text";
|
|
45
91
|
if (FILE_MIME_SET.has(type)) return "file";
|
|
46
92
|
if (type.startsWith("text/") || type === "application/json") return "text";
|
|
47
93
|
if (type === "" && TEXT_EXTENSION_SET.has(extensionOf(fileName))) return "text";
|
|
48
94
|
if (type === "" && EXTRACTED_EXTENSION_SET.has(extensionOf(fileName))) return "document-text";
|
|
95
|
+
if ((type === "" || type === OPAQUE_MIME) && BINARY_EXTENSION_SET.has(extensionOf(fileName))) return "binary";
|
|
49
96
|
}
|
|
50
97
|
/**
|
|
51
98
|
* 文本类附件进模型上下文的最终形态。两条入口共用,差别只有出处那一段(0.14.0 D-20-6)。
|
|
@@ -60,4 +107,4 @@ function formatAttachmentText(input) {
|
|
|
60
107
|
}
|
|
61
108
|
|
|
62
109
|
//#endregion
|
|
63
|
-
export {
|
|
110
|
+
export { FILE_MIME_TYPES as a, TEXT_EXTENSIONS as c, extractedDocumentFormat as d, formatAttachmentText as f, DWG_MIME_TYPES as i, XLSX_MIME as l, BINARY_EXTENSIONS as n, IMAGE_MIME_TYPES as o, DOCX_MIME as r, PPTX_MIME as s, ATTACHMENT_TEXT_LIMIT as t, classifyAttachment as u };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { n as constant_default, t as withPath } from "./path-C27Z2Bjv.js";
|
|
2
|
+
import { t as array_default } from "./array-DQfpQNY8.js";
|
|
3
|
+
import { rt as linear_default } from "./chunk-ZIGJFQKS-DqEFBuHR.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/point.js
|
|
6
|
+
function x(p) {
|
|
7
|
+
return p[0];
|
|
8
|
+
}
|
|
9
|
+
function y(p) {
|
|
10
|
+
return p[1];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/line.js
|
|
15
|
+
function line_default(x$1, y$1) {
|
|
16
|
+
var defined = constant_default(true), context = null, curve = linear_default, output = null, path = withPath(line);
|
|
17
|
+
x$1 = typeof x$1 === "function" ? x$1 : x$1 === void 0 ? x : constant_default(x$1);
|
|
18
|
+
y$1 = typeof y$1 === "function" ? y$1 : y$1 === void 0 ? y : constant_default(y$1);
|
|
19
|
+
function line(data) {
|
|
20
|
+
var i, n = (data = array_default(data)).length, d, defined0 = false, buffer;
|
|
21
|
+
if (context == null) output = curve(buffer = path());
|
|
22
|
+
for (i = 0; i <= n; ++i) {
|
|
23
|
+
if (!(i < n && defined(d = data[i], i, data)) === defined0) if (defined0 = !defined0) output.lineStart();
|
|
24
|
+
else output.lineEnd();
|
|
25
|
+
if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data));
|
|
26
|
+
}
|
|
27
|
+
if (buffer) return output = null, buffer + "" || null;
|
|
28
|
+
}
|
|
29
|
+
line.x = function(_) {
|
|
30
|
+
return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant_default(+_), line) : x$1;
|
|
31
|
+
};
|
|
32
|
+
line.y = function(_) {
|
|
33
|
+
return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant_default(+_), line) : y$1;
|
|
34
|
+
};
|
|
35
|
+
line.defined = function(_) {
|
|
36
|
+
return arguments.length ? (defined = typeof _ === "function" ? _ : constant_default(!!_), line) : defined;
|
|
37
|
+
};
|
|
38
|
+
line.curve = function(_) {
|
|
39
|
+
return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
|
|
40
|
+
};
|
|
41
|
+
line.context = function(_) {
|
|
42
|
+
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
|
|
43
|
+
};
|
|
44
|
+
return line;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { line_default as t };
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { l as color, n as number_default, o as constant_default, r as rgb_default, t as string_default } from "./src-NkhI3UMl.js";
|
|
2
|
+
import { i as exponent_default, n as formatPrefix, r as formatSpecifier, t as format } from "./defaultLocale-B_EoOkSF.js";
|
|
3
|
+
import { t as initRange } from "./init-CMOIWdg-.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js
|
|
6
|
+
function ascending(a, b) {
|
|
7
|
+
return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js
|
|
12
|
+
function descending(a, b) {
|
|
13
|
+
return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js
|
|
18
|
+
function bisector(f) {
|
|
19
|
+
let compare1, compare2, delta;
|
|
20
|
+
if (f.length !== 2) {
|
|
21
|
+
compare1 = ascending;
|
|
22
|
+
compare2 = (d, x) => ascending(f(d), x);
|
|
23
|
+
delta = (d, x) => f(d) - x;
|
|
24
|
+
} else {
|
|
25
|
+
compare1 = f === ascending || f === descending ? f : zero;
|
|
26
|
+
compare2 = f;
|
|
27
|
+
delta = f;
|
|
28
|
+
}
|
|
29
|
+
function left(a, x, lo = 0, hi = a.length) {
|
|
30
|
+
if (lo < hi) {
|
|
31
|
+
if (compare1(x, x) !== 0) return hi;
|
|
32
|
+
do {
|
|
33
|
+
const mid = lo + hi >>> 1;
|
|
34
|
+
if (compare2(a[mid], x) < 0) lo = mid + 1;
|
|
35
|
+
else hi = mid;
|
|
36
|
+
} while (lo < hi);
|
|
37
|
+
}
|
|
38
|
+
return lo;
|
|
39
|
+
}
|
|
40
|
+
function right(a, x, lo = 0, hi = a.length) {
|
|
41
|
+
if (lo < hi) {
|
|
42
|
+
if (compare1(x, x) !== 0) return hi;
|
|
43
|
+
do {
|
|
44
|
+
const mid = lo + hi >>> 1;
|
|
45
|
+
if (compare2(a[mid], x) <= 0) lo = mid + 1;
|
|
46
|
+
else hi = mid;
|
|
47
|
+
} while (lo < hi);
|
|
48
|
+
}
|
|
49
|
+
return lo;
|
|
50
|
+
}
|
|
51
|
+
function center(a, x, lo = 0, hi = a.length) {
|
|
52
|
+
const i = left(a, x, lo, hi - 1);
|
|
53
|
+
return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
left,
|
|
57
|
+
center,
|
|
58
|
+
right
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function zero() {
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/number.js
|
|
67
|
+
function number$1(x) {
|
|
68
|
+
return x === null ? NaN : +x;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisect.js
|
|
73
|
+
const ascendingBisect = bisector(ascending);
|
|
74
|
+
const bisectRight = ascendingBisect.right;
|
|
75
|
+
const bisectLeft = ascendingBisect.left;
|
|
76
|
+
const bisectCenter = bisector(number$1).center;
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js
|
|
80
|
+
const e10 = Math.sqrt(50);
|
|
81
|
+
const e5 = Math.sqrt(10);
|
|
82
|
+
const e2 = Math.sqrt(2);
|
|
83
|
+
function tickSpec(start, stop, count) {
|
|
84
|
+
const step = (stop - start) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
|
|
85
|
+
let i1, i2, inc;
|
|
86
|
+
if (power < 0) {
|
|
87
|
+
inc = Math.pow(10, -power) / factor;
|
|
88
|
+
i1 = Math.round(start * inc);
|
|
89
|
+
i2 = Math.round(stop * inc);
|
|
90
|
+
if (i1 / inc < start) ++i1;
|
|
91
|
+
if (i2 / inc > stop) --i2;
|
|
92
|
+
inc = -inc;
|
|
93
|
+
} else {
|
|
94
|
+
inc = Math.pow(10, power) * factor;
|
|
95
|
+
i1 = Math.round(start / inc);
|
|
96
|
+
i2 = Math.round(stop / inc);
|
|
97
|
+
if (i1 * inc < start) ++i1;
|
|
98
|
+
if (i2 * inc > stop) --i2;
|
|
99
|
+
}
|
|
100
|
+
if (i2 < i1 && .5 <= count && count < 2) return tickSpec(start, stop, count * 2);
|
|
101
|
+
return [
|
|
102
|
+
i1,
|
|
103
|
+
i2,
|
|
104
|
+
inc
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
function ticks(start, stop, count) {
|
|
108
|
+
stop = +stop, start = +start, count = +count;
|
|
109
|
+
if (!(count > 0)) return [];
|
|
110
|
+
if (start === stop) return [start];
|
|
111
|
+
const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
|
|
112
|
+
if (!(i2 >= i1)) return [];
|
|
113
|
+
const n = i2 - i1 + 1, ticks = new Array(n);
|
|
114
|
+
if (reverse) if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;
|
|
115
|
+
else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
|
|
116
|
+
else if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;
|
|
117
|
+
else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
|
|
118
|
+
return ticks;
|
|
119
|
+
}
|
|
120
|
+
function tickIncrement(start, stop, count) {
|
|
121
|
+
stop = +stop, start = +start, count = +count;
|
|
122
|
+
return tickSpec(start, stop, count)[2];
|
|
123
|
+
}
|
|
124
|
+
function tickStep(start, stop, count) {
|
|
125
|
+
stop = +stop, start = +start, count = +count;
|
|
126
|
+
const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
|
|
127
|
+
return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js
|
|
132
|
+
function numberArray_default(a, b) {
|
|
133
|
+
if (!b) b = [];
|
|
134
|
+
var n = a ? Math.min(b.length, a.length) : 0, c = b.slice(), i;
|
|
135
|
+
return function(t) {
|
|
136
|
+
for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
|
|
137
|
+
return c;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function isNumberArray(x) {
|
|
141
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js
|
|
146
|
+
function genericArray(a, b) {
|
|
147
|
+
var nb = b ? b.length : 0, na = a ? Math.min(nb, a.length) : 0, x = new Array(na), c = new Array(nb), i;
|
|
148
|
+
for (i = 0; i < na; ++i) x[i] = value_default(a[i], b[i]);
|
|
149
|
+
for (; i < nb; ++i) c[i] = b[i];
|
|
150
|
+
return function(t) {
|
|
151
|
+
for (i = 0; i < na; ++i) c[i] = x[i](t);
|
|
152
|
+
return c;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js
|
|
158
|
+
function date_default(a, b) {
|
|
159
|
+
var d = /* @__PURE__ */ new Date();
|
|
160
|
+
return a = +a, b = +b, function(t) {
|
|
161
|
+
return d.setTime(a * (1 - t) + b * t), d;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js
|
|
167
|
+
function object_default(a, b) {
|
|
168
|
+
var i = {}, c = {}, k;
|
|
169
|
+
if (a === null || typeof a !== "object") a = {};
|
|
170
|
+
if (b === null || typeof b !== "object") b = {};
|
|
171
|
+
for (k in b) if (k in a) i[k] = value_default(a[k], b[k]);
|
|
172
|
+
else c[k] = b[k];
|
|
173
|
+
return function(t) {
|
|
174
|
+
for (k in i) c[k] = i[k](t);
|
|
175
|
+
return c;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js
|
|
181
|
+
function value_default(a, b) {
|
|
182
|
+
var t = typeof b, c;
|
|
183
|
+
return b == null || t === "boolean" ? constant_default(b) : (t === "number" ? number_default : t === "string" ? (c = color(b)) ? (b = c, rgb_default) : string_default : b instanceof color ? rgb_default : b instanceof Date ? date_default : isNumberArray(b) ? numberArray_default : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object_default : number_default)(a, b);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region ../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/round.js
|
|
188
|
+
function round_default(a, b) {
|
|
189
|
+
return a = +a, b = +b, function(t) {
|
|
190
|
+
return Math.round(a * (1 - t) + b * t);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionFixed.js
|
|
196
|
+
function precisionFixed_default(step) {
|
|
197
|
+
return Math.max(0, -exponent_default(Math.abs(step)));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionPrefix.js
|
|
202
|
+
function precisionPrefix_default(step, value) {
|
|
203
|
+
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionRound.js
|
|
208
|
+
function precisionRound_default(step, max) {
|
|
209
|
+
step = Math.abs(step), max = Math.abs(max) - step;
|
|
210
|
+
return Math.max(0, exponent_default(max) - exponent_default(step)) + 1;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js
|
|
215
|
+
function constants(x) {
|
|
216
|
+
return function() {
|
|
217
|
+
return x;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js
|
|
223
|
+
function number(x) {
|
|
224
|
+
return +x;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js
|
|
229
|
+
var unit = [0, 1];
|
|
230
|
+
function identity(x) {
|
|
231
|
+
return x;
|
|
232
|
+
}
|
|
233
|
+
function normalize(a, b) {
|
|
234
|
+
return (b -= a = +a) ? function(x) {
|
|
235
|
+
return (x - a) / b;
|
|
236
|
+
} : constants(isNaN(b) ? NaN : .5);
|
|
237
|
+
}
|
|
238
|
+
function clamper(a, b) {
|
|
239
|
+
var t;
|
|
240
|
+
if (a > b) t = a, a = b, b = t;
|
|
241
|
+
return function(x) {
|
|
242
|
+
return Math.max(a, Math.min(b, x));
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function bimap(domain, range, interpolate) {
|
|
246
|
+
var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
|
|
247
|
+
if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
|
|
248
|
+
else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
|
|
249
|
+
return function(x) {
|
|
250
|
+
return r0(d0(x));
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function polymap(domain, range, interpolate) {
|
|
254
|
+
var j = Math.min(domain.length, range.length) - 1, d = new Array(j), r = new Array(j), i = -1;
|
|
255
|
+
if (domain[j] < domain[0]) {
|
|
256
|
+
domain = domain.slice().reverse();
|
|
257
|
+
range = range.slice().reverse();
|
|
258
|
+
}
|
|
259
|
+
while (++i < j) {
|
|
260
|
+
d[i] = normalize(domain[i], domain[i + 1]);
|
|
261
|
+
r[i] = interpolate(range[i], range[i + 1]);
|
|
262
|
+
}
|
|
263
|
+
return function(x) {
|
|
264
|
+
var i = bisectRight(domain, x, 1, j) - 1;
|
|
265
|
+
return r[i](d[i](x));
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function copy(source, target) {
|
|
269
|
+
return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
|
|
270
|
+
}
|
|
271
|
+
function transformer() {
|
|
272
|
+
var domain = unit, range = unit, interpolate = value_default, transform, untransform, unknown, clamp = identity, piecewise, output, input;
|
|
273
|
+
function rescale() {
|
|
274
|
+
var n = Math.min(domain.length, range.length);
|
|
275
|
+
if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
|
|
276
|
+
piecewise = n > 2 ? polymap : bimap;
|
|
277
|
+
output = input = null;
|
|
278
|
+
return scale;
|
|
279
|
+
}
|
|
280
|
+
function scale(x) {
|
|
281
|
+
return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));
|
|
282
|
+
}
|
|
283
|
+
scale.invert = function(y) {
|
|
284
|
+
return clamp(untransform((input || (input = piecewise(range, domain.map(transform), number_default)))(y)));
|
|
285
|
+
};
|
|
286
|
+
scale.domain = function(_) {
|
|
287
|
+
return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
|
|
288
|
+
};
|
|
289
|
+
scale.range = function(_) {
|
|
290
|
+
return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
|
|
291
|
+
};
|
|
292
|
+
scale.rangeRound = function(_) {
|
|
293
|
+
return range = Array.from(_), interpolate = round_default, rescale();
|
|
294
|
+
};
|
|
295
|
+
scale.clamp = function(_) {
|
|
296
|
+
return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
|
|
297
|
+
};
|
|
298
|
+
scale.interpolate = function(_) {
|
|
299
|
+
return arguments.length ? (interpolate = _, rescale()) : interpolate;
|
|
300
|
+
};
|
|
301
|
+
scale.unknown = function(_) {
|
|
302
|
+
return arguments.length ? (unknown = _, scale) : unknown;
|
|
303
|
+
};
|
|
304
|
+
return function(t, u) {
|
|
305
|
+
transform = t, untransform = u;
|
|
306
|
+
return rescale();
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function continuous() {
|
|
310
|
+
return transformer()(identity, identity);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/tickFormat.js
|
|
315
|
+
function tickFormat(start, stop, count, specifier) {
|
|
316
|
+
var step = tickStep(start, stop, count), precision;
|
|
317
|
+
specifier = formatSpecifier(specifier == null ? ",f" : specifier);
|
|
318
|
+
switch (specifier.type) {
|
|
319
|
+
case "s":
|
|
320
|
+
var value = Math.max(Math.abs(start), Math.abs(stop));
|
|
321
|
+
if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step, value))) specifier.precision = precision;
|
|
322
|
+
return formatPrefix(specifier, value);
|
|
323
|
+
case "":
|
|
324
|
+
case "e":
|
|
325
|
+
case "g":
|
|
326
|
+
case "p":
|
|
327
|
+
case "r":
|
|
328
|
+
if (specifier.precision == null && !isNaN(precision = precisionRound_default(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
|
|
329
|
+
break;
|
|
330
|
+
case "f":
|
|
331
|
+
case "%":
|
|
332
|
+
if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step))) specifier.precision = precision - (specifier.type === "%") * 2;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
return format(specifier);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js
|
|
340
|
+
function linearish(scale) {
|
|
341
|
+
var domain = scale.domain;
|
|
342
|
+
scale.ticks = function(count) {
|
|
343
|
+
var d = domain();
|
|
344
|
+
return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
|
|
345
|
+
};
|
|
346
|
+
scale.tickFormat = function(count, specifier) {
|
|
347
|
+
var d = domain();
|
|
348
|
+
return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
|
|
349
|
+
};
|
|
350
|
+
scale.nice = function(count) {
|
|
351
|
+
if (count == null) count = 10;
|
|
352
|
+
var d = domain();
|
|
353
|
+
var i0 = 0;
|
|
354
|
+
var i1 = d.length - 1;
|
|
355
|
+
var start = d[i0];
|
|
356
|
+
var stop = d[i1];
|
|
357
|
+
var prestep;
|
|
358
|
+
var step;
|
|
359
|
+
var maxIter = 10;
|
|
360
|
+
if (stop < start) {
|
|
361
|
+
step = start, start = stop, stop = step;
|
|
362
|
+
step = i0, i0 = i1, i1 = step;
|
|
363
|
+
}
|
|
364
|
+
while (maxIter-- > 0) {
|
|
365
|
+
step = tickIncrement(start, stop, count);
|
|
366
|
+
if (step === prestep) {
|
|
367
|
+
d[i0] = start;
|
|
368
|
+
d[i1] = stop;
|
|
369
|
+
return domain(d);
|
|
370
|
+
} else if (step > 0) {
|
|
371
|
+
start = Math.floor(start / step) * step;
|
|
372
|
+
stop = Math.ceil(stop / step) * step;
|
|
373
|
+
} else if (step < 0) {
|
|
374
|
+
start = Math.ceil(start * step) / step;
|
|
375
|
+
stop = Math.floor(stop * step) / step;
|
|
376
|
+
} else break;
|
|
377
|
+
prestep = step;
|
|
378
|
+
}
|
|
379
|
+
return scale;
|
|
380
|
+
};
|
|
381
|
+
return scale;
|
|
382
|
+
}
|
|
383
|
+
function linear() {
|
|
384
|
+
var scale = continuous();
|
|
385
|
+
scale.copy = function() {
|
|
386
|
+
return copy(scale, linear());
|
|
387
|
+
};
|
|
388
|
+
initRange.apply(scale, arguments);
|
|
389
|
+
return linearish(scale);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
//#endregion
|
|
393
|
+
export { bisector as a, tickStep as i, continuous as n, copy as r, linear as t };
|