Skip to content

Commit 6b3e475

Browse files
authored
Rename the Table type's "rows" -> "items" and "columns" -> "attributes" everywhere (#4130)
* Rename TableRow -> Item * Rename row -> item and column -> attribute throughout * Fix a few missed ones * Format
1 parent cb21e59 commit 6b3e475

26 files changed

Lines changed: 552 additions & 548 deletions

File tree

editor/src/messages/portfolio/document/data_panel/data_panel_message_handler.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fn label(x: impl Into<String>) -> Vec<LayoutGroup> {
220220
vec![LayoutGroup::row(error)]
221221
}
222222

223-
trait TableRowLayout {
223+
trait TableItemLayout {
224224
fn type_name() -> &'static str;
225225
fn identifier(&self) -> String;
226226
fn layout_with_breadcrumb(&self, data: &mut LayoutData) -> Vec<LayoutGroup> {
@@ -245,7 +245,7 @@ trait TableRowLayout {
245245
}
246246
}
247247

248-
impl<T: TableRowLayout> TableRowLayout for Table<T> {
248+
impl<T: TableItemLayout> TableItemLayout for Table<T> {
249249
fn type_name() -> &'static str {
250250
"Table"
251251
}
@@ -307,7 +307,7 @@ impl<T: TableRowLayout> TableRowLayout for Table<T> {
307307
}
308308
}
309309

310-
impl TableRowLayout for Artboard {
310+
impl TableItemLayout for Artboard {
311311
fn type_name() -> &'static str {
312312
"Artboard"
313313
}
@@ -323,7 +323,7 @@ impl TableRowLayout for Artboard {
323323
}
324324
}
325325

326-
impl TableRowLayout for Graphic {
326+
impl TableItemLayout for Graphic {
327327
fn type_name() -> &'static str {
328328
"Graphic"
329329
}
@@ -353,7 +353,7 @@ impl TableRowLayout for Graphic {
353353
}
354354
}
355355

356-
impl TableRowLayout for Vector {
356+
impl TableItemLayout for Vector {
357357
fn type_name() -> &'static str {
358358
"Vector"
359359
}
@@ -512,7 +512,7 @@ impl TableRowLayout for Vector {
512512
}
513513
}
514514

515-
impl TableRowLayout for Raster<CPU> {
515+
impl TableItemLayout for Raster<CPU> {
516516
fn type_name() -> &'static str {
517517
"Raster"
518518
}
@@ -543,7 +543,7 @@ impl TableRowLayout for Raster<CPU> {
543543
}
544544
}
545545

546-
impl TableRowLayout for Raster<GPU> {
546+
impl TableItemLayout for Raster<GPU> {
547547
fn type_name() -> &'static str {
548548
"Raster"
549549
}
@@ -556,7 +556,7 @@ impl TableRowLayout for Raster<GPU> {
556556
}
557557
}
558558

559-
impl TableRowLayout for Color {
559+
impl TableItemLayout for Color {
560560
fn type_name() -> &'static str {
561561
"Color"
562562
}
@@ -576,7 +576,7 @@ impl TableRowLayout for Color {
576576
}
577577
}
578578

579-
impl TableRowLayout for GradientStops {
579+
impl TableItemLayout for GradientStops {
580580
fn type_name() -> &'static str {
581581
"Gradient"
582582
}
@@ -596,7 +596,7 @@ impl TableRowLayout for GradientStops {
596596
}
597597
}
598598

599-
impl TableRowLayout for f64 {
599+
impl TableItemLayout for f64 {
600600
fn type_name() -> &'static str {
601601
"Number (f64)"
602602
}
@@ -611,7 +611,7 @@ impl TableRowLayout for f64 {
611611
}
612612
}
613613

614-
impl TableRowLayout for u8 {
614+
impl TableItemLayout for u8 {
615615
fn type_name() -> &'static str {
616616
"Byte"
617617
}
@@ -624,7 +624,7 @@ impl TableRowLayout for u8 {
624624
}
625625
}
626626

627-
impl TableRowLayout for u32 {
627+
impl TableItemLayout for u32 {
628628
fn type_name() -> &'static str {
629629
"Number (u32)"
630630
}
@@ -639,7 +639,7 @@ impl TableRowLayout for u32 {
639639
}
640640
}
641641

642-
impl TableRowLayout for u64 {
642+
impl TableItemLayout for u64 {
643643
fn type_name() -> &'static str {
644644
"Number (u64)"
645645
}
@@ -655,7 +655,7 @@ impl TableRowLayout for u64 {
655655
}
656656
}
657657

658-
impl TableRowLayout for bool {
658+
impl TableItemLayout for bool {
659659
fn type_name() -> &'static str {
660660
"Bool"
661661
}
@@ -670,7 +670,7 @@ impl TableRowLayout for bool {
670670
}
671671
}
672672

673-
impl TableRowLayout for String {
673+
impl TableItemLayout for String {
674674
fn type_name() -> &'static str {
675675
"String"
676676
}
@@ -689,7 +689,7 @@ impl TableRowLayout for String {
689689
}
690690
}
691691

692-
impl TableRowLayout for Option<f64> {
692+
impl TableItemLayout for Option<f64> {
693693
fn type_name() -> &'static str {
694694
"Option<f64>"
695695
}
@@ -704,7 +704,7 @@ impl TableRowLayout for Option<f64> {
704704
}
705705
}
706706

707-
impl TableRowLayout for DVec2 {
707+
impl TableItemLayout for DVec2 {
708708
fn type_name() -> &'static str {
709709
"Vec2"
710710
}
@@ -719,7 +719,7 @@ impl TableRowLayout for DVec2 {
719719
}
720720
}
721721

722-
impl TableRowLayout for Vec2 {
722+
impl TableItemLayout for Vec2 {
723723
fn type_name() -> &'static str {
724724
"Vec2"
725725
}
@@ -734,7 +734,7 @@ impl TableRowLayout for Vec2 {
734734
}
735735
}
736736

737-
impl TableRowLayout for DAffine2 {
737+
impl TableItemLayout for DAffine2 {
738738
fn type_name() -> &'static str {
739739
"Transform"
740740
}
@@ -749,7 +749,7 @@ impl TableRowLayout for DAffine2 {
749749
}
750750
}
751751

752-
impl TableRowLayout for Affine2 {
752+
impl TableItemLayout for Affine2 {
753753
fn type_name() -> &'static str {
754754
"Transform"
755755
}
@@ -765,7 +765,7 @@ impl TableRowLayout for Affine2 {
765765
}
766766
}
767767

768-
impl TableRowLayout for BlendMode {
768+
impl TableItemLayout for BlendMode {
769769
fn type_name() -> &'static str {
770770
"BlendMode"
771771
}
@@ -780,7 +780,7 @@ impl TableRowLayout for BlendMode {
780780
}
781781
}
782782

783-
impl TableRowLayout for GradientType {
783+
impl TableItemLayout for GradientType {
784784
fn type_name() -> &'static str {
785785
"GradientType"
786786
}
@@ -795,7 +795,7 @@ impl TableRowLayout for GradientType {
795795
}
796796
}
797797

798-
impl TableRowLayout for GradientSpreadMethod {
798+
impl TableItemLayout for GradientSpreadMethod {
799799
fn type_name() -> &'static str {
800800
"GradientSpreadMethod"
801801
}
@@ -820,7 +820,7 @@ fn node_id_display_label(node_id: NodeId, network_interface: &NodeNetworkInterfa
820820
}
821821
}
822822

823-
impl TableRowLayout for NodeId {
823+
impl TableItemLayout for NodeId {
824824
fn type_name() -> &'static str {
825825
"NodeId"
826826
}
@@ -932,7 +932,7 @@ impl TableRowLayout for NodeId {
932932
}
933933
}
934934

935-
/// Invokes another macro with the full list of `TableRowLayout`-implementing types whose values may appear
935+
/// Invokes another macro with the full list of `TableItemLayout`-implementing types whose values may appear
936936
/// as attribute values. Both the value-rendering and drilldown-navigation dispatchers iterate this list,
937937
/// so adding a new attribute-displayable type is a single edit here.
938938
macro_rules! known_table_row_types {
@@ -984,9 +984,9 @@ fn display_value_override(any: &dyn Any) -> Option<String> {
984984
}
985985

986986
/// Type-dispatched widget for displaying an attribute value in a `Table<T>` item.
987-
/// Delegates to [`TableRowLayout::value_widget`] so the same widget code is shared between
988-
/// element-column rendering and attribute-column rendering. Returns `None` for unrecognized types so the
989-
/// caller can fall back to a debug-formatted [`TextLabel`].
987+
/// Delegates to [`TableItemLayout::value_widget`] so the same widget code is shared between
988+
/// element-column rendering and attribute-column rendering. Returns `None` for unrecognized
989+
/// types so the caller can fall back to a debug-formatted [`TextLabel`].
990990
fn dispatch_value_widget(any: &dyn Any, target: PathStep, data: &LayoutData) -> Option<WidgetInstance> {
991991
macro_rules! check {
992992
( $($ty:ty),* $(,)? ) => {
@@ -1041,7 +1041,7 @@ fn table_node_id_path_layout_with_breadcrumb(path: &Table<NodeId>, data: &mut La
10411041
}
10421042

10431043
/// Type-dispatched recursion into an attribute value for the Data panel breadcrumb navigation.
1044-
/// Mirrors [`dispatch_value_widget`] but routes to [`TableRowLayout::layout_with_breadcrumb`].
1044+
/// Mirrors [`dispatch_value_widget`] but routes to [`TableItemLayout::layout_with_breadcrumb`].
10451045
/// Returns `None` for unrecognized types.
10461046
fn drilldown_attribute_layout(any: &dyn Any, data: &mut LayoutData) -> Option<Vec<LayoutGroup>> {
10471047
// `Table<NodeId>` is interpreted as a path (e.g. the `editor:layer_path` attribute), so each item's NodeId value

node-graph/graph-craft/src/document/value.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,16 @@ macro_rules! tagged_value {
142142
Self::from_type_or_none(&Type::Concrete(td)).to_dynany()
143143
}
144144
Self::F64Array(values) => {
145-
let table: Table<f64> = values.into_iter().map(core_types::table::TableRow::new_from_element).collect();
145+
let table: Table<f64> = values.into_iter().map(core_types::table::Item::new_from_element).collect();
146146
Box::new(table)
147147
}
148148
Self::Color(color) => {
149-
let table: Table<Color> = color.into_iter().map(core_types::table::TableRow::new_from_element).collect();
149+
let table: Table<Color> = color.into_iter().map(core_types::table::Item::new_from_element).collect();
150150
Box::new(table)
151151
}
152152
Self::Gradient(stops) => Box::new(Table::<GradientStops>::new_from_element(stops)),
153153
Self::BrushStrokes(strokes) => {
154-
let table: Table<BrushStroke> = strokes.into_iter().map(core_types::table::TableRow::new_from_element).collect();
154+
let table: Table<BrushStroke> = strokes.into_iter().map(core_types::table::Item::new_from_element).collect();
155155
Box::new(table)
156156
}
157157
// =======================
@@ -163,7 +163,7 @@ macro_rules! tagged_value {
163163
// =======================
164164
Self::RenderOutput(x) => Box::new(x),
165165
Self::NodeIdPath(path) => {
166-
let table: Table<NodeId> = path.into_iter().map(core_types::table::TableRow::new_from_element).collect();
166+
let table: Table<NodeId> = path.into_iter().map(core_types::table::Item::new_from_element).collect();
167167
Box::new(table)
168168
}
169169
Self::DocumentNode(node) => Box::new(node),
@@ -191,16 +191,16 @@ macro_rules! tagged_value {
191191
Self::from_type_or_none(&Type::Concrete(td)).to_any()
192192
}
193193
Self::F64Array(values) => {
194-
let table: Table<f64> = values.into_iter().map(core_types::table::TableRow::new_from_element).collect();
194+
let table: Table<f64> = values.into_iter().map(core_types::table::Item::new_from_element).collect();
195195
Arc::new(table)
196196
}
197197
Self::Color(color) => {
198-
let table: Table<Color> = color.into_iter().map(core_types::table::TableRow::new_from_element).collect();
198+
let table: Table<Color> = color.into_iter().map(core_types::table::Item::new_from_element).collect();
199199
Arc::new(table)
200200
}
201201
Self::Gradient(stops) => Arc::new(Table::<GradientStops>::new_from_element(stops)),
202202
Self::BrushStrokes(strokes) => {
203-
let table: Table<BrushStroke> = strokes.into_iter().map(core_types::table::TableRow::new_from_element).collect();
203+
let table: Table<BrushStroke> = strokes.into_iter().map(core_types::table::Item::new_from_element).collect();
204204
Arc::new(table)
205205
}
206206
// =======================
@@ -212,7 +212,7 @@ macro_rules! tagged_value {
212212
// =======================
213213
Self::RenderOutput(x) => Arc::new(x),
214214
Self::NodeIdPath(path) => {
215-
let table: Table<NodeId> = path.into_iter().map(core_types::table::TableRow::new_from_element).collect();
215+
let table: Table<NodeId> = path.into_iter().map(core_types::table::Item::new_from_element).collect();
216216
Arc::new(table)
217217
}
218218
Self::DocumentNode(node) => Arc::new(node),

node-graph/interpreted-executor/src/node_registry.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use graphene_std::raster::color::Color;
1616
use graphene_std::raster::*;
1717
use graphene_std::raster::{CPU, Raster};
1818
use graphene_std::render_node::RenderIntermediate;
19-
use graphene_std::table::{AttributeColumnDyn, AttributeValueDyn, Table, TableDyn};
19+
use graphene_std::table::{AttributeDyn, AttributeValueDyn, Table, TableDyn};
2020
use graphene_std::transform::Footprint;
2121
use graphene_std::uuid::NodeId;
2222
use graphene_std::vector::Vector;
@@ -42,19 +42,19 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
4242
#[cfg(feature = "gpu")]
4343
convert_node!(from: Table<Raster<GPU>>, to: Table<Graphic>),
4444
// Type-erased attribute column conversions for the `Attach Attribute` node, so it monomorphizes only over the destination table type.
45-
convert_node!(from: Table<Artboard>, to: AttributeColumnDyn),
46-
convert_node!(from: Table<Graphic>, to: AttributeColumnDyn),
47-
convert_node!(from: Table<Vector>, to: AttributeColumnDyn),
48-
convert_node!(from: Table<Raster<CPU>>, to: AttributeColumnDyn),
49-
convert_node!(from: Table<Color>, to: AttributeColumnDyn),
50-
convert_node!(from: Table<GradientStops>, to: AttributeColumnDyn),
51-
convert_node!(from: Table<f64>, to: AttributeColumnDyn),
52-
convert_node!(from: Table<bool>, to: AttributeColumnDyn),
53-
convert_node!(from: Table<String>, to: AttributeColumnDyn),
54-
convert_node!(from: Table<DAffine2>, to: AttributeColumnDyn),
55-
convert_node!(from: Table<BlendMode>, to: AttributeColumnDyn),
56-
convert_node!(from: Table<graphene_std::vector::style::GradientType>, to: AttributeColumnDyn),
57-
convert_node!(from: Table<graphene_std::vector::style::GradientSpreadMethod>, to: AttributeColumnDyn),
45+
convert_node!(from: Table<Artboard>, to: AttributeDyn),
46+
convert_node!(from: Table<Graphic>, to: AttributeDyn),
47+
convert_node!(from: Table<Vector>, to: AttributeDyn),
48+
convert_node!(from: Table<Raster<CPU>>, to: AttributeDyn),
49+
convert_node!(from: Table<Color>, to: AttributeDyn),
50+
convert_node!(from: Table<GradientStops>, to: AttributeDyn),
51+
convert_node!(from: Table<f64>, to: AttributeDyn),
52+
convert_node!(from: Table<bool>, to: AttributeDyn),
53+
convert_node!(from: Table<String>, to: AttributeDyn),
54+
convert_node!(from: Table<DAffine2>, to: AttributeDyn),
55+
convert_node!(from: Table<BlendMode>, to: AttributeDyn),
56+
convert_node!(from: Table<graphene_std::vector::style::GradientType>, to: AttributeDyn),
57+
convert_node!(from: Table<graphene_std::vector::style::GradientSpreadMethod>, to: AttributeDyn),
5858
convert_node!(from: Table<Artboard>, to: TableDyn),
5959
convert_node!(from: Table<Graphic>, to: TableDyn),
6060
convert_node!(from: Table<Vector>, to: TableDyn),
@@ -151,7 +151,7 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
151151
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => Table<BlendMode>]),
152152
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => Table<graphene_std::vector::style::GradientType>]),
153153
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => Table<graphene_std::vector::style::GradientSpreadMethod>]),
154-
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => AttributeColumnDyn]),
154+
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => AttributeDyn]),
155155
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => AttributeValueDyn]),
156156
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => TableDyn]),
157157
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => Graphic]),
@@ -190,7 +190,7 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
190190
async_node!(graphene_core::context_modification::ContextModificationNode<_, _>, input: Context, fn_params: [Context => &PlatformEditorApi, Context => graphene_std::ContextFeatures]),
191191
async_node!(graphene_core::context_modification::ContextModificationNode<_, _>, input: Context, fn_params: [Context => RenderIntermediate, Context => graphene_std::ContextFeatures]),
192192
async_node!(graphene_core::context_modification::ContextModificationNode<_, _>, input: Context, fn_params: [Context => RenderOutput, Context => graphene_std::ContextFeatures]),
193-
async_node!(graphene_core::context_modification::ContextModificationNode<_, _>, input: Context, fn_params: [Context => AttributeColumnDyn, Context => graphene_std::ContextFeatures]),
193+
async_node!(graphene_core::context_modification::ContextModificationNode<_, _>, input: Context, fn_params: [Context => AttributeDyn, Context => graphene_std::ContextFeatures]),
194194
async_node!(graphene_core::context_modification::ContextModificationNode<_, _>, input: Context, fn_params: [Context => AttributeValueDyn, Context => graphene_std::ContextFeatures]),
195195
async_node!(graphene_core::context_modification::ContextModificationNode<_, _>, input: Context, fn_params: [Context => TableDyn, Context => graphene_std::ContextFeatures]),
196196
#[cfg(target_family = "wasm")]
@@ -216,7 +216,7 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
216216
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => Table<BlendMode>]),
217217
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => Table<graphene_std::vector::style::GradientType>]),
218218
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => Table<graphene_std::vector::style::GradientSpreadMethod>]),
219-
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => AttributeColumnDyn]),
219+
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => AttributeDyn]),
220220
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => AttributeValueDyn]),
221221
async_node!(graphene_core::memo::MemoizeNode<_, _>, input: Context, fn_params: [Context => TableDyn]),
222222
#[cfg(target_family = "wasm")]

0 commit comments

Comments
 (0)