Skip to content
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

Waffle next #2320

Merged
merged 44 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0e5256e
feat(waffle): migrate to TypeScript, remove react-motion
plouc May 2, 2023
68614a2
feat(waffle): get all flavors to work and types to be generated witho…
plouc May 2, 2023
b47932a
feat(waffle): remove react-motion from deps
plouc May 2, 2023
819912f
feat(waffle): remove DefaultRawDatum as Datum can be used as a default
plouc May 2, 2023
d8049a1
feat(waffle): update tests
plouc May 3, 2023
3f4d3b1
feat(waffle): forward legend data
plouc May 3, 2023
b7652d1
feat(storybook): improve globl styles
plouc May 3, 2023
e7ab843
feat(jest): upgrade jest and enable workerThreads to speedup tests
plouc May 3, 2023
5c5bac2
fix(website): disable gatsby handling of eslint
plouc May 3, 2023
00cf21e
fix(waffle): fix the waffle pages in the website
plouc May 3, 2023
74c99e1
feat(waffle): adjust the documentation according to the updated API
plouc May 3, 2023
8565621
feat(waffle): add an ent-to-end test for the tooltip
plouc May 3, 2023
9fa3fdc
feat(waffle): restore the test for Waffle legends support
plouc May 3, 2023
00f73d9
feat(waffle): fix the story showcasing a custom cell component
plouc May 3, 2023
926f9ff
feat(waffle): restore legends for WaffleCanvas
plouc May 3, 2023
cd315cd
feat(waffle): cleanup stories
plouc May 3, 2023
dce8122
feat(waffle): legend items order reacts to fillDirection
plouc May 3, 2023
57086c0
feat(waffle): add story links for WaffleHtml and WaffleCanvas
plouc May 3, 2023
8170b78
feat(grid): introduce @nivo/grid package
plouc May 3, 2023
019ba25
feat(waffle): use @nivo/grid for most computations and restore paddin…
plouc May 5, 2023
50bb4f1
feat(waffle): get rid of lodash
plouc May 6, 2023
1364021
feat(grid): mark the package as side-effects free
plouc May 6, 2023
d3afcdd
feat(waffle): mark the package as side-effects free
plouc May 6, 2023
80c833d
feat(waffle): fix linting errors
plouc May 6, 2023
51861c6
feat(grid): adjust the version to match the latest version of other p…
plouc May 6, 2023
79d5e83
feat(grid): mark data as readonly
plouc May 6, 2023
62c7b9c
feat(waffle): fix snapshots due to the change for the default of fill…
plouc May 6, 2023
8a8e754
feat(waffle): implement proper types for both SVG and canvas custom l…
plouc May 6, 2023
339bbfa
feat(waffle): use the default fillDirectioon in the website for all f…
plouc May 6, 2023
46f6afc
feat(waffle): use a centralized data generator for the website and st…
plouc May 6, 2023
e62b453
feat(waffle): restore the behavior of hiddenIds so that legends are p…
plouc May 6, 2023
ec02a1f
feat(waffle): add missing computedData to the custom layer context
plouc May 6, 2023
12b66a2
feat(waffle): areas should be hidden as well
plouc May 6, 2023
c82de9a
feat(waffle): restore support for emptyOpacity
plouc May 6, 2023
e40c4d5
feat(waffle): move the management of cells transitions to a hook
plouc May 6, 2023
39e8b42
feat(waffle): adjust snapshots due to the addition of opacity
plouc May 6, 2023
47f1b78
feat(waffle): add support for borderRadius
plouc May 7, 2023
140493d
feat(waffle): add aria attributes doc to the website
plouc May 7, 2023
8719b63
feat(waffle): fix borderColor to work for empty and non-empty cells
plouc May 7, 2023
b74727b
feat(waffle): canvas implementation now support borderWidth and intro…
plouc May 7, 2023
f12f12d
feat(waffle): canvas implementation now support cell opacity
plouc May 7, 2023
216af0a
feat(waffle): update the doc to indicate that the canvas implementati…
plouc May 7, 2023
4cca1e3
feat(core): remove unused HOCs
plouc May 7, 2023
5d95efc
feat(waffle): restore support for patterns & gradients for the SVG im…
plouc May 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,10 @@ clean-all: ##@0 global uninstall node modules, remove transpiled code & lock fil

define clean-source-lib
rm -rf $(1)/*/cjs
rm -rf $(1)/*/umd
endef

