Skip to content

Commit

Permalink
fix: type error
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Mar 23, 2024
1 parent 5ac443c commit ad422e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/TrackGraph.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import '@/utils/g6';
import { getLimitLabel } from '@/utils/node';
import type { Selector } from '@/utils/selector';
import type { ConnectKeyType, Selector } from '@/utils/selector';
import type { RawNode } from '@/utils/types';
import type { TreeGraph, TreeGraphData } from '@antv/g6';
import G6 from '@antv/g6';
Expand Down Expand Up @@ -223,7 +223,7 @@ watchEffect(() => {
const tempId = t.id > n.id ? `-${n.id}:${t.id}` : `-${t.id}:${n.id}`;
edgeCountMap[tempId] = (edgeCountMap[tempId] || 0) + 1;
const id = `${tempId}/${edgeCountMap[tempId]}`;
const key = connectKeys[connectKeys.length - i - 1];
const key = connectKeys[connectKeys.length - i - 1] as ConnectKeyType;
const distance: number =
{
'+': () => {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export type Selector = {
querySelectorTrackAll: (node: RawNode) => RawNode[][];
};

export type ConnectKeyType = '+' | '-' | '>' | '<' | '<<';

export const parseSelector = (source: string): Selector => {
const ms = MultiplatformSelector.Companion.parse(source);
for (const [name, type] of ms.nameToTypeList) {
Expand Down

0 comments on commit ad422e4

Please sign in to comment.