Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

fix(plugin-chart-word-cloud): make colors schemes work #788

Merged
merged 3 commits into from
Sep 18, 2020

Conversation

villebro
Copy link
Contributor

🐛 Bug Fix
Currently the selected color scheme isn't being respected. This is probably a regression from #768.

BEFORE

image

AFTER

image

@vercel
Copy link

vercel bot commented Sep 17, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/superset/superset-ui/dlsj0hyhe
✅ Preview: https://superset-ui-git-fork-preset-io-villebro-word-cloud-encodable.superset.vercel.app

Comment on lines 5 to 7
import configureEncodable from '../configureEncodable';

configureEncodable();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ktmud I wasn't sure where/how to call this "the right way", any pointers would be appreciated!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for catching and fixing this!

I feel it's probably better to add these in the plugin definition file (src/plugin/index.ts). @kristw what do you think?

Copy link
Contributor

@kristw kristw Sep 17, 2020

Choose a reason for hiding this comment

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

umm, the regression is in incubator-superset, right?
Better call this in the setup stage of incubator-superset, not in the plugin.
Can add the configureEncodable() call in setupPlugins.ts before registering the charts.

I configured it here for the storybook and haven't done that to the incubator-superset because we were still consolidating core packages at that time.


See current master preview with color.
https://superset-ui.now.sh/?path=/story/chart-plugins-plugin-chart-word-cloud--legacy-shim

Copy link
Contributor

@kristw kristw Sep 17, 2020

Choose a reason for hiding this comment

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

or src/plugin/index.ts as Jesse suggested, but then have to do that for the other ones that use encodable too otherwise they will depend on existence of word cloud.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should only be required temporarily so either solution is fine. I am about to refactor the core package to use same underlying resolvers with encodable so this configuration should eventually be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense 👍 Updated.

@villebro
Copy link
Contributor Author

Side note: the non-legacy plugin is using transformProps.ts from the legacy plugin. We should probably remove transformProps.ts from the new word cloud plugin if it isn't used or going to be worked on any time soon. Or better yet, just remove the legacy plugin and move any code that the new plugin is using to the appropriate place.

@codecov
Copy link

codecov bot commented Sep 17, 2020

Codecov Report

Merging #788 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #788      +/-   ##
==========================================
+ Coverage   25.18%   25.23%   +0.05%     
==========================================
  Files         353      353              
  Lines        7869     7869              
  Branches     1028     1028              
==========================================
+ Hits         1982     1986       +4     
+ Misses       5778     5774       -4     
  Partials      109      109              
Impacted Files Coverage Δ
...lugins/plugin-chart-word-cloud/src/plugin/index.ts 50.00% <100.00%> (+16.66%) ⬆️
plugins/preset-chart-xy/src/BoxPlot/index.ts 33.33% <100.00%> (+33.33%) ⬆️
...gin-chart-echarts/src/Timeseries/transformProps.ts 26.66% <0.00%> (+1.13%) ⬆️
plugins/preset-chart-xy/src/configureEncodable.ts 6.66% <0.00%> (+6.66%) ⬆️
.../plugin-chart-word-cloud/src/configureEncodable.ts 6.66% <0.00%> (+6.66%) ⬆️

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 dc9cf37...a18a0fd. Read the comment docs.

@ktmud
Copy link
Contributor

ktmud commented Sep 17, 2020

Boxplot seems to have the same problem.

@villebro
Copy link
Contributor Author

@ktmud boxplot also fixed, should be good to go.

@ktmud ktmud merged commit 67bfbc7 into apache-superset:master Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants