Published
Edited
Nov 27, 2020
1 star
Insert cell
md `# NLG in Observable: RosaeNLG POC`
Insert cell
md `## Define some data`
Insert cell
fruits = ['avocado', 'mango', 'pear', 'cherry'];
Insert cell
md `## Define your template (or load it from somewhere)`
Insert cell
Insert cell
md `## Import RosaeNLG lib, for a language and with template compilation ability`
Insert cell
rosaenlg = require('https://unpkg.com/rosaenlg@1.20.2/dist/rollup/rosaenlg_tiny_en_US_1.20.2_comp.js');
Insert cell
md `## Check that import is ok`
Insert cell
version = rosaenlg.getRosaeNlgVersion();
Insert cell
md `## Render some text`
Insert cell
{
let rendered = rosaenlg.render(template, {
language: 'en_US',
fruits: fruits
});
return md`**${rendered}**`
}
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more