GitHub user 1ambda opened a pull request:
https://github.com/apache/zeppelin/pull/2114
[ZEPPELIN-2234][BUG] Can't display the same chart again (branch-0.7)
### What is this PR for?
Can't display the same chart again. I attached a screenshot.
- this is the same fix with https://github.com/apache/zeppelin/pull/2110
- except refactoring PR
- based on branch-0.7
#### Implementation Details
After https://github.com/apache/zeppelin/pull/2092,
- result.html will draw chart every time since we use `ng-if` instead of
`ng-show`
- that means DOM is deleted, and created too
- so we have to create visualization instance every time which requires a
newly created DOM.
```js
builtInViz.instance = new Visualization(loadedElem, config); //
`loadedElem` is the newly created DOM.
```
### What type of PR is it?
[Bug Fix]
### Todos
NONE
### What is the Jira issue?
* Open an issue on Jira https://issues.apache.org/jira/browse/ZEPPELIN/
* Put link here, and add [ZEPPELIN-*Jira number*] in PR title, eg.
[ZEPPELIN-533]
### How should this be tested?
I attached a screenshot
### Screenshots (if appropriate)
##### Before: buggy

##### After: fixed

### 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-2234/cant-display-same-chart-again-for-070
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/2114.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 #2114
----
commit 140e79b8f1288d9980f9ff09a04e1e05121fb1bd
Author: 1ambda <[email protected]>
Date: 2017-03-09T08:46:48Z
fix: Create vis instance every time
----
---
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.
---