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

[RFC] Apply our brand colors on source{d} charts #241

Closed
wants to merge 6 commits into from

Conversation

dpordomingo
Copy link
Contributor

@dpordomingo dpordomingo commented Aug 7, 2019


This PR was superseded by #257, #258 and #259 as agreed at #241 (comment)


disclaimer: This PR applies our branding on current source{d} charts. It is done on different levels, as it can be seen in each commit. We can use this PR to discuss the process or do it in separate and sequential PRs. The proposed palettes should be approved or amended by @src-d/product

List of changes:

The final result can also be seen in the overview screenshot and in the collaboration screenshot.

TODO

I found some lines of code in superset still using original palettesbnbColors, d3Category10 and blue_white_yellow, but since it does not have impact in our current dashboards (as far as I could validate in my tests, and can be seen in the screenshots below), I think that it could be addressed in a separate PR.

Available palettes

These are the four new palettes (plus the current ones)

@dpordomingo dpordomingo added the enhancement New feature or request label Aug 7, 2019
@dpordomingo dpordomingo requested review from ricardobaeta and a team August 7, 2019 09:52
@dpordomingo dpordomingo self-assigned this Aug 7, 2019
@dpordomingo
Copy link
Contributor Author

dpordomingo commented Aug 7, 2019

Palette reassignments

Changes applied on overview dashboard:

chart old palette new palette
Number of releases per month and repository bnbColors SUPERSET_DEFAULT
Commits Evolution bnbColors srcdRoyal
Number of commits per day of the week bnbColors srcdRoyal
Number of commits to HEAD per month d3Category10 srcdRoyal
Total number of commits per repository SUPERSET_DEFAULT srcdRoyal

Changes applied on collaboration dashboard:

chart old palette new palette
Most Active Repositories bnbColors srcdOpaques
Number of pull requests created bnbColors srcdRoyal
Time to Merge Change Over Time bnbColors srcdRoyal
Breakdown by Pull Request Outcome bnbColors SUPERSET_DEFAULT

@dpordomingo
Copy link
Contributor Author

dpordomingo commented Aug 7, 2019

overview dashboard

click to see the palettes applied on each chart of overview dashboard
  • SUPERSET_DEFAULT
    • Languages
    • Number of releases per month and repository
    • Number of commits per month breakdown per repo
    • Number of files per languages
    • Number of lines of code per language
    • Number of contributions per organization
    • Organization wordcloud
    • Number of contributions per email
    • Email wordcloud
  • srcdRoyal
    • Commits Evolution
    • Number of commits per day of the week
    • Number of commits to HEAD per month
    • Total number of commits per repository
  • NONE
    • Repository Count
    • Number of collaborators
    • Repositories by number of files
    • Repository by number of collaborators
    • Compliance score
    • Missing files
    • Files missing summary

dashboard-overview

@dpordomingo
Copy link
Contributor Author

collaboration dashboard

note: Pull Requests Workflow chart could not be customized because its underlying type (Event Flow) does not allow to change its visual properties.

click to see the palettes applied on each chart of collaboration dashboard
  • SUPERSET_DEFAULT
    • Breakdown by Pull Request Outcome
  • srcdRoyal
    • Number of pull requests created
    • Time to Merge Change Over Time
  • srcdOpaques
    • Most Active Repositories
  • NONE
    • Not Merged Pull Requests
    • Avg. Time to Merge
    • Median Time to Merge
    • Pull Requests Workflow

dashboard-collaboration

@@ -14,7 +14,7 @@
"datasource_name": "gitbase.admin admin-commit_merges-8X2HBrQre",
"datasource_type": "table",
"id": 9,
"params": "{\"adhoc_filters\": [], \"annotation_layers\": [], \"bottom_margin\": \"auto\", \"color_scheme\": \"bnbColors\", \"comparison_type\": \"values\", \"contribution\": false, \"datasource\": \"14__table\", \"granularity_sqla\": \"commit_author_when\", \"groupby\": [\"commit_type\"], \"line_interpolation\": \"linear\", \"metrics\": [{\"aggregate\": null, \"column\": null, \"expressionType\": \"SQL\", \"fromFormData\": true, \"hasCustomLabel\": false, \"label\": \"COUNT(*)\", \"optionName\": \"metric_n4xn9emh55_60hid92bszp\", \"sqlExpression\": \"COUNT(*)\"}], \"order_desc\": true, \"resample_fillmethod\": null, \"resample_how\": null, \"resample_rule\": null, \"rich_tooltip\": true, \"rolling_type\": \"None\", \"row_limit\": 50000, \"show_brush\": \"auto\", \"show_controls\": false, \"show_legend\": true, \"slice_id\": 4, \"stacked_style\": \"stack\", \"time_grain_sqla\": \"P1M\", \"time_range\": \"100 years ago : \", \"timeseries_limit_metric\": null, \"viz_type\": \"area\", \"x_axis_format\": \"smart_date\", \"x_axis_label\": \"\", \"x_axis_showminmax\": false, \"x_ticks_layout\": \"auto\", \"y_axis_bounds\": [null, null], \"y_axis_format\": \".3s\", \"y_log_scale\": false, \"remote_id\": \"be4154a6-726c-4dcc-bcff-da20558aaa55\", \"datasource_name\": \"gitbase.admin admin-commit_merges-8X2HBrQre\", \"schema\": \"gitbase.admin admin-commit_merges-8X2HBrQre\", \"database_name\": \"gitbase\"}",
"params": "{\"adhoc_filters\": [], \"annotation_layers\": [], \"bottom_margin\": \"auto\", \"color_scheme\": \"srcdRoyal\", \"comparison_type\": \"values\", \"contribution\": false, \"datasource\": \"14__table\", \"granularity_sqla\": \"commit_author_when\", \"groupby\": [\"commit_type\"], \"line_interpolation\": \"linear\", \"metrics\": [{\"aggregate\": null, \"column\": null, \"expressionType\": \"SQL\", \"fromFormData\": true, \"hasCustomLabel\": false, \"label\": \"COUNT(*)\", \"optionName\": \"metric_n4xn9emh55_60hid92bszp\", \"sqlExpression\": \"COUNT(*)\"}], \"order_desc\": true, \"resample_fillmethod\": null, \"resample_how\": null, \"resample_rule\": null, \"rich_tooltip\": true, \"rolling_type\": \"None\", \"row_limit\": 50000, \"show_brush\": \"auto\", \"show_controls\": false, \"show_legend\": true, \"slice_id\": 4, \"stacked_style\": \"stack\", \"time_grain_sqla\": \"P1M\", \"time_range\": \"100 years ago : \", \"timeseries_limit_metric\": null, \"viz_type\": \"area\", \"x_axis_format\": \"smart_date\", \"x_axis_label\": \"\", \"x_axis_showminmax\": false, \"x_ticks_layout\": \"auto\", \"y_axis_bounds\": [null, null], \"y_axis_format\": \".3s\", \"y_log_scale\": false, \"remote_id\": \"be4154a6-726c-4dcc-bcff-da20558aaa55\", \"datasource_name\": \"gitbase.admin admin-commit_merges-8X2HBrQre\", \"schema\": \"gitbase.admin admin-commit_merges-8X2HBrQre\", \"database_name\": \"gitbase\"}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR, but it came to my mind now.

