Reverse the display of facet menus

Solution for Reverse the display of facet menus
is Given Below:

I have an app that is using instantsearch and some of the menus look like this

enter image description here

This is okay although the on position looks like this

enter image description here

which is taking more space. I want to summarize the facets to look like so

enter image description here

The refinement widget code looks like this

and this doesn’t offer options for direct customizations.

How can i customize this widget to only have the checkbox, label text and count similar to the image attached?