autodesk-platform-services / aps-iot-extensions-demo

APS DataViz Extensions Demo:Visualizing IoT sensor data.
https://aps-iot-extensions-demo.autodesk.io
MIT License
11 stars 6 forks source link

Chronos-etu crashing the app #10

Closed dnenov closed 1 year ago

dnenov commented 1 year ago

Issue: enabling the line let timeslider = new ChronosEtu.TimeSlider(container.clientWidth, container.clientHeight, '2022-01-01', '2022-02-01'); causes the app to freeze, no error thrown.

Expected behavior: enable the timeline Widget.

Prerequisits: <script src="https://unpkg.com/chronos-etu@7.0.0/dist/chronos-etu.js"></script> in index.html; npm installed chronos-etu (also tried var TimeSlider= require("chronos-etu"); inside server.js but getting Uncaught ReferenceError ReferenceError: self is not defined

yiskang commented 1 year ago

Hi @dnenov,

You cannot require chronos-etu in server.js. It's a client-side library, not for the server side.

Please do that within the public folder instead.

In addition, I have a wrapper of forge-dataviz-iot-react-components here that allows you to leverage the timeline control of forge-dataviz-iot-react-components](https://github.com/Autodesk-Forge/forge-dataviz-iot-react-components) directly.

https://github.com/yiskang/forge-dataviz-iot-react-components-es5

Here are the examples of using the timeliner from this wrapper:

dnenov commented 1 year ago

Hi, @yiskang! Thanks for the great reply once again, you are always there to supply the correct answer!

chronos-etu was only referenced in the index.html and then initialized inside the timeline.js which is inside the public folder. I could utilize the wrapper you created, but in certain circumstances (such as not supplying the correct css style) I was able to 'reproduce' the same issue, which basically is the app freezing. Is the control picky to some positional criteria and if that's not satisfied it is causing a crash? I am now working my way to implementing the Autodesk.DataVisualization.UI.ChronosTimeSliderControl through trial-and-error, and if I can put my finger on the condition that creates the issue, I will report it here.

Thank you once again!

yiskang commented 1 year ago

Hi @dnenov,

Well... if so, that is weird, but I cannot reproduce this issue on my side.

It would be great if you could consider providing a minimum & runnable test code sample for investigation. I'm happy to help to resolve the problem you're facing. BTW, instead of posting here, you can also report to aps (DOT) help (AT) autodesk (DOT) com, which is one of our official support channels.

Cheers,

dnenov commented 1 year ago

Amazing, I will do so from now on! For this particular case, I will quote the current issue thread, if needed.

Once again, thank you so much for your help on the matter, Eason!