MCPcopy Index your code
hub / github.com/PoignardAzur/panoramix

github.com/PoignardAzur/panoramix @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
464 symbols 907 edges 48 files 76 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Panoramix

crates.io docs.rs license chat

Note: The development of Panoramix is currently (as of December 2022) on hold as I work on masonry. I do intend to resume eventually.

Panoramix is an experimental GUI framework for the Rust programming language.

The framework is data-driven and declarative, drawing some inspiration from React, and implemented on top of the Druid toolkit (hence the name).

It aims to use simple, idiomatic Rust: Panoramix doesn't use unsafe code, cells, mutexes, or DSL macros.

Getting started

Here is our "hello world" example:

use panoramix::elements::{Button, Label};
use panoramix::{component, Column, CompCtx, Element, NoEvent, RootHandler};

#[component]
fn HelloBox(ctx: &CompCtx, _props: ()) -> impl Element<Event = NoEvent> {
    let md = ctx.use_metadata::<NoEvent, ()>();
    Column!(
        Label::new("Hello world!"),
        Button::new("Say hello").on_click(md, |_, _| {
            println!("Hello world");
        })
    )
}

fn main() -> Result<(), panoramix::PlatformError> {
    RootHandler::new(HelloBox).with_tracing(true).launch()
}

See the documentation for details, and the Writing a new component tutorial.

Contributing

Issues and PRs are welcome.

PRs that add "basic block" widgets in particular will be appreciated.

See CONTRIBUTING.md for the rules to follow when making a PR. Issues don't have a mandatory format, but if you submit one, please follow common-sense rules: be polite, be professional, have a plan to kill everyone you meet, and if you have a problem, please include detailed steps to reproduce.

See ARCHITECTURE.md for a high-level presentation of the project code.

To ask questions and discuss development work, go to Druid's Zulip chat, in the #panoramix channel.

Usage

In your Cargo.toml, add the following:

panoramix = "0.1.0"

If you want the bleeding-edge version, add the following instead:

panoramix = { git = "https://github.com/PoignardAzur/panoramix.git" }

Note for Linux users: Panoramix is built on top of Druid, using the GTK backend, which requires a dev version of GTK3. See GTK installation page for install info.

Eg on Ubuntu-based distributions, you should run sudo apt install libgtk-3-dev.

Roadmap

The short term roadmap is:

  • Streamline styling options, especially for common low-effort use cases.
  • Implement two-way bindings.
  • Refactor event handling.
  • Finish doc.
  • Improve performance.
  • Write benchmarks.

On the longer timescale, there are two broad goals:

  • Achieve feature parity with React.
  • Use Panoramix to build a debugging framework, similar to chrome-devtools. TODO - Write blog posts about this.

See ROADMAP.md for details.

Authors

This crate has been almost entirely written by Olivier FAURE. Any other contributor will be added to AUTHORS.md.

This project has been possible thanks to the extremely clean and approchable work of Raph Levien and Colin Rofls, as well as some mentoring on their part, and general interaction with the Druid community. In particular, Panoramix is inspired from Crochet.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 276
Function 94
Class 77
Interface 12
Enum 5

Languages

Rust100%

Modules by API surface

src/elements/any_element.rs28 symbols
src/elements/compute_diff.rs22 symbols
src/widgets/clickable_widget.rs21 symbols
src/widgets/styled_container.rs20 symbols
src/widgets/single_widget.rs18 symbols
src/widgets/textbox_widget.rs17 symbols
src/widgets/button_widget.rs16 symbols
src/elements/component.rs16 symbols
src/test_harness.rs15 symbols
src/elements/with_event.rs15 symbols
src/elements/element_list.rs15 symbols
src/root_handler.rs14 symbols

For agents

$ claude mcp add panoramix \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page