Change dcc control type of dynamically created element

Hello everyone,

I am trying to create a dynamic filter very similar to the one shown by @alexcjohnson in the Medium Article of April 30, 2020 Pattern-Matching Callbacks in Dash.

My app looks like this:

The plotly docs on creating elements using an indexed id number Example dynamic creation of dropdown work great. No problem.

My issue is in trying to change the dcc control for the value that matches up with the chosen feature. For example: the user adds a filter element (which creates the dropdown menu that they select the variable from). Based on the choice - the appropriate value editor would either be another pulldown (if categorical), a range slider (if numeric), or a date picker if a date. But - I don’t know which one until after they select the filter variable. (or change the filter variable after initially selecting another).

I found a post by @AnnMarieW that can remove dynamically created chart Removing dynamic graphs created with pattern matching callbacks. using this method, I think I could remove a dynamically created dcc control using this method and then recreate it, and I don’t know how to position it in the place of the original one. I hope this makes sense (perhaps I am falling down the rabbit hole!).

The original code for Alex’s example would be extremely helpful in the chance that is available.
Anyone have some direction? Many thanks in advance!