chroma.js icon indicating copy to clipboard operation
chroma.js copied to clipboard

Removed exports (scale, limits, brewer) in chroma.js >2.4.2

Open ploth opened this issue 11 months ago • 3 comments

It looks like chroma-js is not exporting scale, limits or brewer anymore. If I'm not wrong those were still available in 2.4.2. Removing these exports is a breaking change. Unfortunately this wasn't respected in the naming of the chroma-js releases. With a breaking change the major version should increase.

ploth avatar Jan 03 '25 14:01 ploth

Hi, I think the exports are still working fine, see this demo.

Can you explain how you're trying to import?

gka avatar Jan 06 '25 07:01 gka

Interesting, I'm working with https://github.com/geostyler/geostyler which has a dependency on chroma-js ^2.4.2 and where I encountered the problem.

Thanks for your demo. For me it looks like that its fixed with a newer version of chroma-js. Try changing the import to: import { brewer } from '[email protected]';

ploth avatar Jan 06 '25 09:01 ploth

Ah, yes I remember. Unfortunately I don't know that it's possible to "retract" a version from npm. Have you tried updating to v3? The only breaking changes involved the exporting of modern CSS colors, which shouldn't really break anything.

gka avatar Jan 06 '25 15:01 gka