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

Add More Live Examples for Molecule Visualization #8

Open
TharunKumarrA opened this issue Dec 24, 2024 · 4 comments
Open

Add More Live Examples for Molecule Visualization #8

TharunKumarrA opened this issue Dec 24, 2024 · 4 comments

Comments

@TharunKumarrA
Copy link
Owner

TharunKumarrA commented Dec 24, 2024

Description

Currently, the application supports a limited number of live examples: benzene, water, methane, and ethane. To enhance the usability and testing capabilities, more molecular examples need to be added. These should include molecules with varying hybridizations and complexities.

Acceptance Criteria

  • Add new live examples for molecules of different types:
    • Molecules with double bonds (e.g., Ethene (C₂H₄)).
    • Molecules with triple bonds (e.g., Acetylene (C₂H₂)).
    • Molecules with sp3d and sp3d2 hybridizations (e.g., PCl₅, SF₆).
  • Ensure correct visualization of these examples in the 3D plot.
  • Include a dropdown or selector in the UI to easily switch between examples. [Already present]

Suggested Approach

  1. Frontend Updates:

    • Add new options for the additional molecules in the dropdown menu for live examples.
    • Pass the selected molecule data to the molecule rendering logic.
  2. Backend Updates:

    • Define the molecular structures for the new examples in the EditMolecule.jsx or the related logic.
    • Ensure correct bond angles and connectivity.
  3. Testing:

    • Verify the 3D visualization for all examples, ensuring accuracy in geometry and bond representations.

File Locations for Implementation

File: /src/components/EditMolecule.jsx

  • Add New Molecules:
    • Extend the sampleMolecules array with additional molecules.
    • Define the molecular structures and ensure compatibility with existing logic.

Code Changes

In EditMolecule.jsx

Add new molecules to the sampleMolecules array:

const sampleMolecules = ["CH4", "C2H6", "C6H6", "H2O", "C2H4", "C2H2", "PCl5", "SF6"];

Update the Molecule Construction Logic

const handleShowMolecule = () => {
  switch (selectedMolecule) {
    case "C2H4": // Ethene
      // Define ethene structure with double bonds
      break;
    case "C2H2": // Acetylene
      // Define acetylene structure with triple bonds
      break;
    case "PCl5": // Phosphorus Pentachloride
      // Define PCl5 structure with sp3d hybridization
      break;
    case "SF6": // Sulfur Hexafluoride
      // Define SF6 structure with sp3d2 hybridization
      break;
    default:
      // Handle existing molecules
  }
};

Suggested New Examples

  • Ethene (C₂H₄): Molecule with double bonds.
  • Acetylene (C₂H₂): Molecule with triple bonds.
  • Phosphorus Pentachloride (PCl₅): Molecule with sp3d hybridization.
  • Sulfur Hexafluoride (SF₆): Molecule with sp3d2 hybridization.

Dependencies

@adithya-menon-r
Copy link

Hey @TharunKumarrA, I would like to work on this issue when the dependent issues are solved.

@TharunKumarrA
Copy link
Owner Author

yes, @adithya-menon-r you can start working on this after the dependency issues are resolved, but as you can hold up only upto 2 issues at a time. I would suggest you to take up issues that you can work on now. Or if you are ok with it I can still assign you to this issue.

@adithya-menon-r
Copy link

Makes sense @TharunKumarrA. I'll work on other issues until the dependent ones are solved... Thanks!

@TharunKumarrA
Copy link
Owner Author

Yeah cool

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

No branches or pull requests

2 participants