Skip to content

Commit

Permalink
Configure Visualizations (#365)
Browse files Browse the repository at this point in the history
* make viz types configurable

* make visualizations configurable

* deault every viz is true

* add blacklist viz_type

* fix build
  • Loading branch information
sid88in authored and mistercrunch committed Apr 18, 2016
1 parent badcd8b commit 3f0171b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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
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')])

0 comments on commit 3f0171b

Please sign in to comment.