Skip to content

Commit

Permalink
Merge branch 'feature/react-d3-plugin' into feature/react-d3-plugin-b…
Browse files Browse the repository at this point in the history
…ar-chart
  • Loading branch information
emileNetter committed Jul 21, 2023
2 parents 9ad0e4d + 96fbf8e commit 6b314c8
Show file tree
Hide file tree
Showing 8 changed files with 1,237 additions and 2,367 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
yarn install
yarn storybook build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: './storybook-static'
- name: Deploy to GitHub Pages
Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "3.1.2",
"command": {
"publish": {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,47 @@
"@storybook/react": "7.0.27",
"@storybook/react-webpack5": "7.0.27",
"@storybook/theming": "7.0.27",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "14.0.0",
"@testing-library/react-native": "12.1.2",
"@testing-library/user-event": "14.4.3",
"@types/d3": "^7.4.0",
"@typescript-eslint/parser": "5.60.1",
"@types/d3": "7.4.0",
"@typescript-eslint/parser": "5.62.0",
"auto-changelog": "2.4.0",
"autoprefixer": "10.4.14",
"babel-jest": "29.5.0",
"babel-jest": "29.6.1",
"babel-loader": "9.1.3",
"clean-css": "5.3.2",
"clean-webpack-plugin": "4.0.0",
"css-loader": "6.8.1",
"d3": "7.8.5",
"eslint": "8.43.0",
"eslint": "8.45.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-babel": "5.3.1",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-n": "16.0.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react": "7.33.0",
"eslint-plugin-react-native": "4.0.0",
"file-loader": "6.2.0",
"friendly-errors-webpack-plugin": "1.7.0",
"fs-extra": "11.1.1",
"html-webpack-plugin": "5.5.3",
"jest": "29.5.0",
"jest-environment-jsdom": "29.5.0",
"lerna": "6.6.2",
"jest": "29.6.1",
"jest-environment-jsdom": "29.6.1",
"lerna": "7.0.0",
"metro-react-native-babel-preset": "0.76.7",
"postcss": "8.4.26",
"postcss-loader": "7.3.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.71.11",
"react-native": "0.72.0",
"react-native-web": "0.19.6",
"react-test-renderer": "18.2.0",
"rollup": "3.25.3",
"rollup": "3.26.3",
"rollup-plugin-dts": "5.3.0",
"rollup-plugin-peer-deps-external": "2.2.4",
"sass": "1.63.6",
"sass": "1.64.0",
"sass-loader": "13.3.2",
"storybook": "7.0.27",
"storybook-dark-mode": "3.0.0",
Expand All @@ -90,7 +90,7 @@
"tailwindcss": "3.3.3",
"typescript": "5.1.6",
"url-loader": "4.1.1",
"webpack": "5.87.0",
"webpack": "5.88.0",
"webpack-bundle-analyzer": "4.9.0",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.15.1",
Expand Down
5 changes: 4 additions & 1 deletion packages/react-d3-plugin/lib/Axis/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export declare interface AxisObject {
min: number | Date;
max: number | Date;
parseTitle?(value: number | Date): string;
findSelectionIndex?(position: number | Date): number;
findSelectionIndex?(
position: number | Date,
data: Array<number | Date>
): number;
ticks: number;
tickSize: number;
grid: boolean;
Expand Down
6 changes: 4 additions & 2 deletions packages/react-d3-plugin/lib/Curve/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ const Curve = forwardRef(({
}

const position = xAxis.range.invert(cursor.x);
const selectionIndex = xAxis.findSelectionIndex(position, xAxis.data);

setSelected([
xAxis?.data[xAxis.findSelectionIndex(position)],
(serie || yAxis?.data || [])[xAxis.findSelectionIndex(position)],
xAxis?.data[selectionIndex],
(serie || yAxis?.data || [])[selectionIndex],
]);
}, [cursor, xAxis, yAxis, serie]);

Expand Down
12 changes: 11 additions & 1 deletion packages/react-d3-plugin/lib/Marker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
import {
forwardRef,
useEffect,
useImperativeHandle,
useMemo,
useRef,
} from 'react';
import { Tooltip, classNames } from '@junipero/react';
import PropTypes from 'prop-types';

Expand Down Expand Up @@ -60,6 +66,10 @@ const Marker = forwardRef(({
isJunipero: true,
}));

useEffect(() => {
tooltipRef.current?.update?.();
}, [x]);

if (!cursor) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-native": "^0.62.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0"
"react-native": "^0.62.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0 || ^0.72.0"
},
"dependencies": {
"prop-types": "15.8.1"
Expand Down
Loading

0 comments on commit 6b314c8

Please sign in to comment.