{"file": "/src/encoded/static/data/embedded-search-table-demo.jsx", "name": "demos.embedded-search-table", "award": {"uuid": "b0b9c607-f8b4-4f02-93f4-9895b461334b", "project": "4DN", "display_title": "4D NUCLEOME NETWORK DATA COORDINATION AND INTEGRATION CENTER", "name": "1U01CA200059-01", "description": "DCIC: The goals of the 4D Nucleome (4DN) Data Coordination and Integration Center (DCIC) are to collect, store, curate, display, and analyze data generated in the 4DN Network. We have assembled a team of investigators with a strong track record in analysis of chromatin interaction data, image processing and three-dimensional data visualization, integrative analysis of genomic and epigenomic data, data portal development, large-scale computing, and development of secure and flexible cloud technologies. In Aim 1, we will develop efficient submission pipelines for data and metadata from 4DN data production groups. We will define data/metadata requirements and quality metrics in conjunction with the production groups and ensure that high-quality, well- annotated data become available to the wider scientific community in a timely manner. In Aim 2, we will develop a user-friendly data portal for the broad scientific community. This portal will provide an easy-to-navigate interface for accessing raw and intermediate data files, allow for programmatic access via APIs, and will incorporate novel analysis and visualization tools developed by DCIC as well as other Network members. For computing and storage scalability and cost-effectiveness, significant efforts will be devoted to development and deployment of cloud-based technology. We will conduct tutorials and workshops to facilitate the use of 4DN data and tools by external investigators. In Aim 3, we will coordinate and assist in conducting integrative analysis of the multiple data types. These efforts will examine key questions in higher-order chromatin organization using both sequence and image data, and the tools and algorithms developed here will be incorporated into the data portal for use by other investigators. These three aims will ensure that the data generated in 4DN will have maximal impact for the scientific community.", "status": "current", "@id": "/awards/1U01CA200059-01/", "@type": ["Award", "Item"], "center_title": "DCIC - DCIC", "pi": {"error": "no view permissions"}, "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin"]}}, "title": "Embedded Search Table Examples", "status": "released", "description": "Check out these examples", "date_created": "2022-08-10T16:08:19.626342+00:00", "section_type": "Page Section", "submitted_by": {"error": "no view permissions"}, "last_modified": {"modified_by": {"error": "no view permissions"}, "date_modified": "2022-08-10T16:09:11.797646+00:00"}, "schema_version": "2", "@id": "/static-sections/4570c6b5-dad9-4f34-b366-9895b461334d/", "@type": ["StaticSection", "UserContent", "Item"], "uuid": "4570c6b5-dad9-4f34-b366-9895b461334d", "principals_allowed": {"view": ["system.Everyone"], "edit": ["group.admin", "role.owner", "userid.986b362f-4eb6-4a9c-8173-3ab267307e3a"]}, "display_title": "Embedded Search Table Examples", "external_references": [], "content": "\n\n<div key=\"someRandomKey\">\n    <h3>Basic Usage</h3>\n    <p>\n        Use JSX component in body of static section of filetype that has a filetype of jsx. Show results of any search URL.\n        For all search tables, it is imperative to supply at least the following 3 <code>props</code>, with which a minimal search table can be embedded:\n    </p>\n\n    <ul>\n        <li key=\"0\"><code>{'searchHref=\"/search/?type=Item...\"'}</code> - This is the initial search URL, including URL query parameters, to search.</li>\n        <li key=\"1\"><code>{'schemas={schemas}'}</code> - This should always be <code>{'schemas={schemas}'}</code>, it means to use/pass-in in-code variable <code>schemas</code>, which contains definitions for facets, columns, property titles, and so forth by Item Type.</li>\n        <li key=\"2\"><code>{'session={session}'}</code> - This should always be <code>{'session={session}'}</code>, it means to use/pass-in in-code variable <code>session</code>, which is a boolean informing whether end-user is logged in, change of which triggers results refresh.</li>\n        <li key=\"3\"><code>{'key=\"anyRandomTextString\"'}</code> - This should always be set to any random string value, it tells React to avoid completely initiating a new instance of this component on extraneous changes, e.g. browser window width. This may be excluded if your component is within a parent/root JSX element that has a <code>key</code> prop, such as this static section.</li>\n        <li key=\"4\"><code>{'title=\"anyString or React component\"'}</code> - Title is optional, you can completely exclude it by not defining <code>title</code> prop at all or you can supply a plain text or allowed React component. It is highly recommended to use the built-in <code>SearchTableTitle</code> component:  <pre className=\"border rounded px-3 py-2\">{'<SearchTableTitle title=\"Experiment Set or File or ..etc\" externalSearchLinkVisible />'}</pre></li>\n    </ul>\n\n    <hr className=\"mt-2\" />\n\n    <h3>FacetList Configuration</h3>\n\n    <h4 className=\"mt-2\">No FacetList<br /><span className=\"text-400\"><em><small>tldr:</small></em> <code>{\"facets={null}\"}</code></span></h4>\n\n    <p>\n        FacetList configuration is done via the <code>facets</code> prop.\n        You can completely exclude a FacetList by passing in <code>null</code> as the value for the <code>facets</code> prop of EmbeddSearchTable.\n        Passing in <code>null</code> is different than not defining <code>facets</code> at all, which has a differing effect.\n    </p>\n\n    <pre className=\"border rounded px-3 py-2\">{'<EmbeddedItemSearchTable\\n    searchHref=\"/search/?type=Item\"\\n    schemas={schemas}\\n    session={session}\\n    facets={null}\\n/>'}</pre>\n\n    <p>This generates the following table:</p>\n\n    <EmbeddedItemSearchTable\n        searchHref=\"/search/?type=Item\"\n        schemas={schemas}\n        session={session}\n        facets={null}\n    />\n\n    <h4 className=\"mt-4\">Default Facets (from Schemas)<br /><span className=\"text-400\">with optional exclusions</span></h4>\n\n    <p>\n        By not supplying a value for <code>facets</code>, leaving it undefined, will instruct the code to use the default Facets that are defined in schemas\n        for the current Item type being searched. In many cases, will want to use the default facets for the Item type, but perhaps <em>remove</em> a few\n        of them, such as facet for <code>type</code> field. This can be accomplished using the optional <code>hideFacets</code> prop, which if not provided will default\n        to <code>[&quot;type&quot;, &quot;validation_errors.name&quot;]</code>. If you are defining the <code>searchHref</code> prop to (pre-)filter the results in some way aside from just <code>type</code>,\n        you would also want to hide the facet that allows people to remove/cancel that filtration. Code example and result is below.\n    </p>\n\n    <pre className=\"border rounded px-3 py-2\">{'<EmbeddedItemSearchTable\\n    searchHref=\"/search/?type=File&file_format.file_format=fastq&status=released&award.project=4DN&file_type=reads\"\\n    schemas={schemas}\\n    session={session}\\n    hideFacets={[\"type\", \"validation_errors.name\", \"status\", \"file_format.file_format\", \"award.project\", \"file_type\"]}\\n/>'}</pre>\n\n    <EmbeddedItemSearchTable\n        searchHref=\"/search/?type=File&file_format.file_format=fastq&status=released&award.project=4DN&file_type=reads\"\n        schemas={schemas}\n        session={session}\n        hideFacets={[\"type\", \"validation_errors.name\", \"status\", \"file_format.file_format\", \"award.project\", \"file_type\"]}\n    />\n\n    <h4 className=\"mt-4\">(TODO) Custom Facets<br /><span className=\"text-400\">NOT YET FUNCTIONAL</span></h4>\n\n    <p>\n        (In the future) You can also define and pass in your own complete facets object into the <code>facets</code> prop. It should be in the same form as the contents of <code>facets</code> property\n        in the search response JSON (array).\n    </p>\n\n    <h5>Current issue & To-Do</h5>\n    <p>\n        The <code>facets</code> to pass in via the prop <b>must</b> currently also contain terms and term counts, which is... impossible to provide ahead of time.\n        For custom facets to work, we must be able to pass in these facets TO the backend endpoint. We can perhaps migrate to POST requests for EmbeddedSearchView in\n        mid-term future to allow for this and other features.\n    </p>\n\n    <h3>Columns Configuration</h3>\n\n    <p>\n        Overall this is very similar to FacetList configuration. There is a prop <code>columns</code> to which may provide an object of columns to completely customize\n        or exclude it (or pass null) to default to the columns in schemas. Like the <code>hideFacets</code> prop, there is also a <code>hideColumns</code> prop which can be used to reduce the in-schema columns\n        down.\n    </p>\n\n    <h4>Default Columns<br /><span className=\"text-400\">with optional exclusions</span></h4>\n\n    <pre className=\"border rounded px-3 py-2\">{'<EmbeddedItemSearchTable\\n    searchHref=\"/search/?type=File&file_format.file_format=fastq&status=released&award.project=4DN&file_type=reads\"\\n    schemas={schemas}\\n    session={session}\\n    columns={null} // excluding this would result in same effect (unlike with facets where null has special meaning)\\n    facets={null} // null hides FacetList explictly.\\n    hideColumns={[\\n        \"track_and_facet_info.experiment_type\",\\n        \"track_and_facet_info.dataset\",\\n        \"track_and_facet_info.assay_info\",\\n        \"file_type\",\\n        \"file_format.file_format\"\\n    ]}\\n/>'}</pre>\n\n    <EmbeddedItemSearchTable\n        searchHref=\"/search/?type=File&file_format.file_format=fastq&status=released&award.project=4DN&file_type=reads\"\n        schemas={schemas}\n        session={session}\n        columns={null} // excluding this would result in same effect (unlike with facets where null has special meaning)\n        facets={null} // null hides FacetList explictly.\n        hideColumns={[\n            \"track_and_facet_info.experiment_type\",\n            \"track_and_facet_info.dataset\",\n            \"track_and_facet_info.assay_info\",\n            \"file_type\",\n            \"file_format.file_format\"\n        ]}\n    />\n\n    <h4>Custom Columns</h4>\n\n    <pre className=\"border rounded px-3 py-2\">{'<EmbeddedItemSearchTable\\n    searchHref=\"/search/?type=File&file_format.file_format=fastq&status=released&award.project=4DN&file_type=reads\"\\n    schemas={schemas}\\n    session={session}\\n    facets={null} // null hides FacetList explictly.\\n    columns={{\\n        \"display_title\": {\\n            \"title\": \"Title\"\\n        },\\n        \"lab.display_title\": {\\n            \"title\": \"Lab\"\\n        },\\n        \"track_and_facet_info.experiment_type\" : {\\n            \"title\" : \"Experiment Type\",\\n            \"description\" : \"Type of experiment to which this file belongs\"\\n        }\\n    }}\\n/>'}</pre>\n\n    <EmbeddedItemSearchTable\n        searchHref=\"/search/?type=File&file_format.file_format=fastq&status=released&award.project=4DN&file_type=reads\"\n        schemas={schemas}\n        session={session}\n        facets={null}\n        columns={{\n            \"display_title\": {\n                \"title\": \"Title\"\n            },\n            \"lab.display_title\": {\n                \"title\": \"Lab\"\n            },\n            \"track_and_facet_info.experiment_type\": {\n                \"title\": \"Experiment Type\",\n                \"description\": \"Type of experiment to which this file belongs\"\n            }\n        }}\n    />\n\n    <h3>Title Configuration</h3>\n\n    <h4 className=\"mt-2\">No Title</h4>\n\n    <p>Set <code>{\"title={null}\"}</code> or do not define <code>title</code> at all.</p>\n\n    <h4 className=\"mt-2\">Default Title</h4>\n\n    <p>\n        The built-in <code>SearchTableTitle</code> component renders the total count of type (you should also pass it as title prop into SearchTableTitle) and an optional Browse/Search button that redirects you to Browse or Search pages with respectively.\n    </p>\n\n    <pre className=\"border rounded px-3 py-2\">{'<EmbeddedItemSearchTable\\r\\n        searchHref=\"/search/?type=Biosource\"\\r\\n        schemas={schemas}\\r\\n        session={session}\\r\\n        facets={null}\\r\\n        title={<SearchTableTitle title=\"Biosource\" externalSearchLinkVisible={true} />}\\r\\n    />'}</pre>\n\n    <p>This generates the following table:</p>\n\n    <EmbeddedItemSearchTable\n        searchHref=\"/search/?type=Biosource\"\n        schemas={schemas}\n        session={session}\n        facets={null}\n        title={<SearchTableTitle title=\"Biosource\" externalSearchLinkVisible={true} />}\n    />\n\n</div>\n\n", "filetype": "jsx", "@context": "/terms/", "aggregated-items": {}, "validation-errors": []}