@smacker is this the result of a json.dumps(params) during export? If it is so, do you think that it could make sense to replace it with a json.dumps(params, indent=4) where params is an OrderedDict? It should simplify the diff as each key would be in different rows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just edited current dashboards, but I agree with you @se7entyse7en; diffs would be better if we could have better formatted this section.

Copy link
Contributor

@se7entyse7en se7entyse7en Aug 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just edited current dashboards

Yup, I imagined that, and thanks for posting the screenshots! 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a value from a database column which can be either empty string or serialized json. In theory, we can amend import/export to serialize it differently. But I wouldn't hack import/export anymore until apache/superset#7829 is merged into upstream, released and merged into our fork.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! Thanks for the info! 👍

Copy link
Contributor

@ricardobaeta ricardobaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so awesome @dpordomingo ✨ Thank you so much.

@smacker
Copy link
Contributor

smacker commented Aug 7, 2019

Eslint fails

@dpordomingo
Copy link
Contributor Author

Now it passes again; thanks @smacker for noticing.

This commit includes for new palettes for source{d} theme:
- srcdMain, with the source{d} main colors from the branding docs.
- srcdAll, with:
  - all colors from srcdMain
  - all other extra colors defined by the branding docs
  - one extra color from the gradients between main colors
- srcdOpaques, with the six main source{d} colors.
- srcdRoyal, with source{d} royal and source{d} deep royal

Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
Superset is using 'SUPERSET_DEFAULT' as the default CategoricalScheme key
i.e. https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-color/src/CategoricalSchemeRegistrySingleton.ts
This commit assigns 'srcdMain' palette for 'SUPERSET_DEFAULT' key

Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
It overrides the 'bnbColors' as defined by superset.

Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
It will select 'srcdMain' palette from the 'Color Scheme' selector
when creating a chart (instead of the current default: 'bnbColors')
It does not change current selected schemes, but it will affect only
the new charts if no other color is manually asigned.

Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
Instead of using 'bnbColors' or 'd3Category10' in our charts,
it will be used the default color_scheme: 'SUPERSET_DEFAULT'

Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
@dpordomingo dpordomingo changed the title [RFC] Apply our brand colors on source{d} charts Apply our brand colors on source{d} charts Aug 8, 2019
@dpordomingo
Copy link
Contributor Author

dpordomingo commented Aug 8, 2019

Since all comments were positive, and our beloved designer already approved it, I think we could turn this RFC into a real PR, and merge it if you agree Carlos

@dpordomingo dpordomingo changed the title Apply our brand colors on source{d} charts [RFC] Apply our brand colors on source{d} charts Aug 8, 2019
@dpordomingo
Copy link
Contributor Author

dpordomingo commented Aug 8, 2019

After a call with @ricardobaeta we agree on splitting this PR in two:

  1. Use SUPERSET_DEFAULT as the default palette #257 Use reduced palettes #258 the logical thing, without visual impact → use defaults instead of hardcoded palettes,
  2. Apply our brand colors on source{d} dashboards #259 the visual part → changing the defaults to use our palette instead of superset ones.

This way, we could merge the first one without visual impact, and iterate later on the visual part, creating more curated palettes and documenting them properly.

Copy link
Contributor

@carlosms carlosms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, up to you to create new PRs or merge this one.

Copy link
Contributor

@ricardobaeta ricardobaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As agreed on Slack Call with @dpordomingo we're splitting this PR in two. My only request is to address just that.

Great work ✨

@dpordomingo
Copy link
Contributor Author

dpordomingo commented Aug 15, 2019

This PR was superseded by #257, #258 and #259 as agreed at #241 (comment)

Thanks for your contributions, which let me improve the proposed change.

@dpordomingo dpordomingo deleted the palette branch August 15, 2019 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants