Skip to content

Commit

Permalink
Merge pull request #34 from mistercrunch/nvd3_2
Browse files Browse the repository at this point in the history
Ripping out Highcharts.
  • Loading branch information
mistercrunch committed Sep 28, 2015
2 parents e643671 + a674fca commit 2e29c39
Show file tree
Hide file tree
Showing 19 changed files with 422 additions and 1,096 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,15 @@ More screenshots
![img](http://i.imgur.com/t7VOtqQ.png)
![img](http://i.imgur.com/PaiFQnH.png)
![img](http://i.imgur.com/CdcGHuC.png)


Tip of the Hat
--------------

Panoramix would not be possible without these great frameworks / libs

* Flask App Builder - Allowing us to focus on building the app quickly while
getting the foundation for free
* The Flask ecosystem - Simply amazing. So much Plug, easy play.
* NVD3 - One of the best charting library out there
* Much more, check out the requirements.txt file!
38 changes: 17 additions & 21 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
# TODO
* Add a per-datasource permission
List of TODO items for Panoramix

* in/notin filters autocomplete
* DRUID: Allow for post aggregations (ratios!)
* compare time ranges
* csv export out of table view
* SQL: Find a way to manage granularity
* Create ~/.panoramix/ to host DB and config, generate default config there
## Improvments
* Reintroduce query and stopwatch
* Sort tooltip
* Make "Test Connection" test further
* Consistent colors for same entities
* Contribution to total
* Arbitrary expressions
* Group bucketing
* ToT
* Layers
* [druid] Allow for post aggregations (ratios!)
* [sql] find a way to manage time granularity
* [sql] support arbitrary expression as column
* [sql] define column based grouping
* [sql] make "Test Connection" test further
* csv export out of table view
* in/notin filters autocomplete

## Test
* Line types
* Intelligence around series name
* Shapes
* Line highlighting - draw attention
## First Class Line Charts
* Contribution to total (added to line chart already)
* Time comparison
* Time ratios
* Line types (dash, dotted)

## Bug
## New Features
* Annotations layers
* Add a per-datasource permission
4 changes: 2 additions & 2 deletions panoramix/bin/panoramix
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def load_examples(sample):
with gzip.open(config.get("BASE_DIR") + '/data/birth_names.csv.gz') as f:
bb_csv = csv.reader(f)
for i, (state, year, name, gender, num) in enumerate(bb_csv):
if i == 0:
if i == 0 or year < "1965": # jumpy data before 1965
continue
if num == "NA":
num = 0
Expand Down Expand Up @@ -224,7 +224,7 @@ def load_examples(sample):
table=tbl,
params=get_slice_json(
slice_name, viz_type="line", groupby=['name'],
granularity='1 day'))
granularity='1 day', rich_tooltip='y', show_legend='y'))
session.add(slc)
slices.append(slc)

Expand Down
38 changes: 31 additions & 7 deletions panoramix/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from wtforms import (
Field, Form, SelectMultipleField, SelectField, TextField, TextAreaField,
BooleanField)
BooleanField, IntegerField)
from copy import copy


Expand Down Expand Up @@ -76,10 +76,19 @@ def form_factory(viz):
'rolling_periods': TextField('Periods', description=(
"Defines the size of the rolling window function, "
"relative to the 'granularity' field")),
'series': SelectField('Series', choices=group_by_choices),
'entity': SelectField('Entity', choices=group_by_choices),
'x': SelectField('X Axis', choices=datasource.metrics_combo),
'y': SelectField('Y Axis', choices=datasource.metrics_combo),
'series': SelectField(
'Series', choices=group_by_choices,
description=(
"Defines the grouping of entities. "
"Each serie is shown as a specific color on the chart and "
"has a legend toggle")),
'entity': SelectField('Entity', choices=group_by_choices,
description="This define the element to be plotted on the chart"),
'x': SelectField(
'X Axis', choices=datasource.metrics_combo,
description="Metric assigned to the [X] axis"),
'y': SelectField('Y Axis', choices=datasource.metrics_combo,
description="Metric assigned to the [Y] axis"),
'size': SelectField('Bubble Size', choices=datasource.metrics_combo),
'where': TextField('Custom WHERE clause'),
'compare_lag': TextField('Comparison Period Lag',
Expand Down Expand Up @@ -109,7 +118,7 @@ def form_factory(viz):
"Range Selector", default=True,
description="Whether to display the time range interactive selector"),
'show_legend': BooleanField(
"Legend", default=True,
"Legend", default=True, false_values=["f"],
description="Whether to display the legend (toggles)"),
'rich_tooltip': BooleanField(
"Rich Tooltip", default=True,
Expand All @@ -120,6 +129,20 @@ def form_factory(viz):
'y_log_scale': BooleanField(
"Y Log", default=False,
description="Use a log scale for the Y axis"),
'x_log_scale': BooleanField(
"X Log", default=False,
description="Use a log scale for the X axis"),
'donut': BooleanField(
"Donut", default=False,
description="Do you want a donut or a pie?"),
'contribution': BooleanField(
"Contribution", default=False,
description="Compute the contribution to the total"),
'num_period_compare': IntegerField(
"Period Ratio", default=None,
description=(
"Number of period to compare against, "
"this is relative to the granularity selected")),
}
field_css_classes = {k: ['form-control'] for k in px_form_fields.keys()}
select2 = [
Expand Down Expand Up @@ -150,7 +173,8 @@ class QueryForm(OmgWtForm):
if isinstance(ff, basestring):
ff = [ff]
for s in ff:
setattr(QueryForm, s, px_form_fields[s])
if s:
setattr(QueryForm, s, px_form_fields[s])

# datasource type specific form elements
if datasource.__class__.__name__ == 'Table':
Expand Down
Loading

0 comments on commit 2e29c39

Please sign in to comment.