|
From: Robert H. <ha...@st...> - 2023-07-05 21:21:16
|
Alex, I might suggest trying the SwingJS version. This is a more robust
version that is much tighter in terms of globals and also has been
implemented as a progressive web app. It isn't set up right now for easy
delivery, and I would have to work on it a bit more, but if you are
interested, it's probably time for me to get this out there.
If you are interested, let me know. What's your application context?
Bob
On Wed, Jul 5, 2023 at 4:13 PM Yang, Alex via Jmol-users <
jmo...@li...> wrote:
> Hi Mark,
>
>
> Yes I was able to get it working in a non-reactive environment.
>
>
> There is an "cannot set properties of undefined" error in the console:
>
> JSmol load jsmolApplet loadClazz...
> JSmol.min.js:280 JSmol load jsmolApplet start applet...
> core.mjs:25499 Angular is running in development mode.
> JSmol.min.js:279 JSmol exec jsmolApplet loadClazz null -- OK
> JSmol.min.js:178 xhr.open async=false
> url=../../assets/jsmol/j2s/core/package.js
> JSmol.min.js:178 xhr.open async=false
> url=../../assets/jsmol/j2s/core/package.js
> JSmol.min.js:178 xhr.open async=false
> url=../../assets/jsmol/j2s/core/corejmol.z.js
> JSmol.min.js:178 xhr.open async=false
> url=../../assets/jsmol/j2s/core/corescript.z.js
> JSmol.min.js:279 JSmol exec jsmolApplet start applet null -- OK
> JSmol.min.js:178 xhr.open async=false
> url=../../assets/jsmol/j2s/JV/StateCreator.js
> JSmol.min.js:178 xhr.open async=false
> url=../../assets/jsmol/j2s/JV/JmolStateCreator.js
> JSmol.min.js:293 ERROR TypeError: Cannot set properties of undefined
> (setting '0')
> at Function.eval [as drawImage] (corejmol.z.js:795:154)
> at Object.eval [as drawImage] (corejmol.z.js:816:362)
> at Object.eval [as drawImage] (corejmol.z.js:2463:73)
> at Object.eval [as getScreenImageBuffer] (corejmol.z.js:2465:169)
> at Object.eval [as renderScreenImageStereo] (corejmol.z.js:2570:246)
> at Object.eval [as updateJS] (corejmol.z.js:2571:496)
> at Object.eval [as update] (corejmol.z.js:1799:493)
> at h (JSmol.min.js:293:312)
> at timer (zone.js:2367:41)
> at _ZoneDelegate.invokeTask (zone.js:402:31)
>
> Which I think is happening because the library is being initialized before
> the angular view is fully rendered. The error does go away along with the
> other logs from JSmol.min.js if I add a small delay before calling
> Jmol.getApplet("jsmolApplet", Info) the initial load or using a button to
> call the function.
>
>
> Thank you,
>
> Alex
> ------------------------------
> *From:* Mark Perri <pe...@so...>
> *Sent:* Wednesday, July 5, 2023 11:59:50 AM
> *To:* jmo...@li...
> *Cc:* Yang, Alex
> *Subject:* Re: [Jmol-users] Jmol Angular integration
>
> [*CAUTION:* Non-UBC Email]
> Hi Alex,
>
> Are there any errors in the console? Do you have it working in a
> non-reactive environment first?
>
> Thanks,
> Mark
>
> On Tue, Jul 4, 2023 at 12:47 PM Yang, Alex via Jmol-users <
> jmo...@li...> wrote:
>
>> Hi, I'm trying to add JSmol into an Angular project and I'm having
>> troubles with it. I am able to load the script and it seems like I'm
>> able to generate a JSmol object, however I am unable to render the applet.
>>
>>
>> Are there any resources someone can point me towards.
>>
>>
>> Thank you,
>>
>> Alex
>> _______________________________________________
>> Jmol-users mailing list
>> Jmo...@li...
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
> _______________________________________________
> Jmol-users mailing list
> Jmo...@li...
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
*We stand on the homelands of the Wahpekute Band of the Dakota Nation. We
honor with gratitude the people who have stewarded the land throughout the
generations and their ongoing contributions to this region. We acknowledge
the ongoing injustices that we have committed against the Dakota Nation,
and we wish to interrupt this legacy, beginning with acts of healing and
honest storytelling about this place.*
|