Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import panel as pn

from panel_reactflow import ReactFlow

pn.extension()
pn.extension("jsoneditor")

nodes = [
{
Expand Down
6 changes: 5 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ generate forms, and plug in editors where you need full control.

## Quickstart

!!! tip "JSONEditor Extension Required"
ReactFlow requires the `jsoneditor` Panel extension for editing node and edge data.
Always call `pn.extension("jsoneditor")` at the start of your application.

```python
import panel as pn
from panel_reactflow import NodeType, ReactFlow

pn.extension()
pn.extension("jsoneditor")

task_schema = {
"type": "object",
Expand Down
6 changes: 6 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ pip install panel-reactflow

## Minimal app

!!! note "Required Extension"
ReactFlow uses Panel's JSONEditor widget for editing node and edge data.
You must call `pn.extension("jsoneditor")` before creating ReactFlow instances
to ensure the extension loads correctly. This should be done early in your
application, typically right after your imports.

```python
import panel as pn

Expand Down
7 changes: 5 additions & 2 deletions src/panel_reactflow/schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pandas as pd
import panel as pn
import param # type: ignore
from panel.layout.base import Panel
from panel.layout.base import ListLike, Panel
from panel.pane.base import PaneBase
from panel.widgets.base import WidgetBase
from panel_material_ui import (
Expand All @@ -27,7 +27,10 @@
class JSONSchema(PaneBase):
default_layout = param.ClassSelector(
default=Paper,
class_=(Panel,),
class_=(
Panel,
ListLike,
),
is_instance=False,
doc="""
Defines the layout the model(s) returned by the pane will
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/test_ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""UI tests for ReactFlow using Playwright."""

import panel as pn
import panel.models.jsoneditor # noqa
import pytest
from panel.tests.util import serve_component, wait_until

Expand All @@ -10,8 +11,6 @@

from playwright.sync_api import expect

pn.extension()

pytestmark = pytest.mark.ui


Expand Down
Loading