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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fish-render/table-gantt

v0.1.8

Published

Fish Render table-gantt component for Vue 3

Readme

@fish-render/table-gantt

TableGantt 组件是一个将表格和甘特图结合在一起的复合组件,左侧显示表格数据,右侧显示对应的甘特图任务,支持两者之间的数据联动和同步滚动。

注意:该组件依赖于以下组件,请确保已安装:

  • @fish-render/table
  • @fish-render/gantt
  • @fish-render/separator

安装

npm install @fish-render/table-gantt
# 或
yarn add @fish-render/table-gantt
# 或
pnpm add @fish-render/table-gantt

使用方法

基础用法

<template>
  <TableGantt
    height="500px"
    tableWidth="300px"
    :data="taskData"
    :columns="columns"
    @sync-scroll="handleSyncScroll"
    @update:data="handleDataUpdate"
  />
</template>
<script setup lang="ts">
import { ref } from 'vue'
// 样式会自动加载,无需额外引入
import { TableGantt } from '@fish-render/table-gantt'

// 统一数据源
const taskData = ref([
  { 
    id: 1, 
    name: '任务1', 
    assignee: '张三',
    start: new Date('2023-06-01'),
    end: new Date('2023-06-05'),
    groupId: 'group1',
    progress: 0.5
  },
  { 
    id: 2, 
    name: '任务2', 
    assignee: '李四',
    start: new Date('2023-06-03'),
    end: new Date('2023-06-08'),
    groupId: 'group1',
    progress: 0.3
  },
  { 
    id: 3, 
    name: '任务3', 
    assignee: '王五',
    start: new Date('2023-06-06'),
    end: new Date('2023-06-10'),
    groupId: 'group2',
    progress: 0.8
  },
])

// 表格列配置
const columns = [
  { title: 'ID', dataIndex: 'id', key: 'id' },
  { title: '任务名称', dataIndex: 'name', key: 'name' },
  { title: '负责人', dataIndex: 'assignee', key: 'assignee' },
  { title: '进度', dataIndex: 'progress', key: 'progress', render: (text) => `${Math.round(text * 100)}%` },
]

// 处理同步滚动
const handleSyncScroll = (scrollTop: number) => {
  console.log('同步滚动位置:', scrollTop)
}

// 处理数据更新
const handleDataUpdate = (updatedData: any[]) => {
  console.log('数据已更新:', updatedData)
  taskData.value = updatedData
}
</script>

全局引入方式

import { createApp } from 'vue'
import App from './App.vue'
import TableGanttPlugin from '@fish-render/table-gantt'

const app = createApp(App)
app.use(TableGanttPlugin)
app.mount('#app')

特性

  1. 统一数据源:表格和甘特图共用一个数据源,简化数据管理
  2. 左右联动:表格与甘特图同步滚动,提升用户体验
  3. 灵活的字段映射:通过taskFieldMap配置项可以灵活映射数据源中的字段
  4. 双向数据绑定:支持从甘特图更新回原始数据源
  5. 完整的类型支持:提供TypeScript类型定义

注意事项

  1. 确保数据源中包含甘特图所需的必要字段(至少包含id、start、end字段)
  2. 推荐设置统一的行高,以确保滚动同步效果最佳
  3. 当数据量大时,可能需要考虑性能优化策略
  4. 如果数据源字段名与甘特图默认字段名不同,需要通过taskFieldMap进行映射配置

许可证

MIT License