Since https://github.com/apache/incubator-superset/pull/6287 and
effectively moving to a new version of d3, d3-format and d3-time-format
raises when receiving invalid input strings.
This code wraps the potential issues inside `try` blocks that will
effectively return an `ERROR` string as output to the formatting
function.
* Add d3 micro packages
* Replace d3 imports with specific modules import
* Define d3 colors
* import specific d3 submodules instead of entire d3
* update function name
* move function location and fix small bug
* Move primary color to control
* remove colorscalefactory usage
* remove unused d3
* fix unit test
* fix color picker
* use @superset-ui/color
* update package version
* remove files that are extracted
* replace all references
* fix two files
* Revert some changes to split to another PR
* remove adaptor
* Address Christine's comment
* remove d3 v3 from calendar
* remove d3.scale.threshold
* Get rid of colorScalerFactory and revise hexToRGB
* fix color cleaning
* fix lint
* 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
* 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()
* [refactor] Migrate from Mocha+Chai to Jest
This change migrates all the existing unit tests
- to Jest's global expect and matchers from chai's imported expect, asserts and matchers.
- to Jest's describe/test from mocha's describe/it
The majority of the mechanical changes to tests are achieved through running jest-codemods. The only two note-worthy manual tweaks:
1. Setting a testURL of http://localhost in jest config and adjusting a few tests to leverage this value instead of relying on about:blank.
2. Re-enabling ExploreChartPanel_spec which was previously commented out as we cannot have empty tests with nothing in it with Jest. :)
This change also removes dependencies to Mocha and Chai.
* Remove the test:one command as it now does the same thing as test.
* Fixing lint errors. The diff looks large but is large done through `yarn run lint --fix`
The only noteworthy change is the one in eslintrc for tests. The env has been updated from mocha to jest.
* Adding eslint-plugin-jest and further modify tests.
- One small fix in sqllab's Timer Spec for a test that is not using the spy it created for testing.
- Deletion of a duplicated test caught by eslint-plugin-jest.
* - Make istanbul coverage work with Jest.
- Remove dependency on stand-alone istanbul and babel-istanbul as they're built-into jest. Yes!
* Attempt to fix dynamic imports in tests.
* run sequentially and log heap usage
* - tweaking maxworkers for travis and specifying coverageDirectory for codecov
- remove dynamic import in shim.js now that it is set in babelrc for tests only.
* 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
* 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
* 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
* 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
* [formats] add better defaults for time + number formatting
* [formatDate] add tests for concise formatDate
* [nvd3] use verbose time format in tooltips
* [number format] improve number format description
* [formats] revert to .3s defaults, tweak number format preview
* [formats] default number vis to .3s
* Use 'count' as the default metric when available
Count is a much better default than the current behavior which is to use
whatever the first metric in the list happens to be.
* Addressing nits
* Introduce Javascript controls
This allows power-users to perform intricate transformations on data and
objects using javascript code.
The operations allowed are "sanboxed" or limited using node's vm
`runInNewContext`
https://nodejs.org/api/vm.html#vm_vm_runinnewcontext_code_sandbox_options
For now I'm only enabling in the line chart visualization, but the plan
would be to go towards offering more power to people who can write some
JS moving forward.
* Not applied
Users can define `label_colors` in a dashboard's JSON metadata that
enforces a label to color mapping.
This also makes the function that maps labels to colors case insensitive.
* DECKGL integration
Adding a new set of geospatial visualizations building on top of the
awesome deck.gl library. https://github.com/uber/deck.gl
While the end goal it to expose all types of layers and let users bind
their data to control most props exposed by the deck.gl API, this
PR focusses on a first set of visualizations and props:
* ScatterLayer
* HexagonLayer
* GridLayer
* ScreenGridLayer
* Addressing comments
* lint
* Linting
* Addressing chri's comments
* Allow for multiple color schemes
1. create ColorSchemeControl component
2. using the same new control component for linear colors
* add color spectum for linear color scheme
* remove dup css
* fix controls setting for linear color scheme
* minor fix by code review comment