When will the transition from Java to Javascript be complete?

It's been nearly ten years since MATLAB began to transition from Java to Javascript graphics. Is there any roadmap for when this transition will be complete? Long ago I was told that the final product would be seemless, i.e. traditional graphic commands would invoke Javascript yet otherwise function like the legacy Java version. Despite many improvements in the new system, the two are still quite different. The difference is most obvious on Mac systems, where uifigures are clearly handled separately from figures. I have stayed with traditional figures for most of this period, waiting for the Javascript alternative to mature, but this is no longer viable due to frequent crashes (as described here).
Recent experence suggests that uifigures are almost ready for general use, but there are a number of missing features. For me, the big ones are limited export options (e.g., improper size scaling for PDF) and the lack of an Extent property; the latter helps size items based on the text held inside them. If I had those features, I could justify the time investment in switching over to uifigures full time. There are also a lot of undocumented things, such as the fact that classic uicontrols can go inside Javascript uifigures, even though the formal documentation says otherwise. I wish Mathworks would be more forthright about this substantial change, focusing less on Live Editor and App Designer updates in each release.

6 件のコメント

dpb
dpb 2024 年 7 月 27 日
" I wish Mathworks would be more ... focusing less on Live Editor and App Designer updates in each release."
Amen, brother! There are many more core issues with HG2 and graphics in general that are far more important than fancy gewgaw UI stuff that mostly just gets in the way of actual base productive coding/problem solving instead focusing on "pretty" instead.
Adam Danz
Adam Danz 2024 年 7 月 31 日
編集済み: Steven Lord 2024 年 7 月 31 日
Hello @Daniel Dolan, the beta version of the new desktop serves as a peek into the future.
[SL: fixed typo]
Adam Danz
Adam Danz 2024 年 7 月 31 日
@Daniel Dolan, could you provide an example of the missing extent property you mentioned in uifigures? I'm not quit sure what this is referring to.
Daniel Dolan
Daniel Dolan 2024 年 7 月 31 日
@Adam Danz I've downloaded the R2024b beta and added the new desktop, but I don't see that either solves the Java/Javascript schism. Legacy figures have features I still need, such as true vector graphic export, but presumably they go away at some point in the figure; I haven't tested it yet, but I suspect my Mac will crash if such figures are routinely opened and closed (as when used for dialog boxes) as has been the case for several months. Javascript figures are better suited for dialog boxes, but I can't reliably export those to a vector *.pdf file for journal submissions. So I'm still trapped between the two worlds, with the Java side collapsing for Mac users.
Regarding the Extent property, classic uicontrols (text, edit, etc.) had both a Position and Extent property. You could fill a control with some amount of text, then query the latter to see how much horiztonal/vertical space is needed to accomodate that text. Using this information, the Position property could be set so that the content fit correctly, automatically accounting for font and its size. The corresponding Javascript controls, such as uilabel, lack the Extent property. This makes it impossible to size items programmatically without some underlying guesswork about the font's width and local display resolution; I've been down this rabbit hole, and it is not pretty. See @Walter Roberson's comments here for a nice summary of the problem.
Adam Danz
Adam Danz 2024 年 7 月 31 日
Thank for the clarification!
dpb
dpb 2024 年 7 月 31 日
And note the date on that thread is four years ago, so not like it's something new...just exacerbated by the changeover.

サインインしてコメントする。

 採用された回答

Adam Danz
Adam Danz 2024 年 8 月 9 日
編集済み: Adam Danz 2024 年 8 月 9 日

4 投票

Thanks for your questions and curiosity about the JavaScript transition. I highly recommend that you try out the beta version of the New Desktop for MATLAB by downloading it from the File Exchange. This is an exciting opportunity for you to get early access to upcoming features, including dark theme in MATLAB Graphics. Releasing a beta like this is something new for us and goes beyond just commenting on feature work. Not only does it give you a sneak peek into the future, but it also provides an opportunity for us to gather valuable feedback.
Beta users have access to a feedback button for easy communication, which MATLAB developers actively review and prioritize. It's by far the most effective way for you to influence the product.
I'd like to add some clarification on some of the topics covered in this thread.
figure() | uifigure()
uifigure was released in R2016a along with AppDesigner to support the new AppDesigner infrastructure and to have a different set of default property values that make more sense with apps. If there is any concern that figures are being replaced by uifigures, I can reassure you that there are no such plans. Both figure and uifigure will co-exist and will continue to support uicontrol components and app-based components respectively. You can verify and experience this now in the New Desktop for MATLAB.
Exporting figures
The relatively recent set of figure exporting functions were designed to simplify and streamline the export process by targeting specific use cases: exporting data visualizations (exportgraphics, copygraphics) and capturing apps (exportapp). This approach allowed us to address user-requested enhancements in a more scalable way than cramming everything into the ever-growing print function. For example, in R2024a, you can specify dimensions and padding in figure exports in MATLAB Online, which is a hint of what's to come. Reference the summary page in the documentation for details.
Controlling layout in apps
As mentioned by others in this thread, UI components lack extent properties, which can interfere with some app development workflows. In many cases, uigridlayout is a better alternative. Not only can you nest uigridlayouts, but you can also specify "fit" for any column or row to adjust its width or height according to its contents. App resize is also more responsive when using uigridlayout. The uigridlayout workflow offers quite a lot of flexibility while reducing the need to compute extents for space management.
Give us feedback
Your feedback is incredibly valuable to us. Please use the feedback button in the New Desktop for MATLAB to share your thoughts and any issues you may find. Alternatively, you can reach out to Tech Support.

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 7 月 27 日
編集済み: Walter Roberson 2024 年 7 月 27 日

2 投票

When will the transition from Java to Javascript be complete?
19 January 2038

4 件のコメント

dpb
dpb 2024 年 7 月 27 日
Or, the 12th of Never...
Daniel Dolan
Daniel Dolan 2024 年 7 月 30 日
I appreciate the dark humour, but this breaks a lot of my stuff. Based on the current documentation, there is a clear break between Java and Javascript graphics that is not getting better. For example, the only way to create true vector files is with the Java graphics, which aren't consistently working for Mac users. Sure, you can always generate a bitmap, but that's not great for publications.
Anyone from Mathworks willing to chime in here?
dpb
dpb 2024 年 7 月 30 日
Very, very rare for Mathworks to comment on either features or timetables, so it's not likely, but there's always that first time/chance.
Submitting bug reports every time you run into one of these issues is the only way to bring things to the attention of official Mathworks support.
Walter Roberson
Walter Roberson 2024 年 7 月 30 日
Is there any roadmap for when this transition will be complete?
There is no public roadmap for when the transition will be complete. Any internal roadmap that Mathworks has would be only approximate.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDownloads についてさらに検索

製品

リリース

R2024a

質問済み:

2024 年 7 月 27 日

編集済み:

2024 年 8 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by