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

@frxjs/ngx-timeline

v19.0.0

Published

The main goal of this angular library is to give you the possibility to integrate a timeline in your app. <br> Version 19.0.0 is compatible with angular 18. <br> Go [here](https://emanuelefricano93.github.io/frxjs-Ngx-Timeline/) and discover all possible

Downloads

3,208

Readme

NgxTimeline check-code-coverage

The main goal of this angular library is to give you the possibility to integrate a timeline in your app. Version 19.0.0 is compatible with angular 18. Go here and discover all possible configurations for the timeline

image

Installation

Running the following command to install the library

npm install @frxjs/ngx-timeline

Examples of Usage

After installing the library and including NgxTimelineModule in your imports module you could add one of following examples to your template in order to display your timeline

<ngx-timeline [events]="events"></ngx-timeline>
<ngx-timeline [events]="events" [langCode]="'it'"></ngx-timeline>
<ngx-timeline [events]="events" [langCode]="'it'" [enableAnimation]="false"></ngx-timeline>

Configuration

Input

Input name | Explanation | Mandatory | Type/Supported Values | Default value --- | --- | --- |---------------------------------------------------------------------------------------------------------------------------------------------| ---
events | list of events to be displayed | yes | NgxTimelineEvent | no default
langCode | language code use to format dates | no | 'en''it''fr''de''es''sl''tr''pl''pt''ru' | 'en'
enableAnimation | Boolean used to enable or disable the animations | no | boolean | true
reverseOrder | Boolean used to reverse sort order (default older first) | no | boolean | false
groupEvent | Logic to be applied in order to group events | no | enum NgxTimelineEventGroup | NgxTimelineEventGroup.MONTH_YEAR orientation | Orientation of the timeline | no | enum NgxTimelineOrientation | NgxTimelineOrientation.VERTICAL changeSide | Logic to be applied in order to put events on LEFT or RIGHT | no | enum NgxTimelineEventChangeSide | NgxTimelineEventChangeSide.ON_DIFFERENT_DAY_IN_GROUP
periodCustomTemplate | Custom Template displayed before a group of events | no | TemplateRef | no default eventCustomTemplate | Custom Template displayed to show a single event | no | TemplateRef | no default centerIconCustomTemplate | Custom Template displayed to show an separator icon | no | TemplateRef | no default dateInstantCustomTemplate | Custom Template displayed to show the side date | no | TemplateRef | no default innerEventCustomTemplate | Custom Template displayed to show the inner event | no | TemplateRef | no default eventDescriptionCustomTemplate| Custom Template displayed to show the description | no | TemplateRef | no default

Output

Output name | Explanation | Mandatory | Type/Supported Values | Default value --- | --- | --- | --- | ---
clickEmitter | Output click event emitter | no | BehaviorSubject | no default

Types and Enums

interface NgxTimelineEvent {
  timestamp?: Date;
  title?: string;
  description?: string;
  id?: any;
  itemPosition?: NgxTimelineItemPosition;
}
enum NgxTimelineEventGroup {
  YEAR = 'YEAR',
  MONTH_YEAR = 'MONTH_YEAR',
  DAY_MONTH_YEAR = 'DAY_MONTH_YEAR'
}
export enum NgxTimelineOrientation {
  HORIZONTAL = 'HORIZONTAL',
  VERTICAL = 'VERTICAL',
}
enum NgxTimelineEventChangeSide {
  ALL = 'ALL',
  ALL_IN_GROUP = 'ALL_IN_GROUP',
  ON_DIFFERENT_DAY_IN_GROUP = 'ON_DIFFERENT_DAY_IN_GROUP',
  ON_DIFFERENT_HMS_IN_GROUP = 'ON_DIFFERENT_HMS_IN_GROUP',
  ON_DIFFERENT_MONTH_IN_GROUP = 'ON_DIFFERENT_MONTH_IN_GROUP'
}

Custom Theme supported

This is an example of custom-theme that can be applied for istance via an ng-class directive to the container of the library. In this way you are redefine some variables that are defined and used inside the library and it is easier to override some properties

.custom-theme {
    --ngx-timeline-icon: black;
    --ngx-timeline-period-inner-container: black;
    --ngx-timeline-line-background: black;
}

Examples with contexts of custom templates

  <ng-template #periodCustomTemplate let-period=period let-index=index let-event=event>
    <div [ngClass]="{'transparent first-line': !index}" class="line"></div>
    <div class="period-container">
      <p>
        {{index}} - {{period | json  }}
      </p>
    </div>
    <div class="line"></div>
  </ng-template>
  <ng-template #centerIconCustomTemplate let-index=index let-event=event>
    <div class="icon-container">
      <img src="assets/image.png">
    </div>
  </ng-template>
  <ng-template #innerEventCustomTemplate let-event=event>
    <div class="event" (click)="handleClick(event)">
      {{event | json}}
    </div>
  </ng-template>
  <ng-template #eventDescriptionCustomTemplate let-event=event>
    <p class="event-info-description">{{event?.eventInfo?.description}}</p>
  </ng-template>
  <ng-template #eventCustomTemplate let-event=event let-colSidePosition=colSidePosition>
    <div class="event" (click)="handleClick(event)">
      {{event | json}}
    </div>
  </ng-template>
  <ng-template #dateInstantCustomTemplate let-item=item>
    <span>
      {{item | json}}
    </span>
  </ng-template>

How to contribute

First of all, in order to track everything, open an issue describing the problem or a missing functionality you would like to add to the lib.

To start the contribution:

  • npm run watch-lib (you are building the lib with --watch options)
  • npm run start-dev (you are linking the lib and starting the demo app )

Every time you will change the code in your lib, any update will trigger the re-load of the app. When your code will be ready, create a Pull Request and put the link in a comment under the issue you opened before. Now is time to enjoy and start to code.

Thanks in advance for your contribution

How to deploy new version (for maintainers only)

After testing the fix or the new feature with 100% test coverage:

  • npm run lint:fix
  • npm run prepare-github-pages
  • npm run new-version patch
  • git push --tags
  • git push
  • npm run publish