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

@mondal/org-chart

v8.1.1

Published

Hierarchical Organizational Chart for Angular

Downloads

72

Readme

Hierarchical Organization Chart for Angular

The mui-org-chart component displays heirarchal Organizational Chart.

Org Chart

Table of Contents

Usage

Each employee is represented by an object with the following properties. Note that all the properties are optional.

| Property | Type| Description | |---|---|---| |name|string| The name of the employee | |cssClass|string| The CSS class to apply to the employee block| |imageUrl|string| URL to the employee's image |designation|string| Employee's designation |subordinates|Employee[]| An array of subordinate employees

Installation

$ npm install @mondal/org-chart

Include default styles in your application

For Angular CLI based applications, import the theming in your styles.scss.

@import "~@mondal/org-chart/_theming.scss";

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

import { OrgChartModule } from '@mondal/org-chart';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,

    OrgChartModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

app.component.html:

<mui-org-chart [topEmployee]="topEmployee" direction="horizontal"></mui-org-chart>

app.component.ts:

export class AppComponent {
  topEmployee: any = {
    name: 'Janis Martin',
    designation: 'CEO',
    subordinates: [
      {
        name: 'Matthew Wikes',
        designation: 'VP',
        subordinates: [
          {
            name: 'Tina Landry',
            designation: 'Budget Analyst',
            subordinates: []
          }

        ]
      },
      {
        name: 'Patricia Lyons',
        designation: 'VP',
        subordinates: [
          {
            name: 'Dylan Wilson',
            designation: 'Web Manager',
            subordinates: []
          },
          {
            name: 'Deb Curtis',
            designation: 'Art Director',
            subordinates: []
          }
        ]
      },
      {
        name: 'Larry Phung',
        designation: 'VP',
        subordinates: []
      }
    ]
  };
}

Inputs

| Name | Type | Description |---|---|---| |topEmployee| Employee object| The Employe object mentioned above |direction| vertical or horizontal | Renders chart vertically or horizontally

Outputs

|Name |Parameters | Description |---|---|---| |itemClick|Employee| The Employee object which was clicked

Default Look

Horizontal

Horizontal Chart

Vertical

Vertical Chart

Custom Styling

You can override default styles with your custom SCSS. Make sure you include your custom SCSS after including the default SCSS so that your styles override the default styles.

.mui-oc-name {
  font-family: 'Patua One', cursive;
}

.mui-oc-designation {
  font-family: 'Oswald', sans-serif;
}

.mui-oc-border {
  border-color: #9E9E9E;
}

.mui-oc-box {
  color: white;
  width: 10em;
}

// Custom cssClass from Employee object
.mui-oc-ceo {
  background-color: #4caf50;
}
.mui-oc-vp {
  background-color: #03A9F4;
}
.mui-oc-dir {
  background-color: #607D8B;
}
.mui-oc-man {
  background-color: #9C27B0;
}