Socket
Socket
Sign inDemoInstall

@frxjs/ngx-timeline

Package Overview
Dependencies
6
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @frxjs/ngx-timeline

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


Version published
Weekly downloads
571
decreased by-15.16%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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 17.0.7 is compatible with angular 17.
Go here and discover all possible configurations for the timeline

image

Fig.1 - Preview of Timeline example configuration page



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 nameExplanationMandatoryType/Supported ValuesDefault value
eventslist of events to be displayedyesNgxTimelineEventno default
langCodelanguage code use to format datesno
  • 'en'
  • 'it'
  • 'fr'
  • 'de'
  • 'es'
  • 'sl'
  • 'tr'
  • 'pl'
  • 'pt'
  • 'ru'
'en'
enableAnimationBoolean used to enable or disable the animationsnobooleantrue
reverseOrderBoolean used to reverse sort order (default older first)nobooleanfalse
groupEventLogic to be applied in order to group eventsnoenum NgxTimelineEventGroupNgxTimelineEventGroup.MONTH_YEAR
changeSideLogic to be applied in order to put events on LEFT or RIGHTnoenum NgxTimelineEventChangeSideNgxTimelineEventChangeSide.ON_DIFFERENT_DAY_IN_GROUP
periodCustomTemplateCustom Template displayed before a group of eventsnoTemplateRefno default
eventCustomTemplateCustom Template displayed to show a single eventnoTemplateRefno default
centerIconCustomTemplateCustom Template displayed to show an separator iconnoTemplateRefno default
dateInstantCustomTemplateCustom Template displayed to show the side datenoTemplateRefno default
innerEventCustomTemplateCustom Template displayed to show the inner eventnoTemplateRefno default
eventDescriptionCustomTemplateCustom Template displayed to show the descriptionnoTemplateRefno default

Output

Output nameExplanationMandatoryType/Supported ValuesDefault value
clickEmitterOutput click event emitternoBehaviorSubjectno 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'
}
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'
}

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

Keywords

FAQs

Last updated on 10 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc