Graphite/frontend/src/components
Keavon Chambers 2f4aef34e5
Add Table<Color> as a graphical type (#3033)
* Reduce code duplication in bounding box impls on Table

* Working Table<Color> rendering in the graph

* Implement color and fix other rendering with Vello and polish
2025-08-10 01:34:33 -07:00
..
floating-menus Eliminate bare Graphic and Artboard graph data by making Merge and Artboard nodes internally use tables (#2996) 2025-08-05 02:24:12 -07:00
layout Tidy up the Layers panel with a new bottom bar 2025-05-21 04:14:01 -07:00
panels Desktop: Fix the Text tool not working with the hole punch (#3012) 2025-08-07 13:49:03 +02:00
views Port node graph wires to the backend and improve graph UI performance (#2795) 2025-07-04 22:53:37 -07:00
widgets Rename the Group type to Graphic everywhere (#3009) 2025-08-05 20:55:15 -07:00
window Desktop: Add the transparent viewport hole punch and hook up window button plumbing (#2949) 2025-07-28 02:13:32 -07:00
Editor.svelte Add Table<Color> as a graphical type (#3033) 2025-08-10 01:34:33 -07:00
README.md Rename and reorganize several widgets (#1462) 2023-11-18 04:34:30 -08:00

README.md

Overview of /frontend/src/components/

Each component represents a (usually reusable) part of the Graphite editor GUI. These all get mounted in Editor.svelte (in the /src directory above this one).

Floating Menus: floating-menus/

The temporary UI areas with dark backgrounds which hover over the top of the editor window content. Examples include menu lists, popovers, and dialogs.

Layout: layout/

Useful containers that control the flow of content held within.

Panels: panels/

The dockable tabbed regions like the Document, Properties, Layers, and Node Graph panels.

Widgets: widgets/

The interactive input items used to display information and provide user control.

Window: window/

The building blocks for the Title Bar, Workspace, and Status Bar within an editor application window.

Svelte tips and tricks

This section contains a growing list of quick reference information for helpful Svelte solutions and best practices. Feel free to add to this to help contributors learn things, or yourself remember tricks you'll likely forget in a few months.

Bi-directional props

The component declares this:

// The dispatcher that sends the changed value as a custom event to the parent
const dispatch = createEventDispatcher<{ theBidirectionalProperty: number }>();

// The prop
export let theBidirectionalProperty: number;

// Called only when `theBidirectionalProperty` is changed from outside this component via its props
$: console.log(theBidirectionalProperty);

// Example of a method that would update the value
function doSomething() {
	dispatch("theBidirectionalProperty", SOME_NEW_VALUE);
},

Users of the component do this for theCorrespondingDataEntry to be a two-way binding:

let theCorrespondingDataEntry = 42;
<DropdownInput
	theBidirectionalProperty={theCorrespondingDataEntry}
	on:theBidirectionalProperty={({ detail }) => { theCorrespondingDataEntry = detail; }}
/>