Skip to content

Commit

Permalink
Vliu explorev2 bugs (#1701)
Browse files Browse the repository at this point in the history
* Fixed table_name does not exist in druid

* Make Chart container scrollable for large chart

* Fixed bug of action buttons not clickable in heatmap

* Solve codeclimate issue

* Limit overflow to x
  • Loading branch information
vera-liu committed Nov 29, 2016
1 parent 3496a80 commit 7919428
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class ChartContainer extends React.Component {
id={this.props.containerId}
ref={(ref) => { this.chartContainerRef = ref; }}
className={this.props.viz_type}
style={{ 'overflow-x': 'scroll' }}
/>)
}
</Panel>
Expand Down
8 changes: 4 additions & 4 deletions superset/assets/visualizations/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function heatmapVis(slice) {
function refresh() {
// Header for panel in explore v2
const header = document.getElementById('slice-header');
const headerHeight = header ? header.getBoundingClientRect().height : 0;
const headerHeight = header ? 30 + header.getBoundingClientRect().height : 0;
const margin = {
top: 20 + headerHeight,
top: headerHeight,
right: 10,
bottom: 35,
left: 35,
Expand Down Expand Up @@ -101,14 +101,14 @@ function heatmapVis(slice) {
.style('height', hmHeight + 'px')
.style('image-rendering', fd.canvas_image_rendering)
.style('left', margin.left + 'px')
.style('top', margin.top + 'px')
.style('top', margin.top + headerHeight + 'px')
.style('position', 'absolute');

const svg = container.append('svg')
.attr('width', width)
.attr('height', height)
.style('left', '0px')
.style('top', '0px')
.style('top', headerHeight + 'px')
.style('position', 'absolute');

const rect = svg.append('g')
Expand Down
5 changes: 4 additions & 1 deletion superset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,11 +1451,14 @@ def explore(self, datasource_type, datasource_id):
"user_id": g.user.get_id() if g.user else None,
"viz": json.loads(viz_obj.get_json())
}
table_name = viz_obj.datasource.table_name \
if datasource_type == 'table' \
else viz_obj.datasource.datasource_name
return self.render_template(
"superset/explorev2.html",
bootstrap_data=json.dumps(bootstrap_data),
slice=slc,
table_name=viz_obj.datasource.table_name)
table_name=table_name)
else:
return self.render_template(
"superset/explore.html",
Expand Down

0 comments on commit 7919428

Please sign in to comment.