Skip to content

Commit

Permalink
Fixing the standalone mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 2, 2016
1 parent 2872c62 commit 51797ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
1 change: 1 addition & 0 deletions panoramix/assets/webpack.config.js
Expand Up @@ -11,6 +11,7 @@ var config = {
explore: APP_DIR + '/javascripts/explore.js',
featured: APP_DIR + '/javascripts/featured.js',
sql: APP_DIR + '/javascripts/sql.js',
standalone: APP_DIR + '/javascripts/standalone.js',
},
output: {
path: BUILD_DIR,
Expand Down
26 changes: 9 additions & 17 deletions panoramix/templates/panoramix/standalone.html
@@ -1,29 +1,21 @@
<html>
<head>
<script src="/static/panoramix.js"></script>

{% block head_css %}
<script src="{{url_for('appbuilder.static',filename='js/jquery-latest.js')}}"></script>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='panoramix.css') }}">
{% endblock %}
<script src="/static/assets/javascripts/dist/standalone.entry.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/stylesheets/panoramix.css" />
{% set CSS_THEME = appbuilder.get_app.config.get("CSS_THEME") %}
{% set height = request.args.get("height", 700) %}
{% if CSS_THEME %}
<link rel="stylesheet" type="text/css" href="{{ CSS_THEME }}" />
{% endif %}
</head>
<body>
<div
id="{{ viz.token }}"
class="viz slice {{ viz.viz_type }}"
class="widget viz slice {{ viz.viz_type }}"
data-slice="{{ viz.json_data }}"
style="height: 700px;">
style="height: {{ height }}px;">
<img src="{{ url_for("static", filename="img/loading.gif") }}" class="loading" alt="loading">
<div id="{{ viz.token }}_con" class="slice_container" style="height: 100%; width: 100%"></div>
</div>

<script>
$(document).ready(function() {
var data = $('.slice').data('slice');
var slice = px.Slice(data);
slice.render();
});
</script>
{% block tail %}{% endblock %}
</body>
</html>
2 changes: 2 additions & 0 deletions panoramix/viz.py
Expand Up @@ -104,6 +104,8 @@ def reassignments(self):

def get_url(self, **kwargs):
d = self.orig_form_data.copy()
if 'json' in d:
del d['json']
if 'action' in d:
del d['action']
d.update(kwargs)
Expand Down

0 comments on commit 51797ca

Please sign in to comment.