In this particular case, you do not need to concatenate - the input selection merges with the update selection after it is called, so all you have to do is process .enter() before selecting the update.
In general, you cannot really combine choices per se, but in practice this is not necessary. You can either change the selection condition to select all the elements you need, or, if this is not possible, use .call() to run the function for all selected elements. This way you do not need to repeat the code to set attributes, etc.
source share