Our state of the art Gantt chart


Post by trevor.k »

First of all - just wanted to take a brief second and commend Bryntum on making great products. Keep up the good work.

A glitch has recently been brought to my attention when rendering a Vue component within the cells of a column. I'm experiencing the content of the cell being repeated within the same cell. This could very well be something I'm doing wrong. Below, I've whittled down the code to the most basic form I could that demonstrates the problem.

Bryntum Version: Vue2 5.5.0 (also tried with 5.6.7)
Chrome 122, Firefox 95 (doesn't seem to be a browser specifc issue)
No console errors

This problem happens when scrolling up or down, and seems to only happen on larger data sets where there are at least a couple hundred rows. Continuing to scroll up or down until the rows are not visible, then scrolling them back into view resolves it temporarily. It seems like the renderer is having a difficult time keeping up with the scrolling rows.

It seems to be fairly random, and I'm unable to pinpoint the culprit. Within our fully configured Gantt, fiddling around with changing the height, rowHeight, and even adding/removing the tbar seems to have a bit of an effect on how prevalent the glitchiness is. Strangely, when using this most basic example below, different height settings seem to have no affect (or lesser) and the repeated content is somewhat more consistent. It also is not restricted to the percentDone column, but has similar unpredictability on any column where a vue component is rendered.

I have followed the Bryntum example found here:

https://bryntum.com/products/gantt/docs/guide/Gantt/integration/vue/guide#implement-column-renderer

Code sample to reproduce:

<template>
  <div>
    <bryntum-gantt
            ref="gantt"
            :columns="columns"
            :height="800"
            :tasks="tasks"
            v-bind="ganttConfig"  
/> </div>
</template> <script> import { BryntumGantt } from '@bryntum/gantt-vue'; import "@bryntum/gantt/gantt.classic-dark.css";
export default { components: { BryntumGantt, }, data() { let tasks = []; for (let i=1; i < 300; i++) { tasks.push( { id : i, name : `Task #${i}`, percentDone: 100 }, ); } return { tasks : tasks, columns : [ { align : 'center', field : 'percentDone', vue : true, renderer({ record, value, isExport }) { return { is : 'progress-circle', record, value: record._data.percentDone, }; } }, ], } }, } </script>

Screenshot:

Image

It may also be important to note that it seems the content of the component is irrelevant. It could be as simple as a basic template-only component that returns a single character, and the chracter will be repeated as well.

Component:

<template>
<div>
x
</div>    
</template>

Screenshot:
Image

I'm at a loss here. Any help would be greatly appreciated.

Thanks!


Post by marcio »

Hey trevor.k,

Thanks for reaching out and welcome to our forums! :)

I tried to reproduce the behavior that you mentioned with the snippet that you provided, but with that snippet, it rendered correctly after scrolling multiple times.

Could you provide more context if I'm trying to reproduce correctly?

I'm sharing a video and a sample project that you can edit and add your ganttConfig for us to debug and check what's causing that behavior.

You can also get more info on how to ask for help by checking our guidelines https://www.bryntum.com/forum/viewtopic.php?f=1&t=772

Attachments
28.02.2024_19.23.36_REC.mp4
(3.03 MiB) Downloaded 13 times
inline-data.zip
(160.98 KiB) Downloaded 11 times

Best regards,
Márcio


Post by trevor.k »

Hi Marcio. Thanks for your response.

I will add, that for whatever reason, it does seem to happen much less when using the mouse scroll wheel. It happens more often when dragging the vertical scroll bar. It might also help if you increase the number of rows from 300. If I increase the rows to 3000 for example, the problem becomes exponentially worse. I've recorded a video clip to help demonstrate. I start off scrolling with the mouse wheel, and everything is rendering fine. Once I drag the vertical scroll bar, the repeated content starts occuring:

https://photos.app.goo.gl/YpEiBahAn87F1GVa8

This also does not happen if I use something such as the native showCircle. It's only when using a vue component. The reason I'm using a custom progress component is because we require some conditional logic and colours.


Post by marcio »

Hey trevor.k,

Just to confirm, are you using the same project that I shared? I used the one that I shared earlier, and increased the number of tasks to 3000 records, and tried to scroll with the vertical scroll bar. As you can see in the video, the behavior didn't happen, and I tried on Mozilla and Chrome using the latest Gantt version.

https://drive.google.com/file/d/1Sdg865V4jGa-YDdUtONm67lObSqKDxFi/view?usp=drive_link

Best regards,
Márcio


Post by trevor.k »

Hi Marcio,

I just downloaded and ran your app. It works because you're rendering it inline. I mentioned that there is no problem when rendering inline. The problem happens once I reference a vue component, as referenced in the docs. That link again is here:

https://bryntum.com/products/gantt/docs/guide/Gantt/integration/vue/guide#implement-column-renderer

Here are the steps to reproduce it within your provided app:

  1. Create a src/ProgressCircle.vue file containing:

    <template>
    <div>
    x
    </div>    
    </template>
  2. Register the component globally by adding this line to main.js:

    Vue.component('progress-circle', require('./ProgressCircle.vue').default);
    
  3. Change your column renderer within App.vue to the following:

          columns : [
    	  	      {
    	        	  align : 'center',
    		          field : 'percentDone',
    		          vue   : true,
    					renderer({ record, value, isExport }) {
    							return {
    								is : 'progress-circle',
    								record,
    								value: record._data.percentDone,
    							};
    						}				  
    } ]
  4. Increase the iterations to 3000 to make the issue more apparent.

  5. Click and hold the vertical scroll bar the drag down and you should see the 'x' repeated in the cells

Here is a video of all the steps:

https://photos.app.goo.gl/WpLYHXaCcL2rSfYn9

Thanks again for your help and time


Post by marcio »

Hey trevor.k,

Thanks for the clarification! I created a ticket to investigate/fix that https://github.com/bryntum/support/issues/8721

Please follow the updates in the GH ticket.

Best regards,
Márcio


Post Reply