Comments (11)
Can you give me some example code to work with? @Kendzi-x
I can't reproduce it
from gantt-schedule-timeline-calendar.
Thank you for a quick response!
For example we can take this example: https://github.com/neuronetio/gantt-schedule-timeline-calendar/blob/master/examples/simple/index.js
with this data:
const itemsFromDB = [
{
id: '1',
label: 'Item 1',
rowId: '1',
time: {
start: GSTC.api.date('2020-01-06').startOf('day').valueOf(),
end: GSTC.api.date('2020-01-20').endOf('day').valueOf(),
},
},
{
id: '2',
label: 'Item 2',
rowId: '1',
time: {
start: GSTC.api.date('2020-01-06').startOf('day').valueOf(),
end: GSTC.api.date('2020-01-09').endOf('day').valueOf(),
},
},
{
id: '3',
label: 'Item 3',
rowId: '1',
time: {
start: GSTC.api.date('2020-01-11').startOf('day').valueOf(),
end: GSTC.api.date('2020-01-14').endOf('day').valueOf(),
},
},
{
id: '4',
label: 'Item 4',
rowId: '1',
time: {
start: GSTC.api.date('2020-01-11').startOf('day').valueOf(),
end: GSTC.api.date('2020-01-14').endOf('day').valueOf(),
},
},
{
id: '5',
label: 'Item 5',
rowId: '1',
time: {
start: GSTC.api.date('2020-01-08').startOf('day').valueOf(),
end: GSTC.api.date('2020-01-12').endOf('day').valueOf(),
},
},
{
id: '6',
label: 'Item 6',
rowId: '1',
time: {
start: GSTC.api.date('2020-01-08').startOf('day').valueOf(),
end: GSTC.api.date('2020-01-12').endOf('day').valueOf(),
},
},
{
id: '7',
label: 'Item 7',
rowId: '1',
time: {
start: GSTC.api.date('2020-01-11').startOf('day').valueOf(),
end: GSTC.api.date('2020-01-15').endOf('day').valueOf(),
},
},
];
As you can see on the right part of the screenshot, if item 2 present, then items 5 and 6 are on the same position
from gantt-schedule-timeline-calendar.
That is, Items will always be arranged in the way they were added to the configuration. No matter how you move them on the chart. So as you add them, in that order they will go lower and lower. If it is very important for you to have more control over how items are arranged, I can add some option to the configuration with a function that will arrange these items. Then you will be able to implement your own arrangement mechanism - I will show you what the standard mechanism looks like and you will be able to modify it according to your needs and add it to the configuration. It just has to be really needed - because each new configuration makes the code more difficult to maintain and may cause errors. So if you really need it, let me know - if not, let's leave it as is 🙂
from gantt-schedule-timeline-calendar.
fixed in 3.33.17
from gantt-schedule-timeline-calendar.
@neuronetio Unfortunately version 3.33.17 works not correct.
I faked the labels but it's the same bars (no changes in the code, just lib version upgrade)
from gantt-schedule-timeline-calendar.
in 3.34.1
it looks like this:
from gantt-schedule-timeline-calendar.
In version 3.34.2
I also added an improvement so that the order of items is preserved even after constantly moving them around the timeline.
from gantt-schedule-timeline-calendar.
@neuronetio Thank you, now everything is shown correctly.
But I have one question about moving: As I think if tasks have the same start date, then we should preserve their order. But if one task starts before another, then it should be higher. What do you think?
Here is the "complex-1" example with the version 3.34.2:
from gantt-schedule-timeline-calendar.
@Kendzi-x I think it will be better to leave the order according to the way of adding items - then the user will be able to sort them according to his own idea. Additionally, by having one way of arranging elements, the code is easier to maintain.
from gantt-schedule-timeline-calendar.
Ah, I see. Then we can sort items after moving/resizing as we want. Good!
from gantt-schedule-timeline-calendar.
Yep, I got it. In our case I update all items after resize/move, so it's not a big deal to sort them also.
So sure it's okay to leave it as it is:)
from gantt-schedule-timeline-calendar.
Related Issues (20)
- Updating the state causes "weeks" calendar level to rebuild with the default "weekStart" HOT 9
- How to display milestone in a diamond shape? HOT 1
- Duplicate items appear when resizing the window HOT 3
- Create new dependencies. HOT 3
- How to add click event to bookmarks ?
- How to sort items inside one row HOT 6
- How to add click event for the "progress-bar" HOT 3
- The data I returned comes with a specific parameter, can the data border be dashed HOT 1
- Select a certain piece of data and click on split to see if it can be split into two parts HOT 2
- Split a progress bar into two progress bars HOT 1
- Updated chart items, how to update the view HOT 3
- Scroll multiplier doesn't work with float numbers and looks laggy HOT 5
- Unhandled typeerror out of nowhere reading 'dataIndex' HOT 2
- when the start date and end date is same the progress bar is not visible HOT 5
- Connection error HOT 1
- How to scroll to position vertically in coding?
- How to change the current column width by dragging the date cell like excel?
- Issue with Rendering Component After Upgrading GSTC to Latest Version HOT 2
- How to entegrate this plugin features to my .net core mvc html page ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gantt-schedule-timeline-calendar.