Graphite/frontend/src/components
Laith Bahodi f17f8ddf61
Set integer ruler intervals when zoomed in (#1966)
* modify interval calculation

* modify progression and add powers of 10

* Some small tweaks

* Prevent the graph view from subdividing below 1

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-09 22:56:37 -07:00
..
floating-menus Add nondestructive vector editing (#1676) 2024-07-05 13:42:40 -07:00
layout Improve rendered SVG output syntax for better compatibility and terseness (#1880) 2024-07-30 08:28:49 -07:00
panels Improve layer panel positioning for upstream nodes (#1928) 2024-08-14 03:27:42 -07:00
views Add shifting of layers in stacks as blocks that collide and bump other layers/nodes (#1940) 2024-08-22 01:56:32 -07:00
widgets Set integer ruler intervals when zoomed in (#1966) 2024-09-09 22:56:37 -07:00
window Add layer node chains, import/export edge connectors, and refactor graph editing to go thru a NodeNetworkInterface (#1794) 2024-08-04 06:47:13 -07:00
Editor.svelte Add shifting of layers in stacks as blocks that collide and bump other layers/nodes (#1940) 2024-08-22 01:56:32 -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; }}
/>