You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/01/13 13:59:41 UTC

[GitHub] fabianmenges commented on issue #4194: [bug fixes] annotations <> x domains, zeros in text

fabianmenges commented on issue #4194: [bug fixes] annotations <> x domains, zeros in text
URL: https://github.com/apache/incubator-superset/pull/4194#issuecomment-357437504
 
 
   I'll first comment on this:
   
   > if the source for event or interval annotations is a table, passing down "from" and "until" should actually perform a filter on the table columns defined by "interval start column" (and "interval end column"), not on the slices "from" and "until" form data.
   
   I don't really think this is a bug but a use case that wasn't covered. The concepts of `until` and `since` are different from any other filter in Superset and the only ones I implemented. 
   
   That said, I thought about similar use cases before and there are some foundations you can use to do what you want to do.
   
   Take a look here:
   https://github.com/apache/incubator-superset/blob/04680e5ff138f7113a3d655133307049bc91ff3d/superset/assets/javascripts/explore/components/controls/AnnotationLayer.jsx#L408
   
   This line will override the `since` field of the annotation slice to use the `since` value of the current slice. The logic that does that is here:
   
   https://github.com/apache/incubator-superset/blob/04680e5ff138f7113a3d655133307049bc91ff3d/superset/assets/javascripts/chart/chartAction.js#L71
   
   Now, in order to implement what you described you will need to add something like this to the `AnnotationLayer`:
   ```
   this.setState({ overrides: { ...overrides, filters: [
     { col: timeColumn, op: '>', val: :  'since' },
     { col: intervalEndColumn, op: '<', val: :  'until' },
   ] } });
   ```
   
   And make changes to the `chartAction` that appends/transforms the filters correctly. This will be pretty tricky to get working in a flexible way.

----------------------------------------------------------------
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