Skip to content

Commit adb15dc

Browse files
AmirMohammad CheraghaliAmirMohammad Cheraghali
authored andcommitted
Fix: Use timestamped scheme ID for charge coloring to avoid conflicts
1 parent 21f0f11 commit adb15dc

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/components/ProteinViewer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,11 +1310,10 @@ export const ProteinViewer = forwardRef<ProteinViewerRef, ProteinViewerProps>(({
13101310
chainIdx++;
13111311
});
13121312
} else if (currentColoring === 'charge') {
1313-
// CHARGE COLORING: Proper NGL ColorMaker scheme
1314-
// This works for ALL representation types including Cartoon and Ribbon
1315-
const chargeSchemeId = "charge_scheme";
1313+
// CHARGE COLORING: Use unique timestamped ID to avoid conflicts
1314+
const chargeSchemeId = `charge_${Date.now()}`;
13161315

1317-
// Define the color scheme using NGL's ColorMaker API
1316+
// Define the color scheme
13181317
NGL.ColormakerRegistry.addScheme(function (this: any) {
13191318
this.atomColor = (atom: any) => {
13201319
const resname = atom.resname;

0 commit comments

Comments
 (0)