-
Notifications
You must be signed in to change notification settings - Fork 8
Feat/cookbook/charts #3062
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
base: main
Are you sure you want to change the base?
Feat/cookbook/charts #3062
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
Biome
[Biome] reported by reviewdog 🐶
fusion-framework/cookbooks/app-react-charts/src/pages/LineChart.tsx
Lines 65 to 70 in bf088be
return ( | |
<div> | |
<h2>📈 Line Chart Example</h2> | |
<Line data={data} options={options} /> | |
</div> | |
); |
[Biome] reported by reviewdog 🐶
fusion-framework/cookbooks/app-react-charts/src/routes.tsx
Lines 1 to 5 in bf088be
import { Outlet, type RouteObject } from "react-router-dom"; | |
import Navigation from "./components/Navigation"; | |
import { BarChart } from "./pages/BarChart"; | |
import { LineChart } from "./pages/LineChart"; | |
import HomePage from "./pages/HomePage"; |
[Biome] reported by reviewdog 🐶
fusion-framework/cookbooks/app-react-charts/src/routes.tsx
Lines 8 to 15 in bf088be
return ( | |
<div style={{ display: "flex", gap: 20 }}> | |
<Navigation /> | |
<div style={{ flexGrow: 1 }}> | |
<Outlet /> | |
</div> | |
</div> | |
); |
[Biome] reported by reviewdog 🐶
fusion-framework/cookbooks/app-react-charts/src/routes.tsx
Lines 19 to 36 in bf088be
{ | |
path: "/", | |
element: <Root />, | |
children: [ | |
{ | |
index: true, | |
Component: HomePage | |
}, | |
{ | |
path: "bar-chart/*", | |
Component: BarChart | |
}, | |
{ | |
path: "line-chart/*", | |
Component: LineChart | |
} | |
] | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a React-based charts cookbook to verify Chart.js integration in CI, adding routing, navigation, and demo pages.
- Adds routes and a layout component for chart pages
- Implements Bar, Line, and Pie chart examples using react-chartjs-2
- Configures app entrypoint, Fusion framework integration, and a minimal README
Reviewed Changes
Copilot reviewed 12 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
cookbooks/app-react-charts/src/routes.tsx | Defines root and child routes for Home, BarChart, and LineChart |
cookbooks/app-react-charts/src/pages/LineChart.tsx | Implements LineChart example and registers ChartJS components |
cookbooks/app-react-charts/src/pages/BarChart.tsx | Implements BarChart example with EDS icon and ChartJS registration |
cookbooks/app-react-charts/src/pages/HomePage.tsx | Adds HomePage with Bar and Pie chart examples |
cookbooks/app-react-charts/src/components/Navigation.tsx | Adds sidebar navigation linking to chart routes |
cookbooks/app-react-charts/src/index.ts | Bootstraps React app within Fusion framework |
cookbooks/app-react-charts/src/config.ts | Configures Fusion modules (navigation) and logging callbacks |
cookbooks/app-react-charts/src/Router.tsx | Sets up React RouterProvider with Fusion’s useRouter |
cookbooks/app-react-charts/src/App.tsx | Renders the router component |
cookbooks/app-react-charts/app.manifest.config.ts | Defines the application manifest |
cookbooks/app-react-charts/README.md | Adds initial README header |
Files not reviewed (4)
- cookbooks/app-react-charts/package.json: Language not supported
- cookbooks/app-react-charts/tsconfig.docker.json: Language not supported
- cookbooks/app-react-charts/tsconfig.json: Language not supported
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)
cookbooks/app-react-charts/src/pages/LineChart.tsx:21
- The new
LineChart
component lacks test coverage; consider adding unit or snapshot tests to validate its rendering and data handling.
export const LineChart = () => {
cookbooks/app-react-charts/src/pages/BarChart.tsx:15
- The
BarChart
component is untested; adding tests would help catch regressions in rendering or data changes.
export const BarChart = () => {
cookbooks/app-react-charts/src/pages/HomePage.tsx:23
- HomePage displays two charts but has no associated tests; consider adding tests to verify layout and data presence.
const HomePage = () => {
Coverage Report
File Coverage
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new React cookbook for Chart.js examples, including Bar, Line, and Pie charts along with the necessary routing, configuration, manifest, and navigation components to integrate these examples into the application.
- Adds new chart pages (BarChart, LineChart, HomePage) with chart examples.
- Configures app routing, navigation, and application manifest.
- Sets up app bootstrap code (index, Router, App) for the cookbook.
Reviewed Changes
Copilot reviewed 12 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
cookbooks/app-react-charts/src/routes.tsx | Defines routing for chart pages using a custom Root layout. |
cookbooks/app-react-charts/src/pages/LineChart.tsx | Implements an example Line Chart using react-chartjs-2. |
cookbooks/app-react-charts/src/pages/HomePage.tsx | Provides Bar and Pie chart examples on the home page. |
cookbooks/app-react-charts/src/pages/BarChart.tsx | Implements an example Bar Chart with an icon in the header. |
cookbooks/app-react-charts/src/index.ts | Bootstraps the application rendering logic. |
cookbooks/app-react-charts/src/config.ts | Sets up application configuration with callbacks. |
cookbooks/app-react-charts/src/components/Navigation.tsx | Implements sidebar navigation for the chart examples. |
cookbooks/app-react-charts/src/Router.tsx | Provides router integration using a custom useRouter hook. |
cookbooks/app-react-charts/src/App.tsx | Wraps the router inside the main app component. |
cookbooks/app-react-charts/app.manifest.config.ts | Defines the app manifest for the cookbook. |
cookbooks/app-react-charts/README.md | Describes the cookbook purpose and examples. |
cookbooks/app-react-charts/CHANGELOG.md | Contains a simple change log file. |
Files not reviewed (4)
- cookbooks/app-react-charts/package.json: Language not supported
- cookbooks/app-react-charts/tsconfig.docker.json: Language not supported
- cookbooks/app-react-charts/tsconfig.json: Language not supported
- pnpm-lock.yaml: Language not supported
Why
To test and check if cart.js is working correctly in CI
https://github.com/equinor/fusion/issues/566
Check off the following:
Confirm that I checked changes to branch which I am merging into.
Confirm that the I have completed the self-review checklist.
Confirm that my changes meet our code of conduct.