File size: 800 Bytes
b1ea792
36669dc
4f06073
36669dc
 
 
 
 
 
 
 
 
4f06073
36669dc
 
4f06073
64b1da0
36669dc
 
4f06073
36669dc
 
 
 
4f06073
36669dc
 
 
 
 
 
64b1da0
36669dc
 
4f06073
36669dc
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Handle, Position } from '@xyflow/react';

import React from 'react';
import styles from './index.less';

const DEFAULT_HANDLE_STYLE = {
  width: 6,
  height: 6,
  bottom: -5,
  fontSize: 8,
};

interface IProps extends React.PropsWithChildren {
  top: number;
  right: number;
  id: string;
  idx?: number;
}

const CategorizeHandle = ({ top, right, id, children }: IProps) => {
  return (
    <Handle
      type="source"
      position={Position.Right}
      id={id}
      isConnectable
      style={{
        ...DEFAULT_HANDLE_STYLE,
        top: `${top}%`,
        right: `${right}%`,
        background: 'red',
        color: 'black',
      }}
    >
      <span className={styles.categorizeAnchorPointText}>{children || id}</span>
    </Handle>
  );
};

export default CategorizeHandle;