nhannht / obsidian-smart-gantt

https://obsidian-smart-gantt.pages.dev
MIT License
17 stars 2 forks source link

[possible bug]: Maximum text size in diagram exceeded #6

Open DaisukeMiyazaki opened 1 month ago

DaisukeMiyazaki commented 1 month ago

@nhannht Thank you for this awesome plugin!

My checkboxes (tasks) contain more than 50 characters per line and the attached error showed up. This resulted in failing on rendering the gantt chart.

I know this is my data incompatibility and should keep them all shorter, but I'd appreciate it if the plugin can trim the letters like "ThisIsAnExampleTaskTh....." etc.

スクリーンショット 2024-06-17 17 02 43
DaisukeMiyazaki commented 1 month ago

Or potentially, this might be caused by the fact that my tasks (including done and not done) have over 3500 checkboxes in the vault, and exceeding the limit of the mermaid.

https://github.com/mermaid-js/mermaid-cli/issues/113

nhannht commented 1 month ago

Thank you for doing research, it helps me reduce the time to fix. I just add in the new version

mermaid.initialize({
    startOnLoad: true,
    maxTextSize:99999999,
                })

Can you try it and report to me if the hotfixs worked?

I will write some scripts to generate very big size samples and test this case. But at the minimum time, I need at least tomorrow to have a new patch.

DaisukeMiyazaki commented 1 month ago

@nhannht Thank you for your quick response on this! Seems like I've faced another issue here. I forked this repository and changed the maxTextSize: 500000 as well but still the same error occurs...

スクリーンショット 2024-06-17 22 27 38
DaisukeMiyazaki commented 1 month ago

I'm going to add the console error here as well. Some kind of parsing might be failing when converting the checkboxes to HTML? on rendering.

スクリーンショット 2024-06-17 22 41 03
nhannht commented 1 month ago

Haizz, seriously, if I don't have the same sample from your case (actually it means your private data).

It is hard for me just to guess what happened. We know there must be some task which produced the bug. But we have thousands of tasks in your vault and impossible for us to guess which is the cause.

Now, I suggest a simple workaround to debug, it not mean the final solution, it just the way to find the cause of the problem. Please only use the "Current file" filter. Well, there will be a change we can narrow down which file has the task that caused the error. You don't need to report me now. Just use the plugin like it was limited in feature until you find the file that causing the error. After that, if you don't mind, please show me all the tasks in that file. (change the sensitive info if needed).

nhannht commented 1 month ago

@nhannht Thank you for your quick response on this! Seems like I've faced another issue here. I forked this repository and changed the maxTextSize: 500000 as well but still the same error occurs...

スクリーンショット 2024-06-17 22 27 38

And about this report, I want to make sure about the phrase "same error". Are you sure it is the same error as the above error, I don't see the sentence "Maximum text size in diagram exceeded"