npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

model-navigator-standalone

v0.1.3

Published

Standalone MDF graph model visualizer

Downloads

97

Readme

Standalone MDF Model Viewer

This package is a completely refactored, standalone version of the Bento framework "Data Model Navigator" React component.

It is meant to be pointed at any arbitrary graph model specified by a set of MDF files, to create an annotated data dictionary with an interactive graphical rendering of the model.

screenshot of ICDC model graph

screenshot of filtered ICDC model graph

screenshot of searched GDC model graph

screenshot of CCDI model table

To start an example app out of the box:

 git clone https://github.com/majensen/model-navigator-standalone
 cd model-navigator-standalone
 npm --legacy-peer-deps install
 npm run example

which should open the model viewer onto the Integrated Canine Data Commons graph data model.

Usage

Just import the ModelNavigator component and the loadMDF utility. Load MDFs to return an MDFReader model object. Provide the model to the navigator component. Render in an appropriate element.

import ModelNavigator, { loadMDF } from  './components/ModelNavigator';
const mdf_urls = ['https://raw.githubusercontent.com/CBIIT/icdc-model-tool/develop/model-desc/icdc-model.yml',
                  'https://raw.githubusercontent.com/CBIIT/icdc-model-tool/develop/model-desc/icdc-model-props.yml'];
function getModel() {
  return loadMDF(...mdf_urls)
    .then( (model) => model );
}
const model = await getModel();
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <ModelNavigator
      model={model}
    />
  </React.StrictMode>
);

Custom Configuration

The Facet Filter and Legend features provide filtering and custom rendering of model nodes that have been assigned to a given logical grouping, or "category". Nodes are assigned categories in the model files themselves, using Tags. Tag model nodes with the key Category and values which name the desired categories.

The app can be configured to display:

  • A custom title,
  • A custom brand icon at the top,
  • Custom facet sections and facets for filtering, based on additional model Tags,
  • Custom graph icons and colors for nodes of different categories,
  • Custom category icons for the legend,
  • Custom styles for node categories in the Table view.

To do this, provide a config object to the ModelNavigator attribute config having the following keys:

const config = {
  pageTitle,
  brandIconSrc,
  facetSections,
  facetFilters,
  tagAttributes,
  legendTag,
  annotationTags,
};

See the file ICDCconfig.js for examples of the values of these elements, and example.jsx for an implementation.