Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masonry - Brick submodule checklist #413

Open
8 of 10 tasks
meganindya opened this issue Sep 2, 2024 · 2 comments
Open
8 of 10 tasks

Masonry - Brick submodule checklist #413

meganindya opened this issue Sep 2, 2024 · 2 comments
Assignees

Comments

@meganindya
Copy link
Member

meganindya commented Sep 2, 2024

Brick

Config

  • (A) list all instantiation properties for each brick type
    • these are going to be constructor args for the classes (model)
    • these are things like type, labels, primary color, secondary color, etc.
  • (B) list all input state properties for each brick type
    • these are going to change during the runtime
    • these are things like highlighted, scale, etc.
  • (C) list all output state properties for each brick type
    • these will be generated based on the input state properties
    • these are things like bounding boxes, connection points, etc.
  • (D) list all mutable and immutable connection point properties for each brick type
    • these are things like type (instruction/argument), co-ordinates relative to the brick origin, etc.

Code

  • 4 concrete classes (model) one for each type
    • (A) will be the constructor args
    • there will be a method in each class that returns (A) + (B) in the current state of each model instance
    • there will be a method in each class that returns (C) in the current state of each model instance
    • there will be methods to get/set the different states
  • Extend statement and value brick classes for their corresponding shadow models
  • 1 factory function to instantiate classes (model)
    • (A) will be passed as args
    • UUIDs will be generated on instantiation
  • 1 warehouse module which would keep the map of id to instance (model)
    • add functions to add, retrieve, and delete instances
  • 1 generic React component (view)
    • (A) + (B) will be the props
  • Storybook files covering all brick types, configurations, and states
    • infinite possibilities; so all you need to show is that each property is utilised atleast once in one of the stories, e.g. no arg, one arg, two args, one missing arg, a big sized arg, no label, one long label, arg labels, no arg labels, etc.

Notes

  • In-line and in-file documentation
@Karan-Palan
Copy link
Collaborator

Karan-Palan commented Sep 3, 2024

I've compiled the properties for each brick type based on the configuration you provided. I’ve organized them into common and unique properties under each category.

(A) Instantiation Properties

Common Properties (Across All Brick Types):

  • id: Unique identifier for the brick (UUID).
  • name: Name of the brick.
  • label: Display label of the brick.
  • glyph: Icon or symbol representing the brick.
  • colorBg: Background color.
  • colorFg: Foreground color.
  • colorBgHighlight: Highlight background color.
  • colorFgHighlight: Highlight foreground color.
  • outline: Outline color.

Unique Properties:

  1. BrickBlock

    • args: Arguments for the brick, including labels and data types.
      • argId
      • argLabel
      • argTypeIncoming (enums)
    • connectAbove: Indicates if the brick can connect above.
    • connectBelow: Indicates if the brick can connect below.
  2. BrickData

    • dynamic: Indicates if the data is dynamic.
    • input: Type of input (e.g., boolean, number, string, options).
    • argTypeOutgoing
  3. BrickExpression

    • args: Arguments for the brick, including labels and data types.
    • argTypeOutgoing
  4. BrickStatement

    • args: Arguments for the brick, including labels and data types.
    • connectAbove: Indicates if the brick can connect above.
    • connectBelow: Indicates if the brick can connect below.

(B) Input State Properties

Common Properties (Across All Brick Types):

  • highlighted: Boolean indicating if the brick is highlighted.
  • scale: Current scaling factor.

Unique Properties:

  1. BrickBlock

    • argExtents (map):
      • argLengthX (optional)
      • argLengthY
    • folded: Boolean indicating if the brick is folded.
  2. BrickExpression

    • argExtents (map):
      • argLengthX (optional)
      • argLengthY

(C) Output State Properties

Common Properties (Across All Brick Types):

  • boundingBox: Bounding box of the brick.
  • connectionPoints: Connection points for attaching other bricks.

(D) Connection Point Properties

Common Connection Points (Across All Brick Types):

  • ArgsIncoming: Connection point for incoming arguments.
  • ArgsOutgoing: Connection point for outgoing arguments.

Unique Properties:

  1. BrickBlock

    • connectionPoints:
      • Top
      • Bottom
      • TopInner
      • ArgsIncoming (already common)
  2. BrickData

    • connectionPoints:
      • ArgsOutgoing (already common)
  3. BrickExpression

    • connectionPoints:
      • ArgsIncoming (already common)
      • ArgsOutgoing (already common)
  4. BrickStatement

    • connectionPoints:
      • ArgsOutgoing (already common)

I will proceed with integrating these properties into the respective classes and updating the factory and warehouse modules accordingly.

Let me know if there are any changes you'd like to see or if anything else needs to be addressed.

@Karan-Palan
Copy link
Collaborator

Updated Abstract Classes

1. BrickModel (Base Class)

  • Common Properties:

    • id: UUID
    • name: Name
    • label: Display label
    • glyph: Icon/symbol
    • colorBg: Background color
    • colorFg: Foreground color
    • colorBgHighlight: Highlight background color (new)
    • colorFgHighlight: Highlight foreground color (new)
    • outline: Outline color
  • Common State Properties:

    • highlighted: Boolean
    • scale: Scaling factor
  • Common Output Properties:

    • boundingBox: Bounding box
    • connectionPoints: Connection points

2. BrickModelArgument

  • Unique Properties:

    • dataType: Type of argument (e.g., boolean, number, string, options)
  • State Properties:

    • argExtents: Map with argLengthX (optional) and argLengthY

3. BrickModelInstruction

  • Unique Properties:

    • args: Arguments with labels and data types
    • connectAbove: Connection above
    • connectBelow: Connection below
  • State Properties:

    • argExtents: Map with argLengthX (optional) and argLengthY

4. BrickModelData

  • Unique Properties:
    • dynamic: Indicates if data is dynamic
    • input: Type of input (e.g., boolean, number, string, options)

5. BrickModelExpression

  • Unique Properties:

    • args: Arguments with labels and data types
  • State Properties:

    • argExtents: Map with argLengthX (optional) and argLengthY

6. BrickModelStatement

  • Unique Properties:
    • args: Arguments with labels and data types
    • connectAbove: Connection above
    • connectBelow: Connection below

7. BrickModelBlock

  • Unique Properties:

    • args: Arguments with labels, data types, and enums for argId, argLabel, argTypeIncoming
    • connectAbove: Connection above
    • connectBelow: Connection below
    • nestExtent: Nest extent for the block
    • collapsed: Indicates if the block is collapsed
  • State Properties:

    • argExtents: Map with argLengthX (optional) and argLengthY
    • folded: Indicates if the block is folded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants