Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cm-angular-org-chart

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cm-angular-org-chart - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

.editorconfig

76

package.json
{
"name": "cm-angular-org-chart",
"description": "Hierarchical Organizational Chart for Angular",
"version": "1.1.0",
"keywords": [
"org-chart",
"organization",
"organizational chart",
"heirarchal chart",
"ng",
"angular",
"angular 2",
"angular 8",
"angular 13",
"angular 14"
],
"author": "Maram Chandrasekhar Reddyl",
"publishConfig": {
"access": "public"
"version": "1.1.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"peerDependencies": {
"dependencies": {
"@angular/animations": "^14.0.0",
"@angular/common": "^14.0.0",
"@angular/core": "^14.0.0"
"@angular/compiler": "^14.0.0",
"@angular/core": "^14.0.0",
"@angular/forms": "^14.0.0",
"@angular/platform-browser": "^14.0.0",
"@angular/platform-browser-dynamic": "^14.0.0",
"@angular/router": "^14.0.0",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"dependencies": {
"tslib": "^2.3.0"
},
"module": "fesm2015/cm-angular-org-chart.mjs",
"es2020": "fesm2020/cm-angular-org-chart.mjs",
"esm2020": "esm2020/cm-angular-org-chart.mjs",
"fesm2020": "fesm2020/cm-angular-org-chart.mjs",
"fesm2015": "fesm2015/cm-angular-org-chart.mjs",
"typings": "index.d.ts",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./index.d.ts",
"esm2020": "./esm2020/cm-angular-org-chart.mjs",
"es2020": "./fesm2020/cm-angular-org-chart.mjs",
"es2015": "./fesm2015/cm-angular-org-chart.mjs",
"node": "./fesm2015/cm-angular-org-chart.mjs",
"default": "./fesm2020/cm-angular-org-chart.mjs"
}
},
"sideEffects": false
}
"devDependencies": {
"@angular-devkit/build-angular": "^14.0.6",
"@angular/cli": "~14.0.6",
"@angular/compiler-cli": "^14.0.0",
"@types/jasmine": "~4.0.0",
"jasmine-core": "~4.1.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"ng-packagr": "^14.0.0",
"typescript": "~4.7.2"
}
}

@@ -1,223 +0,27 @@

# Hierarchical Organization Chart for Angular 14 and above versions
# CmAngularOrgChart
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.0.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.6.
The `cm-angular-org-chart` component displays heirarchal Organizational Chart.
## Development server
![Org Chart](https://github.com/chandumaram/org-chart/blob/master/src/assets/org-chart-horizontal.png)
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Table of Contents
## Code scaffolding
* [Usage](#usage)
* [Inputs](#inputs)
* [Outputs](#outputs)
* [Default Look](#default-look)
* [Custom Styling](#custom-styling)
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Usage
## Build
Each employee is represented by an object with the following properties. Note that all the properties are optional.
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
| 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
## Running unit tests
### Installation
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
```sh
$ npm install @mondal/org-chart
```
## Running end-to-end tests
### `app.module.ts`
```js
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CmAngularOrgChartModule } from 'cm-angular-org-chart';
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
CmAngularOrgChartModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```
## Further help
### `app.component.html`:
```html
<org-chart [topEmployee]="topEmployee" direction="vertical"></org-chart>
```
### `app.component.ts`:
```js
export class AppComponent {
employeeImage = "assets/employee.png";
topEmployee: any = {
name: 'Sundar Pichai',
cssClass: 'oc-superSenior',
imageUrl: this.employeeImage,
designation: 'Chief Executive Officer',
subordinates: [
{
name: 'Thomas Kurian',
cssClass: 'oc-senior',
imageUrl: this.employeeImage,
designation: 'CEO, Google Cloud',
},
{
name: 'Susan Wojcicki',
cssClass: 'oc-senior',
imageUrl: this.employeeImage,
designation: 'CEO, YouTube',
subordinates: [
{
name: 'Beau Avril',
cssClass: 'oc-me',
imageUrl: this.employeeImage,
designation: 'Global Head of Business Operations',
subordinates: []
},
{
name: 'Tara Walpert Levy',
cssClass: 'oc-me',
imageUrl: this.employeeImage,
designation: 'VP, Agency and Brand Solutions',
subordinates: [
{
name: 'Junior 1 David',
cssClass: 'oc-junior',
imageUrl: this.employeeImage,
designation: 'CEO, Google Health',
subordinates: []
},
{
name: 'Junior 2 David',
cssClass: 'oc-junior',
imageUrl: this.employeeImage,
designation: 'CEO, Google Health',
subordinates: [
{
name: 'superJunior 1 David',
cssClass: 'oc-superJunior',
imageUrl: this.employeeImage,
designation: 'CEO, Google Health',
subordinates: []
},
{
name: 'superJunior 2 David',
cssClass: 'oc-superJunior',
imageUrl: this.employeeImage,
designation: 'CEO, Google Health',
subordinates: []
}
]
}
]
},
]
},
{
name: 'Jeff Dean',
cssClass: 'oc-senior',
imageUrl: this.employeeImage,
designation: 'Head of Artificial Intelligence',
subordinates: [
{
name: 'David Feinberg (You)',
cssClass: 'oc-me',
imageUrl: this.employeeImage,
designation: 'CEO, Google Health',
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
Ex: <org-chart [topEmployee]="topEmployee" direction="vertical" (itemClick)="onClickItem($event)"></org-chart>
## Default Look
### Horizontal
![Horizontal Chart](https://github.com/chandumaram/org-chart/blob/master/src/assets/org-chart-horizontal.png)
### Vertical
![Vertical Chart](https://github.com/chandumaram/org-chart/blob/master/src/assets/org-chart-vertical.png)
## 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.
```scss
.oc-name {
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}
.oc-designation {
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
.oc-border {
border-color: #9E9E9E;
}
.oc-box {
color: white;
width: 10em;
}
// Custom cssClass from Employee object
.oc-superSenior {
background-color: midnightblue;
}
.oc-senior {
background-color: brown;
}
.oc-me {
background-color: darkgreen;
}
.oc-junior {
background-color: darkgoldenrod;
}
.oc-superJunior {
background-color: purple;
}
```
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc