Skip to content

Commit

Permalink
Merge pull request #387 from safwansamsudeen/master
Browse files Browse the repository at this point in the history
New Features
  • Loading branch information
safwansamsudeen authored Apr 6, 2024
2 parents 93bf95d + 0b235d3 commit ea6259a
Show file tree
Hide file tree
Showing 24 changed files with 4,273 additions and 4,057 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["env"]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish on NPM
on:
push:
branches: [ master ]
branches: [master]

jobs:
publish:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"tabWidth": 4,
"singleQuote": true
}
}
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@
</p>

### Install

```
npm install frappe-gantt
```

### Usage

Include it in your HTML:

```
<script src="frappe-gantt.min.js"></script>
<link rel="stylesheet" href="frappe-gantt.css">
```

And start hacking:

```js
var tasks = [
{
Expand All @@ -45,20 +49,21 @@ var gantt = new Gantt("#gantt", tasks);
```

You can also pass various options to the Gantt constructor:

```js
var gantt = new Gantt("#gantt", tasks, {
header_height: 50,
column_width: 30,
step: 24,
view_modes: ['Quarter Day', 'Half Day', 'Day', 'Week', 'Month'],
bar_height: 20,
bar_corner_radius: 3,
arrow_curve: 5,
padding: 18,
view_mode: 'Day',
date_format: 'YYYY-MM-DD',
language: 'en', // or 'es', 'it', 'ru', 'ptBr', 'fr', 'tr', 'zh', 'de', 'hu'
custom_popup_html: null
header_height: 50,
column_width: 30,
step: 24,
view_modes: ["Quarter Day", "Half Day", "Day", "Week", "Month"],
bar_height: 20,
bar_corner_radius: 3,
arrow_curve: 5,
padding: 18,
view_mode: "Day",
date_format: "YYYY-MM-DD",
language: "en", // or 'es', 'it', 'ru', 'ptBr', 'fr', 'tr', 'zh', 'de', 'hu'
custom_popup_html: null,
});
```

Expand All @@ -69,6 +74,7 @@ You can add `dark` class to the container element to apply dark theme.
```

### Contributing

If you want to contribute enhancements or fixes:

1. Clone this repo.
Expand All @@ -78,22 +84,26 @@ If you want to contribute enhancements or fixes:
5. Open `index.html` in your browser, make your code changes and test them.

### Publishing

If you have publishing rights (Frappe Team), follow these steps to publish a new version.

Assuming the last commit (or a couple of commits) were enhancements or fixes,

1. Run `yarn build`

This will generate files in the `dist/` folder. These files need to be committed.

1. Run `yarn publish`
1. Type the new version at the prompt

Depending on the type of change, you can either bump the patch version or the minor version.
For e.g.,

```
0.5.0 -> 0.6.0 (minor version bump)
0.5.0 -> 0.5.1 (patch version bump)
```

1. Now, there will be a commit named after the version you just entered. Include the generated files in `dist/` folder as part of this commit by running the command:
```
git add dist
Expand All @@ -103,5 +113,6 @@ Assuming the last commit (or a couple of commits) were enhancements or fixes,

License: MIT

------------------
---

Project maintained by [frappe](https://github.com/frappe)
24 changes: 20 additions & 4 deletions dist/frappe-gantt.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
border-top-color: #333;
}

.gantt {
user-select: none;
-webkit-user-select: none;
}
.gantt .grid-background {
fill: none;
}
Expand Down Expand Up @@ -94,17 +98,28 @@
fill: #fcf8e3;
opacity: 0.5;
}
.gantt .week-highlight {
fill: #fcf8e3;
opacity: 0.5;
}
.gantt .month-highlight {
fill: #fcf8e3;
opacity: 0.5;
}
.gantt .year-highlight {
fill: #fcf8e3;
opacity: 0.5;
}
.gantt .arrow {
fill: none;
stroke: #666;
stroke-width: 1.4;
}
.gantt .bar {
fill: #b8c2cc;
stroke: #8D99A6;
stroke: #8d99a6;
stroke-width: 0;
transition: stroke-width 0.3s ease;
user-select: none;
}
.gantt .bar-progress {
fill: #acacfa;
Expand All @@ -114,7 +129,7 @@
}
.gantt .bar-invalid {
fill: transparent;
stroke: #8D99A6;
stroke: #8d99a6;
stroke-width: 1;
stroke-dasharray: 5;
}
Expand Down Expand Up @@ -159,7 +174,8 @@
.gantt .bar-wrapper.active .bar-progress {
fill: #9494f9;
}
.gantt .lower-text, .gantt .upper-text {
.gantt .lower-text,
.gantt .upper-text {
font-size: 12px;
text-anchor: middle;
}
Expand Down
Loading

0 comments on commit ea6259a

Please sign in to comment.