@vunk/graph 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/api/index.d.ts +0 -0
  2. package/api/index.mjs +1 -0
  3. package/api/user/index.d.ts +3 -0
  4. package/api/user/index.mjs +18 -0
  5. package/api/user/types.d.ts +5 -0
  6. package/components/_plugin-vue_export-helper.mjs +9 -0
  7. package/components/context-menu/index.css +1 -0
  8. package/components/context-menu/index.d.ts +2 -0
  9. package/components/context-menu/index.mjs +1797 -0
  10. package/components/graph/index.css +5 -0
  11. package/components/graph/index.d.ts +6 -0
  12. package/components/graph/index.mjs +110 -0
  13. package/components/graph/src/ctx.d.ts +12 -0
  14. package/components/graph/src/index.vue.d.ts +74 -0
  15. package/components/graph/src/types.d.ts +7 -0
  16. package/components/graph/src/useGraph.d.ts +3 -0
  17. package/components/graph/src/useSigma.d.ts +3 -0
  18. package/components/graph-view-ui/index.css +8 -0
  19. package/components/graph-view-ui/index.d.ts +4 -0
  20. package/components/graph-view-ui/index.mjs +81 -0
  21. package/components/graph-view-ui/src/ctx.d.ts +11 -0
  22. package/components/graph-view-ui/src/index.vue.d.ts +17 -0
  23. package/components/graph-view-ui/src/types.d.ts +1 -0
  24. package/components/hover-edge/index.d.ts +4 -0
  25. package/components/hover-edge/index.mjs +179 -0
  26. package/components/hover-edge/src/ctx.d.ts +42 -0
  27. package/components/hover-edge/src/index.vue.d.ts +194 -0
  28. package/components/hover-edge/src/types.d.ts +4 -0
  29. package/components/hover-highlight/index.d.ts +4 -0
  30. package/components/hover-highlight/index.mjs +133 -0
  31. package/components/hover-highlight/src/ctx.d.ts +33 -0
  32. package/components/hover-highlight/src/index.vue.d.ts +45 -0
  33. package/components/hover-highlight/src/types.d.ts +1 -0
  34. package/components/hover-node/index.d.ts +4 -0
  35. package/components/hover-node/index.mjs +146 -0
  36. package/components/hover-node/src/ctx.d.ts +35 -0
  37. package/components/hover-node/src/index.vue.d.ts +148 -0
  38. package/components/hover-node/src/types.d.ts +4 -0
  39. package/components/label/index.css +30 -0
  40. package/components/label/index.d.ts +6 -0
  41. package/components/label/index.mjs +145 -0
  42. package/components/label/src/core.d.ts +5 -0
  43. package/components/label/src/ctx.d.ts +24 -0
  44. package/components/label/src/index.vue.d.ts +33 -0
  45. package/components/label/src/types.d.ts +1 -0
  46. package/components/label/src/view.vue.d.ts +28 -0
  47. package/components/layout-forceatlas2/index.d.ts +5 -0
  48. package/components/layout-forceatlas2/index.mjs +1617 -0
  49. package/components/layout-forceatlas2/src/ctx.d.ts +9 -0
  50. package/components/layout-forceatlas2/src/index.vue.d.ts +14 -0
  51. package/components/layout-forceatlas2/src/types.d.ts +1 -0
  52. package/components/layout-forceatlas2/src/use.d.ts +16 -0
  53. package/components/link-guide/index.css +9 -0
  54. package/components/link-guide/index.d.ts +4 -0
  55. package/components/link-guide/index.mjs +118 -0
  56. package/components/link-guide/src/ctx.d.ts +11 -0
  57. package/components/link-guide/src/index.vue.d.ts +27 -0
  58. package/components/link-guide/src/types.d.ts +1 -0
  59. package/components/popup/index.css +32 -0
  60. package/components/popup/index.d.ts +5 -0
  61. package/components/popup/index.mjs +136 -0
  62. package/components/popup/src/core.d.ts +24 -0
  63. package/components/popup/src/ctx.d.ts +16 -0
  64. package/components/popup/src/index.vue.d.ts +73 -0
  65. package/components/popup/src/provider.vue.d.ts +46 -0
  66. package/components/popup/src/types.d.ts +1 -0
  67. package/components/search/index.d.ts +4 -0
  68. package/components/search/index.mjs +218 -0
  69. package/components/search/src/ctx.d.ts +53 -0
  70. package/components/search/src/index.vue.d.ts +83 -0
  71. package/components/search/src/types.d.ts +16 -0
  72. package/composables/index.d.ts +1 -0
  73. package/composables/index.mjs +1 -0
  74. package/index.css +90 -0
  75. package/index.d.ts +10 -0
  76. package/index.esm.js +10 -0
  77. package/package.json +108 -0
  78. package/shared/graph/index.d.ts +17 -0
  79. package/shared/graph/index.mjs +19 -0
  80. package/shared/index.d.ts +0 -0
  81. package/shared/index.mjs +1 -0
  82. package/stores/index.d.ts +0 -0
  83. package/stores/index.mjs +1 -0
