GitHub user Remilito opened a pull request:
https://github.com/apache/zeppelin/pull/2099
[ZEPPELIN-2106] providing paragraph config in create note/paragraph rest
call
### What is this PR for?
* Allow to provide graph info, colWidth, showTitle or even full paragraph
config
directly in the Create Paragraph and Create Note endpoint.
* Save calls to [noteId]/paragraph/[paragraphId]/config
* Updated doc.
### What type of PR is it?
Improvement
### Todos
### What is the Jira issue?
[ZEPPELIN-2106](https://issues.apache.org/jira/browse/ZEPPELIN-2106)
### How should this be tested?
Outline the steps to test the PR here.
1. Clone the first paragraph of 'Zeppelin Tutorial/Basic Features (Spark)'
to get the bank data loaded in a new note.
2. curl -X POST -d @testAPI1.json
http://localhost:8080/api/notebook/$YOURNOTEID/paragraph
3. curl -X POST -d @testAPI2.json
http://localhost:8080/api/notebook/$YOURNOTEID/paragraph
4. When running the paragraphes, the graphs will show up with the
appropriate settings.
testAPI1.json:
`{
"title":"Example providing Graph",
"text":"%sql\nselect age, marital, count(1) cvalue from bank group
by age, marital order by age",
"showTitle":true,
"colWidth":9.0,
"graph": {
"mode": "pieChart",
"keys": [
{
"name": "age",
"index": 0.0,
"aggr": "sum"
}
],
"groups": [
{
"name": "marital",
"index": 1.0,
"aggr": "sum"
}
],
"values": [
{
"name": "cvalue",
"index": 2.0,
"aggr": "sum"
}
]
}
}
`
testAPI2.json:
`{
"title":"Example providing config",
"text":"%sql\nselect age, marital, count(1) cvalue from bank group
by age, marital order by age",
"config": {
"title":true,
"colWidth":6.0,
"results": [
{
"graph": {
"mode": "scatterChart",
"optionOpen": true
}
}
]
},
"colWidth":9.0
}
`
### Screenshots (if appropriate)
### 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/Remilito/zeppelin ZEPPELIN-2106b
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/2099.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 #2099
----
commit 76af44ab6c6b3edfd26bc1ffecd2db76d531dbbb
Author: Remilito <[email protected]>
Date: 2017-03-03T17:23:56Z
[ZEPPELIN-2106] providing paragraph config in create
note/paragraph call
* Allow to describe graph, colWidth, showTitle or full paragraph config
directly in the Create Paragraph and Create Note endpoint.
* Updated doc.
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---