Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues, add new features. #130

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

albadedan
Copy link

@albadedan albadedan commented Nov 27, 2024

[fix] Fix #91 duplicate key warning when switching to hour precision.
[feat] Adds day names to timeaxis when using day or date mode.

  • New prop on GGanttChart: showDayName, boolean?, true

[feat] Adds new prop to enable/disable right-click bar dragging. Useful if you want to use the right-click context menu, but want to avoid accidental bar movements.

  • New prop on GGanttChart: allowRightClickDragging, boolean?, false

[feat] fix #89 "Anyway to disable the drag and drop function?" by:

  • New prop on GGanttChart: disableDragging, boolean?, false - toggles dragging for the entire chart.
  • New prop on GGanttRow: disableDragging, boolean? - toggles dragging on a per-row basis
    • Bar config flag immobile still available on a per-bar basis - will be overridden if the row or chart prop is true.
    • Note: If a bar is in a bundle, dragging a bar which is in a row where dragging is not disabled, will override the disabled row.

[feat] Add new methods for highlighting dates and hours (which fixes #125 and fixes #83 and is re-working of #95)

  • New prop on GGanttChart: highlightedDates, number[]?, [] - When precision is set to day or date, dates in array will be highlighted.
  • New prop on GGanttChart: highlightedDaysOfWeek, number[]?, [] - When precision is set to day or date, weekday indexes in array will be highlighted. E.g. [0, 6] = highlight Sunday and Saturday. (Reworking of feat+doc: added GGanttChart/highlight-sundays #95)
  • New prop on GGanttChart: highlightedHours, number[]?, [] - When precision is set to hour, hours in array will be highlighted.

[fix] Fix #123 docs issue
[feat] merges pull request #128 (which fixes #127) by @oldru27 - Ensure bar label is in view when bar start and/or end is beyond viewable range.

[feat] Adds new click event for row labels (closes #116).

  • New event on GGanttRow: click-label, {MouseEvent, label, id}
  • Also adds new id prop for GGanttRow as that, along with the label, will be returned in the click event.

[feat] Optionally add a title and subtitle to the bar tooltips.

  • New prop on GGanttChart: showLabelAsTooltipTitle, boolean?, true. When true, adds the bar label property followed by a line break to the bar tooltip.
  • New property on ganttBarConfig type: tooltipSubtitle, string?, "". When provided, adds a line break and the value to the end of the bar tooltip.
    • Make sure to sanitize these values.
    • See updated docs

Updated docs, added new doc for ganttBarConfig to advise where pre-existing properties exist and how they affect the bars.

Olivier Druais and others added 6 commits October 22, 2024 09:48
- Make sure the bar label is centered on the visible part of the bar, even when the bar overflows.
- The bar label is wrapped into a container whom position is calculated based on the barContainer position and bar position (xStart, xEnd)
If the bar is going out of bounds, make the tooltip visible. Take into account the position of the chart in the page.
Fix duplicate key warning when switching to hour precision
Adds day names to time axis when using day or date mode.

Chose this implementation in order to avoid making sweeping changes to the pre-existing implementation.
Enable or disable right click dragging. Useful if you want to use the right-click context menu but want to prevent accidental bar movement.
@albadedan albadedan changed the title Fix duplicate key warning Fix issue, add new features. Dec 2, 2024
Fix zunnzunn#125
[feat] re-working of zunnzunn#95

Adds new props to handle different methods of highlighting dates and hours.

- `highlighted-days-of-week` to handle highlighting the same day or days every week without having to calculate their dates. Useful for highlighting weekends. Set to [0, 6].
- `highlighted-dates` for when you want to highlight specific dates.
- `highlighted-hours` for when you are using hour precision.

`highlighted-units` probably depreciated now.
new prop `disableDragging` to disable bar dragging at the chart level.
fixes zunnzunn#89

Adds new prop to GGanttRow to disable dragging on whole rows. (Note that bundles will still cause dragging, but that still happens even if you manually set the config flag as well.)
@albadedan albadedan changed the title Fix issue, add new features. Fix issues, add new features. Dec 4, 2024
Update docs to notify user that grid prop must be used in order for highlighting props to have any effect.
New feature to add click events for row labels which will close zunnzunn#116.
Also adds new id prop for rows as that will be returned via the click event along with the label itself.
Reworking of prior work to make it more sensible.

- Adds new prop `showLabelAsTooltipTitle` on GGanttChart. Deafult `true`. Shows the bar item's label as a title (followed by a line break) to the tooltip. Make sure to sanitize label.
- Adds new `subtitle` field to `ganttBarConfig` type. If provided, value will be appended to the end of the tooltip. Make sure to sanitize the value.
Added new doc for ganttBarConfig Object.
Updated docs.
Updated example.
@Xeyos88
Copy link

Xeyos88 commented Dec 31, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants