mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-24 02:05:21 +00:00
Now using dagre for network diagram layout
This commit is contained in:
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { CRow, CCol } from '@coreui/react';
|
||||
import { NetworkDiagram as Graph } from 'ucentral-libs';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import createLayoutedElements from './dagreAdapter';
|
||||
|
||||
const associationStyle = {
|
||||
background: '#3399ff',
|
||||
@@ -136,7 +137,13 @@ const NetworkDiagram = ({ radios, associations }) => {
|
||||
}
|
||||
}, [radios, associations]);
|
||||
|
||||
return <Graph loading={loading} elements={elements} setElements={setElements} />;
|
||||
return (
|
||||
<Graph
|
||||
loading={loading}
|
||||
elements={createLayoutedElements(elements, 220, 80)}
|
||||
setElements={setElements}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
NetworkDiagram.propTypes = {
|
||||
|
||||
Reference in New Issue
Block a user