Skip to content

add cell renderer to FEF #3

@bwalsh

Description

@bwalsh

From craig:

If you look at this site(which uses the Gen3.2 FEF) : https://imaging-hub.data-commons.org/Explorer in the table you will see a Red link icon in the left most column (see below)

In the config file for BIH, this line: https://github.com/uc-cdis/bih-data-commons/blob/main/config/bih/explorer.json#L40 define the guppy data files for a url and the link "cell renderer" ( "cellRenderFunction": "DiacomLink" ) is set here: https://github.com/uc-cdis/bih-data-commons/blob/505436ac57a47f4709db8e7dd89166243db7b476/config/bih/explorer.json#L59. The type is set to link and the cellRenderFunction is set.

The implementation of the DiacomLink cell renderer for that commons is here (it also defined in the sampleApplication in the gen3 frontend framework repo ):
https://github.com/uc-cdis/gen3-frontend-framework/blob/develop/packages/sampleCommons/src/lib/CohortBuilder/CustomCellRenderers.tsx In this file the link renderer is defined and registered as type link with the name DiacomLink When the config is read the type is used to lookup the Data Renderer.

The idea is: define the data field in guppy's index. In the table define the "cell renderer". That is basically a function that is passed a cell and optional parameters, and returns a React component (Slightly below is a cell render that takes parameters. https://github.com/uc-cdis/bih-data-commons/blob/505436ac57a47f4709db8e7dd89166243db7b476/config/bih/explorer.json#L75

This all needs to be documented and I am sorry that it's has not been yet.

There is a also a generic link function which might be usable: Here is a sample definition:
"object_id": {
"title": "Object Id2",
"type": "link",
"accessorPath": "object_id",
"params": {
"baseURL": "/browse/series/"
}
where baseURL can be set to a any valid url.

Let me know if you need more help, and I am happy to write a renderer if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions