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

integrate d3 visualization to grafana panel #1275

Merged
merged 9 commits into from
Feb 8, 2024

Conversation

cjrkoa
Copy link
Contributor

@cjrkoa cjrkoa commented Jan 28, 2024

Fixes #1262

Fixes dyc3#1262
Having problems starting the server. Docker doesn't want to start for some reason
Copy link
Contributor

coderabbitai bot commented Jan 28, 2024

Walkthrough

The recent changes involve integrating a new force-directed graph visualization into a Grafana panel within the ott-vis package. This includes the addition of a ForceGraph component utilizing D3.js for dynamic graph representation, modifications to SimplePanel.tsx for theme usage and data integration, and an update to panel options for specifying allowed entities. The effort aligns with transitioning a previous visualization to a new Grafana panel format.

Changes

File Path Change Summary
.../.config/jest/utils.js Added dependencies to grafanaESModules array.
.../src/components/ForceGraph.tsx Introduced ForceGraph component for force-directed graph visualization.
.../src/components/SimplePanel.tsx Modified imports and usage of useTheme2 and ForceGraph; added nodes and links data.
.../src/module.ts Modified a panel option to "Allowed Entities" with a default value of "25".

Assessment against linked issues

Objective Addressed Explanation
vis: integrate Global vis into a grafana panel (#1262)

Poem

In the code's woven maze, a graph takes flight,
Nodes and links in harmonious dance, a sight so bright.
🐇 With each commit, our vision expands,
A digital forest grows, crafted by skilled hands. 🌿

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Jan 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2cec601) 61.4479% compared to head (873aaaf) 61.5637%.
Report is 15 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master      #1275        +/-   ##
================================================
+ Coverage   61.4479%   61.5637%   +0.1157%     
================================================
  Files           118        118                
  Lines          9517       9439        -78     
  Branches       1158       1161         +3     
================================================
- Hits           5848       5811        -37     
+ Misses         3669       3628        -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dyc3
Copy link
Owner

dyc3 commented Jan 31, 2024

Docker isn't active

Did you make sure to start it outside your dev container?

There were many many errors. All of them are gone but nothing renders right now in the grafana panel
this doesn't work yet
svg isn't rendering properly
@dyc3
Copy link
Owner

dyc3 commented Feb 7, 2024

Also go ahead and remove the d3-visualization folder with the original code you wrote in it

@cjrkoa cjrkoa marked this pull request as ready for review February 8, 2024 17:37
@dyc3 dyc3 merged commit e8ee382 into dyc3:master Feb 8, 2024
16 of 19 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2cec601 and 873aaaf.
Files ignored due to path filters (3)
  • packages/ott-vis/docker-compose.yaml is excluded by: !**/*.yaml
  • packages/ott-vis/package.json is excluded by: !**/*.json
  • yarn.lock is excluded by: !**/*.lock
Files selected for processing (4)
  • packages/ott-vis/.config/jest/utils.js (1 hunks)
  • packages/ott-vis/src/components/ForceGraph.tsx (1 hunks)
  • packages/ott-vis/src/components/SimplePanel.tsx (3 hunks)
  • packages/ott-vis/src/module.ts (1 hunks)
Additional comments: 7
packages/ott-vis/src/module.ts (1)
  • 9-11: Ensure the new option "Allowed Entities" aligns with the intended functionality and user expectations. The description and default value appear appropriate for controlling the number of entities displayed.
packages/ott-vis/.config/jest/utils.js (1)
  • 22-54: Confirm that all added D3-related dependencies are necessary for the visualization features being integrated. Ensure there are no typos in package names.
packages/ott-vis/src/components/ForceGraph.tsx (1)
  • 1-139: - Confirm the use of useRef and useEffect hooks aligns with React best practices for integrating with D3.js.
  • Ensure the force simulation setup and dynamic SVG rendering are correctly implemented for performance and maintainability.
  • Review the drag behavior implementation for correctness and user experience.
packages/ott-vis/src/components/SimplePanel.tsx (4)
  • 5-6: Ensure the modified import paths for useStyles2 and ForceGraph are correct and align with the project's directory structure.
  • 31-31: Commenting out useTheme2 might be intentional for this iteration, but ensure it's not accidentally left out if theme-related functionality is required.
  • 34-210: The json_data object structure appears well-defined for the force-directed graph visualization. Confirm that the data, including nodes and links, aligns with the intended visualization requirements and that the ForceGraph component is correctly utilizing this data.
  • 222-226: Ensure the ForceGraph component's props are correctly passed and that the component's integration within SimplePanel functions as expected, especially with dynamic width and height adjustments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vis: integrate Global vis into a grafana panel
2 participants