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

@google/workflow-graph

v0.1.2

Published

Component for visualizing workflow graphs (directed-acyclic-graphs). Built with Angular, distributed as a Web Component. [WIP]

Downloads

272

Readme

Workflow Graph Component (DAG)

Common component for rendering dag or tree like objects:

Components

There are a few components that help with your DAG Needs

Component | Img | Description --- | --- | --- Renderer | | The Dag Component you can use to render a Graph on page Toolbar | | A toolbar that provides a collapsability toggle along with task status for the graph Scaffold | | A parent element that can position the toolbar to be sticky above the graph while flexing within its parent to allow for CSS-less page design StateBadge | | Status icon badges for each state that an execution node can exist in

Helper Classes

DAG Node

This file contains the Node object that's passed to the Renderer and Toolbar components. It also allows for rapid construction of the GraphSpec via static helper methods

Spec | Description --- | --- DagNode | The Node class that holds all information for a single node on the graph. Superset of DagNodeMeta DagEdge | An edge class that holds from and to relationship as well as relevant edge information GraphSpec | A helper interface that holds nodes, edges and nodeMap DagNodeMeta | An interface that represents all meta information for a node DagNodeSkeleton | An interface that allows a user to write a bare-bone skeleton for a node graph / tree. This is consumed by the static Node.createFromSkeleton() method to construct a graph. DagNodeLinked [Abandoned] | A DagNode implementation that has ancestry baked in within the class and allows child <-> parent traversal

Development, building and re-use

Local developer environment

This app is built with Bazel with Aspect build rules with Angular Architect tooling. After cloning the repo, start a local development environment by running pnpm install and ng serve. This will spin up a local server and use the Angular version of the app, injected into a local HTML file.

Building, bundling

To build a reusable Web Component bundle, run npm run build-web-component. This will create a bundle in your /dist directory, as well as type declarations in /dist-types. The bundle can be included in an HTML file to load the component.

Use as an Angular component

Coming soon...

NPM

This component is available on npm at https://www.npmjs.com/package/@google/workflow-graph. To install it, run npm install @google/workflow-graph or yarn install @google/workflow-graph.

Example

HTML Integration in an Angular app

<ai-dag-scaffold>
    <ai-dag-toolbar [nodes]="graphSpec.nodes" [(expanded)]="expandedMode" />
    <ai-dag-renderer
        [nodes]="graphSpec.nodes"
        [edges]="graphSpec.edges"
        [collapsedArtifacts]="!expandedMode"
        [(selectedNode)]="selectedNode" />
</ai-dag-scaffold>

Web Component integration in any framework

This component can be built and bundled as a Web Component, which makes it reusable in a variety of stacks. A full, working example can be found here. An example repo is available that shows how this component can be used in React and Typescript.

Next steps

  • [x] Create a release script and deploy Web Component artifacts (bundle, CSS, typings) to NPM.
  • [ ] Validate usage as an Angular library, improve documentation
  • [ ] Improve code structure
  • [x] Bump Angular and Angular Material versions to latest

Disclaimer

This is not an officially supported Google product.