Installation
To install SQL Frames integrations with Docusaurus, first install the following packages.
npm install @sqlframes/docusaurus-plugin@latest @sqlframes/docusaurus-components@latest
or
yarn add @sqlframes/docusaurus-plugin@latest @sqlframes/docusaurus-components@latest
Configuration
In the docusaurus.config.json
file, add the following
plugins: [
'@sqlframes/docusaurus-plugin'
],
In addition customFields
fields of the config
JSON node should be configured. Sample code below
customFields: {
sqlframes: {
version: 'latest', // or any valid version of @sqlframes/repl-app such as 0.12.1
license: {"data":{"domain":"localhost","expiry_date":"2022/09/30"},"signature":"CC1gnQL48/Vlt/RoPYTfKA5KSA191foKpl5mlYLHtj53kpZTIj6pnr4+KYiRmuetkx12HWHNzcBMLsvmt8dv6A=="} // this is the SQL Frames license key
}
},
Usage
Within docusaurus content such as pages, docs or blog posts, it is possible to embed analytics components that completely run within the browser using this package. The code looks as follows.
import { REPL } from '@sqlframes/docusaurus-components';
<REPL>
return DataFrame.fromURL('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.csv');
</REPL>
Rest of the documentation provides more examples of using REPL
component to create dashboards, storyboards and analytics apps.