@@ -0,0 +1,148 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ contextMenu: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ modelValue: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ leaveDelay: {
11
+ type: NumberConstructor;
12
+ default: number;
13
+ };
14
+ enterDelay: {
15
+ type: NumberConstructor;
16
+ default: number;
17
+ };
18
+ }>, {
19
+ changeContextmenuShow: (show: boolean) => void;
20
+ contextmenuState: {
21
+ node: string;
22
+ show: boolean;
23
+ options: {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ };
28
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
29
+ 'update:modelValue': null;
30
+ rightClick: (e: import("./types").RightClickEvent) => import("./types").RightClickEvent;
31
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
+ contextMenu: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ modelValue: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ leaveDelay: {
41
+ type: NumberConstructor;
42
+ default: number;
43
+ };
44
+ enterDelay: {
45
+ type: NumberConstructor;
46
+ default: number;
47
+ };
48
+ }>> & Readonly<{
49
+ onRightClick?: ((e: import("./types").RightClickEvent) => any) | undefined;
50
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
51
+ }>, {
52
+ contextMenu: boolean;
53
+ modelValue: string;
54
+ leaveDelay: number;
55
+ enterDelay: number;
56
+ }, {}, {
57
+ ContextMenu: {
58
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
59
+ options: {
60
+ type: import("vue").PropType<import("@vunk/graph/components/context-menu").MenuOptions>;
61
+ default: null;
62
+ };
63
+ show: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
67
+ }>> & {
68
+ onClose?: ((...args: any[]) => any) | undefined;
69
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
70
+ }, {
71
+ closeMenu: () => void;
72
+ isClosed: () => boolean;
73
+ getMenuRef: () => import("@vunk/graph/components/context-menu").ContextSubMenuInstance | undefined;
74
+ getMenuDimensions: () => {
75
+ width: number;
76
+ height: number;
77
+ };
78
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
79
+ close: (...args: any[]) => void;
80
+ "update:show": (...args: any[]) => void;
81
+ }, import("vue").PublicProps, {
82
+ options: import("@vunk/graph/components/context-menu").MenuOptions;
83
+ show: boolean;
84
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
85
+ P: {};
86
+ B: {};
87
+ D: {};
88
+ C: {};
89
+ M: {};
90
+ Defaults: {};
91
+ }, Readonly<import("vue").ExtractPropTypes<{
92
+ options: {
93
+ type: import("vue").PropType<import("@vunk/graph/components/context-menu").MenuOptions>;
94
+ default: null;
95
+ };
96
+ show: {
97
+ type: BooleanConstructor;
98
+ default: boolean;
99
+ };
100
+ }>> & {
101
+ onClose?: ((...args: any[]) => any) | undefined;
102
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
103
+ }, {
104
+ closeMenu: () => void;
105
+ isClosed: () => boolean;
106
+ getMenuRef: () => import("@vunk/graph/components/context-menu").ContextSubMenuInstance | undefined;
107
+ getMenuDimensions: () => {
108
+ width: number;
109
+ height: number;
110
+ };
111
+ }, {}, {}, {}, {
112
+ options: import("@vunk/graph/components/context-menu").MenuOptions;
113
+ show: boolean;
114
+ }>;
115
+ __isFragment?: never;
116
+ __isTeleport?: never;
117
+ __isSuspense?: never;
118
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
119
+ options: {
120
+ type: import("vue").PropType<import("@vunk/graph/components/context-menu").MenuOptions>;
121
+ default: null;
122
+ };
123
+ show: {
124
+ type: BooleanConstructor;
125
+ default: boolean;
126
+ };
127
+ }>> & {
128
+ onClose?: ((...args: any[]) => any) | undefined;
129
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
130
+ }, {
131
+ closeMenu: () => void;
132
+ isClosed: () => boolean;
133
+ getMenuRef: () => import("@vunk/graph/components/context-menu").ContextSubMenuInstance | undefined;
134
+ getMenuDimensions: () => {
135
+ width: number;
136
+ height: number;
137
+ };
138
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
139
+ close: (...args: any[]) => void;
140
+ "update:show": (...args: any[]) => void;
141
+ }, string, {
142
+ options: import("@vunk/graph/components/context-menu").MenuOptions;
143
+ show: boolean;
144
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
145
+ $slots: Partial<Record<number, (_: any) => any>>;
146
+ });
147
+ }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
148
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export interface RightClickEvent {
2
+ node: string;
3
+ original: MouseEvent;
4
+ }
@@ -0,0 +1,30 @@
1
+ .vkg-label-list {
2
+ list-style: none;
3
+ padding: 0;
4
+ margin: 0;
5
+ }
6
+ .vkg-label-item{
7
+ display: flex;
8
+ align-items: center;
9
+ cursor: pointer;
10
+ padding: 4px 0;
11
+ transition: opacity 0.2s;
12
+ }
13
+ .vkg-label-item:hover {
14
+ opacity: 0.8;
15
+ }
16
+ .vkg-label-item.is-hidden {
17
+ opacity: 0.4;
18
+ }
19
+ .vkg-label-dot {
20
+ display: inline-block;
21
+ width: 12px;
22
+ height: 12px;
23
+ border-radius: 50%;
24
+ margin-right: 0.8em;
25
+ flex-shrink: 0;
26
+ }
27
+ .vkg-label-text {
28
+ font-size: 14px;
29
+ user-select: none;
30
+ }
@@ -0,0 +1,6 @@
1
+ import VkLabel from './src/index.vue';
2
+ import VkLabelView from './src/view.vue';
3
+ export { SegmentRenderer as VkLabelProvider } from './src/core';
4
+ export * as __VkLabel from './src/types';
5
+ export { VkLabel, VkLabelView, };
6
+ export default VkLabel;
@@ -0,0 +1,145 @@
1
+ import { defineComponent, resolveComponent, createBlock, openBlock, ref, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, mergeProps, createCommentVNode, normalizeStyle, toDisplayString } from 'vue';
2
+ import { createSegmentRenderer } from '@vunk/core/components/segment-renderer';
3
+ import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
4
+ import { useGraph } from '@vunk/graph/components/graph';
5
+
6
+ const {
7
+ Segment,
8
+ SegmentRenderer,
9
+ SegmentView,
10
+ useSegmentRendererContext
11
+ } = createSegmentRenderer("vunk-graph-label");
12
+
13
+ const props = {
14
+ /**
15
+ * 标签的值,通常对应节点数据中的某个字段值
16
+ */
17
+ value: {
18
+ type: String,
19
+ required: true
20
+ },
21
+ /**
22
+ * 标签显示的文本
23
+ */
24
+ label: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ /**
29
+ * 标签的颜色
30
+ */
31
+ color: {
32
+ type: String,
33
+ default: "skyblue"
34
+ }
35
+ };
36
+ const emits = {};
37
+
38
+ var _sfc_main$1 = defineComponent({
39
+ name: "VkLabel",
40
+ components: {
41
+ Segment
42
+ },
43
+ props,
44
+ emits
45
+ });
46
+
47
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
48
+ const _component_Segment = resolveComponent("Segment");
49
+ return openBlock(), createBlock(_component_Segment, {
50
+ value: _ctx.value,
51
+ label: _ctx.label,
52
+ color: _ctx.color
53
+ }, null, 8, ["value", "label", "color"]);
54
+ }
55
+ var VkLabel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
56
+
57
+ const _hoisted_1 = { class: "vkg-label-list" };
58
+ const _hoisted_2 = ["onClick"];
59
+ const _hoisted_3 = { class: "vkg-label-text" };
60
+ var _sfc_main = /* @__PURE__ */ defineComponent({
61
+ __name: "view",
62
+ props: {
63
+ filterKey: {
64
+ type: String,
65
+ default: ""
66
+ }
67
+ },
68
+ setup(__props) {
69
+ const props = __props;
70
+ const graph = useGraph();
71
+ const hiddenValues = ref([]);
72
+ function updateGraph() {
73
+ if (!props.filterKey)
74
+ return;
75
+ graph.forEachNode((node, attrs) => {
76
+ const nodeValue = attrs[props.filterKey];
77
+ if (nodeValue !== void 0) {
78
+ graph.setNodeAttribute(node, "hidden", hiddenValues.value.includes(nodeValue));
79
+ }
80
+ });
81
+ }
82
+ function toggleItem(value) {
83
+ if (!props.filterKey)
84
+ return;
85
+ const index = hiddenValues.value.indexOf(value);
86
+ if (index > -1) {
87
+ hiddenValues.value.splice(index, 1);
88
+ } else {
89
+ hiddenValues.value.push(value);
90
+ }
91
+ updateGraph();
92
+ }
93
+ return (_ctx, _cache) => {
94
+ return openBlock(), createBlock(unref(SegmentView), null, {
95
+ default: withCtx(({ items, attrs }) => [
96
+ createElementVNode("ul", _hoisted_1, [
97
+ (openBlock(true), createElementBlock(
98
+ Fragment,
99
+ null,
100
+ renderList(items, (item, index) => {
101
+ return openBlock(), createElementBlock("li", mergeProps({ key: index }, { ref_for: true }, attrs, {
102
+ class: ["vkg-label-item", { "is-hidden": hiddenValues.value.includes(item.attrs.value) }],
103
+ onClick: ($event) => toggleItem(item.attrs.value)
104
+ }), [
105
+ createCommentVNode(" \u5C0F\u5706\u70B9 "),
106
+ createElementVNode(
107
+ "span",
108
+ {
109
+ class: "vkg-label-dot",
110
+ style: normalizeStyle({ backgroundColor: item.attrs.color })
111
+ },
112
+ null,
113
+ 4
114
+ /* STYLE */
115
+ ),
116
+ createElementVNode(
117
+ "span",
118
+ _hoisted_3,
119
+ toDisplayString(item.attrs.label),
120
+ 1
121
+ /* TEXT */
122
+ )
123
+ ], 16, _hoisted_2);
124
+ }),
125
+ 128
126
+ /* KEYED_FRAGMENT */
127
+ ))
128
+ ])
129
+ ]),
130
+ _: 1
131
+ /* STABLE */
132
+ });
133
+ };
134
+ }
135
+ });
136
+
137
+ var types = /*#__PURE__*/Object.freeze({
138
+ __proto__: null
139
+ });
140
+
141
+ VkLabel.install = (app) => {
142
+ app.component(VkLabel.name || "VkLabel", VkLabel);
143
+ };
144
+
145
+ export { VkLabel, SegmentRenderer as VkLabelProvider, _sfc_main as VkLabelView, types as __VkLabel, VkLabel as default };
@@ -0,0 +1,5 @@
1
+ export declare const Segment: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, SegmentRenderer: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
2
+ [key: string]: any;
3
+ }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, SegmentView: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
4
+ [key: string]: any;
5
+ }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, useSegmentRendererContext: () => import("@vunk/core/components/segment-renderer/src/types").SegmentRendererContext;
@@ -0,0 +1,24 @@
1
+ export declare const props: {
2
+ /**
3
+ * 标签的值,通常对应节点数据中的某个字段值
4
+ */
5
+ value: {
6
+ type: StringConstructor;
7
+ required: true;
8
+ };
9
+ /**
10
+ * 标签显示的文本
11
+ */
12
+ label: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ /**
17
+ * 标签的颜色
18
+ */
19
+ color: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ };
24
+ export declare const emits: {};
@@ -0,0 +1,33 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ value: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ label: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ color: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ value: {
16
+ type: StringConstructor;
17
+ required: true;
18
+ };
19
+ label: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ color: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
27
+ }>> & Readonly<{}>, {
28
+ label: string;
29
+ color: string;
30
+ }, {}, {
31
+ Segment: import("vue").DefineComponent<{}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
+ }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ filterKey: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ }>, {
7
+ props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
8
+ filterKey: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ }>> & Readonly<{}> & {}>;
13
+ graph: import("graphology").default<import("graphology-types").Attributes, import("graphology-types").Attributes, import("graphology-types").Attributes>;
14
+ hiddenValues: import("vue").Ref<string[], string[]>;
15
+ updateGraph: () => void;
16
+ toggleItem: (value: string) => void;
17
+ readonly SegmentView: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
18
+ [key: string]: any;
19
+ }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
20
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
21
+ filterKey: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ }>> & Readonly<{}>, {
26
+ filterKey: string;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
28
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import VkLayoutForceatlas2 from './src/index.vue';
2
+ export * as __VkLayoutForceatlas2 from './src/types';
3
+ export { useLayoutForceatlas2 } from './src/use';
4
+ export { VkLayoutForceatlas2, };
5
+ export default VkLayoutForceatlas2;