-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easier to access colorBrewer palette keys (#351)
* feat: make it easier to access colorbrewer palette names * docs: explain differences to official colorbrewer scales * chore: add test * fix typo * only use Proxy if it's available * fix: remove circular dependency * build & docs
- Loading branch information
Showing
14 changed files
with
152 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import chroma from 'chroma-js'; | ||
|
||
describe('ColorBrewer palettes', () => { | ||
it('should have all palettes', () => { | ||
expect(chroma.brewer).toBeDefined(); | ||
expect(Object.keys(chroma.brewer).length).toBe(36); | ||
}); | ||
|
||
it('brewer keys are camel-cased', () => { | ||
expect(Object.keys(chroma.brewer)[0]).toBe('OrRd'); | ||
expect(Object.keys(chroma.brewer)[1]).toBe('PuBu'); | ||
}); | ||
|
||
it('supports case-insensitive access to palettes', () => { | ||
expect(chroma.brewer.RdYlBu).toBeDefined(); | ||
expect(chroma.brewer.rdylbu).toBeDefined(); | ||
expect(chroma.brewer.RdylBU).toBeDefined(); | ||
}); | ||
|
||
it('non existing palettes are still undefined', () => { | ||
expect(chroma.brewer.notHere).toBeUndefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters