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

Configure Visualizations #365

Merged
merged 5 commits into from
Apr 18, 2016
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
9 changes: 9 additions & 0 deletions caravel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@
CACHE_DEFAULT_TIMEOUT = None
CACHE_CONFIG = {'CACHE_TYPE': 'null'}


# ---------------------------------------------------
# List of viz_types not allowed in your environment
# For example: Blacklist pivot table and treemap:
# VIZ_TYPE_BLACKLIST = ['pivot_table', 'treemap']
# ---------------------------------------------------

VIZ_TYPE_BLACKLIST = []

try:
from caravel_config import * # noqa
except Exception:
Expand Down
4 changes: 2 additions & 2 deletions caravel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import uuid
from collections import OrderedDict, defaultdict
from datetime import datetime, timedelta

import pandas as pd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge anyways, but the idea for that blank line is to differentiate between standard lib imports and external ones. It matters most in large modules with lots of imports...

import numpy as np
from flask import flash, request, Markup
Expand Down Expand Up @@ -1540,4 +1539,5 @@ def get_data(self):
TreemapViz,
]

viz_types = OrderedDict([(v.viz_type, v) for v in viz_types_list])
viz_types = OrderedDict([(v.viz_type, v) for v in viz_types_list
if v.viz_type not in config.get('VIZ_TYPE_BLACKLIST')])