holonote icon indicating copy to clipboard operation
holonote copied to clipboard

Add Tabulator app

Open hoxbro opened this issue 1 month ago • 1 comments

TODOS:

  • [x] Investigate why I can't delete rows after changing it.
  • [x] Remove flickering, when updating annotation?

Delete rows from the tabulator

https://github.com/holoviz/holonote/assets/19758978/eca71408-7420-4420-9fb0-e03f08f58edb

Edit values from tabulator + sync of selection

https://github.com/holoviz/holonote/assets/19758978/2425ef01-146d-4ba1-9714-5f666acdf7c6

Code
from holonote.annotate import Annotator, SQLiteDB
import hvplot.pandas
import pandas as pd

speed_data = pd.read_parquet("../assets/example.parquet")
curve = speed_data.hvplot("TIME", "SPEED")
annotator = Annotator(
    curve,
    fields=["category"],
    connector=SQLiteDB(table_name="styling"),
)

start_time = pd.date_range("2022-06-04", "2022-06-22", periods=5)
end_time = start_time + pd.Timedelta(days=2)
data = {
    "start_time": start_time,
    "end_time": end_time,
    "category": ["A", "B", "A", "C", "B"],
}
annotator.define_annotations(pd.DataFrame(data), TIME=("start_time", "end_time"))

from holonote.app.tabulator import AnnotatorTabulator

AnnotatorTabulator(annotator)
annotator * curve

hoxbro avatar May 13 '24 17:05 hoxbro