Commit Graph

127 Commits

Author SHA1 Message Date
Beto Dealmeida
f1089c40a4 Improvements to the polygon spatial viz (#6178)
* WIP

* WIP

* WIP

* WIP

* Fix color bucketing

* Fixed colors

* Fix no num categories selected

* Colors working

* Fix no metric selected

* Visual cues for selection

* Add unit tests

* Remove jest from deps

* Rename category to bucket

* Small fixes

* Fix lint

* Fix unit tests

* Remove duplicate hexToRGB

* Fix import

* Change order of arguments in getBuckets

* Refactor function signature
2018-10-24 18:40:57 -07:00
Krist Wongsuphasawat
b9257b2a09 [Refactor] Extend color scheme management to sequential schemes (#6150)
* refactor color scheme

* Update data structure

* Update color scheme files

* wip

* convert all sequential schemes

* Update how color schemes are managed. Extend it for sequential schemes

* extract color setup into separate file

* Update imports

* update imports

* Add new functions to Registry

* Update ColorSchemeManager to extends Registry and update unit tests

* Add test for Registry

* Rename ColorSchemeManager to ColorSchemeRegistry

* Fix unit tests

* Update API

* Fix imports

* Add label field

* Fix reference to colors

* update SequentialScheme contructor

* Fix controls

* rename manager to registry

* Split sequential schemes into multiple files

* update sequential color labels

* add values and valuesAsPromise()

* use .values()
2018-10-22 16:17:14 -07:00
Chris Williams
a71e6eb0a3 [superset-client] replace misc ajax calls (#6135)
* [superset-client][misc] replace ajax calls in DashboardTable, TableLoader, utils, common

* [superset-client][misc] replace ajax calls in AsyncSelect, HeaderActions, Deck.gl

* [superset-client][misc] fix tests

* [superset-client] remove unneeded functional setState calls

* [superset-client] make welcome a redux app for toasts

* [superset-client] make Profile a redux app for toasts

* [superset-client] TableLoader don't pass toast props to dom nodes

* tweak deckgl Multi syntax
2018-10-19 11:41:42 -07:00
Krist Wongsuphasawat
546d150b91 Define chart presets (#6144)
* define chart presets

* remove dual line
2018-10-19 11:40:21 -07:00
Krist Wongsuphasawat
fc3422eaeb add build query as part of plugin (#6146) 2018-10-18 18:39:34 -07:00
Krist Wongsuphasawat
bc4dfad6c8 fix bar chart value overlap with legend (#6145) 2018-10-18 18:00:42 -07:00
Krist Wongsuphasawat
9d01af201e Add annotation information to ChartMetadata (#6136)
* add annotations information to ChartMetadata

* rename fields
2018-10-18 17:59:30 -07:00
Krist Wongsuphasawat
d662e36442 [Ready] Define ChartProps data structure (#6125)
* rename basicChartInput to chartProps

* replace BasicChartInput with ChartProps class

* Add transformProps to deck.gl plugins

* Add space

* delete BasicChartInput

* add width and height as part of ChartProps and update transformProps

* remove width and height

* remove adaptors from deck.gl components

* remove deck.gl creataAdaptor
2018-10-18 15:44:21 -07:00
Krist Wongsuphasawat
0aa6d90429 Remove isNumeric util function and use Number.isFinite instead (#6106)
* remove isNumeric util function and use lodash isFinite instead

* use native Number.isFinite
2018-10-18 11:24:43 -07:00
Krist Wongsuphasawat
dcfbae1ab9 [SIP-5&6] Refactor line_multi (#6058)
* Rewrite line_multi

* move dir

* add chartplugin for line_multi

* rename var
2018-10-16 14:54:01 -07:00
Beto Dealmeida
b4a1983303 Fixes to the CategoricalDeckGLContainer and filter box (#6038)
* WIP

* WIP

* Fix time grain

* Fix autoformatting

* Fix more autoformatting

* Fix even more autoformatting

* Fix manual move of play slider

* Fix state management

* Revert change

* Fix screengrid

* Remove autozoom on render

* Remove unneeded code

* Zoom when mounted

* Fix lint
2018-10-16 12:08:37 -07:00
Krist Wongsuphasawat
dc7b6f2bae Rename onTooltip to setTooltip (#6103)
* rename onTooltip to setTooltip

* fix typo
2018-10-15 09:26:59 -07:00
Krist Wongsuphasawat
3df98e5b4c make BigNumber PureComponent (#6105) 2018-10-15 09:25:48 -07:00
Krist Wongsuphasawat
2fc07435ca move countries directory under CountryMap (#6088) 2018-10-13 10:12:45 -07:00
Krist Wongsuphasawat
e1e8778554 Add ChartPlugin and metadata for deck.gl vis (#6090) 2018-10-12 14:01:32 -07:00
Krist Wongsuphasawat
8e88d0233a Add ChartPlugin and metadata for nvd3 and BigNumber vis (#6085)
* add nvd3 thumbnails

* add ChartPlugin and metadata files

* add BigNumber thumbnails

* Add bignumber ChartPlugin
2018-10-12 12:09:40 -07:00
Krist Wongsuphasawat
2a7b64fef5 [SIP-5] Remove references to slice from all deck.gl components. (#6039)
* start removing slice.

* migrate arc

* refactor arc

* refactor path

* refactor deck polygon

* remove commented code

* refactor factory function

* refactor grid

* refactor hex

* refactor polygon

* refactor scatter

* refactor geojson

* refactor screengrid

* remove unnecessary nesting

* add proptypes

* add proptypes

* refactor deck.gl Multi

* fix lint

* Use export syntax instead of module.exports
2018-10-11 20:56:36 -07:00
Krist Wongsuphasawat
5282f39026 Create chart plugins and metadata (#6072)
* add credit field

* change image size limit for url-loader

* create chord ChartPlugin

* Update config to include original file name in the output

* add calendar

* add country map

* add eventflow

* add thumbnails

* add eventflow, filterbox, force-directed and heatmap

* Add histogram, horizon, mapbox, paired t-test, parallel coordinates

* Create plugins for the rest one-off charts

* ignore chartplugin files from istanbul
2018-10-11 20:55:40 -07:00
Krist Wongsuphasawat
64383ce96e Rename color constants and move util function into separate file (#6074)
* rename constant colors to UPPERCASE

* Move isDefined into its own file and add unit test
2018-10-11 14:05:34 -07:00
Narcissus7
c0f685b640 Fix the horizon title only show the first key (#5998) 2018-10-11 13:08:26 -07:00
Beto Dealmeida
3cc6fb61ab Add increment back arrow to time player (#6062)
* Working on CSS

* Will fix CSS later

* Simplify PR
2018-10-09 11:47:59 -07:00
Krist Wongsuphasawat
cd2c46a5ed Add data structures for chart plugin system (#6028)
* add unit tests

* add test structure

* add unit tests for Registry

* add LoaderRegistry unit test

* add unit test for makeSingleton

* add type check

* add plugin data structures

* simplify API

* add preset tests

* update test message

* fix lint

* update makeSingleton

* update Plugin, Preset and unit test

* revise Registry code

* update unit test, add remove function

* update test

* update unit test

* update plugin unit test

* add .keys(), .entries() and .entriesAsPromise()

* update test description
2018-10-09 11:47:16 -07:00
Teemu Heikkilä
6282edd033 Revert old precision formatters (#6056)
Revert commit 66fcf9b687 (diff-366fb3d6e52b5fb2b9c306763adbc983)
It caused sunburst to became confusing.
2018-10-08 09:41:59 -04:00
Krist Wongsuphasawat
f889798688 use world map only bundle (#6029) 2018-10-04 14:46:08 -07:00
Krist Wongsuphasawat
9f028ccc7b [SIP-6] Migrate visualizations to new directory structure (part 2) (#5997)
* migrate MapBox

* migrate bignumber

* migrate timeseries table

* migrate EventFlow

* add default null

* fix linting

* use shortid instead of passing containerId
2018-10-04 14:45:49 -07:00
Krist Wongsuphasawat
5c2a7880cc [SIP-6] Migrate visualizations to new directory structure (part 3 - nvd3) (#6006)
* migrate nvd3

* update basicchartinput
2018-10-03 10:18:04 -07:00
Krist Wongsuphasawat
2cd9407a50 [SIP-6] Migrate visualizations to new directory structure. (#5949)
* Migrate Chord, Calendar

* Migrate CountryMap

* Add display name and rename Chord.jsx to Chord.js

* migrate Histogram

* add force-directed

* migrate Heatmap

* add horizon

* migrate parallel coordinates

* migrate partition

* migrate pivot table

* migrate rose

* remove react-dom

* migrate Sankey

* migrate sunburst

* migrate table

* migrate treemap

* migrate filterbox

* migrate wordcloud

* add paired t-test

* fix unit test

* remove renaming

* rename fields
2018-09-27 14:39:56 -07:00
Krist Wongsuphasawat
4c21c65824 Remove lodash.throttle and replace underscore calls with lodash (#5946)
* remove lodash.throttle from dependency

* add babel-plugin-lodash'

* use lodash instead of underscore for isFunction

* switch underscore to lodash

* switch from underscore to lodash flatten

* Remove slugify and use kebabCase from lodash instead
2018-09-26 23:28:57 -07:00
Maxime Beauchemin
70c095b1c0 [deck_polyline] show metric in geohash (#5952)
Also improved security a bit by calling `dompurify.sanitize` down the
stack.
2018-09-21 11:23:21 -07:00
Beto Dealmeida
71f014e9b6 Allow removing legend (#5932) 2018-09-19 13:32:07 -07:00
Krist Wongsuphasawat
8fff0d9e8f [SIP-6] Add reactify function and convert world map to new directory structure. (#5893)
* reactify world map

* add createAdaptor

* fix typo

* add schema

* move directory

* remove unnecessary lines

* make setRef a function

* convert keys to camelcase

* add unit test

* update formatting

* add check for displayName

* pass width and height as separate inputs
2018-09-18 23:35:36 -07:00
Christine Chambers
24be6922fd [refactor] Remove dependency on personal fork of supercluster from mapbox visualizations (#5902)
* [refactor] Remove dependency to personal fork of supercluster from mapbox visualizations

- Update dependency to reference the vanilla supercluster
- Clean up backend api call for mapbox vizzes to ensure a boolean is sent to indicate whether the viz includes custom metric for clustering
- Refactor of mapbox and its cluster overlay components to use vanilla supercluster and its recommeded way for handling clustering based on custom aggregations.
- Allow reclustering within the initial bounds on render in mapbox visualizations (stay true to old behaviors).
- Remove the median aggregation from available cluster label aggregators as there is no memory efficient way to implement this and it is unknown how often this feature is used
- Updating doc to mention the backward incompatible change re median

* Perform the check for has_custom_metric through `not None` to produce a boolean and rename the field reflect it is a boolean.
2018-09-18 12:38:17 -07:00
Krist Wongsuphasawat
19a3319acf [bugfix] Fix percent metric display and check for string columns in table (#5917)
* fix percent metric display

* add empty line

* address string or number check
2018-09-18 10:30:47 -07:00
Krist Wongsuphasawat
0e93a94ae4 [SIP-5] Refactor nvd3 (#5838)
* move into folder and scaffold adaptor

* extract width and height

* remove jquery

* extract showBrush

* extract lineInterpolation

* extract xAxisFormat and yAxisFormat

* extract annotationData

* extract xTicksLayout and colorScheme

* extract showXXX

* extract x and y axis labels

* extract showminmax

* extract pie chart props

* extract area chart props

* extract logscale and yAxisBounds

* extract margin

* extract bubble props x,y,size

* extract contribution, comparisonType and color_picker

* remove the last fd.xxx

* remove unnecessary variables

* remove slice.container

* fix unit test reference

* Rewrite logic to compute max label lengths to use only d3, not jquery.

* extract annotationLayers and no more slice.xxx in nvd3vis

* rename x, y, size to xField, yField, sizeField

* use arrow function

* move tooltip function

* extract helper functions into utils

* remove unused argument

* fix height calculation and show bar labels

* rename function

* update unit test

* organize tooltip generator

* update line_multi

* Add proptypes for data

* list proptypes for data

* extract tooltip function for bubble chart

* rename variables

* remove console.log

* enumerate vizTypes and pieLabelType

* parse maxBubble

* use new color scale

* fix import"

* remove line
2018-09-16 20:38:30 -07:00
Chris Williams
b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00
Krist Wongsuphasawat
7098ada8c5 [SIP-5] Refactor Time Series Table (#5775)
* Break TimeTable into smaller pieces

* extract function to compute color

* Handle height and scrollbar

* sort out isGroupBy

* Set default values

* Specify proptypes for data

* rename fields and update proptypes

* Add default props

* remove commented line

* swap import
2018-09-13 10:40:46 -07:00
Conglei
85692612d6 [bug fix] Fixed adhoc metric is not working for WordCloud (#5877)
* fixed adhoc metric

* change rotate default to flat
2018-09-12 23:12:04 -07:00
Conglei
ee89a3eb5e [SIP-6] removed get_data for BigNumber (#5861)
* removed get_data for BigNumber

* removed duplicated condition

* fixed typo
2018-09-12 18:34:21 -07:00
Krist Wongsuphasawat
620beed867 remove getColorFromScheme in favor of CategoricalColorNamespace.getScale() for histogram (#5878) 2018-09-12 15:39:38 -07:00
Arpit
4121d57d32 fix: Pivot table not sorting formatted numeric column properly (#5709)
* fix: Pivot table not sorting formatted numeric column properly

* refactor(lint): fixed lint error
2018-09-12 15:07:44 -07:00
Krist Wongsuphasawat
f482a6cf99 Improve categorical color management (#5815)
* Create new classes for handling categorical colors

* verify to pass existing unit tests

* separate logic for forcing color and getting color

* replace getColorFromScheme with CategoricalColorManager

* organize static functions

* migrate to new function

* Remove ALL_COLOR_SCHEMES

* move sequential colors to another file

* extract categorical colors to separate file

* move airbnb and lyft colors to separate files

* fix missing toFunction()

* Rewrite to support local and global force items, plus namespacing.

* fix references

* revert nvd3

* update namespace api

* Update the visualizations

* update usage with static functions

* update unit test

* add unit test

* rename default namespace

* add unit test for color namespace

* add unit test for namespace

* start unit test for colorschememanager

* add unit tests for color scheme manager

* check returns for chaining

* complete unit test for the new classes

* fix color tests

* update unit tests

* update unit tests

* move color scheme registration to common

* update unit test

* rename sharedForcedColors to parentForcedColors

* remove import
2018-09-12 14:10:26 -07:00
Maxime Beauchemin
367dcdaa7d [time table] fix sorting on missing values (#5863) 2018-09-12 11:21:48 -07:00
Christine Chambers
6df720d873 [bugfix] mapbox pan on filter (#5858)
* Pan mapbox map on query

- Modify the backend to send back the bounds of the points to cluster
- Clean up of mapbox component to derive lat, lon and zoom from the mercator that fitsbounds based on the bounds passed from the backend. This and the computation of clusters are now only done on initial load b/c we are not making queries to the backend on pan/zoom
- A minor clean up of unused props and also making the visual properties panel open by default

* Remove default latitude, longitude and zoom props which are unnecessary for computing the viewport now that it is driven by the bounds from the backend.

* a few small tweaks (rename vars to be sneak case and avoid two extra hash lookups)
2018-09-11 13:33:54 -07:00
Beto Dealmeida
f740974bf7 Handle "ambiguous durations" (#5785)
* WIP

* Update interface

* Fix truncate

* Improve unit tests

* Improve code

* Use moment.js to parse ISO durations

* Fix typo and React props
2018-09-10 10:28:17 -07:00
Krist Wongsuphasawat
6d573724aa Enable hot module replacement for React via react-hot-loader (#5841)
* Install react-hot-loader

* enable react-hot-reload for Explore, Dashboard, Profile and Sqllab

* enable hmr for welcome page

* enable hmr for welcome page

* enable react hot module replacement for addSlice

* fix lint

* fix Welcome test

* remove eslint comment
2018-09-10 10:15:32 -07:00
Krist Wongsuphasawat
3f8b970a88 [bugfix] Fix bignumber overflow in dashboard (#5839)
* Move BigNumber to directory.

* fix chart margin in dashboard

* Fix margin and be more conservative about width.
2018-09-06 21:48:41 -07:00
Krist Wongsuphasawat
68e7794daf [SIP-5] Refactor Paired t-test (#5762)
* extract TTestTable into another file.

* Move into directory.

* update proptypes
2018-09-06 16:14:27 -07:00
Krist Wongsuphasawat
b284788fd8 [SIP-5] Refactor filterbox (#5789)
* reorganize variables

* bring back datasource

* refactor filter box

* rename constants to all caps and update prop types

* bind this.changeFilter

* update event handler
2018-09-06 16:13:50 -07:00
Krist Wongsuphasawat
5eff7a8d6c [SIP-5] Refactor pivot table (#5705)
* extract slice and formData

* rename variables

* update proptypes and add comments
2018-09-05 14:14:12 -07:00
Krist Wongsuphasawat
a9952bb449 [SIP-5] Remove unused function #easy-review (#5825)
* remove unused function

* remove comment
2018-09-05 13:46:04 -07:00