VisActor / VisActor/VTable

[Feature]希望可以增加接口:通过X,Y轴的定位获取日期和任务行

Open
#3,953 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature good first issue
Dominant language
TypeScript
Stars
3.7k
Forks
486
Avg merge
1d 19h
Merged PRs (30d)
16

Description

What problem does this feature solve?

我希望vtable-gantt可以通过X,Y轴的定位获取日期和任务行,这样就可以支持自定义地拖动创建任务排期,另外点击创建排期目前还不能满足业务需求,使操作更加界面化,让用户使用方便

What does the proposed API look like?

gantt.dateFromPos(x, y);这样可以通过XY定位去获取相关信息的api,任务也效果相同,这样可以支持更高层面的定制化

    ///获取日期
    var ganttContainer = gantt.$task_data;
    var x = e.clientX - ganttContainer.getBoundingClientRect().left + ganttContainer.scrollLeft;
    var y = e.clientY - ganttContainer.getBoundingClientRect().top + ganttContainer.scrollTop;
    // 获取任务拖拽到的当前时间位置
    var currentDate = gantt.dateFromPos(x, y);
    if (!currentDate) {
      currentDate = new Date();
    }获取任务也大概如上写法

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the gantt implementation behind gantt.$task_data and the existing date-position handling used by the drag event example. Trace how X/Y coordinates map to timeline dates and task rows, then define and verify the proposed dateFromPos-style API for both results. Done means consumers can retrieve the date and task row from canvas coordinates for custom scheduling interactions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.