Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StippleActiveTables

StippleActiveTables is a plugin for Stipple that provides reactive integration with Active-Table, a powerful interactive table component for displaying and editing tabular data.

Active-Table is a modern, fully-featured data table component with built-in support for:

  • Interactive editing
  • Column sorting and filtering
  • Data validation
  • Formula support
  • Import/Export functionality
  • And many more features

Installation

using Pkg
Pkg.add("StippleActiveTables")

Features

  • Seamless integration between Julia DataFrames and Active-Table
  • Reactive two-way data binding with Stipple
  • Automatic synchronization of edits back to Julia
  • Simple API with minimal boilerplate

Usage

Basic Example

using Stipple, Stipple.ReactiveTools, StippleUI
using StippleActiveTables
using DataFrames

# Create a sample DataFrame
df = DataFrame(
    team1 = ["Team A", "Team B"],
    team2 = ["Team C", "Team D"],
    score1 = [85, 90],
    score2 = [80, 95]
)

@app MyApp begin
    @in activetable = ActiveTable(df)
end

@deps MyApp StippleActiveTables

ui() = htmldiv([
    h3(style = "margin-bottom: 1em", "StippleActiveTables Demo")
    activetable(:activetable)
])

@page("/", ui, model = MyApp)

up()

API

Types

ActiveTable

ActiveTable(df::DataFrame)

Wraps a DataFrame to make it compatible with the Active-Table component. The data is automatically synchronized between Julia and the browser.

Functions

activetable(data::Symbol, args...; kwargs...)

Renders an Active-Table component bound to a reactive ActiveTable variable.

Arguments:

  • data::Symbol: Symbol referring to an ActiveTable reactive variable in your model

Example:

@app MyApp begin
    @in my_table = ActiveTable(DataFrame(a=[1,2,3], b=[4,5,6]))
end

ui() = activetable(:my_table)

How It Works

StippleActiveTables automatically handles the conversion between Julia's DataFrames and Active-Table's expected format:

  • DataFrames are serialized as a vector of rows, with column names as the first element
  • Changes made in the browser are parsed back into a DataFrame
  • The reactive binding keeps everything synchronized in real-time

Dependencies

License

See LICENSE file for details.

Author

Helmut Hänsel

About

Include ActiveTable in Genie/Stipple projects

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages