Skip to content

[ZEPPELIN-6265] Support classic Helium viz packages in new UI#5006

Merged
tbonelee merged 33 commits into
apache:masterfrom
tbonelee:helium-vis
Sep 19, 2025
Merged

[ZEPPELIN-6265] Support classic Helium viz packages in new UI#5006
tbonelee merged 33 commits into
apache:masterfrom
tbonelee:helium-vis

Conversation

@tbonelee

@tbonelee tbonelee commented Aug 2, 2025

Copy link
Copy Markdown
Contributor

What is this PR for?

This PR enables the use of external Helium visualization packages, which are previously available only in the classic UI, in the new UI.

The process of loading and importing Helium packages, as well as rendering them, closely follows the logic from the classic UI.

Since the new-style visualization classes in the new UI are not compatible with the existing ones, the implementation branches accordingly to handle both.

Classic Helium visualization packages depend on legacy technologies such as AngularJS, jQuery, and several visualization libraries, which had to be included as a result.
For Bootstrap styles, conflicts arose with existing styles, so I copied and modified the original HTML templates to prevent clashes.
If a Helium package attempts to use the original HTML template, it will be replaced with the modified version.

Additionally, I identified that the Helium visualization support classes from the discontinued development of the new UI are no longer in use, so I removed them.

What type of PR is it?

Improvement

Todos

  • [v] - Added support for loading Helium packages
  • [v] - Fixed style mismatches in Helium packages
  • [v] - Other functional issues resolved

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-6265

How should this be tested?

  • Enables a classic Helium visualization package in the classic UI, and verify that it works in the new UI.
    • Note: The /helium package management page has not yet been added.

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

@@ -0,0 +1,28 @@
import { HeliumPackageType } from '@zeppelin/helium';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add the Apache License header at the top of this file? This ensures compliance with ASF requirements. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for checking! I've fixed it with other Rat-check violations.

icon: string;
type: HeliumType;
// tslint:disable-next-line:no-any
class: any;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use unknown (with type narrowing)?

constructor() {}

// tslint:disable-next-line:no-any
addDragDropDirectives(module: any): void {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use IModule type from @types/angular?

Comment on lines +115 to +119
function(dragDropService: any) {
return {
restrict: 'A',
// tslint:disable-next-line:no-any
link: function(scope: any, element: any, attrs: any) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about removing the explicit any? Type inference would work correctly here.

@tbonelee

Copy link
Copy Markdown
Contributor Author

@seung-00
Replaced any types with proper interfaces for classic visualizations.

Added new interfaces instead of reusing the Visualization class from zeppelin-vis, since Helium packages are eval’d at runtime and their prototype chains don’t match. Interfaces were preferred over classes because only the shape is shared across eval’d definitions.

module.service('customDragDropService', [
'$parse',
// tslint:disable-next-line:no-any
function($parse: any) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be hard to use the types provided by @types/angular here as well?

And I'm not fully sure, but if the TS compiler can infer the type in some places without explicitly declaring it, it might be nice to rely on inference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking! I'll update it to utilize TS type inference.

this.columns = updatedClassicData.columns;
this.rows = updatedClassicData.rows;
this.comment = updatedClassicData.comment;
}.bind(this)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using an arrow function instead of bind? I think it's more readable and more modern way.

const updatedClassicData = this.convertToClassicFormat(modernTableData);
this.columns = updatedClassicData.columns;
this.rows = updatedClassicData.rows;
this.comment = updatedClassicData.comment;

@seung-00 seung-00 Aug 19, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but it looks like the proxy was supposed to be updated. However, it seems that the TableDataAdapterService instance, which is bound, is being updated instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, the this binding was incorrect here. So I changed it to use arrow functions and access through variable names instead.

@tbonelee tbonelee force-pushed the helium-vis branch 2 times, most recently from 8410ad5 to 840c9c3 Compare August 20, 2025 15:36
@tbonelee

Copy link
Copy Markdown
Contributor Author

@seung-00 I've checked for places where type inference can be used as suggested in the review, and fixed the incorrect this bindings. I've also added proper type definitions to replace any usage in several places.

@Reamer Reamer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor comment on the backend code. I am unable to review the frontend part.

@tbonelee

Copy link
Copy Markdown
Contributor Author

Rebased onto the master branch and add some Prttier exclusion rules for *.min.css and *.min.js files

@ParkGyeongTae

Copy link
Copy Markdown
Member

@tbonelee Please rebase onto the latest master to resolve the conflicts.

@tbonelee

Copy link
Copy Markdown
Contributor Author

Rebased it onto the master branch

@ParkGyeongTae ParkGyeongTae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@tbonelee tbonelee merged commit 948f165 into apache:master Sep 19, 2025
15 of 18 checks passed
tbonelee added a commit that referenced this pull request Sep 19, 2025
### What is this PR for?
This PR enables the use of external Helium visualization packages, which are previously available only in the classic UI, in the new UI.

The process of loading and importing Helium packages, as well as rendering them, closely follows the logic from the classic UI.

Since the new-style visualization classes in the new UI are not compatible with the existing ones, the implementation branches accordingly to handle both.

Classic Helium visualization packages depend on legacy technologies such as AngularJS, jQuery, and several visualization libraries, which had to be included as a result.
For Bootstrap styles, conflicts arose with existing styles, so I copied and modified the original HTML templates to prevent clashes.
If a Helium package attempts to use the original HTML template, it will be replaced with the modified version.

Additionally, I identified that the Helium visualization support classes from the discontinued development of the new UI are no longer in use, so I removed them.

### What type of PR is it?

Improvement

### Todos
* [v] - Added support for loading Helium packages
* [v] - Fixed style mismatches in Helium packages
* [v] - Other functional issues resolved

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6265

### How should this be tested?
* Enables a classic Helium visualization package in the classic UI, and verify that it works in the new UI.
  - Note: The `/helium` package management page has not yet been added.

### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Closes #5006 from tbonelee/helium-vis.

Signed-off-by: ChanHo Lee <chanholee@apache.org>
(cherry picked from commit 948f165)
Signed-off-by: ChanHo Lee <chanholee@apache.org>
@tbonelee tbonelee deleted the helium-vis branch September 19, 2025 12:17
@tbonelee

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews, I've merged this into master and branch-0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants