All Projects → ekzhang → percival

ekzhang / percival

Licence: MIT License
📝 Web-based, reactive Datalog notebooks for data analysis and visualization

Programming Languages

rust
11053 projects
typescript
32286 projects
Svelte
593 projects
go
31211 projects - #10 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to percival

Trading Vue Js
💹 Hackable charting lib for traders. You can draw literally ANYTHING on top of candlestick charts.
Stars: ✭ 1,021 (+258.25%)
Mutual labels:  charts, reactive
Pluto.jl
🎈 Simple reactive notebooks for Julia
Stars: ✭ 3,430 (+1103.51%)
Mutual labels:  reactive, notebook
Spark Notebook
Interactive and Reactive Data Science using Scala and Spark.
Stars: ✭ 3,081 (+981.05%)
Mutual labels:  reactive, notebook
ipychart
The power of Chart.js with Python
Stars: ✭ 48 (-83.16%)
Mutual labels:  charts, notebook
visa-chart-components
Visa Chart Components (VCC) is an accessibility focused, framework agnostic set of data experience design systems components for the web. VCC attempts to provide a toolset to enable developers to build equal data experiences for everyone, everywhere.
Stars: ✭ 81 (-71.58%)
Mutual labels:  charts
rx-ease
Spring animation operator for rxjs 🦚✨
Stars: ✭ 16 (-94.39%)
Mutual labels:  reactive
springboot2-reactive-kotlin
A simple counter using Spring Boot 2 and Kotlin
Stars: ✭ 19 (-93.33%)
Mutual labels:  reactive
graffeine
Simple, modular graphs for iOS.
Stars: ✭ 22 (-92.28%)
Mutual labels:  charts
olliePy
OlliePy is a python package which can help data scientists in exploring their data and evaluating and analysing their machine learning experiments by utilising the power and structure of modern web applications. The data scientist only needs to provide the data and any required information and OlliePy will generate the rest.
Stars: ✭ 46 (-83.86%)
Mutual labels:  charts
kit
C++11 libs: await, channels, reactive/signals, timelines, alarms, logging, args, etc.
Stars: ✭ 21 (-92.63%)
Mutual labels:  reactive
hsdatalog
BDD-based implementation of Datalog
Stars: ✭ 30 (-89.47%)
Mutual labels:  datalog
technote
My technique notebook.
Stars: ✭ 125 (-56.14%)
Mutual labels:  notebook
rfrappe
htmlwidget for frappe charts js library
Stars: ✭ 24 (-91.58%)
Mutual labels:  charts
docker-stacks
Ready-to-run Docker images containing Jupyter applications
Stars: ✭ 6,573 (+2206.32%)
Mutual labels:  notebook
el.js
✨ Higher-order elements powered by transclusion.
Stars: ✭ 35 (-87.72%)
Mutual labels:  reactive
noted
Markdown note-taking with syntax highlighting and real-time preview.
Stars: ✭ 22 (-92.28%)
Mutual labels:  notebook
MetaRx
Reactive data structures for Scala and Scala.js
Stars: ✭ 36 (-87.37%)
Mutual labels:  reactive
yql-plus
The YQL+ parser, execution engine, and source SDK.
Stars: ✭ 36 (-87.37%)
Mutual labels:  query-language
react-mobx-router5
React components for routing solution using router5 and mobx
Stars: ✭ 58 (-79.65%)
Mutual labels:  reactive
vue3-demo
💡 vue3新特性示例: 响应式API、组合式API、TodoMVC
Stars: ✭ 114 (-60%)
Mutual labels:  reactive

Percival

Percival is a declarative data query and visualization language. It provides a reactive, web-based notebook environment for exploring complex datasets, producing interactive graphics, and sharing results.


percival.ink

Percival combines the flexibility of Datalog as a query language for relational data with the beauty of exploratory visualization grammars. These declarative components interact through a reactive dataflow system. Because Percival uses web technologies (including Web Workers for multithreaded, sandboxed execution), fully-interactive notebooks can be shared with anyone on the Internet, making data analyses more tangible to others.

At the core of Percival is a custom Datalog compiler, built with Rust and WebAssembly, which integrates with its notebook runtime. This compiles the query language to JavaScript through a staged evaluation process that also allows users to embed their own JavaScript code. The interface aims to be lightweight, friendly, and accessible, and there is no hidden workspace state.

This is an early-stage research project, and we welcome your feedback, so please feel free to say hello at our discussions page!

Getting Started

If you've gotten to this point in the README, please first try out the web application and demo notebook at percival.ink! The information below is technical documentation intended for contributors.

Building Percival from scratch requires Node v16+, NPM v8+, Rust 1.56+, Cargo, and Wasm-Pack installed on your machine. To build the Rust/WebAssembly portion of the project, use the command:

wasm-pack build --target web crates/percival-wasm

Next, run npm install to install JavaScript dependencies, then run the following command to start the development server:

npm run dev

This should open a Percival notebook in your browser, with live reloading.

Architecture

This section outlines the high-level technical design of Percival.

User Interface

Percival is a client-side web application running fully in the user's browser. The notebook interface is built with Svelte and styled with Tailwind CSS. It relies on numerous other open source libraries, including CodeMirror 6 for live code editing and syntax highlighting, Remark and KaTeX for Markdown rendering, and Vite for frontend bundling.

The code for the web frontend is located in src/, which contains a mix of Svelte (in src/components/) and TypeScript (in src/lib/). These modules are bundled into a static website at build time, and there is no dynamic server-side rendering.

JIT Compiler

Users write code cells in a custom dialect of Datalog, and they are translated to JavaScript by a Rust compiler, which itself is compiled to WebAssembly using wasm-bindgen. The Percival compiler's code is located in the crates/ folder. For ergonomic parsing with human-readable error messages, the compiler relies on chumsky, a parser combinator library.

After the percival-wasm crate is compiled to WebAssembly, it can be used by client-side code. The compiler processes code cells, then sends the resulting JavaScript to separate web workers that sandbox the code and execute it just-in-time. As the user writes queries, their notebook automatically tracks inter-cell dependencies and evaluates cells in topological order, spawning / terminating worker threads on demand.

Data Visualization

Plotting is done using a specialized web worker that runs JavaScript code with access to the Observable Plot library. In order for this library (and D3) to run in a worker context, we patch the global document with a lightweight virtual DOM implementation ported from Domino.

Deployment

In production, the main branch of this repository is continuously deployed to percival.ink via Vercel, which hosts the static website. It also runs a serverless function (see api/index.go) that allows users to share notebooks through the GitHub Gist API.

Development

To build, lint, and format the Svelte project, use the corresponding scripts:

npm run build
npm run check
npm run format

For the Rust crates, you can run unit tests for the core functionality with:

cargo test

You can also run tests for the WebAssembly component using a headless Chrome or Firefox browser:

wasm-pack test --chrome --headless crates/percival-wasm

Since Percival uses a Rust-based compiler but outputs JavaScript, the easiest way to test code generation functionality is within the browser. We use Mocha and Puppeteer for this, and tests can be run with:

npm test

Acknowledgements

Created by Eric Zhang (@ekzhang1). Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].