You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by "Ganko, Marek (Nokia - PH/Quezon City)" <ma...@nokia.com> on 2017/06/19 08:51:34 UTC

Spell Helium plugin

Hi,


I'm testing my Helium Spell plugin written in angular - I'm using Zeppelin from current master unreleased version.

How can I trigger my angular component from the Helium plugin?

I tried to attach my module like this:


    angular.module('zeppelinWebApp').requires.push('myPlugin');


and launch it in many different ways, but I didn't managed to actually run it.

I achieved to compile my component using angular and pass the result as a promise to SpellResult class, but it resolves as a string instead of html.


Thanks,

Marek

Odp.: Spell Helium plugin

Posted by "Ganko, Marek (Nokia - PH/Quezon City)" <ma...@nokia.com>.
Hi Park,


My general use case is to have possibility to export and import notes on my internal git repository (push and pull) as a main storage and authorization layer for further notes sharing.

I wanted to explore the way to achieve that using Helium spell plugin so I created angular plugin which is listing the notes and runs git commit+push or git pull to import one.


This is my current piece of code to run it:

import {
  SpellBase,
  SpellResult,
  DefaultDisplayType,
} from 'zeppelin-spell';


angular
  .module('myModule', [])
  .component('myComponent', {
    template: `<div>It works!</div>`
  });

angular.module('zeppelinWebApp').requires.push('myModule');

export default class MyPlugin extends SpellBase {
  constructor() {
    super('%myplugin');
  }

  interpret() {
    const promise = new Promise(resolve => {
      angular.injector(['ng', 'myModule']).invoke(($rootScope, $compile) => {
        const element = $compile(`<my-component></my-component>`)($rootScope);
        $rootScope.$digest();
        resolve(element.html());
      });
    });

    return new SpellResult(promise, DefaultDisplayType.HTML);
  }
}

Thing is that type "DefaultDisplayType.HTML" is not properly handled for functions, objects and promises (it sets DefaultDisplayType.TEXT as a default one)

I already fixed that in the zeppelin-spell/spell-result.js file - I will add a PR shortly.



Overall I think the best solution would be to either add possibility to share the notes between the users or add functionality to run your scripts on pre and post import/export actions.

I found one improvement requestwhich could be achieved using pre-import script: https://issues.apache.org/jira/browse/ZEPPELIN-1793

Import\export between Zeppelin and Jupyter notebook formats<https://issues.apache.org/jira/browse/ZEPPELIN-1793>
issues.apache.org
As a user doing data analytics in Notebook environment, I would like not to be locked up with a single notebook implementation. Right now, Apache Zeppelin has it's ...


Thanks,
Marek



________________________________
Od: Park Hoon <1a...@gmail.com>
Wysłane: 19 czerwca 2017 18:41:03
Do: users@zeppelin.apache.org
Temat: Re: Spell Helium plugin

Hi. Thanks for sharing your problem while using Spell.


Could you share the exact use case?

On Mon, Jun 19, 2017 at 5:51 PM, Ganko, Marek (Nokia - PH/Quezon City) <ma...@nokia.com>> wrote:

Hi,


I'm testing my Helium Spell plugin written in angular - I'm using Zeppelin from current master unreleased version.

How can I trigger my angular component from the Helium plugin?

I tried to attach my module like this:


    angular.module('zeppelinWebApp').requires.push('myPlugin');


and launch it in many different ways, but I didn't managed to actually run it.

I achieved to compile my component using angular and pass the result as a promise to SpellResult class, but it resolves as a string instead of html.


Thanks,

Marek


Re: Spell Helium plugin

Posted by Park Hoon <1a...@gmail.com>.
Hi. Thanks for sharing your problem while using Spell.


Could you share the exact use case?

On Mon, Jun 19, 2017 at 5:51 PM, Ganko, Marek (Nokia - PH/Quezon City) <
marek.ganko@nokia.com> wrote:

> Hi,
>
>
> I'm testing my Helium Spell plugin written in angular - I'm using Zeppelin
> from current master unreleased version.
>
> How can I trigger my angular component from the Helium plugin?
>
> I tried to attach my module like this:
>
>
>     angular.module('zeppelinWebApp').requires.push('myPlugin');
>
>
> and launch it in many different ways, but I didn't managed to actually run
> it.
>
> I achieved to compile my component using angular and pass the result as a
> promise to SpellResult class, but it resolves as a string instead of html.
>
>
> Thanks,
>
> Marek
>