Improvement of the sum / mf settings
- Dominant language
- TypeScript
- Stars
- 80
- Forks
- 34
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 36
Description
Currently when trying to assign a molecule you need to draw the molecule but you need also in all the ranges, correlations or integral to setup the molecular formula. This is really annoying ...
The default behaviour should be that the molecular formula of the first molecule is taken as default.
## Current status:
In ranges we have the following options:
```json
"options": {
"sum": 100,
"isSumConstant": true
}
```
In Correlations we have the following options:
```json
"options": {
"tolerance": {
"C": 0.25,
"H": 0.02,
"N": 0.25,
"F": 0.25,
"Si": 0.25,
"P": 0.25
},
"mf": "C8H10"
}
```
## Suggested changes for Ranges (and Integrals)
```json
"options": {
"sum": 100,
"isSumConstant": true
}
```
Becomes
```
"options": {
"mf": {
value: 'C10H20O3', // continuously updated if auto is defined
auto: 0, // if the auto parameter is defined it will take the MF of the corresponding draw molecule.
},
"sum": undefined, // we still want to allow to force the sum when you click twice of an integration. If you force the "sum" the mf.auto should become undefined
"isSumConstant": true
}
```
and create a smart function to get the sum
```
function getSum(mf, nucleus) {
if (!mf) return 100;
// insert here the smart code that allows to know the number of atoms for a specific nucleus
// don't know if it already exists in the project
}
```
In the format migration we just remove the old sum parameter.
## Suggested changes for Summary
- use the same 'sum icon'
- use the same component to set the molecular formula as for integral / ranges
- migrate the format so that mf becomes an object
```
"options": {
"mf": {
value: 'C10H20O3', // continuously updated if auto is defined
auto: 0, // if the auto parameter is defined it will take the MF of the corresponding draw molecule
},
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.