@datagrok-libraries/chem-meta
Advanced tools
Comparing version 1.2.7 to 1.2.8
# chem-meta changelog | ||
## 1.2.8 (2024-11-01) | ||
### New features | ||
Add mergeSubstructs | ||
## 1.2.7 (2024-09-24) | ||
@@ -4,0 +10,0 @@ |
@@ -7,13 +7,13 @@ { | ||
"friendlyName": "Datagrok chem-meta library", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"description": "RDKit JS API, utils for molfiles parsing", | ||
"dependencies": { | ||
"wu": "latest" | ||
"wu": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/wu": "latest", | ||
"@typescript-eslint/eslint-plugin": "latest", | ||
"@typescript-eslint/parser": "latest", | ||
"eslint": "latest", | ||
"eslint-config-google": "latest", | ||
"@types/wu": "^2.1.44", | ||
"@typescript-eslint/eslint-plugin": "^8.8.1", | ||
"@typescript-eslint/parser": "^8.8.1", | ||
"eslint": "^8.57.1", | ||
"eslint-config-google": "^0.14.0", | ||
"ts-loader": "^9.2.6", | ||
@@ -20,0 +20,0 @@ "typescript": "^4.2.3" |
@@ -11,2 +11,3 @@ export interface ISubstruct { | ||
} | ||
export declare function mergeSubstructs(substructs: ISubstruct[]): ISubstruct; | ||
export interface ISubstructProvider { | ||
@@ -13,0 +14,0 @@ /** To highlight */ |
@@ -0,1 +1,12 @@ | ||
export function mergeSubstructs(substructs) { | ||
var _a, _b, _c, _d; | ||
const res = { atoms: [], bonds: [], highlightAtomColors: {}, highlightBondColors: {} }; | ||
for (const s of substructs) { | ||
res.atoms = [...(_a = res.atoms) !== null && _a !== void 0 ? _a : [], ...(_b = s.atoms) !== null && _b !== void 0 ? _b : []]; | ||
res.bonds = [...(_c = res.bonds) !== null && _c !== void 0 ? _c : [], ...(_d = s.bonds) !== null && _d !== void 0 ? _d : []]; | ||
res.highlightAtomColors = Object.assign(Object.assign({}, res.highlightAtomColors), s.highlightAtomColors); | ||
res.highlightBondColors = Object.assign(Object.assign({}, res.highlightBondColors), s.highlightBondColors); | ||
} | ||
return res; | ||
} | ||
/** Return global monomer hover object. null - no monomer hover, negative seqPosition - hovered on not in a*/ | ||
@@ -20,2 +31,2 @@ export function getMonomerHover() { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ0eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE4QkEsNkdBQTZHO0FBQzdHLE1BQU0sVUFBVSxlQUFlOztJQUM3QixPQUFPLE1BQUEsTUFBTSxDQUFDLGFBQWEsbUNBQUksSUFBSSxDQUFDO0FBQ3RDLENBQUM7QUFFRCxNQUFNLFVBQVUsZUFBZSxDQUFDLEtBQThCO0lBQzVELE1BQU0sQ0FBQyxhQUFhLEdBQUcsS0FBSyxDQUFDO0FBQy9CLENBQUM7QUFFRCxNQUFNLFVBQVUsb0JBQW9CLENBQUMsT0FBWSxFQUFFLGlCQUFxQztJQUN0RixJQUFJLElBQUksR0FBRyxPQUFPLDJEQUErQixDQUFDO0lBQ2xELElBQUksQ0FBQyxJQUFJO1FBQ1AsSUFBSSxHQUFHLE9BQU8sMkRBQStCLEdBQUcsRUFBRSxDQUFDO0lBQ3JELElBQUksQ0FBQyxJQUFJLENBQUMsaUJBQWlCLENBQUMsQ0FBQztJQUM3QixPQUFPLDJEQUErQixHQUFHLElBQUksQ0FBQztBQUNoRCxDQUFDO0FBRUQsTUFBTSxVQUFVLHFCQUFxQixDQUFDLE9BQVk7O0lBQ2hELE9BQU8sTUFBQSxPQUFPLGFBQVAsT0FBTyx1QkFBUCxPQUFPLDJEQUFpQyxtQ0FBSSxFQUFFLENBQUM7QUFDeEQsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7Q2hlbVRlbXBzfSBmcm9tICcuL2NvbnN0cyc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgSVN1YnN0cnVjdCB7XG4gIGF0b21zPzogbnVtYmV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