Skip to content

Commit

Permalink
1.8.3
Browse files Browse the repository at this point in the history
* [#143](#143), scattergeo map chart UI changes
* updated offline chart generation of maps to work without loading topojson from the web
* fix to allow correlations timeseries to handle when date columns jump between rolling & non-rolling
* added slider to animation and added animation to maps
* fixes for IE 11 compatibility issues
* labeling changes for "Reshape" popup
* added grouping to maps
  • Loading branch information
Andrew Schonfeld committed Apr 4, 2020
1 parent 3dfe5d5 commit 338f63b
Show file tree
Hide file tree
Showing 68 changed files with 568 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defaults: &defaults
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
CODECOV_TOKEN: b0d35139-0a75-427a-907b-2c78a762f8f0
VERSION: 1.8.2
VERSION: 1.8.3
PANDOC_RELEASES_URL: https://github.com/jgm/pandoc/releases
steps:
- checkout
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## Changelog

### 1.8.3 (2020-4-4)
* [#143](https://github.com/man-group/dtale/issues/143), scattergeo map chart UI changes
* updated offline chart generation of maps to work without loading topojson from the web
* fix to allow correlations timeseries to handle when date columns jump between rolling & non-rolling
* added slider to animation and added animation to maps
* fixes for IE 11 compatibility issues
* labeling changes for "Reshape" popup
* added grouping to maps

### 1.8.2 (2020-4-1)
* [#129](https://github.com/man-group/dtale/issues/129), show dtype when hovering over header in "Highlight Dtypes" mode and description tooltips added to main menu
* made "No Aggregation" the default aggregation in charts
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/Title.png)](https://github.com/man-group/dtale)

[Live Demo](http://andrewschonfeld.pythonanywhere.com)
[Live Demo](http://alphatechadmin.pythonanywhere.com)

-----------------

Expand Down Expand Up @@ -41,7 +41,7 @@ D-Tale was the product of a SAS to Python conversion. What was originally a per
- [Dimensions/Main Menu](#dimensionsmain-menu)
- [Header](#header)
- [Main Menu Functions](#main-menu-functions)
- [Describe](#describe), [Filter](#filter), [Building Columns](#building-columns), [Reshape](#reshape), [Charts](#charts), [Coverage (Deprecated)](#coverage-deprecated), [Correlations](#correlations), [Heat Map](#heat-map), [Instances](#instances), [Code Exports](#code-exports), [About](#about), [Resize](#resize), [Shutdown](#shutdown)
- [Describe](#describe), [Custom Filter](#custom-filter), [Building Columns](#building-columns), [Summarize Data](#summarize-data), [Charts](#charts), [Coverage (Deprecated)](#coverage-deprecated), [Correlations](#correlations), [Heat Map](#heat-map), [Instances](#instances), [Code Exports](#code-exports), [About](#about), [Resize](#resize), [Shutdown](#shutdown)
- [Column Menu Functions](#column-menu-functions)
- [Filtering](#filtering), [Moving Columns](#moving-columns), [Hiding Columns](#hiding-columns), [Lock](#lock), [Unlock](#unlock), [Sorting](#sorting), [Formats](#formats), [Column Analysis](#column-analysis)
- [Menu Functions Depending on Browser Dimensions](#menu-functions-depending-on-browser-dimensions)
Expand All @@ -51,7 +51,7 @@ D-Tale was the product of a SAS to Python conversion. What was originally a per
- [Linting](#linting)
- [Formatting JS](#formatting-js)
- [Docker Development](#docker-development)
- [Global State/Data Storage](#global-state_data-storage)
- [Global State/Data Storage](https://github.com/man-group/dtale/blob/master/docs/GLOBAL_STATE.md)
- [Startup Behavior](#startup-behavior)
- [Documentation](#documentation)
- [Requirements](#requirements)
Expand Down Expand Up @@ -333,8 +333,8 @@ View all the columns & their data types as well as individual details of each co
|int|![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/Describe_int.png)|Anything with standard numeric classifications (min, max, 25%, 50%, 75%) will have a nice boxplot with the mean (if it exists) displayed as an outlier if you look closely.|
|float|![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/Describe_float.png)||

#### Filter
Apply a simple pandas `query` to your data (link to pandas documentation included in popup)
#### Custom Filter
Apply a custom pandas `query` to your data (link to pandas documentation included in popup)

Context Variables are user-defined values passed in via the `context_variables` argument to dtale.show(); they can be referenced in filters by prefixing the variable name with '@'.

Expand Down Expand Up @@ -371,7 +371,7 @@ This video shows you how to build the following:
- Dates: retrieving date properties (hour, weekday, month...) as well as conversions (month end)
- Random: columns of data type (int, float, string & date) populated with random uniformly distributed values.

#### Reshape
#### Summarize Data

This is very powerful functionality which allows users to create a new data from currently loaded data. The operations currently available are:
- **Aggregation**: consolidate data by running different aggregations on columns by a specific index
Expand Down Expand Up @@ -416,6 +416,8 @@ Here are some examples:
|heatmap|![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/charts/heatmap.png)||
|3D scatter|![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/charts/3d_scatter.png)||
|surface|![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/charts/surface.png)||
|Maps (Scatter GEO)|![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/charts/scattergeo.png)||
|Maps (Choropleth)|![](https://raw.githubusercontent.com/aschonfeld/dtale-media/master/images/charts/choropleth.png)||

Y-Axis Toggling

Expand Down
2 changes: 1 addition & 1 deletion docker/2_7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ WORKDIR /app

RUN set -eux \
; . /root/.bashrc \
; easy_install dtale-1.8.2-py2.7.egg
; easy_install dtale-1.8.3-py2.7.egg
2 changes: 1 addition & 1 deletion docker/3_6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ WORKDIR /app

RUN set -eux \
; . /root/.bashrc \
; easy_install dtale-1.8.2-py3.7.egg
; easy_install dtale-1.8.3-py3.7.egg
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
# built documents.
#
# The short X.Y version.
version = u'1.8.2'
version = u'1.8.3'
# The full version, including alpha/beta/rc tags.
release = u'1.8.2'
release = u'1.8.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion dtale/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,6 @@ def offline_chart(df, chart_type=None, query=None, x=None, y=None, z=None, group
instance = startup(url=None, data=df, data_id=999)
output = instance.offline_chart(chart_type=chart_type, query=query, x=x, y=y, z=z, group=group, agg=agg,
window=window, rolling_comp=rolling_comp, barmode=barmode, barsort=barsort,
yaxis=yaxis, filepath=filepath)
yaxis=yaxis, filepath=filepath, **kwargs)
global_state.cleanup()
return output
36 changes: 20 additions & 16 deletions dtale/charts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def valid_chart(chart_type=None, x=None, y=None, z=None, **inputs):
map_type = inputs.get('map_type')
if map_type == 'choropleth' and all(inputs.get(p) is not None for p in ['loc_mode', 'loc', 'map_val']):
return True
elif map_type == 'scattergeo' and all(inputs.get(p) is not None for p in ['lat', 'lon', 'map_val']):
elif map_type == 'scattergeo' and all(inputs.get(p) is not None for p in ['lat', 'lon']):
return True
return False

Expand Down Expand Up @@ -144,6 +144,23 @@ def group_filter_handler(col_def, group_val, group_classifier):
return "{col} == '{val}'".format(col=col_def, val=group_val)


def build_group_inputs_filter(df, group_inputs):
dtypes = get_dtypes(df)

def _group_filter(group_val):
for gc, gv in group_val.items():
classifier = classify_type(dtypes[gc])
yield group_filter_handler(gc, gv, classifier)

def _full_filter():
for group_val in group_inputs:
group_filter = ' and '.join(list(_group_filter(group_val)))
yield group_filter

filters = list(_full_filter())
return '({})'.format(') or ('.join(filters))


def retrieve_chart_data(df, *args, **kwargs):
"""
Retrieves data from a dataframe for x, y, z & group inputs complete with date frequency
Expand All @@ -169,20 +186,7 @@ def retrieve_chart_data(df, *args, **kwargs):
all_data = pd.concat(all_data, axis=1)
all_code = ["chart_data = pd.concat(["] + all_code + ["], axis=1)"]
if len(make_list(kwargs.get('group_val'))):
dtypes = get_dtypes(all_data)

def _group_filter(group_val):
for gc, gv in group_val.items():
classifier = classify_type(dtypes[gc])
yield group_filter_handler(gc, gv, classifier)

def _full_filter():
for group_val in kwargs['group_val']:
group_filter = ' and '.join(list(_group_filter(group_val)))
yield group_filter

filters = list(_full_filter())
filters = '({})'.format(') or ('.join(filters))
filters = build_group_inputs_filter(all_data, kwargs['group_val'])
all_data = all_data.query(filters)
all_code.append('chart_data = chart_data.query({})'.format(filters))
return all_data, all_code
Expand Down Expand Up @@ -426,6 +430,6 @@ def weekday_tick_handler(col_data, col):

def find_group_vals(df, group_cols):
group_vals, _ = retrieve_chart_data(df, group_cols)
group_vals = group_vals.drop_duplicates()
group_vals = group_vals.drop_duplicates().sort_values(group_cols)
group_f, _ = build_formatters(group_vals)
return group_f.format_dicts(group_vals.itertuples())
8 changes: 1 addition & 7 deletions dtale/cli/loaders/csv_loader.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import pandas as pd
import requests
from six import PY3
from six import PY3, StringIO

from dtale.app import show
from dtale.cli.clickutils import get_loader_options

if PY3:
from io import StringIO
else:
from StringIO import StringIO


'''
IMPORTANT!!! These global variables are required for building any customized CLI loader.
When build_loaders runs startup it will search for any modules containing the global variable LOADER_KEY.
Expand Down
Loading

0 comments on commit 338f63b

Please sign in to comment.