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 🙏

© 2025 – Pkg Stats / Ryan Hefner

apexgantt-webcomponent

v0.0.1

Published

[![npm version](https://img.shields.io/npm/v/apexgantt-webcomponent.svg)](https://www.npmjs.com/package/apexgantt-webcomponent) [![License](https://img.shields.io/github/license/apexcharts/apexgantt-webcomponent.svg)](https://github.com/apexcharts/apexgan

Readme

ApexGantt Web Component

npm version License

A modern, lightweight web component wrapper for ApexGantt, built with Lit. Create interactive Gantt charts with minimal setup and maximum flexibility.

Features

  • 🎯 Framework Agnostic - Works with React, Vue, Angular, or vanilla JavaScript
  • 🚀 Lightweight - Built on Lit for optimal performance
  • 🎨 Fully Customizable - Extensive configuration options
  • 📱 Responsive - Adapts to different screen sizes
  • 🔄 Dynamic Updates - Update tasks and options on the fly
  • 📊 Zoom Controls - Built-in zoom in/out functionality
  • 🎯 TypeScript Support - Full type definitions included

Installation

npm install apexgantt-webcomponent

Quick Start

1. Register the Component

import { ApexGanttChart } from 'apexgantt-webcomponent';

// Register the custom element
ApexGanttChart.register();

2. Add to Your HTML

<apex-gantt-chart id="gantt"></apex-gantt-chart>

3. Configure Your Gantt Chart

const ganttChart = document.querySelector('#gantt');

ganttChart.options = {
  tasks: [
    {
      id: '1',
      name: 'Project Planning',
      start: '2025-01-01',
      end: '2025-01-15',
      progress: 100
    },
    {
      id: '2',
      name: 'Development',
      start: '2025-01-16',
      end: '2025-03-31',
      progress: 45,
      dependencies: '1'
    },
    {
      id: '3',
      name: 'Testing',
      start: '2025-04-01',
      end: '2025-04-30',
      progress: 0,
      dependencies: '2'
    }
  ],
  viewMode: 'Week'
};

Usage with Frameworks

React

import { useEffect, useRef } from 'react';
import { ApexGanttChart } from 'apexgantt-webcomponent';

// Register once in your app
ApexGanttChart.register();

function GanttComponent() {
  const ganttRef = useRef(null);

  useEffect(() => {
    if (ganttRef.current) {
      ganttRef.current.options = {
        tasks: [
          // Your tasks here
        ],
        viewMode: 'Month'
      };
    }
  }, []);

  return <apex-gantt-chart ref={ganttRef} />;
}

Vue 3

<template>
  <apex-gantt-chart ref="ganttRef"></apex-gantt-chart>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { ApexGanttChart } from 'apexgantt-webcomponent';

// Register once in your app
ApexGanttChart.register();

const ganttRef = ref(null);

onMounted(() => {
  ganttRef.value.options = {
    tasks: [
      // Your tasks here
    ],
    viewMode: 'Day'
  };
});
</script>

Angular

import { Component, OnInit, ViewChild, ElementRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ApexGanttChart } from 'apexgantt-webcomponent';

// Register once in your app (e.g., in main.ts)
ApexGanttChart.register();

@Component({
  selector: 'app-gantt',
  template: '<apex-gantt-chart #gantt></apex-gantt-chart>',
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class GanttComponent implements OnInit {
  @ViewChild('gantt') gantt!: ElementRef;

  ngOnInit() {
    this.gantt.nativeElement.options = {
      tasks: [
        // Your tasks here
      ]
    };
  }
}

API Reference

Properties

options

Type: GanttUserOptions

The main configuration object for the Gantt chart. Includes tasks, view mode, and other settings.

ganttChart.options = {
  tasks: [...],
  viewMode: 'Week',
  // Additional configuration options
};

Methods

updateTask(taskId, updatedTask)

Updates a specific task with new data.

ganttChart.updateTask('task-1', {
  progress: 75,
  end: '2025-02-15'
});

updateOptions(options)

Updates the entire Gantt chart configuration.

ganttChart.updateOptions({
  tasks: [...],
  viewMode: 'Month'
});

zoomIn()

Zooms in the Gantt chart (Year → Quarter → Month → Week → Day).

ganttChart.zoomIn();

zoomOut()

Zooms out the Gantt chart (Day → Week → Month → Quarter → Year).

ganttChart.zoomOut();

Events

The component emits the following custom events:

  • gantt-task-update - Fired when a task is being updated
  • gantt-task-update-success - Fired when a task update succeeds
  • gantt-task-update-error - Fired when a task update fails
  • gantt-task-validation-error - Fired when task validation fails
ganttChart.addEventListener('gantt-task-update-success', (event) => {
  console.log('Task updated:', event.detail);
});

Configuration Options

For a complete list of configuration options, please refer to the ApexGantt documentation.

Development

Prerequisites

  • Node.js (v20 or higher recommended)
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/apexcharts/apexgantt-webcomponent.git

# Install dependencies
npm install

# Start development server
npm start

# Run tests
npm test

# Build for production
npm run build

Scripts

  • npm start - Start development server with live reload
  • npm run build - Build for production
  • npm test - Run test suite
  • npm run test:watch - Run tests in watch mode
  • npm run lint - Lint code
  • npm run fix - Fix linting issues

Browser Support

This component works in all modern browsers that support:

  • Custom Elements (Web Components)
  • ES Modules
  • ES2020 features

For older browsers, you may need polyfills.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

ISC

Links

Support

If you encounter any issues or have questions, please open an issue on GitHub.