-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Conversation
Codecov Report
@@ 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.
|
0c3d5ba
to
078e286
Compare
There was a problem hiding this 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.
superset/assets/src/explore/components/controls/ColorSchemeControl.jsx
Outdated
Show resolved
Hide resolved
58b28ef
to
fcdc50e
Compare
return v => hexToRGB(scaler(v)); | ||
} | ||
return scaler; | ||
return d3.scale.linear().domain(points).range(colors).clamp(true); |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 🍒🍌 :)
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this 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 :)
sweet! will merge when 🍏 (green) |
@kristw there's a conflict now, looks fixable with the web UI possibly 🤔 |
conflict resolved |
…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
@superset-ui
@superset-ui
code.SequentialScheme
function to create linear color scale.core-js
fromvendor-major
hard-coded bundle. Thecore-js
comes frombabel-polyfill
and by enforcing it intovendor-major
causes some issues.@williaster @conglei @graceguo-supercat @michellethomas @xtinec @mistercrunch