UNPKG

model-navigator-standalone

Version:

Standalone MDF graph model visualizer

40 lines 1.09 kB
import "core-js/modules/web.dom-collections.iterator.js"; import React, { memo } from 'react'; import { useSelector } from 'react-redux'; import withStyles from '@mui/styles/withStyles'; import { getStraightPath } from 'reactflow'; import { selectIsSearchMode } from '../../../../../features/search/searchSlice'; import Styles from './CustomEdgeStyle'; const CustomEdgeView = _ref => { let { id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style = {}, // data, markerEnd } = _ref; const isSearchMode = useSelector(selectIsSearchMode); const [edgePath] = getStraightPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition }); return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", { id: id, fill: "none", stroke: isSearchMode ? '#b1b1b7' : "#222", strokeWidth: 1, className: "animated", d: edgePath, markerEnd: markerEnd })); }; export default withStyles(Styles)(/*#__PURE__*/memo(CustomEdgeView));