model-navigator-standalone
Version:
Standalone MDF graph model visualizer
46 lines • 1.86 kB
JavaScript
import "core-js/modules/web.dom-collections.iterator.js";
import React, { useContext } from 'react';
import withStyles from '@mui/styles/withStyles';
import './DataDictionaryTable.css';
// import {
// createFileName,
// } from '../../utils';
import { ModelContext } from '../../../Model/ModelContext';
import DataDictionaryCategory from '../DataDictionaryCategory';
const DataDictionaryTable = _ref => {
let {
classes,
dictionaryName
// pdfDownloadConfig,
} = _ref;
const model = useContext(ModelContext);
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
className: classes.tableInfo
}, /*#__PURE__*/React.createElement("span", null, dictionaryName), /*#__PURE__*/React.createElement("span", null, " Model has "), /*#__PURE__*/React.createElement("span", null, model.nodes().length), /*#__PURE__*/React.createElement("span", null, " nodes and "), /*#__PURE__*/React.createElement("span", null, model.props().length), /*#__PURE__*/React.createElement("span", null, " properties ")), /*#__PURE__*/React.createElement("div", {
className: classes.tableBody
}, model.tag_kvs('Category').length > 0 ? model.tag_kvs('Category').map(_ref2 => {
let [, category] = _ref2;
return /*#__PURE__*/React.createElement(DataDictionaryCategory, {
key: category,
nodes: model.tagged_items('Category', category),
category: category
});
}) : /*#__PURE__*/React.createElement(DataDictionaryCategory, {
nodes: model.nodes(),
category: "Nodes"
})));
};
const styles = () => ({
tableBody: {},
tableInfo: {
marginTop: '0',
marginBottom: '0',
marginLeft: '15px',
color: '#32495A',
fontFamily: 'Lato',
fontSize: '14px',
letterSpacing: '0',
lineHeight: '26.06px'
}
});
export default withStyles(styles)(DataDictionaryTable);