Datawheel / canon

Reusable React environment and components for creating visualization engines.
GNU General Public License v3.0
27 stars 7 forks source link

1348 (part 1) Add Block Configs #1358

Closed greenrhyno closed 2 years ago

greenrhyno commented 2 years ago

Adds a BlockConfig object that helps simplify some of the differing logic and behaviors of different types of blocks. Currently, there exist many pieces of logic like "if the block type is Viz, do this" -- these changes are the beginning of a push to remove all those type-specific branches of logic and replace them with checks for a block's behaviors rather than types. This generalization and abstraction should allow for more maintainable code and easier maintenance and extensibility.

Addresses some of the issues mentioned in #1348

greenrhyno commented 2 years ago

@jhmullen I chose to leave some of the rendering refactors of the block editing for another day since I thought it was better to get these changes out there first.