Code Monkey home page Code Monkey logo

melfore / konva-timeline Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 2.0 12.55 MB

@melfore/konva-timeline is a free, open source, TypeScript ReactJS library that uses konva and react-konva to render a scheduler / gantt / calendar component using canvas.

Home Page: https://melfore.github.io/konva-timeline/

License: MIT License

TypeScript 98.59% MDX 1.41%
calendar canvas dnd free gantt konva konva-react open-source opensource reactjs scheduler timeline tracker typescript

konva-timeline's People

Contributors

crisgrud avatar luciob avatar melfore-devops avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ces-truongvu

konva-timeline's Issues

[Task] Display label

Display task label allowing toggle display via boolean flag at Timeline level.
Add ellipsis if text goes longer than task size.

[Drag] Too small ratio between resolutions

util.js:239 Uncaught Error: Invalid unit value NaN
    at asNumber (util.js:239:1)
    at normalizeObject (util.js:249:1)
    at Duration.fromObject (duration.js:263:1)
    at Duration.fromDurationLike (duration.js:286:1)
    at DateTime.plus (datetime.js:1440:1)
    at Group.<anonymous> (index.tsx:171:1)
    at Group._fire (Node.js:1188:1)
    at Group._fireAndBubble (Node.js:1139:1)
    at Group.fire (Node.js:824:1)
    at DragAndDrop.js:92:1

Code refactoring

Code refactoring of components and methods, before doing optimization and performance related issues

[Timeline] Round range to closest resolution

Take following example:

Timestamp in milliseconds: 1693523580000
Date and time (GMT): Thursday, 31 August 2023 23:13:00
Date and time (your time zone): Friday, 1 September 2023 01:13:00 GMT+02:00

In this case, with range duration = 1d and resolution = 1h, the result on timeline shows ticks for each 13th minute.
It should instead reset to closest resolution (1h) to ensure correct ticks format.

[Grid] Static view

Display a time range of 24hrs, creating one column for each hour.
Column width could be set from the outside, but have a lower bounded value, below which is not possible to go.

Fix tooltip

Standard tooltip is disappearing from screen when scrolling

Handle layout theme

Handle layout theme via prop or via browser APIs and internally apply corresponding color schema.
Relates to #12

Prepare CI for release

Prepare all steps required to CI release:

  • npm repository
  • GitHub actions
  • GitHub triggers
  • Husky workflows

Fix bugs on resize

Fix the known bugs happening on component space resize:

  • window width
  • hide/show resources
  • change of resolution

[Grid] Set column magnitude dynamically

In addition to what done in #1, the column magnitude will not be by default 1hr but its value can vary.
Provide a set of predefined choices (1 / 2 / 4 / 6 / 12 / 24).

[Drag] Improve UX

Try fixing some UX issues with drag & drop.
The most important found:

  • x offset of tooltip is put to 0 instead of original x point
  • change cursor appearance to adhere to browser standard
  • make canvas move when dragging to the bound of canvas

Custom tooltip

Add possibility for final user to pass in a custom tooltip component to display on task over.

Add meaningful datasets

Prepare two datasets:

  • Shift reports
    • 5 years coverage
    • 3 tasks per day (avg length 8h/12h)
    • 20 resources
  • Time Tracking
    • 2 hours / 4 months coverage
    • avg task length 5/10 mins
    • 16 resources

[Drag] Do not inherit resolution

When dragResolution is not set, use 1 min by default.
The calculation of dragResolution is done inside TimelineContext component.

Improve date time visualization

Improve date time visualization displaying two units at the same time:

  • current view (e.g. hours)
  • scale view (e.g. days)

This requires the definition of a schema mapping between different units (hour/day, day/week, week/month, month/year)

Move the hour tick above the cell border or in a better place to improve UX.

[CI] Fix concurrently start error

Concurrently requires a set of \ separated commands to exec.
Commands where just added in series using | operator from GH actions.

https://storybook.js.org/docs/react/writing-tests/test-runner#run-against-non-deployed-storybooks

npm WARN exec The following package was not found and will be installed: [email protected]
node:assert:125
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: [concurrently] no commands provided
    at concurrently (/home/runner/.npm/_npx/e559c3a2028ff25f/node_modules/concurrently/dist/src/concurrently.js:36:22)
    at exports.default (/home/runner/.npm/_npx/e559c3a2028ff25f/node_modules/concurrently/dist/src/index.js:34:44)
    at Object.<anonymous> (/home/runner/.npm/_npx/e559c3a2028ff25f/node_modules/concurrently/dist/bin/concurrently.js:207:21)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: 0,
  expected: 0,
  operator: 'notStrictEqual'
}

Fix semantic-release configuration

[3:09:15 PM] [semantic-release] › ℹ  Running semantic-release version 21.0.9
[3:09:15 PM] [semantic-release] › ✘  An error occurred while running semantic-release: Error: Cannot find module '@semantic-release/changelog'
Require stack:
- /home/runner/work/konva-timeline/konva-timeline/noop.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at resolveFileName (/home/runner/work/konva-timeline/konva-timeline/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/home/runner/work/konva-timeline/konva-timeline/node_modules/resolve-from/index.js:43:9)
    at module.exports (/home/runner/work/konva-timeline/konva-timeline/node_modules/resolve-from/index.js:46:47)
    at loadPlugin (file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/utils.js:59:54)
    at file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:1[8](https://github.com/melfore/konva-timeline/actions/runs/5940672165/job/16109772606#step:8:9):43
    at async file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:15:2[9](https://github.com/melfore/konva-timeline/actions/runs/5940672165/job/16109772606#step:8:10)
    at async file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:15:29
    at async file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:15:29
    at async default (file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:14:7) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/runner/work/konva-timeline/konva-timeline/noop.js' ]
}
Error: Cannot find module '@semantic-release/changelog'
Require stack:
- /home/runner/work/konva-timeline/konva-timeline/noop.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:[10](https://github.com/melfore/konva-timeline/actions/runs/5940672165/job/16109772606#step:8:11)77:15)
    at resolveFileName (/home/runner/work/konva-timeline/konva-timeline/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/home/runner/work/konva-timeline/konva-timeline/node_modules/resolve-from/index.js:43:9)
    at module.exports (/home/runner/work/konva-timeline/konva-timeline/node_modules/resolve-from/index.js:46:47)
    at loadPlugin (file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/utils.js:59:54)
    at file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:18:43
    at async file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:15:29
    at async file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:15:29
    at async file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:15:29
    at async default (file:///home/runner/work/konva-timeline/konva-timeline/node_modules/semantic-release/lib/plugins/index.js:[14](https://github.com/melfore/konva-timeline/actions/runs/5940672165/job/16109772606#step:8:15):7) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/runner/work/konva-timeline/konva-timeline/noop.js' ]
}

Import Error

Could not find a declaration file for module '@melfore/konva-timeline'. 'c:/Users/grudz/projects/peanut/node_modules/@melfore/konva-timeline/dist/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/melfore__konva-timeline if it exists or add a new declaration (.d.ts) file containing declare module '@melfore/konva-timeline';

Define styles

Create styles for components in order to handle Theme variants (dark vs light).

Implement snap to grid when dragging

Implement snap to grid when dragging by adding a prop for drag and drop resolution.
It should be possibly different from standard resolution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.