Platform
Resources
Pricing
Sign in
Get started
Grant Nestor
Owner of Hammies, former Jupyter core developer and co-lead of Jupyter Notebook and JupyterLab teams
Workspace
Fork
Published
Libraries
By
Grant Nestor
Edited
Oct 19, 2021
Fork of
Hyperformula
5 stars
Insert cell
Insert cell
Insert cell
table
(
data
,
{
colHeaders
:
true
,
rowHeaders
:
true
,
formulas
:
{
engine
:
hf
,
sheetName
:
"Sheet1"
}
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
runFormula
=
(
formula
)
=>
{
// // Using a separate sheet
// if (hf.countSheets() < 2) {
// hf.addSheet('Queries');
// }
// hf.setCellContents({ sheet: 1, col: 0, row: 0 }, [[formula]]);
// return hf.getCellValue({ sheet: 1, col: 0, row: 0 });
// // Using named expression
// if (hf.listNamedExpressions().includes('Query')) {
// hf.changeNamedExpression('Query', formula);
// } else {
// hf.addNamedExpression('Query', formula);
// }
// return hf.getNamedExpressionValue('Query');
return
hf
.
calculateFormula
(
formula
,
0
)
;
}
Insert cell
FormulaEditor
=
async
(
doc
=
''
,
extensions
=
[
]
)
=>
{
// https://github.com/codemirror/legacy-modes
// const { StreamLanguage } = await skypack('@codemirror/stream-parser');
// const { mathematica } = await skypack(
// '@codemirror/legacy-modes/mode/mathematica'
// );
return
CodeMirror
(
doc
,
[
// StreamLanguage.define(mathematica),
...
extensions
]
)
;
}
Insert cell
Insert cell
data
=
{
const
response
=
await
fetch
(
"//raw.githubusercontent.com/vega/vega/master/docs/data/cars.json"
)
;
return
response
.
json
(
)
;
}
Insert cell
// hf = {
// const hf = HyperFormula.buildFromArray(
// viewof dataTable.hot.getSourceDataArray(),
// {
// precisionRounding: 4,
// licenseKey: 'gpl-v3'
// }
// );
// Object.keys(data[0]).forEach((column, index) => {
// const a1 = hf
// .simpleCellAddressToString({ sheet: 0, col: index, row: 0 })
// .replace(/Sheet1!([A-Z])\d/, '$1');
// hf.addNamedExpression(column, `${a1}:${a1}`);
// });
// return hf;
// }
// hf = HyperFormula.buildFromArray(viewof dataTable.hot.getSourceDataArray(), {
// precisionRounding: 4,
// licenseKey: "gpl-v3"
// })
hf
=
HyperFormula
.
buildEmpty
(
)
Insert cell
import
{
table
}
from
"@gnestor/table"
Insert cell
import
{
CodeMirror
,
skypack
}
from
'@gnestor/codemirror'
Insert cell
import
{
HyperFormula
}
from
"@gnestor/hyperformula"
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
query
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
result
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dataTable
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
runFormula
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
FormulaEditor
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
hf
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML