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

feat: add hide-nav config for web use #365

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

islxyqwe
Copy link
Member

@islxyqwe islxyqwe commented Apr 8, 2024

add a new prop: hideChartNav to hide the chart navigation.
usage:

<GraphicWalker {...props} hideChartNav />

Copy link

vercel bot commented Apr 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphic-walker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2024 7:45am

Copy link
Contributor

github-actions bot commented Apr 8, 2024

Risk Level 2 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/App.tsx

The code changes seem to be mostly about UI and layout adjustments, and the addition of a utility function parseErrorMessage. There are no obvious bugs or performance issues. However, there are a few areas that could be improved for readability and maintainability:

  1. Use of magic numbers: The code contains magic numbers, such as 501 in the reportError function and 60000 for computationTimeout. It would be better to replace these with named constants to improve readability and maintainability.

  2. Complexity of the useEffect hooks: There are multiple useEffect hooks with complex logic inside. It would be better to extract this logic into separate functions with descriptive names.

  3. Inconsistent use of optional chaining: In some places, optional chaining (?.) is used, but in others it is not. It would be better to use it consistently to avoid potential undefined errors.

Here are some example changes:

// Replace magic numbers with named constants
const DEFAULT_COMPUTATION_TIMEOUT = 60000;
const ERROR_CODE = 501;

// Extract complex logic into separate functions
const handleGeographicDataUpdate = () => {
  if (geographicData) {
    vizStore.setGeographicData(geographicData, geographicData.key);
  }
};

useEffect(handleGeographicDataUpdate, [vizStore, geographicData]);

// Use optional chaining consistently
onError?.(err);

}


🔮💡🔗


Powered by Code Review GPT

@ObservedObserver ObservedObserver merged commit 596c7b7 into main Apr 8, 2024
6 checks passed
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.

2 participants