define clean-source-all
rm -rf $(1)/*/cjs
rm -rf $(1)/*/umd
rm -rf $(1)/*/node_modules
rm -rf $(1)/*/package-lock.json
endef
Expand Down Expand Up @@ -142,7 +140,7 @@ pkg-watch-test-%: ##@1 packages run tests for a package and watch for changes

pkgs-test: ##@1 packages run tests for all packages
@echo "${YELLOW}Running test suites for all packages${RESET}"
@export BABEL_ENV=development; pnpm jest -c ./packages/jest.config.js --rootDir . ./packages/*/tests
@export BABEL_ENV=development; pnpm jest -c ./packages/jest.config.js --workerThreads --rootDir . ./packages/*/tests

pkgs-watch-test: ##@1 packages run tests for all packages and watch for changes
@echo "${YELLOW}Running test suites watcher for all packages${RESET}"
Expand All @@ -159,7 +157,7 @@ pkgs-build: pkgs-types ##@1 packages build all packages
| xargs -P 8 -I '{}' sh -c '$(MAKE) pkg-build-{} || exit 255'

pkgs-types: ##@1 packages build all package types
@pnpm tsc -b ./tsconfig.monorepo.json
@pnpm tsc --build ./tsconfig.monorepo.json

pkg-types-%: ##@1 packages generate types for a specific package
@if [ "$${SKIP_TYPES}" != "TRUE" ]; \
Expand All @@ -169,7 +167,7 @@ pkg-types-%: ##@1 packages generate types for a specific package
echo "${YELLOW}Building TypeScript types for package ${WHITE}@nivo/${*}${RESET}"; \
rm -rf ./packages/${*}/dist/types; \
rm -rf ./packages/${*}/dist/tsconfig.tsbuildinfo; \
pnpm tsc -b ./packages/${*}; \
pnpm tsc --build ./packages/${*}; \
fi \
fi;

Expand Down
2 changes: 1 addition & 1 deletion cypress/src/components/bar/Bar.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Bar } from '@nivo/bar'

describe('Bar', () => {
describe('<Bar />', () => {
it('should render a bar chart', () => {
cy.mount(
<Bar
Expand Down
2 changes: 1 addition & 1 deletion cypress/src/components/bar/BarCanvas.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BarCanvas } from '@nivo/bar'

describe('BarCanvas', () => {
describe('<BarCanvas />', () => {
it('should render a bar chart', () => {
cy.mount(
<BarCanvas
Expand Down
46 changes: 46 additions & 0 deletions cypress/src/components/waffle/Waffle.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Waffle } from '@nivo/waffle'

describe('<Waffle />', () => {
it('should show a tooltip when hovering the areas', () => {
cy.mount(
<Waffle
width={500}
height={300}
total={100}
data={[
{
id: 'cats',
label: 'Cats',
value: 43,
},
{
id: 'dogs',
label: 'Dogs',
value: 27,
},
{
id: 'rabbits',
label: 'Rabits',
value: 17,
},
]}
columns={12}
rows={20}
animate={false}
testIdPrefix="waffle"
/>
)

const pets = ['cats', 'dogs', 'rabbits']
pets.forEach(pet => {
const area = cy.get(`[data-test-id="waffle.area_${pet}.polygon_0"]`)
area.should('exist')

area.trigger('mouseover')
cy.get('svg + div').should('exist')

area.trigger('mouseout')
cy.get('svg + div').should('not.exist')
})
})
})
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@typescript-eslint/parser": "^5.59.1",
"@wojtekmaj/enzyme-adapter-react-17": "0.6.6",
"@wyze/clog-cli": "^1.0.1",
"babel-jest": "^24.9.0",
"babel-jest": "^29.5.0",
"babel-loader": "^8.2.3",
"chalk": "^5.2.0",
"chalk-template": "^1.0.0",
Expand All @@ -45,8 +45,9 @@
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"gh-pages": "^5.0.0",
"jest": "^27.4.5",
"jsdom": "^21.1.1",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jsdom": "^22.0.0",
"lerna": "^6.6.1",
"lodash": "^4.17.21",
"prettier": "^2.8.8",
Expand Down
6 changes: 3 additions & 3 deletions packages/arcs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"dependencies": {
"@nivo/colors": "workspace:*",
"@react-spring/web": "9.4.5 || ^9.7.2",
"d3-shape": "^1.3.5"
"d3-shape": "^1.3.5",
"@types/d3-shape": "^2.0.0"
},
"devDependencies": {
"@nivo/core": "workspace:*",
"@types/d3-shape": "^2.0.0"
"@nivo/core": "workspace:*"
},
"peerDependencies": {
"@nivo/core": "0.82.1",
Expand Down
Loading