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

Convert formulas into values #75

Open
dimassuarez opened this issue Dec 6, 2024 · 1 comment
Open

Convert formulas into values #75

dimassuarez opened this issue Dec 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dimassuarez
Copy link

Is your feature request related to a problem?

When entering formulas into a CSV file using the jupyterlab-spreadsheet-editor extension, the numerical results can be seen in the CSV viewer / editor, but the corresponding CSV file contains only the formulas.

1fb48407305b3d2bee0e25ae17d688b0a47d79bc

To ease the usage or export of the augmented CSV files, it would be interesting to have to option of converting formulas into values.

Describe the solution you'd like

For the sake of simplicity and keeping in mind the usage of this extension by fresh students in science labs, it would be nice to add another button on the tools bar for converting the formulas of selected cells into numerical values

Thanks a lot in advance!

@dimassuarez dimassuarez added the enhancement New feature or request label Dec 6, 2024
@krassowski
Copy link
Collaborator

To add a button we use code like this:

const addRowButton = new ToolbarButton({
icon: addRowIcon,
onClick: () => {
this.content.jexcel!.insertRow();
this.content.updateModel();
},
tooltip: this._trans.__('Insert a row at the end')
});
this.toolbar.addItem('spreadsheet:insert-row', addRowButton);

To convert formulas to values I think we would need to iterate over every cell and execute executeFormula function documented in https://jspreadsheet.com/docs/formulas and update values with it. PRs welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants