react-kggraph 0.0.9 → 0.0.11
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/lib/index.es6.js +56 -56
- package/lib/style.css +1 -1
- package/package.json +4 -6
package/lib/index.es6.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
1
|
+
import { jsxs as o, Fragment as z, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as Me, useContext as qe, useState as w, useRef as Be, useImperativeHandle as Qe, useEffect as Ze } from "react";
|
|
3
3
|
import { AppstoreOutlined as Ge, TableOutlined as Ke, RobotOutlined as Ue, LineChartOutlined as Xe, SelectOutlined as Ye, SaveOutlined as Re, BorderOuterOutlined as et, LineHeightOutlined as tt, ClearOutlined as nt, PlusCircleOutlined as lt, MinusCircleOutlined as st, PlusSquareOutlined as ot, MinusSquareOutlined as at } from "@ant-design/icons";
|
|
4
4
|
/* empty css */
|
|
@@ -12,7 +12,7 @@ import Ct from "./index.es20.js";
|
|
|
12
12
|
import Nt from "./index.es21.js";
|
|
13
13
|
import ae from "./index.es22.js";
|
|
14
14
|
import { downloadFile as ie } from "./index.es12.js";
|
|
15
|
-
const
|
|
15
|
+
const F = (f, r) => (y) => {
|
|
16
16
|
y.stopPropagation(), f == null || f(r || "");
|
|
17
17
|
}, Wt = Me(({
|
|
18
18
|
graphInfo: f,
|
|
@@ -22,7 +22,7 @@ const z = (f, r) => (y) => {
|
|
|
22
22
|
relationObj: O
|
|
23
23
|
}, de) => {
|
|
24
24
|
var X, Y, R, ee, te, ne, le;
|
|
25
|
-
const { layoutType: he, setLayoutType: ue } = qe(wt), [k, me] = w(""), [ge,
|
|
25
|
+
const { layoutType: he, setLayoutType: ue } = qe(wt), [k, me] = w(""), [ge, _] = w(!1), [H, pe] = w(y), [fe, I] = w(!1), [we, D] = w(!1), [W, be] = w(null), [ye, J] = w(!1), [ve, $] = w(!1), [Ce, Ne] = w("node"), V = Be(null), [M, Se] = w(!0), [q, xe] = w(/* @__PURE__ */ new Set()), [B, ke] = w(/* @__PURE__ */ new Set());
|
|
26
26
|
Qe(de, () => ({
|
|
27
27
|
onPathAnalysis: () => {
|
|
28
28
|
G();
|
|
@@ -114,8 +114,8 @@ const z = (f, r) => (y) => {
|
|
|
114
114
|
属性值: L.value || ""
|
|
115
115
|
};
|
|
116
116
|
}), h = s.map((g) => {
|
|
117
|
-
var p, v,
|
|
118
|
-
const d = g.data || {}, L = ((v = (p = d.source) == null ? void 0 : p.split("/#")[0]) == null ? void 0 : v.split("/").pop()) || d.source, m = ((
|
|
117
|
+
var p, v, S, x;
|
|
118
|
+
const d = g.data || {}, L = ((v = (p = d.source) == null ? void 0 : p.split("/#")[0]) == null ? void 0 : v.split("/").pop()) || d.source, m = ((x = (S = d.target) == null ? void 0 : S.split("/#")[0]) == null ? void 0 : x.split("/").pop()) || d.target;
|
|
119
119
|
return {
|
|
120
120
|
源节点: L,
|
|
121
121
|
目标节点: m,
|
|
@@ -218,9 +218,9 @@ const z = (f, r) => (y) => {
|
|
|
218
218
|
}, Te = () => {
|
|
219
219
|
const e = r.current;
|
|
220
220
|
if (console.log("isShow::::"), ge)
|
|
221
|
-
|
|
221
|
+
_(!1), e.nodes('[types="typed-literal" ]').style("visibility", "visible"), e.edges().style("visibility", "visible");
|
|
222
222
|
else {
|
|
223
|
-
|
|
223
|
+
_(!0);
|
|
224
224
|
const n = e.nodes('[types="typed-literal" ]');
|
|
225
225
|
n.style("visibility", "hidden"), n.connectedEdges().style("visibility", "hidden");
|
|
226
226
|
}
|
|
@@ -231,9 +231,9 @@ const z = (f, r) => (y) => {
|
|
|
231
231
|
pe(l);
|
|
232
232
|
const s = n.nodes();
|
|
233
233
|
s.style("width", (u) => (u.data("baseWidth") || 80) * l), s.style("height", (u) => (u.data("baseHeight") || 80) * l);
|
|
234
|
-
},
|
|
234
|
+
}, Ae = (e) => {
|
|
235
235
|
me(e.content), Q(e.content);
|
|
236
|
-
},
|
|
236
|
+
}, ze = (e = "刘强东", n = "1") => {
|
|
237
237
|
const l = r.current;
|
|
238
238
|
if (!l) return;
|
|
239
239
|
l.elements().removeClass("level-highlight level-selected level-grayed level-highlightedge");
|
|
@@ -247,16 +247,16 @@ const z = (f, r) => (y) => {
|
|
|
247
247
|
m.addClass("level-selected"), h.merge(m);
|
|
248
248
|
let p = l.collection();
|
|
249
249
|
const v = /* @__PURE__ */ new Set();
|
|
250
|
-
v.add(m.id()), u >= 1 && (p = m.neighborhood().nodes(), p.forEach((
|
|
251
|
-
v.add(
|
|
250
|
+
v.add(m.id()), u >= 1 && (p = m.neighborhood().nodes(), p.forEach((S) => {
|
|
251
|
+
v.add(S.id()), h.merge(S);
|
|
252
252
|
}), b.push(p));
|
|
253
|
-
for (let
|
|
254
|
-
const
|
|
253
|
+
for (let S = 2; S <= u; S++) {
|
|
254
|
+
const x = l.collection();
|
|
255
255
|
p.forEach((T) => {
|
|
256
|
-
T.neighborhood().nodes().forEach((
|
|
257
|
-
v.has(
|
|
256
|
+
T.neighborhood().nodes().forEach((A) => {
|
|
257
|
+
v.has(A.id()) || (v.add(A.id()), x.merge(A));
|
|
258
258
|
});
|
|
259
|
-
}),
|
|
259
|
+
}), x.forEach((T) => h.merge(T)), b.push(x), p = x;
|
|
260
260
|
}
|
|
261
261
|
}), b.forEach((m) => {
|
|
262
262
|
m.addClass("level-highlight");
|
|
@@ -266,12 +266,12 @@ const z = (f, r) => (y) => {
|
|
|
266
266
|
}).addClass("level-highlightedge");
|
|
267
267
|
const d = l.elements().filter(".level-selected, .level-highlight, .level-highlightedge");
|
|
268
268
|
l.elements().not(d).addClass("level-grayed"), P.success(`已高亮 "${e}" 及其 ${u} 度关联节点和连线`);
|
|
269
|
-
},
|
|
269
|
+
}, Fe = (e) => {
|
|
270
270
|
const n = r.current;
|
|
271
271
|
if (!n) return;
|
|
272
272
|
const l = new Set(q);
|
|
273
|
-
l.has(e) ? (l.delete(e), n.nodes().filter((s) => s.data("type") === e).show()) : (l.add(e), n.nodes().filter((s) => s.data("type") === e).hide()),
|
|
274
|
-
},
|
|
273
|
+
l.has(e) ? (l.delete(e), n.nodes().filter((s) => s.data("type") === e).show()) : (l.add(e), n.nodes().filter((s) => s.data("type") === e).hide()), xe(l);
|
|
274
|
+
}, _e = (e) => {
|
|
275
275
|
const n = r.current;
|
|
276
276
|
if (!n) return;
|
|
277
277
|
const l = new Set(B);
|
|
@@ -316,11 +316,11 @@ const z = (f, r) => (y) => {
|
|
|
316
316
|
});
|
|
317
317
|
}), P.success("连线配置保存成功"));
|
|
318
318
|
};
|
|
319
|
-
return /* @__PURE__ */ o(
|
|
319
|
+
return /* @__PURE__ */ o(z, { children: [
|
|
320
320
|
/* @__PURE__ */ t("div", { className: "graph-bar", children: /* @__PURE__ */ o("div", { className: "graph-bar-min", children: [
|
|
321
|
-
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
321
|
+
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", onClick: () => Se(!M), children: [
|
|
322
322
|
/* @__PURE__ */ t(Ge, {}),
|
|
323
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
323
|
+
/* @__PURE__ */ t(i, { className: "w-100", justify: "center", children: "查询统计" })
|
|
324
324
|
] }),
|
|
325
325
|
/* @__PURE__ */ t(
|
|
326
326
|
j,
|
|
@@ -330,18 +330,18 @@ const z = (f, r) => (y) => {
|
|
|
330
330
|
...e,
|
|
331
331
|
label: /* @__PURE__ */ t("div", { className: ae({
|
|
332
332
|
"text-[#145afd]": he === e.key
|
|
333
|
-
}), onClick:
|
|
333
|
+
}), onClick: F(Le, e.key), children: e.label })
|
|
334
334
|
}))
|
|
335
335
|
},
|
|
336
|
-
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
336
|
+
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", children: [
|
|
337
337
|
/* @__PURE__ */ t(Ke, {}),
|
|
338
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
338
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "布局" })
|
|
339
339
|
] })
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
342
|
+
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", onClick: () => We(), children: [
|
|
343
343
|
/* @__PURE__ */ t(Ue, {}),
|
|
344
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
344
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "图显示设置" })
|
|
345
345
|
] }),
|
|
346
346
|
/* @__PURE__ */ t(
|
|
347
347
|
j,
|
|
@@ -370,9 +370,9 @@ const z = (f, r) => (y) => {
|
|
|
370
370
|
)
|
|
371
371
|
}))
|
|
372
372
|
},
|
|
373
|
-
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
373
|
+
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", children: [
|
|
374
374
|
/* @__PURE__ */ t(Xe, {}),
|
|
375
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
375
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "分析" })
|
|
376
376
|
] })
|
|
377
377
|
}
|
|
378
378
|
),
|
|
@@ -382,12 +382,12 @@ const z = (f, r) => (y) => {
|
|
|
382
382
|
menu: {
|
|
383
383
|
items: (Y = ut) == null ? void 0 : Y.map((e) => ({
|
|
384
384
|
...e,
|
|
385
|
-
label: /* @__PURE__ */ t("div", { onClick:
|
|
385
|
+
label: /* @__PURE__ */ t("div", { onClick: F(Pe, e.key), children: e.label })
|
|
386
386
|
}))
|
|
387
387
|
},
|
|
388
|
-
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
388
|
+
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", children: [
|
|
389
389
|
/* @__PURE__ */ t(Ye, {}),
|
|
390
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
390
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "选择" })
|
|
391
391
|
] })
|
|
392
392
|
}
|
|
393
393
|
),
|
|
@@ -400,15 +400,15 @@ const z = (f, r) => (y) => {
|
|
|
400
400
|
label: /* @__PURE__ */ t("div", { onClick: (n) => De(n, e.key), children: e.label })
|
|
401
401
|
}))
|
|
402
402
|
},
|
|
403
|
-
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
403
|
+
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", children: [
|
|
404
404
|
/* @__PURE__ */ t(Re, {}),
|
|
405
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
405
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "下载数据" })
|
|
406
406
|
] })
|
|
407
407
|
}
|
|
408
408
|
),
|
|
409
|
-
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
409
|
+
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", onClick: () => Te(), children: [
|
|
410
410
|
/* @__PURE__ */ t(et, {}),
|
|
411
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
411
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "隐藏属性" })
|
|
412
412
|
] }),
|
|
413
413
|
/* @__PURE__ */ t(
|
|
414
414
|
j,
|
|
@@ -416,37 +416,37 @@ const z = (f, r) => (y) => {
|
|
|
416
416
|
menu: {
|
|
417
417
|
items: (ee = ce) == null ? void 0 : ee.map((e) => ({
|
|
418
418
|
...e,
|
|
419
|
-
label: /* @__PURE__ */ t("div", { onClick:
|
|
419
|
+
label: /* @__PURE__ */ t("div", { onClick: F(() => gt(r, e.key), e.key), children: e.label })
|
|
420
420
|
}))
|
|
421
421
|
},
|
|
422
|
-
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
422
|
+
children: /* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", children: [
|
|
423
423
|
/* @__PURE__ */ t(tt, {}),
|
|
424
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
424
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "文字位置" })
|
|
425
425
|
] })
|
|
426
426
|
}
|
|
427
427
|
),
|
|
428
|
-
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
428
|
+
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", onClick: () => He(), children: [
|
|
429
429
|
/* @__PURE__ */ t(nt, {}),
|
|
430
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
430
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "清空画布" })
|
|
431
431
|
] }),
|
|
432
|
-
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
432
|
+
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", children: [
|
|
433
433
|
/* @__PURE__ */ o(i, { gap: "5px", children: [
|
|
434
434
|
/* @__PURE__ */ t(lt, { onClick: () => U("in") }),
|
|
435
435
|
/* @__PURE__ */ t(st, { onClick: () => U("out") })
|
|
436
436
|
] }),
|
|
437
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
437
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "节点缩放" })
|
|
438
438
|
] }),
|
|
439
|
-
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "
|
|
439
|
+
/* @__PURE__ */ o(i, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor", children: [
|
|
440
440
|
/* @__PURE__ */ o(i, { gap: "5px", children: [
|
|
441
441
|
/* @__PURE__ */ t(ot, { onClick: () => Z("in") }),
|
|
442
442
|
/* @__PURE__ */ t(at, { onClick: () => Z("out") })
|
|
443
443
|
] }),
|
|
444
|
-
/* @__PURE__ */ t(i, { className: "w-100
|
|
444
|
+
/* @__PURE__ */ t(i, { className: "w-100 ", justify: "center", children: "画布缩放" })
|
|
445
445
|
] })
|
|
446
446
|
] }) }),
|
|
447
|
-
/* @__PURE__ */ t(vt, { isVisible: fe, searchChange: (e) =>
|
|
447
|
+
/* @__PURE__ */ t(vt, { isVisible: fe, searchChange: (e) => Ae(e), closeQuery: () => I(!1) }),
|
|
448
448
|
/* @__PURE__ */ t(Ct, { isVisible: we, analysis: (e) => pt(r, { pathNodes: e }), closePath: () => D(!1) }),
|
|
449
|
-
/* @__PURE__ */ t(Nt, { ref: V, onLevelClick:
|
|
449
|
+
/* @__PURE__ */ t(Nt, { ref: V, onLevelClick: ze }),
|
|
450
450
|
/* @__PURE__ */ t(
|
|
451
451
|
it,
|
|
452
452
|
{
|
|
@@ -477,19 +477,19 @@ const z = (f, r) => (y) => {
|
|
|
477
477
|
{
|
|
478
478
|
label: "节点设置",
|
|
479
479
|
key: "node",
|
|
480
|
-
children: /* @__PURE__ */ t(
|
|
480
|
+
children: /* @__PURE__ */ t(St, { onSave: Je })
|
|
481
481
|
},
|
|
482
482
|
{
|
|
483
483
|
label: "连线设置",
|
|
484
484
|
key: "edge",
|
|
485
|
-
children: /* @__PURE__ */ t(
|
|
485
|
+
children: /* @__PURE__ */ t(xt, { onSave: $e })
|
|
486
486
|
}
|
|
487
487
|
]
|
|
488
488
|
}
|
|
489
489
|
)
|
|
490
490
|
}
|
|
491
491
|
),
|
|
492
|
-
/* @__PURE__ */ t("div", { className: ae("
|
|
492
|
+
/* @__PURE__ */ t("div", { className: ae("gtaph-statics absolute", {
|
|
493
493
|
hidden: !M
|
|
494
494
|
}), children: /* @__PURE__ */ t(
|
|
495
495
|
se,
|
|
@@ -498,7 +498,7 @@ const z = (f, r) => (y) => {
|
|
|
498
498
|
{
|
|
499
499
|
label: "实体",
|
|
500
500
|
key: "entity",
|
|
501
|
-
children: /* @__PURE__ */ t(
|
|
501
|
+
children: /* @__PURE__ */ t(z, { children: Object.keys(N).length > 0 ? /* @__PURE__ */ o("div", { children: [
|
|
502
502
|
/* @__PURE__ */ o("p", { children: [
|
|
503
503
|
"实体数量:",
|
|
504
504
|
Object.values(N).reduce((e, n) => e + n.count, 0)
|
|
@@ -507,7 +507,7 @@ const z = (f, r) => (y) => {
|
|
|
507
507
|
"实体类型:",
|
|
508
508
|
Object.keys(N).length
|
|
509
509
|
] }),
|
|
510
|
-
/* @__PURE__ */ t(i, { gap: "5px", justify: "start", className: "w-100
|
|
510
|
+
/* @__PURE__ */ t(i, { gap: "5px", justify: "start", className: "w-100", wrap: !0, children: Object.keys(N).map((e) => /* @__PURE__ */ o(i, { gap: "4px", justify: "start", className: `w-100 cursor ${q.has(e) ? "opacity-30" : ""}`, onClick: () => Fe(e), children: [
|
|
511
511
|
/* @__PURE__ */ t("img", { className: "w-20px rounded-50%", src: N[e].img, alt: "" }),
|
|
512
512
|
e,
|
|
513
513
|
":",
|
|
@@ -518,7 +518,7 @@ const z = (f, r) => (y) => {
|
|
|
518
518
|
{
|
|
519
519
|
label: "关系",
|
|
520
520
|
key: "relation",
|
|
521
|
-
children: /* @__PURE__ */ t(
|
|
521
|
+
children: /* @__PURE__ */ t(z, { children: ((te = Object.keys(O)) == null ? void 0 : te.length) > 0 ? /* @__PURE__ */ o("div", { children: [
|
|
522
522
|
/* @__PURE__ */ o("div", { children: [
|
|
523
523
|
"关系数量:",
|
|
524
524
|
(ne = Object.keys(O)) == null ? void 0 : ne.length
|
|
@@ -527,7 +527,7 @@ const z = (f, r) => (y) => {
|
|
|
527
527
|
"关系类型:",
|
|
528
528
|
(le = Object.values(O)) == null ? void 0 : le.reduce((e, n) => e + n, 0)
|
|
529
529
|
] }),
|
|
530
|
-
/* @__PURE__ */ t(i, { gap: "5px", justify: "start", className: "w-100
|
|
530
|
+
/* @__PURE__ */ t(i, { gap: "5px", justify: "start", className: "w-100", wrap: !0, children: Object.keys(O).map((e) => /* @__PURE__ */ o(i, { gap: "4px", className: `w-100 cursor ${B.has(e) ? "opacity-30" : ""}`, onClick: () => _e(e), children: [
|
|
531
531
|
e,
|
|
532
532
|
":",
|
|
533
533
|
O[e]
|
|
@@ -538,7 +538,7 @@ const z = (f, r) => (y) => {
|
|
|
538
538
|
}
|
|
539
539
|
) })
|
|
540
540
|
] });
|
|
541
|
-
}),
|
|
541
|
+
}), St = ({ onSave: f }) => {
|
|
542
542
|
const [r] = c.useForm();
|
|
543
543
|
return /* @__PURE__ */ o(c, { form: r, layout: "vertical", onFinish: f, children: [
|
|
544
544
|
/* @__PURE__ */ t(c.Item, { label: "节点大小", name: "nodeSize", initialValue: 80, children: /* @__PURE__ */ t(C, { type: "number", placeholder: "请输入节点大小" }) }),
|
|
@@ -561,7 +561,7 @@ const z = (f, r) => (y) => {
|
|
|
561
561
|
] }) }),
|
|
562
562
|
/* @__PURE__ */ t(c.Item, { children: /* @__PURE__ */ t(re, { type: "primary", htmlType: "submit", block: !0, children: "保存节点配置" }) })
|
|
563
563
|
] });
|
|
564
|
-
},
|
|
564
|
+
}, xt = ({ onSave: f }) => {
|
|
565
565
|
const [r] = c.useForm(), [y, N] = w("default");
|
|
566
566
|
return /* @__PURE__ */ o(c, { form: r, layout: "vertical", onFinish: f, children: [
|
|
567
567
|
/* @__PURE__ */ t(c.Item, { label: "类型", name: "edgeType", initialValue: "straight", children: /* @__PURE__ */ o(a, { children: [
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cytoscape-container{width:100%;max-width:100%;margin:20px auto}.search-input{padding:8px 12px;width:300px;margin-bottom:10px;border:1px solid #ddd;border-radius:4px}.btn-group{margin-bottom:10px}.btn{padding:8px 16px;margin:0 5px;border:none;border-radius:4px;background:#4285f4;color:#fff;cursor:pointer}.btn:hover{background:#3367d6}.result-text{margin-bottom:10px;color:#333;font-size:14px}.cy-container{width:100%;height:calc(100vh - 180px)}.cy-container :global(.grayed){opacity:.3!important;background-color:#bdbdbd!important;color:#757575!important}.cy-container :global(.highlighted){background-color:#ffeb3b!important;border-color:#fbc02d!important;color:#333!important}.cy-container :global(.selected){border-color:#4caf50!important;background-color:#a5d6a7!important;color:#1b5e20!important}.cy-container .cy-edge:selected{line-color:#ea4335;line-width:3px;line-style:solid}.cy-container .cy-node:hover:not(:selected){background-color:#3367d6}.cy-container .cy-edge:hover:not(:selected){line-color:#757575}.path-nodes-container{margin-bottom:15px}.path-nodes-container h3{margin:10px 0;font-size:16px;color:#333}.node-input-row{display:flex;align-items:center;margin-bottom:8px}.node-input-row span{margin-right:10px;min-width:60px}.node-input-row input{flex:1;margin-right:10px}.remove-node-btn{background:#f44336;padding:6px 12px;font-size:12px}.add-node-btn{background:#4caf50;padding:8px 16px;margin-top:10px}.menuBtn:nth-child(1){transform:rotate(0) skew(31deg)}.menuBtn:nth-child(2){transform:rotate(51deg) skew(31deg)}.menuBtn:nth-child(3){transform:rotate(102deg) skew(31deg)}.menuBtn:nth-child(4){transform:rotate(153deg) skew(31deg)}.menuBtn:nth-child(5){transform:rotate(204deg) skew(31deg)}.menuBtn:nth-child(6){transform:rotate(255deg) skew(31deg)}.menuBtn:nth-child(7){transform:rotate(306deg) skew(35deg)}.menuBtn .menu-item{color:#fff;display:block;width:50px;height:20px;position:absolute;text-align:center;font-size:12px}.menuBtn .menu-item:hover{background:transparent!important}.menuBtn .menu-item{bottom:5px;right:19px;transform:skew(-30deg) translate(-9%) rotate(2deg) translateY(0)}.menuCertent{width:60px;height:60px;display:flex;align-items:center;justify-content:center;position:absolute;top:50%;left:50%;margin-top:-15%;margin-left:-15%;z-index:999;border-radius:50%;color:#fff;text-align:center;font-size:16px;cursor:pointer;border:2px solid #c9cec9}.graph-bar{display:flex;height:60px;background:#fff;box-shadow:0 4px 20px #100dae33;border-radius:6px;align-items:center}.graph-bar .graph-bar-min{display:flex}.graph-bar .graph-bar-menu{position:relative;cursor:pointer;margin:0 10px;white-space:nowrap;display:flex;align-items:center}.graph-bar .graph-bar-menu:hover .grap-menu-dropdown-item{color:#145afd}.graph-bar .grap-menu-dropdown{background:#fff;box-shadow:0 4px 20px #0000003b;border-radius:6px;position:absolute;padding:5px 0;z-index:99;top:60px}.graph-bar .grap-menu-dropdown p{white-space:nowrap;padding:5px 15px}.graph-bar .grap-menu-dropdown p:hover{background:#f5f5f5;color:#145afd}.graph-bar .grap-menu-dropdown-item{display:flex;cursor:pointer;flex-direction:column;align-items:center}.graph-bar .hide{display:none}.graph-bar .show{display:block}.
|
|
1
|
+
.cytoscape-container{width:100%;max-width:100%;margin:20px auto}.search-input{padding:8px 12px;width:300px;margin-bottom:10px;border:1px solid #ddd;border-radius:4px}.btn-group{margin-bottom:10px}.btn{padding:8px 16px;margin:0 5px;border:none;border-radius:4px;background:#4285f4;color:#fff;cursor:pointer}.btn:hover{background:#3367d6}.result-text{margin-bottom:10px;color:#333;font-size:14px}.cy-container{width:100%;height:calc(100vh - 180px)}.cy-container :global(.grayed){opacity:.3!important;background-color:#bdbdbd!important;color:#757575!important}.cy-container :global(.highlighted){background-color:#ffeb3b!important;border-color:#fbc02d!important;color:#333!important}.cy-container :global(.selected){border-color:#4caf50!important;background-color:#a5d6a7!important;color:#1b5e20!important}.cy-container .cy-edge:selected{line-color:#ea4335;line-width:3px;line-style:solid}.cy-container .cy-node:hover:not(:selected){background-color:#3367d6}.cy-container .cy-edge:hover:not(:selected){line-color:#757575}.path-nodes-container{margin-bottom:15px}.path-nodes-container h3{margin:10px 0;font-size:16px;color:#333}.node-input-row{display:flex;align-items:center;margin-bottom:8px}.node-input-row span{margin-right:10px;min-width:60px}.node-input-row input{flex:1;margin-right:10px}.remove-node-btn{background:#f44336;padding:6px 12px;font-size:12px}.add-node-btn{background:#4caf50;padding:8px 16px;margin-top:10px}.menuBtn:nth-child(1){transform:rotate(0) skew(31deg)}.menuBtn:nth-child(2){transform:rotate(51deg) skew(31deg)}.menuBtn:nth-child(3){transform:rotate(102deg) skew(31deg)}.menuBtn:nth-child(4){transform:rotate(153deg) skew(31deg)}.menuBtn:nth-child(5){transform:rotate(204deg) skew(31deg)}.menuBtn:nth-child(6){transform:rotate(255deg) skew(31deg)}.menuBtn:nth-child(7){transform:rotate(306deg) skew(35deg)}.menuBtn .menu-item{color:#fff;display:block;width:50px;height:20px;position:absolute;text-align:center;font-size:12px}.menuBtn .menu-item:hover{background:transparent!important}.menuBtn .menu-item{bottom:5px;right:19px;transform:skew(-30deg) translate(-9%) rotate(2deg) translateY(0)}.menuCertent{width:60px;height:60px;display:flex;align-items:center;justify-content:center;position:absolute;top:50%;left:50%;margin-top:-15%;margin-left:-15%;z-index:999;border-radius:50%;color:#fff;text-align:center;font-size:16px;cursor:pointer;border:2px solid #c9cec9}.graph-bar{display:flex;height:60px;background:#fff;box-shadow:0 4px 20px #100dae33;border-radius:6px;align-items:center}.graph-bar .graph-bar-min{display:flex}.graph-bar .graph-bar-menu{position:relative;cursor:pointer;margin:0 10px;white-space:nowrap;display:flex;align-items:center}.graph-bar .graph-bar-menu:hover .grap-menu-dropdown-item{color:#145afd}.graph-bar .grap-menu-dropdown{background:#fff;box-shadow:0 4px 20px #0000003b;border-radius:6px;position:absolute;padding:5px 0;z-index:99;top:60px}.graph-bar .grap-menu-dropdown p{white-space:nowrap;padding:5px 15px}.graph-bar .grap-menu-dropdown p:hover{background:#f5f5f5;color:#145afd}.graph-bar .grap-menu-dropdown-item{display:flex;cursor:pointer;flex-direction:column;align-items:center}.graph-bar .hide{display:none}.graph-bar .show{display:block}.relaative{position:relative}.absolute{position:absolute}.w-100{width:100%}.gtaph-statics{right:0;z-index:1;background:#fff;padding:10px;border-radius:10px;width:200px;box-shadow:0 4px 20px #0000003b}.hove-active{cursor:pointer;font-size:14px}.hove-active:hover{color:#145afd}.z-10{z-index:10}.hidden{display:none}.query-node{width:300px;position:absolute;background-color:#fff;right:0;top:20px;padding:10px 20px;border-radius:10px}.path-node{width:380px;position:absolute;background-color:#fff;right:0;padding:10px 20px;border-radius:10px;box-shadow:0 4px 20px #0000003b;z-index:10}.path-node .title{display:flex;justify-content:space-between;height:35px;align-items:center;margin-bottom:10px;font-weight:700;font-size:14px}.path-node .search-input{margin-bottom:0;padding-bottom:5px}.path-node .btn-group{display:flex;justify-content:flex-end;margin-top:20px}.path-node .ant-select-suffix{width:10px}.query-node{width:300px;position:absolute;background-color:#fff;right:0;padding:10px 20px;border-radius:10px;box-shadow:0 4px 20px #0000003b}.query-node .title{display:flex;justify-content:space-between;height:35px;align-items:center;margin-bottom:10px;font-weight:700;font-size:14px}.radial-menu{position:relative;display:inline-flex;align-items:center;justify-content:center}.radial-svg{position:absolute;top:0;left:0}.sector-group{cursor:pointer;transition:all .2s ease}.sector-group .sector-path{transition:all .2s ease}.sector-group:hover .sector-path{filter:brightness(1.15) drop-shadow(0 2px 4px rgba(0,0,0,.3))}.sector-label{pointer-events:none;text-shadow:0 1px 3px rgba(0,0,0,.4);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.center-avatar{position:absolute;z-index:10;background:linear-gradient(135deg,#667eea,#764ba2);border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 15px #0000004d;transition:all .3s ease;overflow:hidden;color:#fff;font-weight:500}.center-avatar img{width:100%;height:100%;object-fit:cover}.center-avatar .center-text{font-size:14px;text-align:center}.center-avatar:hover{transform:scale(1.08);box-shadow:0 6px 20px #0006}.center-avatar:active{transform:scale(.95)}
|
package/package.json
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-kggraph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "A knowledge graph visualization component based on Cytoscape",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.es.js",
|
|
7
7
|
"module": "./lib/index.es.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"import": "./lib/index.es.js"
|
|
11
|
-
"style": "./lib/react-kggraph.css"
|
|
10
|
+
"import": "./lib/index.es.js"
|
|
12
11
|
},
|
|
13
|
-
"./
|
|
14
|
-
"./lib/components/Graph/react-kggraph.css": "./lib/react-kggraph.css"
|
|
12
|
+
"./style.css": "./lib/style.css"
|
|
15
13
|
},
|
|
16
14
|
"files": [
|
|
17
15
|
"lib"
|
|
18
16
|
],
|
|
19
|
-
"style": "lib/
|
|
17
|
+
"style": "lib/style.css",
|
|
20
18
|
"keywords": [
|
|
21
19
|
"knowledge-graph",
|
|
22
20
|
"cytoscape",
|