uncharted-aske / HMI

Apache License 2.0
1 stars 0 forks source link

Belief score facet for the Bio view #182

Closed RosaRomeroGomez closed 3 years ago

RosaRomeroGomez commented 3 years ago
mj3cheun commented 3 years ago

https://github.com/uncharted-aske/HMI/blob/5d9d08e0f705738fba224e3654552859cceb9599/client/src/components/FacetHistogram.vue

heres a link to a now deleted file containing a binning algorithm specifically designed to work with facets in case it is useful here

Update: Looking at this is not really necessary as this functionality has already been built into code that is currently in main. Look at comment about this below.

adamocarolli commented 3 years ago

This issue is challenging as it involves a number of changes:

  1. We currently do not have a Facets component in the Bio view. Implementing the UI for this component is worthy of a single PR.
  2. We already have existing Lex Pills in the Bio view. Are some of these compatible as Facets queries? How should the Lex search bar's pills and the facet selection's synchronize? Should we first add these existing queries as facets? Synchronizing these is worthy of a PR.
  3. Once the above portions are finished then there should be a clear path to adding a belief score facet. Still probably worthy of its own PR.

Additional considerations:

  1. Our filters to bgraph query builder (filterToBgraph) requires us to add a new case every time we add a new query field. ie.
    case QUERY_FIELDS_MAP.BIO_NODE_NAME.field: {
    return bgraph.filter(node => clause.values.indexOf(node.name) !== -1);
    }

    Is it worthwhile to create a mechanism by which adding a field in QUERY_FIELDS_MAP is recognized by the filterToBgraph function? How would this work when you have some pills in the Bio view vs the Epi view?

  2. The aggregation methods being called in the binning algorithm that Manfred posted above could potentially be registered as either pipes or transformers in bgraph. We may want to consider adding them there.

Notes: bgraph queries are currently run when @Getter getFilters; changes, in order to leverage this mechanism Facets should also connect to the vuex query store.

mj3cheun commented 3 years ago

@adamocarolli @YohannParis I just reviewed the code again and I apologize for the confusion but there are some resources already built out for facets which can be taken advantage of. The binning algorithm has actually been relocated to the util BinUtil.ts. There are 3 general components related to facets as well, FacetBars.vue, FacetHistogram.vue, FacetTerms.vue.

Some background, they were built as part of earlier efforts to integrate facets to do histograms but they were never fully integrated into the app for one reason or another.

YohannParis commented 3 years ago

Here my first pass at how this task can be broken down.

Filters Architecture

Filters Architecture v2 2021-04-22

https://excalidraw.com/#json=5837133143080960,Jn10XRG9uEpH28JZqnGmOw

Tasks

  1. [x] Store and access Filters in the VueX Store, and manage the URLs as well.
  2. [x] Update BGraphUtils to query and get aggregated values from BGraph results.
  3. [x] Update Facets to consume Filters.
  4. [ ] Update LexBar to consume Filters.