You are going to have to build youw own custom widget. It is possible to make a widget context aware so you can use data from the context object. You can even call microflows etc. This will however require JavaScript knowlegde.
Take a look at: https://docs.mendix.com/howto6/Create+a+Basic+Hello+World+Custom+Widget and https://www.npmjs.com/package/generator-mendix
What you describe is a custom widget. You can combine data with javascript. Or do you want use some dynamic javascript from an attribute in an entity?