Skip to content

BREAKING drop hardcoded and generated colors#1806

Merged
santam85 merged 1 commit intovalor-software:masterfrom
PowerKiKi:powerkiki
Feb 10, 2024
Merged

BREAKING drop hardcoded and generated colors#1806
santam85 merged 1 commit intovalor-software:masterfrom
PowerKiKi:powerkiki

Conversation

@PowerKiKi
Copy link
Contributor

builtInDefaults and baseColors were dropped. That means that colors
will change to be the default as defined by Chart.js, and we will no
longer generate colors on the fly.

If you need this kind of features, see https://www.chartjs.org/docs/latest/general/colors.html#advanced-color-palettes

As discussed in #1801 (comment)

To be merged afer #1804

@santam85
Copy link
Contributor

santam85 commented Feb 1, 2024

Checks are failing because you only regenerated the macOS (darwin) screenshots. There is a command in the tools folder to regenerate the linux ones using Docker, but it might need some tweaking...

@PowerKiKi
Copy link
Contributor Author

PowerKiKi commented Feb 3, 2024

I'm on linux, so I am actually generating linux images:

image

However, I am having trouble to generate the correct screenshots systematically. They sometimes happens to be 1248px wide, whereas they should all be 600px. Could you give it a try on your side ?

PS: I suspect a timing issue where a animation is sometimes running while it takes a screenshot. But the canvas is styled to be 600px wide, so I don't get how an animation could change that... 🤷

@santam85
Copy link
Contributor

santam85 commented Feb 5, 2024

Very strange this is happening to me too now. Perhaps an update from Chart.js behaviour when rendering responsive: true charts could have caused it?

@santam85
Copy link
Contributor

santam85 commented Feb 9, 2024

@PowerKiKi I ended up having to do substantial changes to the demo app, as it seems the e2e flakyness was caused by the canvas being hidden/animating while the chart was initializing in the lazy loaded tabs. See if the new setup works better for you too, I'll start working on fixing unit tests.

`builtInDefaults` and `baseColors` were dropped. That means that colors
will change to be the default as defined by Chart.js, and we will no
longer generate colors on the fly.

If you need this kind of features, see https://www.chartjs.org/docs/latest/general/colors.html#advanced-color-palettes

As discussed in valor-software#1801 (comment)
@PowerKiKi
Copy link
Contributor Author

I rebased on top of master, and regenerated screenshots. It can now run consistently every single time on my machine. However I see the CI is still failing... I'll see if I can grab the screen shot generated by CI...

@PowerKiKi PowerKiKi force-pushed the powerkiki branch 7 times, most recently from 7833966 to 8fd1b96 Compare February 10, 2024 10:05
@PowerKiKi
Copy link
Contributor Author

I'm getting crazy here. I'm convinced that local e2e is non-flaky. I pushed to CI and it fails. I spend way too much time trying random things with constants failure. And when I'm about to give up, it works ! 🙄

... so I guess it can be merged ... ?

@santam85 santam85 merged commit 7fd1407 into valor-software:master Feb 10, 2024
gisbdzhch pushed a commit to gisktzh/gb3-web_ui that referenced this pull request Mar 14, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ng2-charts](https://github.com/valor-software/ng2-charts) | [`^5.0.3` -> `^6.0.0`](https://renovatebot.com/diffs/npm/ng2-charts/5.0.4/6.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/ng2-charts/6.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/ng2-charts/6.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/ng2-charts/5.0.4/6.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/ng2-charts/5.0.4/6.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>valor-software/ng2-charts (ng2-charts)</summary>

### [`v6.0.0`](https://github.com/valor-software/ng2-charts/releases/tag/v6.0.0)

[Compare Source](valor-software/ng2-charts@v5.0.4...v6.0.0)

#### What’s Changed

-   BREAKING Tree shakable standalone library ([#&#8203;1801](valor-software/ng2-charts#1801)) [@&#8203;PowerKiKi](https://github.com/PowerKiKi)
    Users must import the library in standalone mode
-   BREAKING drop hardcoded and generated colors ([#&#8203;1806](valor-software/ng2-charts#1806)) [@&#8203;PowerKiKi](https://github.com/PowerKiKi)
    Users must migrate to the Colors [plugin](https://www.chartjs.org/docs/latest/general/colors.html) from Chart.js for color generation
-   Angular 17 ([#&#8203;1757](valor-software/ng2-charts#1757)) [@&#8203;santam85](https://github.com/santam85)
    Angular 17 is the minimum version for v6
-   Target ES2022 as is done in Angular 17 new projects ([#&#8203;1802](valor-software/ng2-charts#1802)) [@&#8203;PowerKiKi](https://github.com/PowerKiKi)
-   Enforce prettier in CI ([#&#8203;1804](valor-software/ng2-charts#1804)) [@&#8203;PowerKiKi](https://github.com/PowerKiKi)
-   Drop CHANGELOG.md ([#&#8203;1805](valor-software/ng2-charts#1805)) [@&#8203;PowerKiKi](https://github.com/PowerKiKi)
-   Migrate to new control flow syntax ([#&#8203;1827](valor-software/ng2-charts#1827)) [@&#8203;PowerKiKi](https://github.com/PowerKiKi)
-   Make defaults type safe ([#&#8203;1836](valor-software/ng2-charts#1836)) [@&#8203;Cselt](https://github.com/Cselt)
-   chore(deps-dev): bump [@&#8203;types/node](https://github.com/types/node) from 20.11.23 to 20.11.24 ([#&#8203;1857](valor-software/ng2-charts#1857)) [@&#8203;dependabot](https://github.com/dependabot)
-   chore(deps-dev): bump [@&#8203;types/node](https://github.com/types/node) from 20.11.20 to 20.11.21 ([#&#820...
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.

2 participants