Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the chart type of Visualize in sqllab #3241

Merged
merged 2 commits into from
Aug 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions superset/assets/javascripts/SqlLab/components/VisualizeModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ import { getExploreUrl } from '../../explore/exploreUtils';
import * as actions from '../actions';
import { VISUALIZE_VALIDATION_ERRORS } from '../constants';
import { QUERY_TIMEOUT_THRESHOLD } from '../../constants';
import visTypes from '../../explore/stores/visTypes';

const CHART_TYPES = [
{ value: 'dist_bar', label: 'Distribution - Bar Chart', requiresTime: false },
{ value: 'pie', label: 'Pie Chart', requiresTime: false },
{ value: 'line', label: 'Time Series - Line Chart', requiresTime: true },
{ value: 'bar', label: 'Time Series - Bar Chart', requiresTime: true },
];
const CHART_TYPES = Object.keys(visTypes)
.filter(typeName => !!visTypes[typeName].showOnExplore)
.map((typeName) => {
const vis = visTypes[typeName];
return {
value: typeName,
label: vis.label,
requiresTime: !!vis.requiresTime,
};
});

const propTypes = {
actions: PropTypes.object.isRequired,
Expand Down
4 changes: 4 additions & 0 deletions superset/assets/javascripts/explore/stores/visTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const sections = {
export const visTypes = {
dist_bar: {
label: 'Distribution - Bar Chart',
showOnExplore: true,
controlPanelSections: [
{
label: 'Chart Options',
Expand Down Expand Up @@ -108,6 +109,7 @@ export const visTypes = {

pie: {
label: 'Pie Chart',
showOnExplore: true,
controlPanelSections: [
{
label: null,
Expand All @@ -124,6 +126,7 @@ export const visTypes = {

line: {
label: 'Time Series - Line Chart',
showOnExplore: true,
requiresTime: true,
controlPanelSections: [
sections.NVD3TimeSeries[0],
Expand Down Expand Up @@ -194,6 +197,7 @@ export const visTypes = {

bar: {
label: 'Time Series - Bar Chart',
showOnExplore: true,
requiresTime: true,
controlPanelSections: [
sections.NVD3TimeSeries[0],
Expand Down
19 changes: 19 additions & 0 deletions superset/assets/stylesheets/superset.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,22 @@ div.widget .slice_container {
.Select-menu-outer {
z-index: 10 !important;
}

/** not found record **/
.panel b {
display: inline-block;
width: 98%;
padding: 2rem;
margin: 0 1% 20px 1%;
background: #f8f8f8;
}

/** table on both sides of the gap **/
.panel .table-responsive{
margin: 0 1%;
}
@media screen and (max-width: 767px) {
.panel .table-responsive{
width: 98%;
}
}
4 changes: 2 additions & 2 deletions superset/templates/appbuilder/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
</a>
</li>
<li>
<a href="https://github.com/airbnb/superset" title="Superset's Github">
<a href="https://github.com/apache/incubator-superset" title="Superset's Github">
<i class="fa fa-github"></i> &nbsp;
</a>
</li>
<li>
<a href="http://airbnb.io/superset" title="Documentation">
<a href="https://superset.incubator.apache.org" title="Documentation">
<i class="fa fa-book"></i> &nbsp;
</a>
</li>
Expand Down