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

Better tooltips and more ways to integrate them easily #77

Merged
merged 1 commit into from
Dec 10, 2015
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
29 changes: 23 additions & 6 deletions panoramix/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ def __init__(self, viz):
default='None',
choices=[(s, s) for s in ['None', 'mean', 'sum', 'std', 'cumsum']],
description=(
"Defines a rolling window function to apply")),
"Defines a rolling window function to apply, works along "
"with the [Periods] text box")),
'rolling_periods': IntegerField(
'Periods',
validators=[validators.optional()],
description=(
"Defines the size of the rolling window function, "
"relative to the 'granularity' field")),
"relative to the time granularity selected")),
'series': SelectField(
'Series', choices=group_by_choices,
default=default_groupby,
Expand All @@ -152,8 +153,19 @@ def __init__(self, viz):
'Bubble Size',
default=default_metric,
choices=datasource.metrics_combo),
'where': TextField('Custom WHERE clause', default=''),
'having': TextField('Custom HAVING clause', default=''),
'where': TextField(
'Custom WHERE clause', default='',
description=(
"The text in this box gets included in your query's WHERE "
"clause, as an AND to other criteria. You can include "
"complex expression, parenthesis and anything else "
"supported by the backend it is directed towards.")),
'having': TextField('Custom HAVING clause', default='',
description=(
"The text in this box gets included in your query's HAVING"
" clause, as an AND to other criteria. You can include "
"complex expression, parenthesis and anything else "
"supported by the backend it is directed towards.")),
'compare_lag': TextField('Comparison Period Lag',
description="Based on granularity, number of time periods to compare against"),
'compare_suffix': TextField('Comparison suffix',
Expand Down Expand Up @@ -305,8 +317,13 @@ class QueryForm(OmgWtForm):

# datasource type specific form elements
if datasource.__class__.__name__ == 'SqlaTable':
QueryForm.fieldsets += (
{'label': 'SQL', 'fields': ['where', 'having']},)
QueryForm.fieldsets += ({
'label': 'SQL',
'fields': ['where', 'having'],
'description': (
"This section exposes ways to include snippets of "
"SQL in your query"),
},)
setattr(QueryForm, 'where', px_form_fields['where'])
setattr(QueryForm, 'having', px_form_fields['having'])

Expand Down
8 changes: 8 additions & 0 deletions panoramix/templates/panoramix/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ <h4>
{% if fieldset.label %}
<legend class="legend-style">
<span class="legend_label">{{ fieldset.label }}</span>
{% if fieldset.description %}
<i class="fa fa-info-circle" data-toggle="tooltip"
data-placement="bottom"
title="{{ fieldset.description }}"></i>
{% endif %}
<span class="collapser"> [-]</span>
</legend>
{% endif %}
Expand Down Expand Up @@ -70,6 +75,9 @@ <h4>
<fieldset class="fs-style">
<legend class="legend-style">
<span class="legend_label">Filters</span>
<i class="fa fa-info-circle" data-toggle="tooltip"
data-placement="bottom"
title="Filters are defined using comma delimited strings as in 'US,FR,Other'"></i>
<span class="collapser"> [-]</span>
</legend>
<div class="fieldset_content">
Expand Down
4 changes: 4 additions & 0 deletions panoramix/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,10 @@ class NVD3TimeSeriesViz(NVD3Viz):
),
}, {
'label': 'Advanced Analytics',
'description': (
"This section contains options "
"that allow for advanced analytical post processing "
"of query reults"),
'fields': (
('rolling_type', 'rolling_periods'),
'time_compare',
Expand Down