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

[reviewable] Integrate @superset-ui/{core,color,chart} modules #6234

Merged
merged 26 commits into from
Nov 11, 2018

Conversation

kristw
Copy link
Contributor

@kristw kristw commented Oct 30, 2018

  • Delete files that are already extracted to @superset-ui
  • Update references to the files above to point to corresponding @superset-ui code.
  • Update color module usage to utilize the new SequentialScheme function to create linear color scale.
  • Remove core-js from vendor-major hard-coded bundle. The core-js comes from babel-polyfill and by enforcing it into vendor-major causes some issues.

@williaster @conglei @graceguo-supercat @michellethomas @xtinec @mistercrunch

@codecov-io
Copy link

codecov-io commented Oct 30, 2018

Codecov Report

Merging #6234 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6234   +/-   ##
=======================================
  Coverage   77.33%   77.33%           
=======================================
  Files          67       67           
  Lines        9578     9578           
=======================================
  Hits         7407     7407           
  Misses       2171     2171

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 3ffb48c...5e5218e. Read the comment docs.

@kristw kristw changed the title [WIP] Import specific d3 submodules instead of entire d3 Import specific d3 submodules instead of entire d3 Oct 31, 2018
@kristw kristw force-pushed the kristw-d3 branch 3 times, most recently from 0c3d5ba to 078e286 Compare November 6, 2018 21:52
@kristw kristw changed the title Import specific d3 submodules instead of entire d3 Integrate @superset-ui/core,color/chart modules Nov 7, 2018
@kristw kristw closed this Nov 7, 2018
@kristw kristw reopened this Nov 7, 2018
@kristw kristw closed this Nov 7, 2018
@kristw kristw reopened this Nov 7, 2018
@kristw kristw changed the title Integrate @superset-ui/core,color/chart modules Integrate @superset-ui/{core,color,chart} modules Nov 7, 2018
@kristw kristw closed this Nov 7, 2018
@kristw kristw reopened this Nov 7, 2018
@kristw kristw changed the title Integrate @superset-ui/{core,color,chart} modules [reviewable] Integrate @superset-ui/{core,color,chart} modules Nov 7, 2018
Copy link
Contributor

@xtinec xtinec left a comment

Choose a reason for hiding this comment

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

Thanks for this big sweeping change! 🎉
Looking awesome. Just a couple small nits.

@kristw kristw force-pushed the kristw-d3 branch 2 times, most recently from 58b28ef to fcdc50e Compare November 8, 2018 06:43
return v => hexToRGB(scaler(v));
}
return scaler;
return d3.scale.linear().domain(points).range(colors).clamp(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

just noting that if we swapped out scaleLinear from d3 v4 here would could get rid of d3 from another file -- def not blocking tho!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are slight difference between d3 v3 scale.linear and v4 scaleLinear. The deck.gl util that uses this function fails the test after the swap. I want to take a closer look at it in another PR and remove this colorScalerFactory function completely.

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 ended up taking care of it. Goodbye colorScalerFactory!

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import shortid from 'shortid';
import { XYChart, AreaSeries, CrossHair, LinearGradient } from '@data-ui/xy-chart';
import { BRAND_COLOR } from '../../modules/colors';
import { BRAND_COLOR } from '@superset-ui/color';
Copy link
Contributor

Choose a reason for hiding this comment

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

noting that we should probably make this settable in the future since most people will never be able to modify @superset-ui/color

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Umm, good point. maybe ConstantRegistry in @superset-ui/core?

Copy link
Contributor

Choose a reason for hiding this comment

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

sgtm 👍

const colorScale = colorScalerFactory(linearColorScheme, null, null, extents);
const colorScale = getSequentialSchemeRegistry()
.get(linearColorScheme)
.createLinearScale(extents);

const legend = d3.range(steps)
Copy link
Contributor

@williaster williaster Nov 9, 2018

Choose a reason for hiding this comment

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

also noting that you could swap out d3Range here from d3-array and also get rid of d3 v3 in this file 🎉 (also not blocking you just seem to be swapping some so pointing out the low hanging 🍒🍌 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@@ -1,5 +1,6 @@
import d3 from 'd3';
Copy link
Contributor

Choose a reason for hiding this comment

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

d3.scale => scaleThreshold would remove d3 v3 in this file (not blocking)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Done, plus some more clean up

Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

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

noted a couple easier d3 swaps but, LGTM! thanks for such a big swap! 💪

also curious what the core-js in vendor issues were :)

@williaster
Copy link
Contributor

sweet! will merge when 🍏 (green)

@williaster
Copy link
Contributor

@kristw there's a conflict now, looks fixable with the web UI possibly 🤔

@kristw
Copy link
Contributor Author

kristw commented Nov 11, 2018

conflict resolved

@williaster williaster merged commit a7b52da into apache:master Nov 11, 2018
bipinsoniguavus pushed a commit to ThalesGroup/incubator-superset that referenced this pull request Dec 26, 2018
…e#6234)

* 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
@kristw kristw deleted the kristw-d3 branch March 5, 2019 23:55
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants