A request to use local images in the Timeline component
Thanks a lot for the component, it helps me a lot to show my work, but I still have a need. For some reasons, I can only display some images locally, and I want to load them in the timeline. However, limited by technology, according to the example.json file you provided, I have seen the method of importing images by url, but I have not seen the strategy of localization import. Please guide me.
"title": {
"media": {
"url": "",
"caption": " <a target=\"_blank\" href=''>credits</a>",
"credit": ""
},
"text": {
"headline": "Welcome to<br>TastePeptides-Meta",
"text": "<p>A Timeline showcasing the development process of TastePeptides-Meta</p>"
}
},
Try this: https://docs.streamlit.io/develop/concepts/configuration/serving-static-files
After enabling static file serving as described, you can serve local images in your example as follows:
"url": "app/static/your_img.jpg"
Maybe I didn’t express myself clearly before. I want to make modifications within the JSON to achieve the masking function. Now I have the following code, but the recognition fails.
{
"media": {
"url": "statics/0-MyWeb/2-Timeline/6-SARS-Cov2.jpg"
},
f it’s convenient for you, could you please provide sample code for referencing local files within a JSON file? Thank you!