I did have a look at the PR 321 and failed to get in touch with its
developer (rookalkar) via linkedin/gmail/twitter.
I attempted to add candle stick support to zeppelin. In short it did not
work, in long read on.
*JS Error: (Chrome developer tools)*
TypeError: nv.models[b] is not a function
at q (http://zeppelin-server.com:10008/scripts/scripts.js:1:26185)
at l.a.setGraphMode (
http://zeppelin-server.com:10008/scripts/scripts.js:1:24693)
at l.a.init (http://zeppelin-server.com:10008/scripts/scripts.js:1:13350
)
at me.functionCall (
http://zeppelin-server.com:10008/scripts/vendor.js:39:10378)
at l.a.$get.l.$eval (
http://zeppelin-server.com:10008/scripts/vendor.js:38:1094)
at zc.compile.pre (
http://zeppelin-server.com:10008/scripts/vendor.js:39:25248)
at fa (http://zeppelin-server.com:10008/scripts/vendor.js:37:3594)
at v (http://zeppelin-server.com:10008/scripts/vendor.js:36:29494)
at h (http://zeppelin-server.com:10008/scripts/vendor.js:36:25521)
at b.$get.b (http://zeppelin-server.com:10008/scripts/vendor.js:36:25017)
<div id="{{currentParagraph.id}}_paragraphColumn_main"
ng-repeat="currentParagraph in note.paragraphs"
ng-controller="ParagraphCtrl" ng-init="init(currentParagraph)"
ng-class="columnWidthClass(currentParagraph.config.colWidth)"
class="paragraph-col ng-scope">
*Output:*
[image: Inline image 1]
I do not see any graph because of JS error and other unknown error.
Coming to code changes:
Attached is the git diff.
Questions
1) Obviously, how to fix that JS error.
2) paragraph.controller.js:
Changes:
} else if (type === 'candleStick') {
d3g = [{values: [{'date': 15854, 'open': 165.42, 'high': 165.8, 'low':
164.34, 'close': 165.22, 'volume': 160363400, 'adjusted': 164.35},
{'date': 15855, 'open': 165.35, 'high': 166.59, 'low':
165.22, 'close': 165.83, 'volume': 107793800, 'adjusted': 164.96}]}];
$scope.chart[type].x(function(d) { return d.date; }).y(function(d) {
return d.close; }).duration(250).maxBoxWidth(75).yDomain([0, 500]);
$scope.chart[type].xAxis.tickFormat(function(d) {
return d3.time.format('%x')(new Date(new Date() - (20000 *
86400000) + (d * 86400000)));
});
$scope.chart[type].yAxis.axisLabelDistance(50).tickFormat(function(d,i){
return '$' + d3.format(',.1f')(d); });
$scope.chart[type].useInteractiveGuideline(true);
}
1) I have dummy data for 2 points in candle stick and the below code to get
the candle stick. Once i get this plotted on zeppelin, i will then want to
work with actual data. Is above right way of doing it.
2) Dev environment: I made code changes, moved to ubuntu , built on ubuntu
(as mac build fails, questions on other post) and then run start/stop. This
looks like a long way of testing UI changes (JS/HTML). In my past
experience i make such changes to deployed webapp and just refresh browser.
Looks like that is not the case here, as JS is jumbled up and i cannot see
my JS on developer tools (chrome). Is this expected ?
Once i get it working, i will write a wiki and have it contributed back to
zeppelin.
Regards,
Deepak
On Mon, Sep 28, 2015 at 2:05 AM, Corneau Damien <[email protected]>
wrote:
> You can find a lot of informations in the README.md in github.
> There is also a few guides on how to contribute
> https://github.com/apache/incubator-zeppelin/blob/master/CONTRIBUTING.md
>
> https://github.com/apache/incubator-zeppelin/blob/master/zeppelin-web/CONTRIBUTING.md
>
> And regarding the box plot, just like I said before, there is the PR #321
> that is doing it. To understand how you can add a graph, you can check that
> PR or the source code of zeppelin-web (paragraph.js).
>
> Madhuka also made a post when he worked on the map chart for GSOC, that
> explained how you can add a new visualization in zeppelin source code.
>
> http://madhukaudantha.blogspot.kr/2015/08/introducing-new-chart-library-and-types.html?m=1
> On Sep 28, 2015 4:41 AM, "tog" <[email protected]> wrote:
>
>> Hi Deepak
>>
>> Do not hesitate to ask your specific questions on the mailing list? The
>> answers might help other people as well
>>
>> Cheers
>> Guillaume
>>
>> On 27 September 2015 at 17:14, ÐΞ€ρ@Ҝ (๏̯͡๏) <[email protected]> wrote:
>>
>>> Any suggestions ??
>>>
>>> On Fri, Sep 25, 2015 at 2:52 PM ÐΞ€ρ@Ҝ (๏̯͡๏) <[email protected]>
>>> wrote:
>>>
>>>> Hello Lucas,
>>>> Will it be possible for you to have a quick chat with me. I need your
>>>> help in understand a little background of the changes made, development
>>>> environment setup and dev test environment.
>>>> Really appreciate your support here.
>>>> Regards,
>>>> Deepak
>>>>
>>>> On Fri, Sep 25, 2015 at 2:04 AM, Partridge, Lucas (GE Aviation) <
>>>> [email protected]> wrote:
>>>>
>>>>> Go here for a list of Zeppelin pull-requests:
>>>>> https://github.com/apache/incubator-zeppelin/pulls
>>>>>
>>>>>
>>>>>
>>>>> You’ll see #321 in the list or
>>>>> https://github.com/apache/incubator-zeppelin/pull/321 if you want a
>>>>> direct link.
>>>>>
>>>>>
>>>>>
>>>>> *From:* ÐΞ€ρ@Ҝ (๏̯͡๏) [mailto:[email protected]]
>>>>> *Sent:* 25 September 2015 04:11
>>>>> *To:* [email protected]
>>>>> *Subject:* Re: Box plot graph support missing,
>>>>>
>>>>>
>>>>>
>>>>> Please share url
>>>>>
>>>>> On Thu, Sep 24, 2015 at 7:35 PM Corneau Damien <[email protected]>
>>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>>
>>>>> There is already PR#321 being done
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Sep 25, 2015 at 11:30 AM, ÐΞ€ρ@Ҝ (๏̯͡๏) <[email protected]>
>>>>> wrote:
>>>>>
>>>>> Can someone guide me here. I want to add support for box plot graph,
>>>>> how do i go from here.
>>>>>
>>>>>
>>>>>
>>>>> Also, please describe your dev setup. IDE , Mac etc.
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Sep 23, 2015 at 4:44 PM, ÐΞ€ρ@Ҝ (๏̯͡๏) <[email protected]>
>>>>> wrote:
>>>>>
>>>>> I do not see box plot graph support in Zeppelin. So i guess i will
>>>>> have to add it.
>>>>>
>>>>>
>>>>>
>>>>> I saw this commit from @minahlee
>>>>>
>>>>>
>>>>> https://github.com/apache/incubator-zeppelin/commit/5fce509131f25b2e30590a9d60667f428ef53835
>>>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_incubator-2Dzeppelin_commit_5fce509131f25b2e30590a9d60667f428ef53835&d=BQMFaQ&c=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=c1CCNND4PG-Q_V2AJWDWrugZAXQ8Y3EE_f_mAHcpXcs&m=mnlsQFiRLxhbpxFQZJf8zD5y989iHorJ2qSEYbViPoM&s=21g1JA5ljCaWMSDk34QgxvQKwc6Gh1SvuF2f8D0does&e=>
>>>>>
>>>>>
>>>>>
>>>>> 1) Do i need to something similar ?
>>>>>
>>>>> 2) Is my assumption and hence the developing the solution a right
>>>>> direction ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Deepak
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Deepak
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Deepak
>>>>
>>>>
>>
>>
>> --
>> PGP KeyID: 2048R/EA31CFC9 subkeys.pgp.net
>>
>
--
Deepak
diff --git a/cassandra/pom.xml b/cassandra/pom.xml
index 860f3a7..026ed56 100644
--- a/cassandra/pom.xml
+++ b/cassandra/pom.xml
@@ -295,5 +295,40 @@
</plugin>
</plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store
Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+
<pluginExecutionFilter>
+
<groupId>
+
org.scalatra.scalate
+
</groupId>
+
<artifactId>
+
maven-scalate-plugin_2.11
+
</artifactId>
+
<versionRange>
+
[1.7.1,)
+
</versionRange>
+ <goals>
+
<goal>precompile</goal>
+ </goals>
+
</pluginExecutionFilter>
+ <action>
+
<ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
</project>
diff --git a/flink/pom.xml b/flink/pom.xml
index 27d8034..81c4b1c 100644
--- a/flink/pom.xml
+++ b/flink/pom.xml
@@ -374,5 +374,54 @@
</executions>
</plugin>
</plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e
settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+
<groupId>org.codehaus.mojo</groupId>
+ <artifactId>
+
build-helper-maven-plugin
+ </artifactId>
+
<versionRange>[1.7,)</versionRange>
+ <goals>
+
<goal>add-source</goal>
+
<goal>add-test-source</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+
<ignore></ignore>
+ </action>
+ </pluginExecution>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+
org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+
maven-remote-resources-plugin
+ </artifactId>
+
<versionRange>[1.5,)</versionRange>
+ <goals>
+
<goal>process</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+
<ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
</project>
diff --git a/zeppelin-web/bower.json b/zeppelin-web/bower.json
index 04bdbf8..e0919c9 100644
--- a/zeppelin-web/bower.json
+++ b/zeppelin-web/bower.json
@@ -16,7 +16,7 @@
"ace-builds": "1.1.9",
"angular-ui-ace": "0.1.1",
"jquery.scrollTo": "~1.4.13",
- "nvd3": "~1.1.15-beta",
+ "nvd3": "~1.8.1",
"angular-dragdrop": "~1.0.8",
"perfect-scrollbar": "~0.5.4",
"ng-sortable": "~1.1.9",
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 08eb657..8f5fc80 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -729,7 +729,7 @@ angular.module('zeppelinWebApp')
result.rows = rows;
}
};
-
+
$scope.setGraphMode = function(type, emit, refresh) {
if (emit) {
setNewMode(type);
@@ -928,6 +928,15 @@ angular.module('zeppelinWebApp')
$scope.chart[type].yAxis.axisLabelDistance(50);
$scope.chart[type].useInteractiveGuideline(true); // for better UX and
performance issue. (https://github.com/novus/nvd3/issues/691)
$scope.chart[type].forceY([0]); // force y-axis minimum to 0 for line
chart.
+ } else if (type === 'candleStick') {
+ d3g = [{values: [{'date': 15854, 'open': 165.42, 'high': 165.8,
'low': 164.34, 'close': 165.22, 'volume': 160363400, 'adjusted': 164.35},
+ {'date': 15855, 'open': 165.35, 'high': 166.59,
'low': 165.22, 'close': 165.83, 'volume': 107793800, 'adjusted': 164.96}]}];
+ $scope.chart[type].x(function(d) { return d.date; }).y(function(d) {
return d.close; }).duration(250).maxBoxWidth(75).yDomain([0, 500]);
+ $scope.chart[type].xAxis.tickFormat(function(d) {
+ return d3.time.format('%x')(new Date(new Date() - (20000 *
86400000) + (d * 86400000)));
+ });
+
$scope.chart[type].yAxis.axisLabelDistance(50).tickFormat(function(d,i){ return
'$' + d3.format(',.1f')(d); });
+ $scope.chart[type].useInteractiveGuideline(true);
}
}
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.html
b/zeppelin-web/src/app/notebook/paragraph/paragraph.html
index 0ad03a6..45953f6 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.html
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.html
@@ -129,6 +129,10 @@ limitations under the License.
ng-class="{'active': isGraphMode('scatterChart')}"
ng-click="setGraphMode('scatterChart', true)"><i class="cf
cf-scatter-chart"></i>
</button>
+ <button type="button" class="btn btn-default btn-sm"
+ ng-class="{'active': isGraphMode('candleStick')}"
+ ng-click="setGraphMode('candleStick', true)"><i class="cf
cf-candle-stick"></i>
+ </button>
</div>
<span ng-if="getResultType()=='TABLE' && getGraphMode()!='table' &&
!asIframe && !viewOnly"
style="margin-left:10px; cursor:pointer; display: inline-block;
vertical-align:top; position: relative; line-height:30px;">
@@ -333,6 +337,11 @@ limitations under the License.
id="p{{paragraph.id}}_scatterChart">
<svg></svg>
</div>
+
+ <div ng-if="getGraphMode()=='candleStick'"
+ id="p{{paragraph.id}}_candleStick">
+ <svg></svg>
+ </div>
</div>
<div id="{{paragraph.id}}_comment"