Javascript diagram doesn't show up on HTMLViewer


I am trying to draw a diagram on HTMLViewer by using ‘js-sequence-diagrams’.
With a normal browser, I see the good result which shows a rectangle and text inside of the rectangle like below picture.

link picture

However, on HTMLViewer, when I just only put following code, I can see the rectangle.

t.WriteLine(" Title: Diagram ")

When I put another string like below, I just see text strings without any rectangle, and I think there is something wrong in drawing a diagram on HTMLViewer.

 t.WriteLine("    Title: Diagram         ")
 t.WriteLine("    Participant FIRST       ")          // <--------------

You can check the Xojo project file here.

Can you advise me why this issue happens?

Thanks in advance.

This could help :

I will try that and get you posted.

I tried to make a Windows registry to emulate higher version of IE but the issue remains. Um…

You have two options left to try :

See InvokeScriptAsync at the page I linked to, to run JavaScript with that control.

It’s because your JavaScript files aren’t getting created properly, or loaded, or anything at all really. It just happens to accidentally load the HTML file, but that’s because of some lucky things in how poorly the files are managed. Nothing is really happening in terms of JavaScript in the loaded web page.

You should seriously reconsider the approach you use for the file management. My opinion of the way you do it now is, “simply wrong, and redundant.” The Window Open event goes into CopyJSSource several times, where the CopyJSSource method has a select case to handle each one individually…

Be sure you are using your own subfolder in SpecialFolder.ApplicationData and not using that folder itself. You share it with every other app on the computer. Try something such as SpecialFolder.ApplicationData.Child("DiagramTest")

Do not use PathTypeAbsolute or NativePath, and especially do not flip flop back and forth between them. Get FolderItems by starting with a base SpecialFolder and navigating using the .Child method.

I would recommend you read over the FolderItem documentation.

@Tim Parnell . Thanks for the advice.

When the app is launched, it automatically generates a JavaScript file and the app doesn’t draw a diagram properly.
However, I can load the page with a normal browser with the generated file. That is why I am wondering.

@ Michel.
The uploaded project already uses a Webkit.
Using Native explorer is a good idea, but I am not good at using native codes. I will just try that.


It works just fine on Mac if you clean up the FolderItem disaster. I also discovered code that was breaking things in the JavaScript source - I can only assume you blindly copy and pasted that too.

Using fresh copies of the JavaScript and with proper file management, I present:

Couldn’t get it to work on Windows 10 quickly. I probably could if I spent time looking into it, but my time is not free.


Yes, I just copied the JavaScript from the web, and tried to make a file.
Can you let me know which part broke something in JavaScript?

Let me clean it up first and will try it again(Windows).

Thanks for your time.

@ Tim:
If you could share your project, I believe I can learn and go over the failure. Can you do that?
I can run the project on Mac as well.

Thank you Tim.
From your advice, I cleared up the messy code in FolderItem then I could finally see a correct shape in HTMLViewer.

Thanks again.