Make sure these boxes are checked before submitting your issue - thank you!

 I have checked the superset logs for python stacktraces and included it here 
as text if any
- [x] I have checked the superset logs for python stacktraces and included it 
here as text if any
- [x] I have reproduced the issue with at least the latest released version of 
superset
- [x] I have checked the issue tracker for the same issue and I haven't found 
one similar


### Superset version
0.26

### Expected results

A Separator'esque widget that can render not just html or text, but can render 
variables and even include branching logic. I'd imagine that being able to 
insert Jinja templating with access to the pandas dataframe would suffice.

The reason for it, is that I want to create more descriptive text that might 
help to explain the data being visualised. For example, the final rendered text 
may look something like:

  "USA's population is growing slower (by 5%) than Australia's"

And the Jinja template may look something like (It's been years since I've done 
Jinja, so forgive any errors):
```
  <text>
     {% if df[df.country == 'USA'].growth <  if df[df.country == 
'Australia'].growth %}
     USA's population is growing slower by ( {{ df[df.country == 'USA'].growth 
}} )
     than Australia's.
     {% else %}
     USA's population is growing faster than Australia's.
     {% endif %}
   </text>
```
I have spent only 5 minutes looking at this, but I suspect we would need a viz 
object that builds a dataframe based on the form data (i.e columns, metrics, 
group by etc) as other Viz objects do, but also have a textarea like 
`MarkupViz` to save our template.  

Anyway, the implementation details would need to be worked out, but for me this 
would be a great addition as well as for others potentially.

Thoughts ?

### Actual results

This feature does not exist AFAIK.

### Steps to reproduce






[ Full content available at: 
https://github.com/apache/incubator-superset/issues/5747 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to