You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/08/27 23:26:44 UTC

[GitHub] kalium99 opened a new issue #5747: Template based Separator

kalium99 opened a new issue #5747: Template based Separator
URL: https://github.com/apache/incubator-superset/issues/5747
 
 
   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
   
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org