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

Enable color consistency in a dashboard #7086

Closed
wants to merge 74 commits into from
Closed

Conversation

khtruong
Copy link
Contributor

We want color consistency so that when users revisit dashboards, colors remain the same for metrics.

Currently, we follow a general algorithm to assign colors to metrics but it can lead to inconsistency. The user first picks a color scheme. Then we iterate through the list of data values and assign a color to it in a sequential manner. The color assignments are stored for the current session. If more values are added, we continue down the list of colors that are part of the scheme. If a user removes a value, all the other values keep their color association because we have stored this information. When the user saves the chart or dashboard, we do not save the color assignments. Thus when the user revisits the chart or dashboard, the color assignments may change because it iterates through the values displayed in the chart or dashboard and re-assigns their colors again. This can cause some confusion when users revisit their visualizations.

This PR enforces color consistency in dashboards so that when users revisit dashboards, the same colors are applied to metrics on each visit. Note that this will not apply until the owner edits his or her dashboard and selects/saves a color scheme.

I am putting out a PR while I add unit tests.

john-bodley and others added 30 commits March 3, 2019 15:27
* [date-filter] Adding minus infinity

* Update DateFilterControl.jsx

eqeqeq
* added more functionalities for query context and object.

* fixed cache logic

* added default value for groupby

* updated comments and removed print
…6857)

* auto-set 'Is Temporal' to true where column_name == '__time'

* Adress comments

* lint

* clarifying name and comments
* initial commit for VIZ-58

* address @kristw's comments

* per @mistercrunch's comment to use a static list for now

* fix javascript test errors

* fix lint errors

* per @betodealmeida's comments

* remove unnecessary loop
…he#6925)

* [docs] warn that docker installation instructions are `contrib/`

* Words
* Adding extraOverrides to line chart

* Updating extraOverrides to fit with more cases

* Moving extraOverrides to index.js

* Removing webpack-merge in package.json

* Fixing metrics control clearing metric
* feat: bump @superset-ui versions

* refactor: remove visUtils and use @superset-ui/dimension

* refactor: remove dead code

* fix: update package lock

* fix: lint two files

* fix: package lock
This PR removes the iteration over charts, dashboards and saved queries to create tags in the original migration, leaving only the logic to create the tags and the tagged objects tables.
Tested locally by running `superset db downgrade` to revert to the previous migration and then running `superset db upgrade` to the current version.
* Bump sqlalchemy dep

* Addressing comments
* [api/v1][query_obj] add default prequeries array

* [api/v1][query_obj] fix prequeries type
* User can turn off download - export csv from a dashboard

* Revert changes in the backendSync

* Fix space error in the MenuItem Export CSV
* Download RAT binary via HTTPS, not HTTP

* Merge branch 'patch-1' of github.com:hajdbo/incubator-superset into patch-1
@khtruong khtruong changed the title WIP: Enable color consistency in a dashboard (Need to add unit tests) Enable color consistency in a dashboard Mar 25, 2019
mistercrunch and others added 4 commits March 25, 2019 15:03
This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board
* Add HTTP Basic Auth for Druid (Issue apache#4776)

This should resolve [Issue apache#4776](apache#4776)

Add HTTP Basic Auth to the Druid Broker.

Signed-off-by: Don Bowman <don@agilicus.com>

* Encrypt broker password in database

Signed-off-by: Don Bowman <don@agilicus.com>

* Merge from master, new migration needed

Signed-off-by: Don Bowman <don@agilicus.com>

* Do not expose hashed druid basic auth password

* docs: add description_columns for druid basic auth
@codecov-io
Copy link

codecov-io commented Mar 25, 2019

Codecov Report

Merging #7086 into lyftga will decrease coverage by 0.15%.
The diff coverage is 25.86%.

Impacted file tree graph

@@            Coverage Diff             @@
##           lyftga    #7086      +/-   ##
==========================================
- Coverage   64.34%   64.18%   -0.16%     
==========================================
  Files         422      425       +3     
  Lines       20520    20672     +152     
  Branches     2253     2269      +16     
==========================================
+ Hits        13204    13269      +65     
- Misses       7183     7270      +87     
  Partials      133      133
Impacted Files Coverage Δ
...sets/src/dashboard/containers/DashboardBuilder.jsx 0% <ø> (ø) ⬆️
...ssets/src/dashboard/containers/DashboardHeader.jsx 100% <ø> (ø) ⬆️
superset/assets/src/dashboard/util/propShapes.jsx 100% <ø> (ø) ⬆️
superset/assets/src/chart/ChartRenderer.jsx 7.04% <0%> (-0.11%) ⬇️
...t/assets/src/dashboard/reducers/getInitialState.js 0% <0%> (ø) ⬆️
...rset/assets/src/dashboard/components/SaveModal.jsx 40.9% <0%> (-5.25%) ⬇️
.../src/dashboard/components/BuilderComponentPane.jsx 28.57% <0%> (+2.25%) ⬆️
...src/dashboard/components/HeaderActionsDropdown.jsx 70% <100%> (ø) ⬆️
superset/assets/src/dashboard/util/constants.js 100% <100%> (ø) ⬆️
superset/views/core.py 75.01% <100%> (+0.1%) ⬆️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfc0010...7af8500. Read the comment docs.

rasmi-ranjan-guavus and others added 3 commits March 26, 2019 08:35
…#7090)

* fix(useless-self-assignment): correct useless-self-assignment

* udated code formatting
I left this behind on a previous PR, and it gets kind of crazy on large
SQL statements, so decided it's probably a good thing to clean this up.
Package maintainers should really never delete packages, but it appears
this happened with croniter and resulted in breaking our builds.

This PR bumps to a more recent existing version of the library
@khtruong
Copy link
Contributor Author

Closing because I got my branch in a weird state and it was just easier to create a new branch.

Refer to this PR: #7135

@khtruong khtruong closed this Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.