You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by 1ambda <gi...@git.apache.org> on 2017/03/06 05:52:57 UTC

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

GitHub user 1ambda opened a pull request:

    https://github.com/apache/zeppelin/pull/2098

    [ZEPPELIN-2217] AdvancedTransformation for Visualization

    ### What is this PR for?
    
    Even if we already have 2 useful transformation, they have limitations.
    
    - we can't configure axises in `PivotTransformation`
    - we can't use aggregator functions in `ColumnselectorTransformation`
    
    `AdvancedTransformation` provides both functionality. Additionally, it supports
    
    - dynamic parameter panel for configuring charts
    - multiple, configurable, detailed axises
    - maximizing / minimizing each panel
    
    #### Implementation Details: Configuring Chart
    
    See also: [an example visualization using AdvancedTransformation](https://github.com/1ambda/zeppelin-advanced-transformation/blob/master/examples/local-test-highcharts-columnrange/index.js)
    
    ```javascript
    
            this.spec = {
                /** axis spec */
                axis: {
                    'xAxis': { type: 'number', dimension: 'single', group: false, aggregator: false, },
                    'yAxis': { type: 'string', dimension: 'multiple', group: true, aggregator: false, },
                },
    
                /** parameter spec */
                parameter: {
                    'xAxisName': { type: 'string', defaultValue: '', description: 'Name of xAxis', },
                    'yAxisName': { type: 'string', defaultValue: '', description: 'Name of yAxis', },
                    'yAxisUnit': { type: 'string', defaultValue: '', description: 'Unit of yAxis', },
                }
            }
    
            this.transformation = new AdvancedTransformation(config, this.spec)
    ```
    
    #### Implementation Details: return value of `transform`
    
    ```javascript
    return {
      raw: tableData.rows,
      grouped: grouped, /** [{ group, groupedRows, aggregated }] */
        column: {
          allColumns: tableData.columns,
          groupColumns: groupColumns,
          aggregatedColumns,
          normalColumns: normalColumns,
       }
    }
    ```
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    NONE
    
    ### What is the Jira issue?
    
    [ZEPPELIN-2217](https://issues.apache.org/jira/browse/ZEPPELIN-2217)
    
    ### How should this be tested?
    
    1. Clone https://github.com/1ambda/zeppelin-advanced-transformation
    2. Copy `examples/local-test-highcharts-columnrange/local-test-highcharts-columnrange.json` into `$ZEPPELIN_HOME/helium`
    3. Install the above visualization in `localhost:9000/#helium`
    4. Test it
    
    ### Screenshots (if appropriate)
    
    ![advanced_transformation_axis](https://cloud.githubusercontent.com/assets/4968473/23598175/f886f880-027b-11e7-83d6-3cbfb97ff9a7.gif)
    
    ![advanced_transformation_param](https://cloud.githubusercontent.com/assets/4968473/23598178/fb4c0416-027b-11e7-9efe-8c09bb55da79.gif)
    
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-2217/advanced-transformation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2098
    
----
commit 0cf49fb17182d879ab7cc4972d2b17025ba6e278
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-06T05:39:48Z

    feat: AdvancedTransformation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Cool! LGTM. Looking forward to many usage of this advanced transformation by Zeppelin-Helium fans :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda I feel so sorry for my late response. Tested this patch \w your Helium package: zeppelin-ultimate-line-chart. Here are some thought and question(?) in my head. 
     
    1. "Save" & "Delete" button on top of the setting table
     - It'll be better there are some feedback after clicking these buttons like "Changes are successfully saved" or "Changes will be discarded". How about small `ngtoast` or bootstrap dialog? 
    ![small_btns](https://cloud.githubusercontent.com/assets/10060731/24440153/82552bcc-148d-11e7-96ee-3dd305917d21.gif)
    Probably ppl can click the trash can button by mistake. Then they'll lose the setting. To prevent this, we can provide some alert for this. 
    
     - I think we can hide "Save" & "Delete" button when the setting table is folded. A good example is in our interpreter setting page. As you know, users only can save/remove the setting when they click "edit" button. So how about activating those disket & trash btns only when the setting table is expanded? 
    
    2. no-group field 
     - What is difference between `no-group` and just letting `group` field as blank? Is there special reason for creating `no-group` field? (It's question actually :D)
    
     - `xAxis` and `yAxis` field size are different in `no-group` section.
    <img width="610" alt="screen shot 2017-03-29 at 2 25 50 pm" src="https://cloud.githubusercontent.com/assets/10060731/24440240/0ae00fc0-148e-11e7-999b-554af8d39f72.png">
    
    And again, this is really cool! 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @AhyoungRyu resolved all comments. Thanks for detailed review.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for Visual...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Few things are fixed. And really ready to be reviewed.
    
    - Use `description` field in `axisType` as description will be displayed using tooltip in 7c6768f
    - Fix yarn cache issue in c91a033, 4887800
    - Add `array:2-key` transform method which is designed for xyz chart (e.g bubble) in bf56761
    
    @AhyoungRyu @Leemoonsoo Please help review this. Here is a pretty chart you might be interested in using newly added transform method :)
    
    ![scatter](https://cloud.githubusercontent.com/assets/4968473/24864896/8fe4806e-1e40-11e7-8263-8000f7d45ff2.gif)
    ![bubble_1](https://cloud.githubusercontent.com/assets/4968473/24864898/91b8a65e-1e40-11e7-8464-7a612ceb94bb.gif)
    ![bubble_2](https://cloud.githubusercontent.com/assets/4968473/24864901/93735084-1e40-11e7-9d04-765e74abfa2e.gif)
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda closed the pull request at:

    https://github.com/apache/zeppelin/pull/2098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for Visual...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Found few bugs. Let me update more.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
GitHub user 1ambda reopened a pull request:

    https://github.com/apache/zeppelin/pull/2098

    [ZEPPELIN-2217] AdvancedTransformation for Visualization

    ### What is this PR for?
    
    `AdvancedTransformation` has more detailed options while providing existing features of `PivotTransformation` and `ColumnselectorTransformation` which Zeppelin already has 
    
    ![av_in_30sec](https://cloud.githubusercontent.com/assets/4968473/24037330/c9478e86-0b40-11e7-9886-1ffb85042a7a.gif)
    
    Here are some features which advanced-transformation can provide.
    
    1. **(screenshot)** multiple sub charts
    2. **(screenshot)** parameter widgets: `input`, `checkbox`, `option`, `textarea`
    3. **(screenshot)** expand/fold axis and parameter panels
    4. **(screenshot)** clear axis and parameter panels
    5. **(screenshot)** remove duplicated columns in an axis
    6. **(screenshot)** limit column count in an axis
    7. configurable char axes: `valueType`, `axisType`, `description`, ...
    8. configurable chart parameters
    9. lazy transformation
    10. parsing parameters automatically based on their type: `int`, `float`, `string`, `JSON`
    11. multiple transformation methods
    12. re-initialize whole configuration based on spec hash.
    13. **(screenshot)** shared axis
    
    #### API Details: Spec
    
    `AdvancedTransformation` requires `spec` which includes axis and parameter details for charts.
    
    - Let's create 2 sub-charts called `simple-line` and `step-line`.
    - Each sub chart can have different `axis` and `parameter` depending on their requirements.
    
    ```js
      constructor(targetEl, config) {
        super(targetEl, config)
    
        const spec = {
          charts: {
            'simple-line': {
              sharedAxis: true, /** set if you want to share axes between sub charts, default is `false` */
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key', },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'dashLength': { valueType: 'int', defaultValue: 0, description: 'the length of dash', },
              },
            },
    
            'step-line': {
              axis: {
                'xAxis': { dimension: 'single', axisType: 'unique', },
                'yAxis': { dimension: 'multiple', axisType: 'value', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'noStepRisers': { valueType: 'boolean', defaultValue: false, description: 'no risers in step line', widget: 'checkbox', },
            },
    
          },
        }
    
        this.transformation = new AdvancedTransformation(config, spec)
      }
    ```
    
    ####  API Details: Axis Spec
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`dimension` | `single` | Axis can contains only 1 column |
    |`dimension` | `multiple` | Axis can contains multiple columns |
    |`axisType` | `key` | Column(s) in this axis will be used as `key` like in `PivotTransformation`. These columns will be served in `column.key` |
    |`axisType` | `aggregator` | Column(s) in this axis will be used as `value` like in `PivotTransformation`. These columns will be served in `column.aggregator` |
    |`axisType` | `group` | Column(s) in this axis will be used as `group` like in `PivotTransformation`. These columns will be served in `column.group` |
    |`axisType` | (string) | Any string value can be used here. These columns will be served in `column.custom` |
    |`maxAxisCount` | (int) | The maximum column count that this axis can contains. (unlimited if `undefined`) |
    |`valueType` | (string) | Describe the value type just for annotation |
    
    Here is an example.
    
    ```js
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key',  },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', maxAxisCount: 2, valueType: 'string', },
              },
    ```
    
    ####  API Details: Parameter Spec
    
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`valueType` | `string` | Parameter which has string value |
    |`valueType` | `int` | Parameter which has int value |
    |`valueType` | `float` | Parameter which has float value |
    |`valueType` | `boolean` | Parameter which has boolean value used with `checkbox` widget usually |
    |`valueType` | `JSON` | Parameter which has JSON value used with `textarea` widget usually. `defaultValue` should be `""` (empty string). This ||`defaultValue` | (any) | Default value of this parameter. `JSON` type should have `""` (empty string) |
    |`description` | (string) | Description of this parameter. This value will be parsed as HTML for pretty output |
    |`widget` | `input` |  Use [input](https://developer.mozilla.org/en/docs/Web/HTML/Element/input) widget. This is the default widget (if `widget` is undefined)|
    |`widget` | `checkbox` |  Use [checkbox](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox) widget. |
    |`widget` | `textarea` |  Use [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) widget. |
    |`widget` | `option` |  Use [select + option](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) widget. This parameter should have `optionValues` field as well. |
    |`optionValues` | (Array<string>) |  Available option values used with the `option` widget |
    
    Here is an example.
    
    ```js
    parameter: {
      // string type, input widget
      'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
    
      // boolean type, checkbox widget
      'inverted': { widget: 'checkbox', valueType: 'boolean', defaultValue: false, description: 'invert x and y axes', },
    
      // string type, option widget with `optionValues`
      'graphType': { widget: 'option', valueType: 'string', defaultValue: 'line', description: 'graph type', optionValues: [ 'line', 'smoothedLine', 'step', ], },
    
      // HTML in `description`
      'dateFormat': { valueType: 'string', defaultValue: '', description: 'format of date (<a href="https://docs.amcharts.com/3/javascriptcharts/AmGraph#dateFormat">doc</a>) (e.g YYYY-MM-DD)', },
     
      // JSON type, textarea widget
      'yAxisGuides': { widget: 'textarea', valueType: 'JSON', defaultValue: '', description: 'guides of yAxis ', },
    ```
    
    #### API Details: Transformer Spec
    
    `AdvancedTransformation` supports 3 transformation methods. The return value will depend on the transformation method type. 
    
    ```js
        const spec = {
          charts: {
            'simple': {
              /** default value of `transform.method` is the flatten cube.  */
              axis: { ... },
              parameter: { ... }
            },
    
            'cube-group': {
              transform: { method: 'cube', },
              axis: { ... },
              parameter: { ... },
            }
    
            'no-group': {
              transform: { method: 'raw', },
              axis: { ... },
              parameter: { ... },
            }
    ```
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`method` | `object` |  designed for [amcharts: serial](https://www.amcharts.com/demos/date-based-data/) | 
    |`method` | `array` | designed for [highcharts: column](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-basic/) |
    |`method` | `drill-down` | designed for [highcharts: drill-down](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-drilldown/) |
    |`method` | `raw` | will return the original `tableData.rows` | 
    
    Whatever you specified as `transform.method`, the `transformer` value will be always function for lazy computation. 
    
    ```js
    // advanced-transformation.util#getTransformer
    
      if (transformSpec.method === 'raw') {
        transformer = () => { return rows; }
      } else if (transformSpec.method === 'array') {
        transformer = () => {
          ...
          return { ... }
        }
      }
    
    ```
    
    #### Feature Details: Automatic parameter parsing
    
    Advanced transformation will parse parameter values automatically based on their type: `int`, `float`, `string`, `JSON`
    
    - See also `advanced-transformation-util.js#parseParameter`
    
    #### Feature Details: re-initialize the whole configuration based on spec hash
    
    ```js
    // advanced-transformation-util#initializeConfig
    
      const currentVersion = JSON.stringify(spec)
      if (!config.spec || !config.spec.version || config.spec.version !== currentVersion) {
        spec.version = currentVersion
        // reset config...
      }
    ```
    
    #### Feature Details: Shared Axes
    
    If you set `sharedAxis` to `true` in chart specification, then these charts will share their axes. (default is `false`)
    
    ```js
        const spec = {
          charts: {
            'column': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... },
              parameter: { ... },
            },
    
            'stacked': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... }
              parameter: { ... },
            },
    ```
    
    ![sharedaxis](https://cloud.githubusercontent.com/assets/4968473/24207116/6999ad8a-0f63-11e7-8b61-273b712612fc.gif)
    
    #### API Details: Usage in Visualization#render()
    
    Let's assume that we want to create 2 sub-charts called `basic` and `no-group`.
    
    - https://github.com/1ambda/zeppelin-ultimate-line-chart (an practical example)
    
    ```js
      drawBasicChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      drawNoGroupChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      render(data) {
        const { chart, parameter, column, transformer, } = data
    
        if (chart === 'basic') {
          this.drawBasicChart(parameter, column, transformer)
        } else if (chart === 'no-group') {
          this.drawNoGroupChart(parameter, column, transformer)
        }
      }
    ```
    
    
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    NONE
    
    ### What is the Jira issue?
    
    [ZEPPELIN-2217](https://issues.apache.org/jira/browse/ZEPPELIN-2217)
    
    ### How should this be tested?
    
    1. Clone https://github.com/1ambda/zeppelin-ultimate-line-chart
    2. Create a symbolic link `ultimate-line-chart.json` into `$ZEPPELIN_HOME/helium`
    3. Modify the `artifact` value to proper absolute path considering your local machine.
    4. Install the above visualization in `localhost:9000/#helium`
    5. Test it
    
    ### Screenshots (if appropriate)
    
    #### 1. *(screenshot)* multiple sub charts
    
    ![av_multiple_charts](https://cloud.githubusercontent.com/assets/4968473/24034638/7b84dba0-0b35-11e7-989d-059ccc87f968.gif)
    
    #### 2. *(screenshot)* parameter widgets: `input`, `checkbox`, `option`, `textarea`
    
    ![av_widgets_new](https://cloud.githubusercontent.com/assets/4968473/24034652/88679d6c-0b35-11e7-835a-3970d7124850.gif)
    
    #### 3. *(screenshot)* expand/fold axis and parameter panels
    
    ![av_fold_expand](https://cloud.githubusercontent.com/assets/4968473/24034653/8a634ddc-0b35-11e7-9851-15280a6b5fd3.gif)
    
    #### 4. *(screenshot)* clear axis and parameter panels
    
    ![av_clean_buttons](https://cloud.githubusercontent.com/assets/4968473/24034654/8d3dc14a-0b35-11e7-98c7-3aeddce6d80a.gif)
    
    #### 5. *(screenshot)* remove duplicated columns in an axis
    
    ![av_duplicated_columns](https://cloud.githubusercontent.com/assets/4968473/24034657/910f4d20-0b35-11e7-9e9b-d9e2f799a5dd.gif)
    
    #### 6. *(screenshot)* limit column count in an axis
    
    ![av_maxaxiscount](https://cloud.githubusercontent.com/assets/4968473/24034679/a5e8eb34-0b35-11e7-89cd-070f3790d511.gif)
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-2217/advanced-transformation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2098
    
----
commit 69e0757a2871cf6a2a93a0129a7a83c4339f41b3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-06T05:39:48Z

    feat: AdvancedTransformation

commit 872cac3bbfd694acb7a1a13ae4cfa32cf34272e1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-11T20:48:35Z

    fix: Overflow issue in single aggr

commit dce24e233ce5bc96ba926df6545dd97b2e4cdad2
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:46:59Z

    feat: Add groupBase axis option

commit 9d4867d3440763257a73333dc461690467c9cf72
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:55:12Z

    refactor: Add getAxisInSingleDimension func

commit 727e2d5bc877a4864c904b414de00de4122a67c1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:16:41Z

    feat: Add clearConfig

commit a2e2004d32bdc6237e6b79f755dc388824ac0204
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:59:28Z

    refactor: Refine transform API

commit e18424177792f54c91c0afe25a6450cf41071f25
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T09:06:40Z

    fix: Add singleDimensionAggregatorChanged

commit 45866d0c7197d68203f0180b2d48ea357ef78f0b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T09:26:40Z

    feat: Support multiple charts

commit e09c06c87aa3fb055ae022ffa379d2fa191713e6
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T11:21:40Z

    feat: Support multiple charts in UI

commit 61f8d28a0443f0fb4cdf45eb2261de0e068ad844
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T12:15:38Z

    feat: advanced-transformation-api

commit 300942d51612b7e1046301a77a09c2128eb1c855
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T15:49:23Z

    refactor: Refine axis, param spec

commit 2bac0084f729b8261b73b2dff511c8a9993848c3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T16:17:33Z

    feat: Support same axis types

commit 63952ecfb7f9546574db2c291e96350b309c6a0d
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:03:10Z

    feat: Cube Transformation

commit 334ef190f8ea6ede00a9d2b5f61e8ba22ebc3c1c
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:48:23Z

    feat: Support undefined valueType in axisSpec

commit 16a22b29728c5d694780b1fa462f7dedd277014b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T13:15:59Z

    feat: Support maxAxisCount in axisSpec

commit 7b1c99cffcbce501f53bfcde73e9bf2a1a3be47f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:44:04Z

    feat: Support transform: flatten

commit 03de88c00c323dce408efcc87f1e2895d98d9864
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:48:24Z

    fix: Modify margin of subchart radio btns

commit 72a644effecf6dc033be2df16e32a0548118a422
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:52:35Z

    fix: Duplicated radio btn id, name

commit da783eb7b9ea7ea554e4021d57699ad5a2c35d38
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T16:35:26Z

    feat: Automatic spec versioning

commit e62a8635883c600f7c314a6a11107a2c98b4fafa
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T17:11:17Z

    feat: Support transformer

commit 43e66a6471798da1756346ea34b617f287e531ba
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:24:20Z

    feat: custom axisSpec

commit 5663d530cafbc22a1c77d87fa51cd5a435db0d89
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:35:23Z

    feat: Save and close with enter key

commit 5b6bea9a881715abc14e2facef14a5918c3d55dc
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:45:55Z

    fix: Change panel header

commit d2f3fbaba69af4c9f00bdeff0005bfa9d240f400
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:26:38Z

    feat: option widget

commit 74b8df099b21c53633cce3f3d12c40837eab5e25
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:30:15Z

    feat: widget checkbox

commit d531b3eedc7489183dd5fe75835298db8c22e6dd
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:39:31Z

    feat: textare widget and update hook

commit 101e9270189847cd177885304c6fa11df8dc942e
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T15:32:46Z

    refactor: Remove util and add Widget funcs

commit 1b1417843f648c576cc89634ff609bd4ce0b45e0
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:03:10Z

    fix: Dont close param panel when enter

commit f6a1d834bd9be7277267c3e37368e069c4201d77
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:54:57Z

    feat: Automatic param parsing

commit 4407b91c063d7247aa2321e458e0a042fbf7a61f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T19:11:35Z

    fix: Stop event propagation in widgets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda closed the pull request at:

    https://github.com/apache/zeppelin/pull/2098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
GitHub user 1ambda reopened a pull request:

    https://github.com/apache/zeppelin/pull/2098

    [ZEPPELIN-2217] AdvancedTransformation for Visualization

    ### What is this PR for?
    
    `AdvancedTransformation` has more detailed options while providing existing features of `PivotTransformation` and `ColumnselectorTransformation` which Zeppelin already has 
    
    ![av_in_30sec](https://cloud.githubusercontent.com/assets/4968473/24037330/c9478e86-0b40-11e7-9886-1ffb85042a7a.gif)
    
    Here are some features which advanced-transformation can provide.
    
    1. **(screenshot)** multiple sub charts
    2. **(screenshot)** parameter widgets: `input`, `checkbox`, `option`, `textarea`
    3. **(screenshot)** expand/fold axis and parameter panels
    4. **(screenshot)** clear axis and parameter panels
    5. **(screenshot)** remove duplicated columns in an axis
    6. **(screenshot)** limit column count in an axis
    7. configurable char axes: `valueType`, `axisType`, `description`, ...
    8. configurable chart parameters
    9. lazy transformation
    10. parsing parameters automatically based on their type: `int`, `float`, `string`, `JSON`
    11. multiple transformation methods
    12. re-initialize whole configuration based on spec hash.
    13. **(screenshot)** shared axis
    
    #### API Details: Spec
    
    `AdvancedTransformation` requires `spec` which includes axis and parameter details for charts.
    
    - Let's create 2 sub-charts called `simple-line` and `step-line`.
    - Each sub chart can have different `axis` and `parameter` depending on their requirements.
    
    ```js
      constructor(targetEl, config) {
        super(targetEl, config)
    
        const spec = {
          charts: {
            'simple-line': {
              sharedAxis: true, /** set if you want to share axes between sub charts, default is `false` */
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key', },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'dashLength': { valueType: 'int', defaultValue: 0, description: 'the length of dash', },
              },
            },
    
            'step-line': {
              axis: {
                'xAxis': { dimension: 'single', axisType: 'unique', },
                'yAxis': { dimension: 'multiple', axisType: 'value', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'noStepRisers': { valueType: 'boolean', defaultValue: false, description: 'no risers in step line', widget: 'checkbox', },
            },
    
          },
        }
    
        this.transformation = new AdvancedTransformation(config, spec)
      }
    ```
    
    ####  API Details: Axis Spec
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`dimension` | `single` | Axis can contains only 1 column |
    |`dimension` | `multiple` | Axis can contains multiple columns |
    |`axisType` | `key` | Column(s) in this axis will be used as `key` like in `PivotTransformation`. These columns will be served in `column.key` |
    |`axisType` | `aggregator` | Column(s) in this axis will be used as `value` like in `PivotTransformation`. These columns will be served in `column.aggregator` |
    |`axisType` | `group` | Column(s) in this axis will be used as `group` like in `PivotTransformation`. These columns will be served in `column.group` |
    |`axisType` | (string) | Any string value can be used here. These columns will be served in `column.custom` |
    |`maxAxisCount` | (int) | The maximum column count that this axis can contains. (unlimited if `undefined`) |
    |`valueType` | (string) | Describe the value type just for annotation |
    
    Here is an example.
    
    ```js
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key',  },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', maxAxisCount: 2, valueType: 'string', },
              },
    ```
    
    ####  API Details: Parameter Spec
    
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`valueType` | `string` | Parameter which has string value |
    |`valueType` | `int` | Parameter which has int value |
    |`valueType` | `float` | Parameter which has float value |
    |`valueType` | `boolean` | Parameter which has boolean value used with `checkbox` widget usually |
    |`valueType` | `JSON` | Parameter which has JSON value used with `textarea` widget usually. `defaultValue` should be `""` (empty string). This ||`defaultValue` | (any) | Default value of this parameter. `JSON` type should have `""` (empty string) |
    |`description` | (string) | Description of this parameter. This value will be parsed as HTML for pretty output |
    |`widget` | `input` |  Use [input](https://developer.mozilla.org/en/docs/Web/HTML/Element/input) widget. This is the default widget (if `widget` is undefined)|
    |`widget` | `checkbox` |  Use [checkbox](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox) widget. |
    |`widget` | `textarea` |  Use [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) widget. |
    |`widget` | `option` |  Use [select + option](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) widget. This parameter should have `optionValues` field as well. |
    |`optionValues` | (Array<string>) |  Available option values used with the `option` widget |
    
    Here is an example.
    
    ```js
    parameter: {
      // string type, input widget
      'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
    
      // boolean type, checkbox widget
      'inverted': { widget: 'checkbox', valueType: 'boolean', defaultValue: false, description: 'invert x and y axes', },
    
      // string type, option widget with `optionValues`
      'graphType': { widget: 'option', valueType: 'string', defaultValue: 'line', description: 'graph type', optionValues: [ 'line', 'smoothedLine', 'step', ], },
    
      // HTML in `description`
      'dateFormat': { valueType: 'string', defaultValue: '', description: 'format of date (<a href="https://docs.amcharts.com/3/javascriptcharts/AmGraph#dateFormat">doc</a>) (e.g YYYY-MM-DD)', },
     
      // JSON type, textarea widget
      'yAxisGuides': { widget: 'textarea', valueType: 'JSON', defaultValue: '', description: 'guides of yAxis ', },
    ```
    
    #### API Details: Transformer Spec
    
    `AdvancedTransformation` supports 3 transformation methods. The return value will depend on the transformation method type. 
    
    ```js
        const spec = {
          charts: {
            'simple': {
              /** default value of `transform.method` is the flatten cube.  */
              axis: { ... },
              parameter: { ... }
            },
    
            'cube-group': {
              transform: { method: 'cube', },
              axis: { ... },
              parameter: { ... },
            }
    
            'no-group': {
              transform: { method: 'raw', },
              axis: { ... },
              parameter: { ... },
            }
    ```
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`method` | `object` |  designed for [amcharts: serial](https://www.amcharts.com/demos/date-based-data/) | 
    |`method` | `array` | designed for [highcharts: column](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-basic/) |
    |`method` | `drill-down` | designed for [highcharts: drill-down](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-drilldown/) |
    |`method` | `raw` | will return the original `tableData.rows` | 
    
    Whatever you specified as `transform.method`, the `transformer` value will be always function for lazy computation. 
    
    ```js
    // advanced-transformation.util#getTransformer
    
      if (transformSpec.method === 'raw') {
        transformer = () => { return rows; }
      } else if (transformSpec.method === 'array') {
        transformer = () => {
          ...
          return { ... }
        }
      }
    
    ```
    
    #### Feature Details: Automatic parameter parsing
    
    Advanced transformation will parse parameter values automatically based on their type: `int`, `float`, `string`, `JSON`
    
    - See also `advanced-transformation-util.js#parseParameter`
    
    #### Feature Details: re-initialize the whole configuration based on spec hash
    
    ```js
    // advanced-transformation-util#initializeConfig
    
      const currentVersion = JSON.stringify(spec)
      if (!config.spec || !config.spec.version || config.spec.version !== currentVersion) {
        spec.version = currentVersion
        // reset config...
      }
    ```
    
    #### Feature Details: Shared Axes
    
    If you set `sharedAxis` to `true` in chart specification, then these charts will share their axes. (default is `false`)
    
    ```js
        const spec = {
          charts: {
            'column': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... },
              parameter: { ... },
            },
    
            'stacked': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... }
              parameter: { ... },
            },
    ```
    
    ![sharedaxis](https://cloud.githubusercontent.com/assets/4968473/24207116/6999ad8a-0f63-11e7-8b61-273b712612fc.gif)
    
    #### API Details: Usage in Visualization#render()
    
    Let's assume that we want to create 2 sub-charts called `basic` and `no-group`.
    
    - https://github.com/1ambda/zeppelin-ultimate-line-chart (an practical example)
    
    ```js
      drawBasicChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      drawNoGroupChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      render(data) {
        const { chart, parameter, column, transformer, } = data
    
        if (chart === 'basic') {
          this.drawBasicChart(parameter, column, transformer)
        } else if (chart === 'no-group') {
          this.drawNoGroupChart(parameter, column, transformer)
        }
      }
    ```
    
    
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    NONE
    
    ### What is the Jira issue?
    
    [ZEPPELIN-2217](https://issues.apache.org/jira/browse/ZEPPELIN-2217)
    
    ### How should this be tested?
    
    1. Clone https://github.com/1ambda/zeppelin-ultimate-line-chart
    2. Create a symbolic link `ultimate-line-chart.json` into `$ZEPPELIN_HOME/helium`
    3. Modify the `artifact` value to proper absolute path considering your local machine.
    4. Install the above visualization in `localhost:9000/#helium`
    5. Test it
    
    ### Screenshots (if appropriate)
    
    #### 1. *(screenshot)* multiple sub charts
    
    ![av_multiple_charts](https://cloud.githubusercontent.com/assets/4968473/24034638/7b84dba0-0b35-11e7-989d-059ccc87f968.gif)
    
    #### 2. *(screenshot)* parameter widgets: `input`, `checkbox`, `option`, `textarea`
    
    ![av_widgets_new](https://cloud.githubusercontent.com/assets/4968473/24034652/88679d6c-0b35-11e7-835a-3970d7124850.gif)
    
    #### 3. *(screenshot)* expand/fold axis and parameter panels
    
    ![av_fold_expand](https://cloud.githubusercontent.com/assets/4968473/24034653/8a634ddc-0b35-11e7-9851-15280a6b5fd3.gif)
    
    #### 4. *(screenshot)* clear axis and parameter panels
    
    ![av_clean_buttons](https://cloud.githubusercontent.com/assets/4968473/24034654/8d3dc14a-0b35-11e7-98c7-3aeddce6d80a.gif)
    
    #### 5. *(screenshot)* remove duplicated columns in an axis
    
    ![av_duplicated_columns](https://cloud.githubusercontent.com/assets/4968473/24034657/910f4d20-0b35-11e7-9e9b-d9e2f799a5dd.gif)
    
    #### 6. *(screenshot)* limit column count in an axis
    
    ![av_maxaxiscount](https://cloud.githubusercontent.com/assets/4968473/24034679/a5e8eb34-0b35-11e7-89cd-070f3790d511.gif)
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-2217/advanced-transformation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2098
    
----
commit 69e0757a2871cf6a2a93a0129a7a83c4339f41b3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-06T05:39:48Z

    feat: AdvancedTransformation

commit 872cac3bbfd694acb7a1a13ae4cfa32cf34272e1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-11T20:48:35Z

    fix: Overflow issue in single aggr

commit dce24e233ce5bc96ba926df6545dd97b2e4cdad2
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:46:59Z

    feat: Add groupBase axis option

commit 9d4867d3440763257a73333dc461690467c9cf72
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:55:12Z

    refactor: Add getAxisInSingleDimension func

commit 727e2d5bc877a4864c904b414de00de4122a67c1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:16:41Z

    feat: Add clearConfig

commit a2e2004d32bdc6237e6b79f755dc388824ac0204
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:59:28Z

    refactor: Refine transform API

commit e18424177792f54c91c0afe25a6450cf41071f25
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T09:06:40Z

    fix: Add singleDimensionAggregatorChanged

commit 45866d0c7197d68203f0180b2d48ea357ef78f0b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T09:26:40Z

    feat: Support multiple charts

commit e09c06c87aa3fb055ae022ffa379d2fa191713e6
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T11:21:40Z

    feat: Support multiple charts in UI

commit 61f8d28a0443f0fb4cdf45eb2261de0e068ad844
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T12:15:38Z

    feat: advanced-transformation-api

commit 300942d51612b7e1046301a77a09c2128eb1c855
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T15:49:23Z

    refactor: Refine axis, param spec

commit 2bac0084f729b8261b73b2dff511c8a9993848c3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T16:17:33Z

    feat: Support same axis types

commit 63952ecfb7f9546574db2c291e96350b309c6a0d
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:03:10Z

    feat: Cube Transformation

commit 334ef190f8ea6ede00a9d2b5f61e8ba22ebc3c1c
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:48:23Z

    feat: Support undefined valueType in axisSpec

commit 16a22b29728c5d694780b1fa462f7dedd277014b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T13:15:59Z

    feat: Support maxAxisCount in axisSpec

commit 7b1c99cffcbce501f53bfcde73e9bf2a1a3be47f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:44:04Z

    feat: Support transform: flatten

commit 03de88c00c323dce408efcc87f1e2895d98d9864
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:48:24Z

    fix: Modify margin of subchart radio btns

commit 72a644effecf6dc033be2df16e32a0548118a422
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:52:35Z

    fix: Duplicated radio btn id, name

commit da783eb7b9ea7ea554e4021d57699ad5a2c35d38
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T16:35:26Z

    feat: Automatic spec versioning

commit e62a8635883c600f7c314a6a11107a2c98b4fafa
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T17:11:17Z

    feat: Support transformer

commit 43e66a6471798da1756346ea34b617f287e531ba
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:24:20Z

    feat: custom axisSpec

commit 5663d530cafbc22a1c77d87fa51cd5a435db0d89
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:35:23Z

    feat: Save and close with enter key

commit 5b6bea9a881715abc14e2facef14a5918c3d55dc
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:45:55Z

    fix: Change panel header

commit d2f3fbaba69af4c9f00bdeff0005bfa9d240f400
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:26:38Z

    feat: option widget

commit 74b8df099b21c53633cce3f3d12c40837eab5e25
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:30:15Z

    feat: widget checkbox

commit d531b3eedc7489183dd5fe75835298db8c22e6dd
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:39:31Z

    feat: textare widget and update hook

commit 101e9270189847cd177885304c6fa11df8dc942e
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T15:32:46Z

    refactor: Remove util and add Widget funcs

commit 1b1417843f648c576cc89634ff609bd4ce0b45e0
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:03:10Z

    fix: Dont close param panel when enter

commit f6a1d834bd9be7277267c3e37368e069c4201d77
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:54:57Z

    feat: Automatic param parsing

commit 4407b91c063d7247aa2321e458e0a042fbf7a61f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T19:11:35Z

    fix: Stop event propagation in widgets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for Visual...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Some features, improvements which can be done in this PR
    
    - refine `transform()` return value
    - selectable dynamic parameter. `{ ..., name: "theme" paramType: "optional", options: ["light", "dark"]`
    - support multiple chart types in one visualization. `{ subcharts: ["area", "stacked", "stream"] }`
    - customized axis spec + dynamic parameters for each sub chart type.
    - parse dynamic parameters based on types (`string`, `number`, `JSON`)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/zeppelin/pull/2098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda closed the pull request at:

    https://github.com/apache/zeppelin/pull/2098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Some ideas
    
    - multiple aggregaor axes support
    - remove aggregator column name from the legend when only 1 aggr column and group is enabled


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda closed the pull request at:

    https://github.com/apache/zeppelin/pull/2098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda closed the pull request at:

    https://github.com/apache/zeppelin/pull/2098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
GitHub user 1ambda reopened a pull request:

    https://github.com/apache/zeppelin/pull/2098

    [ZEPPELIN-2217] AdvancedTransformation for Visualization

    ### What is this PR for?
    
    `AdvancedTransformation` has more detailed options while providing existing features of `PivotTransformation` and `ColumnselectorTransformation` which Zeppelin already has 
    
    ![av_in_30sec](https://cloud.githubusercontent.com/assets/4968473/24037330/c9478e86-0b40-11e7-9886-1ffb85042a7a.gif)
    
    Here are some features which advanced-transformation can provide.
    
    1. **(screenshot)** multiple sub charts
    2. **(screenshot)** parameter widgets: `input`, `checkbox`, `option`, `textarea`
    3. **(screenshot)** expand/fold axis and parameter panels
    4. **(screenshot)** clear axis and parameter panels
    5. **(screenshot)** remove duplicated columns in an axis
    6. **(screenshot)** limit column count in an axis
    7. configurable char axes: `valueType`, `axisType`, `description`, ...
    8. configurable chart parameters
    9. lazy transformation
    10. parsing parameters automatically based on their type: `int`, `float`, `string`, `JSON`
    11. multiple transformation methods
    12. re-initialize whole configuration based on spec hash.
    13. **(screenshot)** shared axis
    
    #### API Details: Spec
    
    `AdvancedTransformation` requires `spec` which includes axis and parameter details for charts.
    
    - Let's create 2 sub-charts called `simple-line` and `step-line`.
    - Each sub chart can have different `axis` and `parameter` depending on their requirements.
    
    ```js
      constructor(targetEl, config) {
        super(targetEl, config)
    
        const spec = {
          charts: {
            'simple-line': {
              sharedAxis: true, /** set if you want to share axes between sub charts, default is `false` */
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key', },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'dashLength': { valueType: 'int', defaultValue: 0, description: 'the length of dash', },
              },
            },
    
            'step-line': {
              axis: {
                'xAxis': { dimension: 'single', axisType: 'unique', },
                'yAxis': { dimension: 'multiple', axisType: 'value', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'noStepRisers': { valueType: 'boolean', defaultValue: false, description: 'no risers in step line', widget: 'checkbox', },
            },
    
          },
        }
    
        this.transformation = new AdvancedTransformation(config, spec)
      }
    ```
    
    ####  API Details: Axis Spec
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`dimension` | `single` | Axis can contains only 1 column |
    |`dimension` | `multiple` | Axis can contains multiple columns |
    |`axisType` | `key` | Column(s) in this axis will be used as `key` like in `PivotTransformation`. These columns will be served in `column.key` |
    |`axisType` | `aggregator` | Column(s) in this axis will be used as `value` like in `PivotTransformation`. These columns will be served in `column.aggregator` |
    |`axisType` | `group` | Column(s) in this axis will be used as `group` like in `PivotTransformation`. These columns will be served in `column.group` |
    |`axisType` | (string) | Any string value can be used here. These columns will be served in `column.custom` |
    |`maxAxisCount` | (int) | The maximum column count that this axis can contains. (unlimited if `undefined`) |
    |`valueType` | (string) | Describe the value type just for annotation |
    
    Here is an example.
    
    ```js
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key',  },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', maxAxisCount: 2, valueType: 'string', },
              },
    ```
    
    ####  API Details: Parameter Spec
    
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`valueType` | `string` | Parameter which has string value |
    |`valueType` | `int` | Parameter which has int value |
    |`valueType` | `float` | Parameter which has float value |
    |`valueType` | `boolean` | Parameter which has boolean value used with `checkbox` widget usually |
    |`valueType` | `JSON` | Parameter which has JSON value used with `textarea` widget usually. `defaultValue` should be `""` (empty string). This ||`defaultValue` | (any) | Default value of this parameter. `JSON` type should have `""` (empty string) |
    |`description` | (string) | Description of this parameter. This value will be parsed as HTML for pretty output |
    |`widget` | `input` |  Use [input](https://developer.mozilla.org/en/docs/Web/HTML/Element/input) widget. This is the default widget (if `widget` is undefined)|
    |`widget` | `checkbox` |  Use [checkbox](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox) widget. |
    |`widget` | `textarea` |  Use [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) widget. |
    |`widget` | `option` |  Use [select + option](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) widget. This parameter should have `optionValues` field as well. |
    |`optionValues` | (Array<string>) |  Available option values used with the `option` widget |
    
    Here is an example.
    
    ```js
    parameter: {
      // string type, input widget
      'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
    
      // boolean type, checkbox widget
      'inverted': { widget: 'checkbox', valueType: 'boolean', defaultValue: false, description: 'invert x and y axes', },
    
      // string type, option widget with `optionValues`
      'graphType': { widget: 'option', valueType: 'string', defaultValue: 'line', description: 'graph type', optionValues: [ 'line', 'smoothedLine', 'step', ], },
    
      // HTML in `description`
      'dateFormat': { valueType: 'string', defaultValue: '', description: 'format of date (<a href="https://docs.amcharts.com/3/javascriptcharts/AmGraph#dateFormat">doc</a>) (e.g YYYY-MM-DD)', },
     
      // JSON type, textarea widget
      'yAxisGuides': { widget: 'textarea', valueType: 'JSON', defaultValue: '', description: 'guides of yAxis ', },
    ```
    
    #### API Details: Transformer Spec
    
    `AdvancedTransformation` supports 3 transformation methods. The return value will depend on the transformation method type. 
    
    ```js
        const spec = {
          charts: {
            'simple': {
              /** default value of `transform.method` is the flatten cube.  */
              axis: { ... },
              parameter: { ... }
            },
    
            'cube-group': {
              transform: { method: 'cube', },
              axis: { ... },
              parameter: { ... },
            }
    
            'no-group': {
              transform: { method: 'raw', },
              axis: { ... },
              parameter: { ... },
            }
    ```
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`method` | `object` |  designed for [amcharts: serial](https://www.amcharts.com/demos/date-based-data/) | 
    |`method` | `array` | designed for [highcharts: column](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-basic/) |
    |`method` | `drill-down` | designed for [highcharts: drill-down](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-drilldown/) |
    |`method` | `raw` | will return the original `tableData.rows` | 
    
    Whatever you specified as `transform.method`, the `transformer` value will be always function for lazy computation. 
    
    ```js
    // advanced-transformation.util#getTransformer
    
      if (transformSpec.method === 'raw') {
        transformer = () => { return rows; }
      } else if (transformSpec.method === 'array') {
        transformer = () => {
          ...
          return { ... }
        }
      }
    
    ```
    
    #### Feature Details: Automatic parameter parsing
    
    Advanced transformation will parse parameter values automatically based on their type: `int`, `float`, `string`, `JSON`
    
    - See also `advanced-transformation-util.js#parseParameter`
    
    #### Feature Details: re-initialize the whole configuration based on spec hash
    
    ```js
    // advanced-transformation-util#initializeConfig
    
      const currentVersion = JSON.stringify(spec)
      if (!config.spec || !config.spec.version || config.spec.version !== currentVersion) {
        spec.version = currentVersion
        // reset config...
      }
    ```
    
    #### Feature Details: Shared Axes
    
    If you set `sharedAxis` to `true` in chart specification, then these charts will share their axes. (default is `false`)
    
    ```js
        const spec = {
          charts: {
            'column': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... },
              parameter: { ... },
            },
    
            'stacked': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... }
              parameter: { ... },
            },
    ```
    
    ![sharedaxis](https://cloud.githubusercontent.com/assets/4968473/24207116/6999ad8a-0f63-11e7-8b61-273b712612fc.gif)
    
    #### API Details: Usage in Visualization#render()
    
    Let's assume that we want to create 2 sub-charts called `basic` and `no-group`.
    
    - https://github.com/1ambda/zeppelin-ultimate-line-chart (an practical example)
    
    ```js
      drawBasicChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      drawNoGroupChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      render(data) {
        const { chart, parameter, column, transformer, } = data
    
        if (chart === 'basic') {
          this.drawBasicChart(parameter, column, transformer)
        } else if (chart === 'no-group') {
          this.drawNoGroupChart(parameter, column, transformer)
        }
      }
    ```
    
    
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    NONE
    
    ### What is the Jira issue?
    
    [ZEPPELIN-2217](https://issues.apache.org/jira/browse/ZEPPELIN-2217)
    
    ### How should this be tested?
    
    1. Clone https://github.com/1ambda/zeppelin-ultimate-line-chart
    2. Create a symbolic link `ultimate-line-chart.json` into `$ZEPPELIN_HOME/helium`
    3. Modify the `artifact` value to proper absolute path considering your local machine.
    4. Install the above visualization in `localhost:9000/#helium`
    5. Test it
    
    ### Screenshots (if appropriate)
    
    #### 1. *(screenshot)* multiple sub charts
    
    ![av_multiple_charts](https://cloud.githubusercontent.com/assets/4968473/24034638/7b84dba0-0b35-11e7-989d-059ccc87f968.gif)
    
    #### 2. *(screenshot)* parameter widgets: `input`, `checkbox`, `option`, `textarea`
    
    ![av_widgets_new](https://cloud.githubusercontent.com/assets/4968473/24034652/88679d6c-0b35-11e7-835a-3970d7124850.gif)
    
    #### 3. *(screenshot)* expand/fold axis and parameter panels
    
    ![av_fold_expand](https://cloud.githubusercontent.com/assets/4968473/24034653/8a634ddc-0b35-11e7-9851-15280a6b5fd3.gif)
    
    #### 4. *(screenshot)* clear axis and parameter panels
    
    ![av_clean_buttons](https://cloud.githubusercontent.com/assets/4968473/24034654/8d3dc14a-0b35-11e7-98c7-3aeddce6d80a.gif)
    
    #### 5. *(screenshot)* remove duplicated columns in an axis
    
    ![av_duplicated_columns](https://cloud.githubusercontent.com/assets/4968473/24034657/910f4d20-0b35-11e7-9e9b-d9e2f799a5dd.gif)
    
    #### 6. *(screenshot)* limit column count in an axis
    
    ![av_maxaxiscount](https://cloud.githubusercontent.com/assets/4968473/24034679/a5e8eb34-0b35-11e7-89cd-070f3790d511.gif)
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-2217/advanced-transformation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2098
    
----
commit 69e0757a2871cf6a2a93a0129a7a83c4339f41b3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-06T05:39:48Z

    feat: AdvancedTransformation

commit 872cac3bbfd694acb7a1a13ae4cfa32cf34272e1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-11T20:48:35Z

    fix: Overflow issue in single aggr

commit dce24e233ce5bc96ba926df6545dd97b2e4cdad2
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:46:59Z

    feat: Add groupBase axis option

commit 9d4867d3440763257a73333dc461690467c9cf72
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:55:12Z

    refactor: Add getAxisInSingleDimension func

commit 727e2d5bc877a4864c904b414de00de4122a67c1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:16:41Z

    feat: Add clearConfig

commit a2e2004d32bdc6237e6b79f755dc388824ac0204
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:59:28Z

    refactor: Refine transform API

commit e18424177792f54c91c0afe25a6450cf41071f25
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T09:06:40Z

    fix: Add singleDimensionAggregatorChanged

commit 45866d0c7197d68203f0180b2d48ea357ef78f0b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T09:26:40Z

    feat: Support multiple charts

commit e09c06c87aa3fb055ae022ffa379d2fa191713e6
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T11:21:40Z

    feat: Support multiple charts in UI

commit 61f8d28a0443f0fb4cdf45eb2261de0e068ad844
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T12:15:38Z

    feat: advanced-transformation-api

commit 300942d51612b7e1046301a77a09c2128eb1c855
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T15:49:23Z

    refactor: Refine axis, param spec

commit 2bac0084f729b8261b73b2dff511c8a9993848c3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T16:17:33Z

    feat: Support same axis types

commit 63952ecfb7f9546574db2c291e96350b309c6a0d
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:03:10Z

    feat: Cube Transformation

commit 334ef190f8ea6ede00a9d2b5f61e8ba22ebc3c1c
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:48:23Z

    feat: Support undefined valueType in axisSpec

commit 16a22b29728c5d694780b1fa462f7dedd277014b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T13:15:59Z

    feat: Support maxAxisCount in axisSpec

commit 7b1c99cffcbce501f53bfcde73e9bf2a1a3be47f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:44:04Z

    feat: Support transform: flatten

commit 03de88c00c323dce408efcc87f1e2895d98d9864
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:48:24Z

    fix: Modify margin of subchart radio btns

commit 72a644effecf6dc033be2df16e32a0548118a422
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:52:35Z

    fix: Duplicated radio btn id, name

commit da783eb7b9ea7ea554e4021d57699ad5a2c35d38
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T16:35:26Z

    feat: Automatic spec versioning

commit e62a8635883c600f7c314a6a11107a2c98b4fafa
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T17:11:17Z

    feat: Support transformer

commit 43e66a6471798da1756346ea34b617f287e531ba
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:24:20Z

    feat: custom axisSpec

commit 5663d530cafbc22a1c77d87fa51cd5a435db0d89
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:35:23Z

    feat: Save and close with enter key

commit 5b6bea9a881715abc14e2facef14a5918c3d55dc
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:45:55Z

    fix: Change panel header

commit d2f3fbaba69af4c9f00bdeff0005bfa9d240f400
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:26:38Z

    feat: option widget

commit 74b8df099b21c53633cce3f3d12c40837eab5e25
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:30:15Z

    feat: widget checkbox

commit d531b3eedc7489183dd5fe75835298db8c22e6dd
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:39:31Z

    feat: textare widget and update hook

commit 101e9270189847cd177885304c6fa11df8dc942e
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T15:32:46Z

    refactor: Remove util and add Widget funcs

commit 1b1417843f648c576cc89634ff609bd4ce0b45e0
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:03:10Z

    fix: Dont close param panel when enter

commit f6a1d834bd9be7277267c3e37368e069c4201d77
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:54:57Z

    feat: Automatic param parsing

commit 4407b91c063d7247aa2321e458e0a042fbf7a61f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T19:11:35Z

    fix: Stop event propagation in widgets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    CI status: https://travis-ci.org/1ambda/zeppelin/builds/218186828


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Thanks for letting me know. Just look through what you said, generally looks good. Let me test again. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Great work!!!
    
    Looks great to me!
    
    I think it's worth to move usages and examples in this PR description under `/docs`. 
    Where do you think this information can be placed?
    
    We didn't have any unittest for pivot transformation. So it was hard to improve / change without any side effects. So having some basic unittest for advanced transformation will help other people add and improve the feature much faster.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @AhyoungRyu 
    
    Thanks for detailed review. 
    
    1. It would be nice to have some popup or feedback when conf is updated.
    2. Let me hide them when panel is minimized (e.g the chart panel, the parameter panel)
    
    Regarding to `3. no-group field`, it's quite hard to say in just few lines. So let me describe more.
    
    (A) Some charts require aggregation. (= groupBy in SQL)
    (B) But some charts might not need aggregation. Assume that it's already grouped by SQL
    
    In ultimate-line-chart, there are sub charts called `line`, `dashed`, `step` and `no-group`.
    
    - `line`, `dashed`,` step` uses aggregation like zeppelin's existing charts. (similar to `PivotTransformation`)
    - But `no-group` doesn't use aggregation. (similar to `ColumnTransformation`)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for Visual...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Few things are left. Thus i'v just changed to WIP again. Sorry for confusing.
    
    - adding more `transformation.method` for columnar and drill-down charts: `array:key`, `array:group`, `array:drilldown`
    - fixing bugs.
    
    The final output will be served with 2 examples
    
    1. column charts including drill-down functionality
    2. pie charts including drill-down functionality
    
    Let me mention again after then :)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Looks awesome! Let me test it and i'll get back to you soon. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Looks great! 
    So sorry I forgot to mention that there is another place to be updated regarding [this change](https://github.com/apache/zeppelin/pull/2098#issuecomment-291390619). 
    
    <img src="https://cloud.githubusercontent.com/assets/10060731/24690393/7e4612ec-1a07-11e7-8d70-34554826a27a.png" width="600px">
    
    Could you update [`docs/index.html`](https://github.com/apache/zeppelin/blob/master/docs/index.md#more) as well? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Cool! Let me test this and I will get back you soon.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda closed the pull request at:

    https://github.com/apache/zeppelin/pull/2098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    ![image](https://cloud.githubusercontent.com/assets/4968473/24690813/45d7d834-1a0a-11e7-88bd-ca78d69a30df.png)
    
    @AhyoungRyu I forgot as well to modify `index.md` \U0001f62d.
    I'v just updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Let me add docs and unit tests. I guess it will take few days. Then i will comment. Thanks @Leemoonsoo 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for Visual...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Okay then feel free to ping me when they're done :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Tremendous work @1ambda !
    LGTM and merge to master if no further discussions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
GitHub user 1ambda reopened a pull request:

    https://github.com/apache/zeppelin/pull/2098

    [ZEPPELIN-2217] AdvancedTransformation for Visualization

    ### What is this PR for?
    
    Even if we already have 2 useful transformation, they have limitations.
    
    - we can't configure axises in `PivotTransformation`
    - we can't use aggregator functions in `ColumnselectorTransformation`
    
    `AdvancedTransformation` provides both functionality. Additionally, it supports
    
    - dynamic parameter panel for configuring charts
    - multiple, configurable, detailed axises
    - maximizing / minimizing each panel
    
    #### Implementation Details: Configuring Chart
    
    See also: [an example visualization using AdvancedTransformation](https://github.com/1ambda/zeppelin-advanced-transformation/blob/master/examples/local-test-highcharts-columnrange/index.js)
    
    ```javascript
    
            this.spec = {
                /** axis spec */
                axis: {
                    'xAxis': { type: 'number', dimension: 'single', group: false, aggregator: false, },
                    'yAxis': { type: 'string', dimension: 'multiple', group: true, aggregator: false, },
                },
    
                /** parameter spec */
                parameter: {
                    'xAxisName': { type: 'string', defaultValue: '', description: 'Name of xAxis', },
                    'yAxisName': { type: 'string', defaultValue: '', description: 'Name of yAxis', },
                    'yAxisUnit': { type: 'string', defaultValue: '', description: 'Unit of yAxis', },
                }
            }
    
            this.transformation = new AdvancedTransformation(config, this.spec)
    ```
    
    #### Implementation Details: return value of `transform`
    
    ```javascript
    return {
      raw: tableData.rows,
      grouped: grouped, /** [{ group, groupedRows, aggregated }] */
      column: {
          allColumns: tableData.columns,
          groupColumns: groupColumns,
          aggregatedColumns,
          normalColumns: normalColumns,
      }
    }
    ```
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    NONE
    
    ### What is the Jira issue?
    
    [ZEPPELIN-2217](https://issues.apache.org/jira/browse/ZEPPELIN-2217)
    
    ### How should this be tested?
    
    1. Clone https://github.com/1ambda/zeppelin-advanced-transformation
    2. Copy `examples/local-test-highcharts-columnrange/local-test-highcharts-columnrange.json` into `$ZEPPELIN_HOME/helium`
    3. Install the above visualization in `localhost:9000/#helium`
    4. Test it
    
    ### Screenshots (if appropriate)
    
    ![advanced_transformation_axis](https://cloud.githubusercontent.com/assets/4968473/23598175/f886f880-027b-11e7-83d6-3cbfb97ff9a7.gif)
    
    ![advanced_transformation_param](https://cloud.githubusercontent.com/assets/4968473/23598178/fb4c0416-027b-11e7-9efe-8c09bb55da79.gif)
    
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-2217/advanced-transformation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2098
    
----
commit 9fdbc1889622cb664a381771941b11f41b6db7a3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-06T05:39:48Z

    feat: AdvancedTransformation

commit 0278a201c7fb9918e127ef15fdffb792fa8a6dba
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-11T20:48:35Z

    fix: Overflow issue in single aggr

commit dbebddb08485628e4ccd33a37641e124053ca51c
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:46:59Z

    feat: Add groupBase axis option

commit 6f2a7407a800b1abe4868f2c4e57b170789564b6
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:55:12Z

    refactor: Add getAxisInSingleDimension func

commit d11cae1bda946fd318cbaf3842cacf22472ce933
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:16:41Z

    feat: Add clearConfig

commit ccdb5a67d90ef52107535a2e5a4d31ceea1c5ca8
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:59:28Z

    refactor: Refine transform API

commit 44825ca172e6ba5ff9c30f4aa2b16982ef5bf8a8
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T09:06:40Z

    fix: Add singleDimensionAggregatorChanged

commit c05e1f9bd9af1fc3f5bfdeb9a52bb9826b3d1692
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T09:26:40Z

    feat: Support multiple charts

commit 1cdaa5763f9581fa334bdf1785da99f4cd4b1f1b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T11:21:40Z

    feat: Support multiple charts in UI

commit 352d9ff0ad6f94ebc37dc6869e2010046cd8bf0d
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T12:15:38Z

    feat: advanced-transformation-api

commit ac1425be555a22cebd7371f591c69a94bee85187
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T15:49:23Z

    refactor: Refine axis, param spec

commit c42bee20fac7feefba10630543d149a517471c22
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T16:17:33Z

    feat: Support same axis types

commit 52c2afc31fab2c39a77f3989ed22fb77978204fe
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:03:10Z

    feat: Cube Transformation

commit d4194cd204e95da57778ff28db0b0b12f6e98419
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:48:23Z

    feat: Support undefined valueType in axisSpec

commit 48984539adf7de06a6cfc5e5422b395685cd0e9e
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T13:15:59Z

    feat: Support maxAxisCount in axisSpec

commit ad80e11a739cb2e7374779beba70ba5aafcafd41
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:44:04Z

    feat: Support transform: flatten

commit 4d034139d8c0975cc15c41b625e62f6e9cf2a2c2
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:48:24Z

    fix: Modify margin of subchart radio btns

commit c30d3cb2bafb6c5e2b613d20969f6c0bc200e499
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:52:35Z

    fix: Duplicated radio btn id, name

commit 763eb26fd81a393ad08cb9d0ea8393d3b5cceb8d
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T16:35:26Z

    feat: Automatic spec versioning

commit ecca5c1c6aed749839296753fd3e5354253726cf
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T17:11:17Z

    feat: Support transformer

commit 8a8055f7469d334e206931ebde34d3a0a24dcb9f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:24:20Z

    feat: custom axisSpec

commit 12b16ec1360fc06dd2c3d0d34b5fd73f212952c6
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:35:23Z

    feat: Save and close with enter key

commit b5e78e0db548d272145c963d94180fc674e4ee39
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:45:55Z

    fix: Change panel header

commit bf3bcc1fb22088bc464885084ae1a072f0c024d1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:26:38Z

    feat: option widget

commit 70291717f9dbe1f688b850ddbf0cb6b129008642
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:30:15Z

    feat: widget checkbox

commit 356072e8fe36e669b7cc48baec895a877b90bdb6
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:39:31Z

    feat: textare widget and update hook

commit 5a08ce077b2a48f3b85d5c437f9573713526897e
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T15:32:46Z

    refactor: Remove util and add Widget funcs

commit 331b2a97e2598c13e47a8e8c349fe1ae0ec4dc0b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:03:10Z

    fix: Dont close param panel when enter

commit b0cbb9378abb44d171e5579b20c55892a1a9b0f3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:54:57Z

    feat: Automatic param parsing

commit f849161ebed87930b69c3889b40c1eb806abe590
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T19:11:35Z

    fix: Stop event propagation in widgets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @AhyoungRyu 
    
    1. Hide other buttons when panel is minified
    
    ![image](https://cloud.githubusercontent.com/assets/4968473/24619895/9ac980fc-18d6-11e7-9eec-059e0494c59c.png)
    
    2. Added doc to `docs/development/writingzeppelinvisualization_transformation.md`. It looks like 
    
    ![2098_docs](https://cloud.githubusercontent.com/assets/4968473/24619937/c1841e46-18d6-11e7-87d0-6350cd4d43c0.gif)
    
    3. Regarding to popup, i think we can skip it because if parameter is applied or reset, the chart will change according to the options. The chart will remain same only if parameter is not changed at all and user can recognize when he/she does't change parameter.
    
    @Leemoonsoo 
    
    4. I added many tests to `advanced-transformation-util.test.js`. It covers most cases and many functions. Here is the file.
    
    - https://github.com/1ambda/zeppelin/blob/6a0559b18542c60b1211095f7583a71e5fb0c136/zeppelin-web/src/app/tabledata/advanced-transformation-util.test.js
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Appreciate for such detailed explanation! 
    Regarding `no-group`, I can assume the other ppl can be confused like me. So it'll be better to add some description for that to the documentation. (you already wrote all needed contents in your comments :D)
    
    FYI I suggested to separate Helium related docs page from "Contribute" section in the dropdown menu and create new section "Helium Framework" in #2202(Helium is worth to have its own kk). So your new docs page "Writing Zeppelin Visualization: Transformation(or another name?)" can be put under this section.
    And maybe more self-descriptive name would be better instead of just `Transformation`(hard to recognize at a glance what kind of transformation is). Something like `Writing Zeppelin Visualization: Advanced Chart Configuration`.. 
    But I don't wanna hang this PR because of docs. Surely you can handle it in another PR.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    updated
    
    Please check https://github.com/1ambda/zeppelin-ultimate-line-chart as well.
    
    Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @AhyoungRyu Thanks! 
    
    I didn't attach screenshots for examples which use `aggregator: false,`.  I will prepare in few days. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    Removed `WIP` from PR title.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @1ambda Great work!
    
    Let me test this interesting feature in this weekend.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    CI passed. I will update PR description


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for Visual...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @Leemoonsoo, @AhyoungRyu implementation is finally finished (IMO \U0001f62d )
    
    - Please help review this. 
    - Testing these 2 examples will be helpful (not published yet) [ultimate-line-chart](https://github.com/1ambda/zeppelin-ultimate-line-chart), [ultimate-column-chart](https://github.com/1ambda/zeppelin-ultimate-column-chart)
    - I will write documentation based on the PR description if review is done. I would like to postpone writing doc because it can change easily.
    
    Here is GIF for drill-down and shared axis what i added in last few commits :)
    
    ![drilldown](https://cloud.githubusercontent.com/assets/4968473/24207358/fa78662a-0f63-11e7-82cd-63d3af61794b.gif)
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217] AdvancedTransformation for Visu...

Posted by 1ambda <gi...@git.apache.org>.
GitHub user 1ambda reopened a pull request:

    https://github.com/apache/zeppelin/pull/2098

    [ZEPPELIN-2217] AdvancedTransformation for Visualization

    ### What is this PR for?
    
    Even if we already have 2 useful transformation, they have limitations.
    
    - we can't configure axises in `PivotTransformation`
    - we can't use aggregator functions in `ColumnselectorTransformation`
    
    `AdvancedTransformation` provides both functionality. Additionally, it supports
    
    - dynamic parameter panel for configuring charts
    - multiple, configurable, detailed axises
    - maximizing / minimizing each panel
    
    #### Implementation Details: Configuring Chart
    
    See also: [an example visualization using AdvancedTransformation](https://github.com/1ambda/zeppelin-advanced-transformation/blob/master/examples/local-test-highcharts-columnrange/index.js)
    
    ```javascript
    
            this.spec = {
                /** axis spec */
                axis: {
                    'xAxis': { type: 'number', dimension: 'single', group: false, aggregator: false, },
                    'yAxis': { type: 'string', dimension: 'multiple', group: true, aggregator: false, },
                },
    
                /** parameter spec */
                parameter: {
                    'xAxisName': { type: 'string', defaultValue: '', description: 'Name of xAxis', },
                    'yAxisName': { type: 'string', defaultValue: '', description: 'Name of yAxis', },
                    'yAxisUnit': { type: 'string', defaultValue: '', description: 'Unit of yAxis', },
                }
            }
    
            this.transformation = new AdvancedTransformation(config, this.spec)
    ```
    
    #### Implementation Details: return value of `transform`
    
    ```javascript
    return {
      raw: tableData.rows,
      grouped: grouped, /** [{ group, groupedRows, aggregated }] */
      column: {
          allColumns: tableData.columns,
          groupColumns: groupColumns,
          aggregatedColumns,
          normalColumns: normalColumns,
      }
    }
    ```
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    NONE
    
    ### What is the Jira issue?
    
    [ZEPPELIN-2217](https://issues.apache.org/jira/browse/ZEPPELIN-2217)
    
    ### How should this be tested?
    
    1. Clone https://github.com/1ambda/zeppelin-advanced-transformation
    2. Copy `examples/local-test-highcharts-columnrange/local-test-highcharts-columnrange.json` into `$ZEPPELIN_HOME/helium`
    3. Install the above visualization in `localhost:9000/#helium`
    4. Test it
    
    ### Screenshots (if appropriate)
    
    ![advanced_transformation_axis](https://cloud.githubusercontent.com/assets/4968473/23598175/f886f880-027b-11e7-83d6-3cbfb97ff9a7.gif)
    
    ![advanced_transformation_param](https://cloud.githubusercontent.com/assets/4968473/23598178/fb4c0416-027b-11e7-9efe-8c09bb55da79.gif)
    
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-2217/advanced-transformation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2098
    
----
commit 0cf49fb17182d879ab7cc4972d2b17025ba6e278
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-06T05:39:48Z

    feat: AdvancedTransformation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    @AhyoungRyu Updated docs as well.
    
    ![image](https://cloud.githubusercontent.com/assets/4968473/24641455/edad6e28-193a-11e7-93a5-7306a1de276e.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2098: [ZEPPELIN-2217] AdvancedTransformation for Visualizati...

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/2098
  
    I'v just updated the PR description. Please help review this @AhyoungRyu :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2098: [ZEPPELIN-2217][WIP] AdvancedTransformation for...

Posted by 1ambda <gi...@git.apache.org>.
GitHub user 1ambda reopened a pull request:

    https://github.com/apache/zeppelin/pull/2098

    [ZEPPELIN-2217][WIP] AdvancedTransformation for Visualization

    ### What is this PR for?
    
    `AdvancedTransformation` has more detailed options while providing existing features of `PivotTransformation` and `ColumnselectorTransformation` which Zeppelin already has 
    
    ![av_in_30sec](https://cloud.githubusercontent.com/assets/4968473/24037330/c9478e86-0b40-11e7-9886-1ffb85042a7a.gif)
    
    Here are some features which advanced-transformation can provide.
    
    1. **(screenshot)** multiple sub charts
    2. **(screenshot)** parameter widgets: `input`, `checkbox`, `option`, `textarea`
    3. **(screenshot)** expand/fold axis and parameter panels
    4. **(screenshot)** clear axis and parameter panels
    5. **(screenshot)** remove duplicated columns in an axis
    6. **(screenshot)** limit column count in an axis
    7. configurable char axes: `valueType`, `axisType`, `description`, ...
    8. configurable chart parameters
    9. lazy transformation
    10. parsing parameters automatically based on their type: `int`, `float`, `string`, `JSON`
    11. multiple transformation methods
    12. re-initialize whole configuration based on spec hash.
    13. **(screenshot)** shared axis
    
    #### API Details: Spec
    
    `AdvancedTransformation` requires `spec` which includes axis and parameter details for charts.
    
    - Let's create 2 sub-charts called `simple-line` and `step-line`.
    - Each sub chart can have different `axis` and `parameter` depending on their requirements.
    
    ```js
      constructor(targetEl, config) {
        super(targetEl, config)
    
        const spec = {
          charts: {
            'simple-line': {
              sharedAxis: true, /** set if you want to share axes between sub charts, default is `false` */
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key', },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'dashLength': { valueType: 'int', defaultValue: 0, description: 'the length of dash', },
              },
            },
    
            'step-line': {
              axis: {
                'xAxis': { dimension: 'single', axisType: 'unique', },
                'yAxis': { dimension: 'multiple', axisType: 'value', },
              },
              parameter: {
                'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
                'yAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of yAxis', },
                'noStepRisers': { valueType: 'boolean', defaultValue: false, description: 'no risers in step line', widget: 'checkbox', },
            },
    
          },
        }
    
        this.transformation = new AdvancedTransformation(config, spec)
      }
    ```
    
    ####  API Details: Axis Spec
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`dimension` | `single` | Axis can contains only 1 column |
    |`dimension` | `multiple` | Axis can contains multiple columns |
    |`axisType` | `key` | Column(s) in this axis will be used as `key` like in `PivotTransformation`. These columns will be served in `column.key` |
    |`axisType` | `aggregator` | Column(s) in this axis will be used as `value` like in `PivotTransformation`. These columns will be served in `column.aggregator` |
    |`axisType` | `group` | Column(s) in this axis will be used as `group` like in `PivotTransformation`. These columns will be served in `column.group` |
    |`axisType` | (string) | Any string value can be used here. These columns will be served in `column.custom` |
    |`maxAxisCount` | (int) | The maximum column count that this axis can contains. (unlimited if `undefined`) |
    |`valueType` | (string) | Describe the value type just for annotation |
    
    Here is an example.
    
    ```js
              axis: {
                'xAxis': { dimension: 'multiple', axisType: 'key',  },
                'yAxis': { dimension: 'multiple', axisType: 'aggregator'},
                'category': { dimension: 'multiple', axisType: 'group', maxAxisCount: 2, valueType: 'string', },
              },
    ```
    
    ####  API Details: Parameter Spec
    
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`valueType` | `string` | Parameter which has string value |
    |`valueType` | `int` | Parameter which has int value |
    |`valueType` | `float` | Parameter which has float value |
    |`valueType` | `boolean` | Parameter which has boolean value used with `checkbox` widget usually |
    |`valueType` | `JSON` | Parameter which has JSON value used with `textarea` widget usually. `defaultValue` should be `""` (empty string). This ||`defaultValue` | (any) | Default value of this parameter. `JSON` type should have `""` (empty string) |
    |`description` | (string) | Description of this parameter. This value will be parsed as HTML for pretty output |
    |`widget` | `input` |  Use [input](https://developer.mozilla.org/en/docs/Web/HTML/Element/input) widget. This is the default widget (if `widget` is undefined)|
    |`widget` | `checkbox` |  Use [checkbox](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox) widget. |
    |`widget` | `textarea` |  Use [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) widget. |
    |`widget` | `option` |  Use [select + option](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) widget. This parameter should have `optionValues` field as well. |
    |`optionValues` | (Array<string>) |  Available option values used with the `option` widget |
    
    Here is an example.
    
    ```js
    parameter: {
      // string type, input widget
      'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', },
    
      // boolean type, checkbox widget
      'inverted': { widget: 'checkbox', valueType: 'boolean', defaultValue: false, description: 'invert x and y axes', },
    
      // string type, option widget with `optionValues`
      'graphType': { widget: 'option', valueType: 'string', defaultValue: 'line', description: 'graph type', optionValues: [ 'line', 'smoothedLine', 'step', ], },
    
      // HTML in `description`
      'dateFormat': { valueType: 'string', defaultValue: '', description: 'format of date (<a href="https://docs.amcharts.com/3/javascriptcharts/AmGraph#dateFormat">doc</a>) (e.g YYYY-MM-DD)', },
     
      // JSON type, textarea widget
      'yAxisGuides': { widget: 'textarea', valueType: 'JSON', defaultValue: '', description: 'guides of yAxis ', },
    ```
    
    #### API Details: Transformer Spec
    
    `AdvancedTransformation` supports 3 transformation methods. The return value will depend on the transformation method type. 
    
    ```js
        const spec = {
          charts: {
            'simple': {
              /** default value of `transform.method` is the flatten cube.  */
              axis: { ... },
              parameter: { ... }
            },
    
            'cube-group': {
              transform: { method: 'cube', },
              axis: { ... },
              parameter: { ... },
            }
    
            'no-group': {
              transform: { method: 'raw', },
              axis: { ... },
              parameter: { ... },
            }
    ```
    
    | Field Name | Available Values (type) | Description |
    | --- | --- | --- |
    |`method` | `object` |  designed for [amcharts: serial](https://www.amcharts.com/demos/date-based-data/) | 
    |`method` | `array` | designed for [highcharts: column](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-basic/) |
    |`method` | `drill-down` | designed for [highcharts: drill-down](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/column-drilldown/) |
    |`method` | `raw` | will return the original `tableData.rows` | 
    
    Whatever you specified as `transform.method`, the `transformer` value will be always function for lazy computation. 
    
    ```js
    // advanced-transformation.util#getTransformer
    
      if (transformSpec.method === 'raw') {
        transformer = () => { return rows; }
      } else if (transformSpec.method === 'array') {
        transformer = () => {
          ...
          return { ... }
        }
      }
    
    ```
    
    #### Feature Details: Automatic parameter parsing
    
    Advanced transformation will parse parameter values automatically based on their type: `int`, `float`, `string`, `JSON`
    
    - See also `advanced-transformation-util.js#parseParameter`
    
    #### Feature Details: re-initialize the whole configuration based on spec hash
    
    ```js
    // advanced-transformation-util#initializeConfig
    
      const currentVersion = JSON.stringify(spec)
      if (!config.spec || !config.spec.version || config.spec.version !== currentVersion) {
        spec.version = currentVersion
        // reset config...
      }
    ```
    
    #### Feature Details: Shared Axes
    
    If you set `sharedAxis` to `true` in chart specification, then these charts will share their axes. (default is `false`)
    
    ```js
        const spec = {
          charts: {
            'column': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... },
              parameter: { ... },
            },
    
            'stacked': {
              transform: { method: 'array', },
              sharedAxis: true,
              axis: { ... }
              parameter: { ... },
            },
    ```
    
    ![sharedaxis](https://cloud.githubusercontent.com/assets/4968473/24207116/6999ad8a-0f63-11e7-8b61-273b712612fc.gif)
    
    #### API Details: Usage in Visualization#render()
    
    Let's assume that we want to create 2 sub-charts called `basic` and `no-group`.
    
    - https://github.com/1ambda/zeppelin-ultimate-line-chart (an practical example)
    
    ```js
      drawBasicChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      drawNoGroupChart(parameter, column, transformer) { 
        const { ... } = transformer()
      }
    
      render(data) {
        const { chart, parameter, column, transformer, } = data
    
        if (chart === 'basic') {
          this.drawBasicChart(parameter, column, transformer)
        } else if (chart === 'no-group') {
          this.drawNoGroupChart(parameter, column, transformer)
        }
      }
    ```
    
    
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    NONE
    
    ### What is the Jira issue?
    
    [ZEPPELIN-2217](https://issues.apache.org/jira/browse/ZEPPELIN-2217)
    
    ### How should this be tested?
    
    1. Clone https://github.com/1ambda/zeppelin-ultimate-line-chart
    2. Create a symbolic link `ultimate-line-chart.json` into `$ZEPPELIN_HOME/helium`
    3. Modify the `artifact` value to proper absolute path considering your local machine.
    4. Install the above visualization in `localhost:9000/#helium`
    5. Test it
    
    ### Screenshots (if appropriate)
    
    #### 1. *(screenshot)* multiple sub charts
    
    ![av_multiple_charts](https://cloud.githubusercontent.com/assets/4968473/24034638/7b84dba0-0b35-11e7-989d-059ccc87f968.gif)
    
    #### 2. *(screenshot)* parameter widgets: `input`, `checkbox`, `option`, `textarea`
    
    ![av_widgets_new](https://cloud.githubusercontent.com/assets/4968473/24034652/88679d6c-0b35-11e7-835a-3970d7124850.gif)
    
    #### 3. *(screenshot)* expand/fold axis and parameter panels
    
    ![av_fold_expand](https://cloud.githubusercontent.com/assets/4968473/24034653/8a634ddc-0b35-11e7-9851-15280a6b5fd3.gif)
    
    #### 4. *(screenshot)* clear axis and parameter panels
    
    ![av_clean_buttons](https://cloud.githubusercontent.com/assets/4968473/24034654/8d3dc14a-0b35-11e7-98c7-3aeddce6d80a.gif)
    
    #### 5. *(screenshot)* remove duplicated columns in an axis
    
    ![av_duplicated_columns](https://cloud.githubusercontent.com/assets/4968473/24034657/910f4d20-0b35-11e7-9e9b-d9e2f799a5dd.gif)
    
    #### 6. *(screenshot)* limit column count in an axis
    
    ![av_maxaxiscount](https://cloud.githubusercontent.com/assets/4968473/24034679/a5e8eb34-0b35-11e7-89cd-070f3790d511.gif)
    
    ### Questions:
    * Does the licenses files need update? - NO
    * Is there breaking changes for older versions? - NO
    * Does this needs documentation? - NO


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/1ambda/zeppelin ZEPPELIN-2217/advanced-transformation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2098
    
----
commit 10c80fc8beb8731ad416449350cda255b59de107
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-06T05:39:48Z

    feat: AdvancedTransformation

commit 91ae54d1c151667c57186913cf03feb56a7a17d6
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-11T20:48:35Z

    fix: Overflow issue in single aggr

commit 9768ecfcc576ba37c8f7f1bd12b4cf95f0c6705c
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:46:59Z

    feat: Add groupBase axis option

commit a8a4fb1ac53ca106830fa7b460032775baa0ea8f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T07:55:12Z

    refactor: Add getAxisInSingleDimension func

commit 9fb398e92d2f7f623a8dfe37adc6fb5ef6a6bf3a
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:16:41Z

    feat: Add clearConfig

commit 676bd7e422df4cfb4d7d0101a75f3d2f7b452d69
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T08:59:28Z

    refactor: Refine transform API

commit 97be62933685d5494397f736f69f0d6c465c7371
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-12T09:06:40Z

    fix: Add singleDimensionAggregatorChanged

commit e1fcc2e234b3c68e8cef347357e71c7dbed7930b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T09:26:40Z

    feat: Support multiple charts

commit 75569cea6e9eb5b7deb8efe428b84bcc445888e1
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T11:21:40Z

    feat: Support multiple charts in UI

commit d89e223768aa9945fc8f1729301e93e765d95917
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-13T12:15:38Z

    feat: advanced-transformation-api

commit 49985c69056603a53ffa2ca2f596c82ea58f6f04
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T15:49:23Z

    refactor: Refine axis, param spec

commit f0ed02fff0841af306e3f52d990332fe3d6a7719
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-14T16:17:33Z

    feat: Support same axis types

commit 7a454ff8218745f5d8f5150e553488bb501be207
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:03:10Z

    feat: Cube Transformation

commit 936901b553442fb1a014e2197496457b44e524ec
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T12:48:23Z

    feat: Support undefined valueType in axisSpec

commit 0484e1ee6b57fbb327ebf94d3347779f7ae44def
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T13:15:59Z

    feat: Support maxAxisCount in axisSpec

commit 019892ce00309208293b66a2eacf7241ffd5b3f3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:44:04Z

    feat: Support transform: flatten

commit 5b88f08be1492dc045581896e571f2953548ea46
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:48:24Z

    fix: Modify margin of subchart radio btns

commit 74b8b4e64918a2a1f3bf50998f489808fde025df
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T15:52:35Z

    fix: Duplicated radio btn id, name

commit 94d837a4f7267511b787809fefdd6e8776dafeb3
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T16:35:26Z

    feat: Automatic spec versioning

commit 0dbc431e1cddef6e7a2fa12daf410c04564a3309
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T17:11:17Z

    feat: Support transformer

commit 53f508c2d3cfee692f7f606d550113b3b15b693e
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:24:20Z

    feat: custom axisSpec

commit b1d9d31b970b153d11a9b67c2cade6d2cf21ffcb
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:35:23Z

    feat: Save and close with enter key

commit 5d3efc932f9dffb04c314f7e574b471982eabf3b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-15T18:45:55Z

    fix: Change panel header

commit 11b7eaac94a807d6c62a9ed484b3e47f67f72f3b
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:26:38Z

    feat: option widget

commit 4e73012033e8720f4227c5fcbba23e54275fc8d5
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:30:15Z

    feat: widget checkbox

commit bf88b4f237fd99d7d3c0a4e6d8b64933f6dcd1d0
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T10:39:31Z

    feat: textare widget and update hook

commit 088705b3b83c3ea716bb396b995f305aeac0d692
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T15:32:46Z

    refactor: Remove util and add Widget funcs

commit b4d774cde12e341511880a42fa2fbf7bbae4a76f
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:03:10Z

    fix: Dont close param panel when enter

commit fcc625cb0c9c5f247ebfadc2c52720bdc907e424
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T18:54:57Z

    feat: Automatic param parsing

commit 9a2d227318469383fc4015d2fc2f81752a71ee76
Author: 1ambda <1a...@gmail.com>
Date:   2017-03-16T19:11:35Z

    fix: Stop event propagation in widgets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---